-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjeelizFaceFilter.js
164 lines (163 loc) · 77.7 KB
/
jeelizFaceFilter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/**
* Jeeliz Face Filter - https://github.com/jeeliz/jeelizFaceFilter
*
* Copyright 2018 Jeeliz ( https://jeeliz.com )
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var JEEFACEFILTERAPI=(function(){window.JEEFACEFILTERAPIGEN=function(){function Bb(a){var c=null,d=null,e=null,m=0;this.m=function(f){this.se(f.Qa);e.yd({Gb:f.Gb,Db:f.Db})};this.Qd=function(f){return c[f]};this.se=function(f){var r=null;m=f.length;c=f.map(function(n,g){n=Object.assign({},n,{index:g,parent:this,Xa:r,$d:g===m-1});return r=g=0===g?Cb.instance(n):Db.instance(n)});d=c[0];e=c[m-1];c.forEach(function(n,g){0!==g&&n.me()})};this.M=function(f,r){var n=r;c.forEach(function(g){n=g.M(n,f)});return n};this.Pd=function(){return d.D()};
this.vc=function(){return e.Rd()};this.sc=function(){return e.sc()};this.h=function(){c&&(c.forEach(function(f){f.h()}),e=d=c=null,m=0)};"undefined"!==typeof a&&this.m(a)}function bb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Eb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var m="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var f=m.length;c=new Uint8Array(f);for(var r=0;r<f;++r)c[r]=m.charCodeAt(r);m=new Float32Array(e);f=new Float32Array(d);r=a+d+
1;for(var n=0;n<e;++n){for(var g=r*n,v=0===bb(c,g)?1:-1,k=g+1,h=1,w=0,l=k+a-1;l>=k;--l)w+=h*bb(c,l),h*=2;k=w;g=g+1+a;h=f.length;w=0;for(l=g;l<g+h;++l)f[w]=bb(c,l,!0),++w;for(h=g=0;h<d;++h)g+=f[h]*Math.pow(2,-h-1);m[n]=0===g&&0===k?0:v*(1+g)*Math.pow(2,1+k-Math.pow(2,a-1))}return m}function Ua(){return-1!==[aa.ready,aa.play,aa.pause].indexOf(ia)}function Fb(a){if(ia!==aa.pause){var c=ia===aa.play?J.Ba:Y.ld;Va=setTimeout(nb.bind(null,a),c)}}function cb(){if(ia===aa.play)return!1;ia=aa.play;Ma&&window.cancelAnimationFrame(Ma);
nb(0)}function ob(){if(ia!==aa.play)return!1;Va&&(clearTimeout(Va),Va=null);Ma&&(window.cancelAnimationFrame(Ma),Ma=null);ia=aa.pause;return!0}function Da(a,c,d,e,m){a=4*(3*c+a)+d;return e+(W.buffer[a]/255+W.buffer[a+12]/65025)*(m-e)}function db(){b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);sa.Y();S.reset();X.reset();y.L();y.fc();b.disable(b.DEPTH_TEST);b.disable(b.BLEND);S.ra();y.la()}function nb(){if(ia!==aa.pause){y.fc();S.reset();S.ra();b.disable(b.DEPTH_TEST);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,
!1);sa.Y();y.la();if(!x.yb)a:{if(x.Na){if(!x.element.needsUpdate)break a;x.ca.Ie(x.element.arrayBuffer);x.element.needsUpdate=!1}else{var a=x.element.currentTime,c=a-x.Ya;0>c&&(x.Ya=a);if(1E3*c<Y.Ke)break a;x.Ya+=c;x.ca.refresh()}y.set("s50");x.W.P();x.ca.b(0);S.g(!1,!1)}a=za.tc();if(G.O.length>a)G.O.splice(0,G.O.length-a);else for(;G.O.length<a;)G.O.push(0);if(1!==G.i)if(oa.every(eb)){for(var d=0,e=c=0;e<oa.length;++e)oa[e].detected>d&&(d=oa[e].detected,c=0);for(d=0;d<a;++d)G.O[d]=c}else{c=G.Jc;
d=0;for(e=!1;d<a;++d){if(eb(oa[c]))if(e){do++c===G.i&&(c=0);while(eb(oa[c]))}else e=!0;G.O[d]=c++;c>=G.i&&(c=0)}G.Jc=c}for(a=0;a<za.tc();++a)G.ga=G.O[a],G.Cb=(.5+G.ga)/G.i,G.Ec=G.O.lastIndexOf(G.ga)===a,y.set("s51"),c=oa[G.ga],y.B("u37",1+Na.Jb*(Math.cos(c.ry)-1)),J.ja&&y.B("u36",c.rz),1!==G.i&&y.B("u35",G.Cb),T.wa.P(),x.W.b(0),W.Aa.b(1),S.g(!1,!1),T.wa.b(0),Oa.M(!1,T.wa);za.De();sa.J();b.viewport(0,0,3,2*G.i);y.set("s49");W.Aa.b(0);S.g(!1,!1);b.readPixels(0,0,3,2*G.i,b.RGBA,b.UNSIGNED_BYTE,W.buffer);
for(a=0;a<G.i;++a)if(-1!==G.O.indexOf(a)){var m=a;c=Sa[m];var f=[m];d=oa[m];e=fb[m];var r=2*m;c.Fa=Da(1,r,3,0,1);d.detected=pa.S(d.detected,c.Fa,Y.hd);if(c.Fa<Y.Lc)J.ja&&(d.rz=0,d.ry=0);else{var n=W.xa;c.x=Da(0,r,1,-1,1);c.y=Da(0,r,2,-1,1);c.V=Da(0,r,3,0,1);c.Hb=Da(1,r,0,-n[0],n[0]);c.Ib=Da(1,r,1,-n[1],n[1]);c.ya=Da(1,r,2,-n[2],n[2]);for(n=0;n<W.T;++n)c.nc[n]=W.va[n](Da(2,r,n,0,1));f.ob=c.x-d.xRaw;f.pb=c.y-d.yRaw;f.nb=c.V-d.sRaw;f.kb=c.Hb-d.rx;f.lb=c.Ib-d.ry;f.mb=J.ja?c.ya:c.ya-d.rz;r=za.Md();f=(1-
Wa.Ra(ta.translationFactorRange[0],ta.translationFactorRange[1],Math.sqrt(f.ob*f.ob+f.pb*f.pb+f.nb*f.nb)/r))*(1-Wa.Ra(ta.rotationFactorRange[0],ta.rotationFactorRange[1],Math.sqrt(f.kb*f.kb+f.lb*f.lb+f.mb*f.mb)/r))*Wa.Ra(ta.qualityFactorRange[0],ta.qualityFactorRange[1],c.Fa);m=e[++gb[m]%e.length]=f;for(r=0;r<e.length;++r)m=Math.min(m,e[r]);m=Math.max(.5,m);f=Math.min(m,f);e=pa.S(ta.alphaRange[1],ta.alphaRange[0],Math.pow(f,Y.kd));d.xRaw=pa.S(d.xRaw,c.x,e);d.yRaw=pa.S(d.yRaw,c.y,e);d.sRaw=pa.S(d.sRaw,
c.V,e);d.rx=pa.S(d.rx,c.Hb,e);d.ry=pa.S(d.ry,c.Ib,e);d.rz=J.ja?d.rz+e*c.ya:pa.S(d.rz,c.ya,e);m=d.sRaw*Na.jb*Math.sin(d.ry);f=Math.sin(d.rz)*m/Pa;d.x=d.xRaw+Math.cos(d.rz)*m;d.y=d.yRaw+f;d.s=d.sRaw;e=Math.max(e,Y.jd);for(m=0;m<W.T;++m)d.expressions[m]=pa.S(d.expressions[m],c.nc[m],e);++c.Ua}}sa.Ge();sa.reset();X.reset();b.enable(b.DEPTH_TEST);J.Ea&&(1===G.i?J.Ea(oa[0]):J.Ea(oa));b.disable(b.BLEND);ia===aa.play&&(Ma=window.requestAnimationFrame(Fb))}}function pb(){x.W||(x.W=X.instance({isPot:!1,isLinear:!0,
isFloat:!1,width:T.C,height:T.A}));T.wa=X.instance({isPot:!0,isFloat:!1,width:Oa.Pd()});for(var a=Y.$c,c=G.i,d=new Float32Array([0,.5,.5,0,0,0,0,0,0,0,0,0]),e=new Float32Array(d.length*G.i),m=0,f;m<G.i;++m)for(f=0;f<d.length;++f)e[m*d.length+f]=d[f];W.Aa=Gb.instance({width:a,height:c,isFloat:!0,isPot:!1,array:e})}function Hb(){function a(c){for(var d=[],e=0;e<G.i;++e)d.push(JSON.parse(JSON.stringify(c)));return d}W.buffer=new Uint8Array(8*Y.$c*G.i);Sa=a({Fa:0,x:0,y:0,V:1,Hb:0,Ib:0,ya:0,nc:new Float32Array(W.T),
Ua:0});oa=a({detected:0,x:0,y:0,s:1,xRaw:0,yRaw:0,sRaw:1,rx:0,ry:0,rz:0,expressions:new Float32Array(W.T)});a({ob:0,pb:0,nb:0,kb:0,lb:0,mb:0})}function hb(){y.N("s51",[{type:"1i",name:"u1",value:0},{type:"1i",name:"u33",value:1},{type:"2f",name:"u34",value:T.u},{type:"1f",name:"u35",value:.5},{type:"1f",name:"u36",value:0}]);y.N("s52",[{type:"1i",name:"u38",value:0},{type:"1i",name:"u33",value:1},{type:"1f",name:"u41",value:Y.Ee},{type:"1f",name:"u42",value:na.threshold},{type:"3f",name:"u40",value:[W.I[0]*
T.u[0],W.I[1]*T.u[1],W.I[2]]},{type:"1f",name:"u35",value:.5},{type:"1f",name:"u43",value:1},{type:"1f",name:"u36",value:0}]);var a=[{type:"1i",name:"u38",value:0}];y.N("s53",a);y.N("s54",a);y.N("s49",[{type:"1i",name:"u33",value:0},{type:"1f",name:"u46",value:T.u[0]},{type:"2f",name:"u45",value:[0,.5/G.i]}])}function ib(){T.u[0]=1;T.u[1]=T.C/T.A;qb.m({Wa:na.overlapFactors,Pc:na.nScaleLevels,C:T.C,A:T.A,Vc:na.scale0Factor,I:W.I,Wc:na.scanCenterFirst})}function Ib(a){if(J.na)rb("string"===typeof J.na?
JSON.parse(J.na):J.na,a);else{var c=J.Tb;"JSON"!==c.toUpperCase().split(".").pop()&&(c+=Y.neuralNetworkPath);sb.get(c,function(d){d=JSON.parse(d);rb(d,a)})}}function rb(a,c){if(a.exportData){var d=a.exportData;d.rotationEulerAnglesFactors&&(W.xa=d.rotationEulerAnglesFactors);d.translationScalingFactors&&(W.I=d.translationScalingFactors);"undefined"!==typeof d.nExpressions&&(W.T=d.nExpressions);Na.Jb=.4;Na.jb=.7;"undefined"!==typeof d.fgScaleXFactor&&(Na.Jb=d.fgScaleXFactor);"undefined"!==typeof d.fgDisplaceXFactor&&
(Na.jb=d.fgDisplaceXFactor)}W.T||(W.T=Y.Oc);if(!W.va)for(W.va=[],d=0;d<W.T;++d)W.va.push(Y.Gd);c(a)}function Jb(){if(Qa.m({hb:J.Z,width:T.C,height:T.A,debug:!1,Qc:function(){Ga("GLCONTEXT_LOST")},antialias:J.antialias,premultipliedAlpha:!0}))return!0;Ga("GL_INCOMPATIBLE");return!1}function eb(a){return a.detected<=Y.Lc}function tb(a,c,d,e){return d>a?Math.max(0,a+c/2-(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Kb(){return Sa.some(function(a,c){if(c===G.ga)return!1;c=Sa[G.ga];if(c.Ua>a.Ua||3>a.Ua||
tb(c.x,c.V,a.x,a.V)<Y.Mc*c.V)return!1;var d=T.C/T.A;return tb(c.y,c.V*d,a.y,a.V*d)>Y.Mc*c.V*d})}function Lb(){var a=G.ga;W.Aa.ve(1);1!==G.i&&(b.viewport(0,0,3,G.i),y.set("s0"),y.Zc("u1",1),S.g(!1,!1),y.Zc("u1",0));b.viewport(0,a,1,1);y.set("s52");J.ja&&y.B("u36",oa[a].rz);1!==G.i&&y.B("u35",G.Cb);if(1<G.i){var c=Kb()?0:1;y.B("u43",c)}y.xe("u39",qb.get());S.g(!1,!1);G.Ec&&(b.viewport(1,a,1,1),y.set("s53"),S.g(!1,!1),b.viewport(2,a,1,1),y.set("s54"),S.g(!1,!1))}function ub(){x.ca&&x.ca.remove();x.Na=
x.element.isFakeVideo?!0:!1;if(x.Na){var a=vb();a={isFlipY:!1,array:x.element.arrayBuffer,width:a.w,height:a.ka,isKeepArray:!0}}else a={H:x.element};x.ca=X.instance(Object.assign({isPot:!1,isFloat:!1},a))}function Ha(){y.N("s50",[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:x.o}])}function Ia(){x.G[0]=.5;x.G[1]=.5;var a=x.u[1]/x.u[0];Pa=Qa.R()/Qa.D();90===Math.abs(ma.rotate)&&(a=1/a);a>Pa?x.G[1]*=Pa/a:x.G[0]*=a/Pa;y.N("s52",[{name:"u44",type:"1f",value:Pa}]);x.o[0]=0;x.o[1]=0;x.o[2]=
0;x.o[3]=0;switch(ma.rotate){case 0:x.o[0]=x.G[0];x.o[3]=x.G[1];break;case 180:x.o[0]=-x.G[0];x.o[3]=-x.G[1];break;case 90:x.o[1]=x.G[0];x.o[2]=-x.G[1];break;case -90:x.o[1]=-x.G[0],x.o[2]=x.G[1]}ma.flipX&&(x.o[0]*=-1,x.o[2]*=-1)}function vb(){var a={w:x.element.videoWidth||x.element.width,ka:x.element.videoHeight||x.element.height};if(!a.w||!a.ka||4>a.w||4>a.ka)throw Error("INVALID VIDEO DIMENSIONS - width = "+a.w+" height = "+a.ka);return a}function jb(){var a=vb(),c=x.u[0]!==a.w||x.u[1]!==a.ka;
c&&(x.u[0]=a.w,x.u[1]=a.ka);return c}function Xa(a,c){if(ia===aa.error)return!1;x.element=a;jb();c&&c();return!0}function wb(a,c,d){a&&a();x.ta={video:{facingMode:{ideal:ma.facingMode},width:{min:ma.minWidth,max:ma.maxWidth,ideal:ma.idealWidth},height:{min:ma.minHeight,max:ma.maxHeight,ideal:ma.idealHeight}},audio:!1};ma.deviceId&&(x.ta.deviceId=ma.deviceId);V.get(x.element?x.element:V.Td(),function(e){c&&c(e);d(e)},function(){Ga("WEBCAM_UNAVAILABLE")},x.ta)}function Ga(a){ia!==aa.error&&(ia=aa.error,
J.sa&&J.sa(a))}var pa={Gf:function(a){return Math.ceil(Math.log2(a))},de:function(a){return Math.log2(a)},Uf:function(a){return 0===Math.log2(a)%1},Te:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},Ue:function(a,c,d){return Math.min(Math.max(a,c),d)},Xe:function(a){return a*Math.PI/180},$f:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},ag:function(a){return Math.round(1E6*a)/1E6},Hf:function(a,c){return(100*a/c).toFixed(3)},S:function(a,
c,d){return a*(1-d)+c*d},Cd:function(a,c){return pa.vd(a-c)},vd:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},Ze:function(a,c){return Math.abs(pa.Cd(a,c))},Le:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},sb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0===e.status?c(e.responseText):"undefined"!==typeof d&&d(e.status))};
e.send()},Df:function(a,c){sb.get(a,function(d){c(JSON.parse(d))})},Yf:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},sf:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)};d.send()}},Wa={lg:function(a,c,d){a=Math.min(Math.max((d-a)/(c-
a),0),1);return a*a*(3-2*a)},Ra:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},kf:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},pg:function(){return 0},Xf:function(){return 1},Wf:function(a){return a},gf:function(a){return a*a},mf:function(a){return a*(2-a)},df:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},bf:function(a){return a*a*a},lf:function(a){return--a*a*a+1},cf:function(a){return.5>a?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1},hf:function(a){return a*a*a*a},pf:function(a){return 1-
--a*a*a*a},ef:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},jf:function(a){return a*a*a*a*a},qf:function(a){return 1+--a*a*a*a*a},ff:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Mb={Id:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+c+",step(0.,"+c+"));";case "arctan":return d+"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";
case "copy":return"";default:return!1}}},y=function(){function a(u,t,D){t=u.createShader(t);u.shaderSource(t,D);u.compileShader(t);return u.getShaderParameter(t,u.COMPILE_STATUS)?t:!1}function c(u,t,D){t=a(u,u.VERTEX_SHADER,t);D=a(u,u.FRAGMENT_SHADER,D);u===b&&r.push(t,D);var Q=u.createProgram();u.attachShader(Q,t);u.attachShader(Q,D);u.linkProgram(Q);return Q}function d(u,t){void 0===t.ia&&(t.ia="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}");
void 0===t.Ca&&(t.Ca=["a0"]);void 0===t.pa&&(t.pa=[2]);if(void 0===t.precision||"highp"===t.precision)t.precision=h;t.id=v++;void 0!==t.re&&t.re.forEach(function(Q,U){t.a=t.a.replace(Q,t.Za[U])});t.Sb=0;t.pa.forEach(function(Q){t.Sb+=4*Q});t.ha=c(u,t.ia,"precision "+t.precision+" float;\n"+t.a);t.j={};t.c.forEach(function(Q){t.j[Q]=u.getUniformLocation(t.ha,Q)});t.attributes={};t.qa=[];t.Ca.forEach(function(Q){var U=u.getAttribLocation(t.ha,Q);t.attributes[Q]=U;t.qa.push(U)});if(t.f){u.useProgram(t.ha);
g=t;n=t.id;for(var D in t.f)u.uniform1i(t.j[D],t.f[D])}t.xb=!0}function e(u){ua.we(M);n!==u.id&&(M.L(),n=u.id,g=u,b.useProgram(u.ha),u.qa.forEach(function(t){0!==t&&b.enableVertexAttribArray(t)}))}function m(u,t,D){d(u,t,D);u.useProgram(t.ha);u.enableVertexAttribArray(0);n=-1;return g=t}function f(){return{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:["u1"],f:{u1:0}}}var r=[],n=-1,g=null,v=0,k=!1,h="highp",w=["u1"],l=["u0"],B={u1:0},F={u0:0},H={u1:0,u2:1},
N={u3:0},A={s0:f(),s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:w,f:B,precision:"lowp"},s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:H},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:w,f:B},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}",
c:["u1","u2"],f:H},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}",c:w,f:B},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:w,f:B},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:F},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}",
c:["u0","u4"],f:F},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}",c:w,f:B},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}",
c:["u1","u7"],f:B},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}",
c:["u1","u8"],f:B},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:l,f:F},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:l,f:F},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:l,f:F},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}",
c:l,f:F},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:l,f:F},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}",
c:l,f:F},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}",
c:["u1","u12"],f:B},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}",
c:"u13 u14 u16 u20 u17 u18 u19".split(" "),f:{u14:0,u13:1,u20:3,u17:4,u18:5,u19:6}},s25:{a:"uniform sampler2D u13,u14,u21;uniform float u16,u22,u23,u24;varying vec2 vv0;const vec2 j=vec2(1.,1.);void main(){vec2 a=floor(u22*vv0),b=u22*vv0-a;float c=u16/u22;vec2 d=floor(b*c),f=b*c-d,g=(a+f)/u22;float k=u22*u24/u16;vec2 l=k*d,h=(l+f*u23)/u24,i=step(h,j);vec4 m=texture2D(u13,g),n=texture2D(u14,h),o=m*n*i.x*i.y,p=texture2D(u21,g);gl_FragColor=o*u23*u23+p;}",c:"u13 u14 u16 u22 u23 u24 u21".split(" "),f:{u14:0,
u13:1,u21:2}},s26:{a:"uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec4 a=texture2D(u13,vv0),b=texture2D(u14,vv0);gl_FragColor=a*b;}",c:["u13","u14"],f:{u14:0,u13:1}},s27:{a:"uniform sampler2D u1,u21;uniform float u25;varying vec2 vv0;void main(){gl_FragColor=texture2D(u21,vv0)+u25*texture2D(u1,vv0);}",c:["u1","u21","u25"],f:{u1:0,u21:1}},s28:{a:"varying vec2 vv0;uniform sampler2D u1;const vec4 f=vec4(1.,1.,1.,1.),g=vec4(.299,.587,.114,0.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=dot(a,g)*f;}",
c:w,f:B,precision:"lowp"},s29:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(dot(a,f),dot(b,f),dot(c,f),dot(d,f));}",c:["u1","u26"],f:B,precision:"lowp"},s30:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(a.r,b.g,c.b,dot(d,f));}",
c:["u1","u26"],f:B,precision:"lowp"},s31:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=vec4(0.);a-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y))*2.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y))*2.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec4 b=vec4(0.);b-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,b-=texture2D(u1,vec2(vv0.x,vv0.y-u27))*2.,b-=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,b+=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,b+=texture2D(u1,vec2(vv0.x,vv0.y+u27))*2.,b+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec3 c=sqrt(a.rgb*a.rgb+b.rgb*b.rgb);vec4 e=vec4(c,texture2D(u1,vv0).a),g=texture2D(u2,vv0);gl_FragColor=g.a*e.r*f;}",
c:["u1","u2","u27"],f:H},s32:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 j=vec4(1.,1.,1.,1.);const vec2 k=vec2(1.,1.);void main(){float h=0.;vec2 l=k*u27,a,b;float c,d,i=0.;for(float e=-4.;e<=4.;e+=1.)for(float f=-4.;f<=4.;f+=1.)a=vec2(e,f),c=length(a)/2.,d=exp(-c*c),b=vv0+l*a,h+=d*texture2D(u1,b).r,i+=d;vec4 m=texture2D(u2,vv0);gl_FragColor=m.a*(texture2D(u1,b).r-h/i)*j;}",c:["u1","u2","u27"],f:H},s33:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}const vec2 g=vec2(.5,.5),h=vec2(1.,0.),i=vec2(0.,1.);void main(){vec2 a=vv0-u7*g;vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*h),d=texture2D(u3,a+u7*i),j=texture2D(u3,a+u7),k=e(b,c),l=e(d,j);gl_FragColor=e(k,l);}",
c:["u3","u7"],f:N},s34:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;const vec2 k=vec2(1.,0.),l=vec2(0.,1.),m=vec2(2.,0.),n=vec2(0.,2.);vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}vec4 f(vec2 a){vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*k),d=texture2D(u3,a+u7*l),g=texture2D(u3,a+u7),h=e(b,c),i=e(d,g);return e(h,i);}void main(){vec2 a=vv0+u7*vec2(-.55,-1.05);vec4 b=f(a),c=f(a+u7*m),d=f(a+u7*2.),g=f(a+u7*n),h=e(b,c),i=e(d,g);gl_FragColor=e(h,i);}",c:["u3","u7"],f:N},s35:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a*a;}",
c:["u1"],f:B,precision:"lowp"},s36:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;const float e=15444.;void main(){vec4 a=1001./e*texture2D(u1,vv0-3.*u7)+2002./e*texture2D(u1,vv0-2.*u7)+3003./e*texture2D(u1,vv0-u7)+3432./e*texture2D(u1,vv0)+3003./e*texture2D(u1,vv0+u7)+2002./e*texture2D(u1,vv0+2.*u7)+1001./e*texture2D(u1,vv0+3.*u7);gl_FragColor=a;}",c:["u7","u1"],f:B,precision:"lowp"},s37:{a:"uniform sampler2D u1,u28,u29;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);const float g=.1;void main(){vec4 a=texture2D(u28,vv0),b=texture2D(u29,vv0),c=texture2D(u1,vv0),d=max(f*g,b-a*a),h=sqrt(d);gl_FragColor=(c-a)/h;}",
c:["u1","u28","u29"],f:{u1:0,u28:1,u29:2}}},E={s38:{a:"uniform float u16,u30;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-5,1e-5);void main(){vec4 sum=texture2D(u21,vv0);float toSparsity=1.1111;vec2 uvFrom,uvWeight,xyPatch=ZERO2,eps2=EPS2/u16,xyTo=floor(vv0*u16+eps2);float weightSize=toSparsity*u16;vec2 halfFromSparsity=ONE2*(toSparsity-1.)/2.;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.)xyPatch.y=patch_y,uvFrom=(xyTo+HALF2+u30*(xyPatch-halfFromSparsity))/u16,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),uvWeight=(xyTo*toSparsity+xyPatch+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}gl_FragColor=sum,gl_FragColor*=2.2222;}",
c:["u16","u13","u14","u21","u30"],Za:["1.1111","gl_FragColor\\*=2.2222;"]},s39:{a:"uniform float u16,u30,u24;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-4,1e-4);void main(){vec4 sum=texture2D(u21,vv0);float fromSparsity=1.1111,shrinkFactor=3.3333;vec2 uvFrom,uvWeight,xyFrom,xyPatchTo,xyPatch=ZERO2,xyShrink=ZERO2,eps2=EPS2/u24,xyTo=floor(vv0*u16+eps2);float weightSize=fromSparsity*u24;vec2 halfFromSparsity=ONE2*(fromSparsity-1.)/2.;float toSparsity=weightSize/u16;vec2 xyFrom0=xyTo*shrinkFactor;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.){xyPatch.y=patch_y;for(float shrink_x=0.;shrink_x<3.3333;shrink_x+=1.){xyShrink.x=shrink_x;for(float shrink_y=0.;shrink_y<3.3333;shrink_y+=1.)xyShrink.y=shrink_y,xyFrom=xyFrom0+xyShrink+shrinkFactor*u30*(xyPatch-halfFromSparsity),uvFrom=(xyFrom+HALF2)/u24,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),xyPatchTo=xyPatch*shrinkFactor+xyShrink,uvWeight=(xyTo*toSparsity+xyPatchTo+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}}}gl_FragColor=sum,gl_FragColor*=2.2222;}",
c:"u16 u24 u13 u14 u21 u30".split(" "),Za:["1.1111","gl_FragColor\\*=2.2222;","3.3333"]}},M={Pa:function(){return k},m:function(){if(!k){h="highp";for(var u in A)d(b,A[u],u);y.set("s0");b.enableVertexAttribArray(0);k=!0}},gd:function(u){u.forEach(function(t){M.Vb(t)})},Vb:function(u){A[u.id]=u;d(b,u,u.id)},xc:function(u,t,D){t||(t=u);A[t]=Object.create(E[u]);A[t].Zd=!0;E[u].Za&&E[u].Za.forEach(function(Q,U){A[t].a=A[t].a.replace(new RegExp(Q,"g"),D[U])});d(b,A[t],t)},set:function(u){e(A[u])},$a:function(u){return m(u,
f(),"s40")},Kb:function(u){return m(u,{a:"void main(){gl_FragColor=vec4(.5,.5,.5,.5);}",c:[],precision:"highp"},"s41")},Fd:function(u){return"undefined"===typeof A[u]?!1:A[u].xb},L:function(){-1!==n&&(n=-1,g.qa.forEach(function(u){0!==u&&b.disableVertexAttribArray(u)}))},Mb:function(){var u=0;g.qa.forEach(function(t,D){D=g.pa[D];b.vertexAttribPointer(t,D,b.FLOAT,!1,g.Sb,u);u+=4*D})},fc:function(){b.enableVertexAttribArray(0)},la:function(){M.ab(b)},ab:function(u){u.vertexAttribPointer(g.qa[0],2,u.FLOAT,
!1,8,0)},Zc:function(u,t){b.uniform1i(g.j[u],t)},B:function(u,t){b.uniform1f(g.j[u],t)},za:function(u,t,D){b.uniform2f(g.j[u],t,D)},fg:function(u,t){b.uniform2fv(g.j[u],t)},xe:function(u,t){b.uniform3fv(g.j[u],t)},gg:function(u,t,D,Q){b.uniform3f(g.j[u],t,D,Q)},hg:function(u,t,D,Q,U){b.uniform4f(g.j[u],t,D,Q,U)},Lb:function(u,t){b.uniform4fv(g.j[u],t)},ig:function(u,t){b.uniformMatrix2fv(g.j[u],!1,t)},jg:function(u,t){b.uniformMatrix3fv(g.j[u],!1,t)},kg:function(u,t){b.uniformMatrix4fv(g.j[u],!1,
t)},N:function(u,t){M.set(u);t.forEach(function(D){switch(D.type){case "4f":b.uniform4fv(g.j[D.name],D.value);break;case "3f":b.uniform3fv(g.j[D.name],D.value);break;case "2f":b.uniform2fv(g.j[D.name],D.value);break;case "1f":b.uniform1f(g.j[D.name],D.value);break;case "1i":b.uniform1i(g.j[D.name],D.value);break;case "mat2":b.uniformMatrix2fv(g.j[D.name],!1,D.value);break;case "mat3":b.uniformMatrix3fv(g.j[D.name],!1,D.value);break;case "mat4":b.uniformMatrix4fv(g.j[D.name],!1,D.value)}})},Ff:function(){return"lowp"},
h:function(){b.disableVertexAttribArray(0);M.L();for(var u in A){var t=A[u];t.xb&&(t.xb=!1,b.deleteProgram(t.ha));t.Zd&&delete A[u]}r.forEach(function(D){b.deleteShader(D)});r.splice(0);v=0;k=!1}};return M}(),b=null,Qa=function(){function a(h){console.log("ERROR in ContextFF: ",h);return!1}function c(h){function w(){Ea.h();B.getExtension("WEBGL_lose_context").loseContext()}if(navigator.userAgent&&-1!==navigator.userAgent.indexOf("forceWebGL1"))return!1;var l=document.createElement("canvas");l.setAttribute("width",
1);l.setAttribute("height",1);var B=null;try{B=l.getContext("webgl2",h)}catch(F){return!1}if(!B)return!1;d(B);ba.hc(B);h=ba.ib(B);if(!h.$&&!h.aa)return w(),!1;h=Ea.Zb(B,h);w();return h?!0:!1}function d(h){h.clearColor(0,0,0,0);h.disable(h.DEPTH_TEST);h.disable(h.BLEND);h.disable(h.DITHER);h.disable(h.STENCIL_TEST);h.disable(h.CULL_FACE);h.GENERATE_MIPMAP_HINT&&h.hint(h.GENERATE_MIPMAP_HINT,h.FASTEST);h.disable(h.SAMPLE_ALPHA_TO_COVERAGE);h.disable(h.SAMPLE_COVERAGE);h.depthFunc(h.LEQUAL);h.clearDepth(1)}
var e=null,m=null,f=null,r=null,n=!0,g=null,v=null,k={D:function(){return e.width},R:function(){return e.height},wf:function(){return e},uf:function(){return b},ba:function(){return n},flush:function(){b.flush()},Ld:function(){g||(g=new Uint8Array(e.width*e.height*4));b.readPixels(0,0,e.width,e.height,b.RGBA,b.UNSIGNED_BYTE,g);return g},yf:function(){return e.toDataURL("image/jpeg")},zf:function(){sa.J();m||(m=document.createElement("canvas"),f=m.getContext("2d"));m.width=e.width;m.height=e.height;
for(var h=k.Ld(),w=f.createImageData(m.width,m.height),l=m.width,B=m.height,F=w.data,H=0;H<B;++H)for(var N=B-H-1,A=0;A<l;++A){var E=4*(H*l+A),M=4*(N*l+A);F[E]=h[M];F[E+1]=h[M+1];F[E+2]=h[M+2];F[E+3]=h[M+3]}f.putImageData(w,0,0);return m.toDataURL("image/png")},xf:function(h){!m&&h&&(m=document.createElement("canvas"),f=m.getContext("2d"));var w=h?m:document.createElement("canvas");w.width=e.width;w.height=e.height;(h?f:w.getContext("2d")).drawImage(e,0,0);return w},m:function(h){h.zd&&!h.hb?e=document.getElementById(h.zd):
h.hb&&(e=h.hb);e||(e=document.createElement("canvas"));e.width=h&&void 0!==h.width?h.width:512;e.height=h&&void 0!==h.height?h.height:512;"undefined"===typeof h&&(h={});void 0===h.premultipliedAlpha&&(h.premultipliedAlpha=!1);void 0===h.Bc&&(h.Bc=!0);void 0===h.antialias&&(h.antialias=!1);if(!b){var w={antialias:h.antialias,alpha:!0,preserveDrawingBuffer:!0,premultipliedAlpha:h.premultipliedAlpha,stencil:!1,depth:h.Bc};navigator&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("noAntialiasing")&&
(w.antialias=!1);var l=c(w);!l&&w.antialias&&(w.antialias=!1,l=c(w));l&&(b=e.getContext("webgl2",w));b?n=!0:((b=e.getContext("webgl",w))||(b=e.getContext("experimental-webgl",w)),n=!1)}if(!b)return a("WebGL1 and 2 are not enabled");(r=b.getExtension("WEBGL_lose_context"))&&h.Qc&&(v=h.Qc,e.addEventListener("webglcontextlost",v,!1));if(!ba.m())return a("Not enough GL capabilities");d(b);y.m();S.m();return Ea.Zb(b,ba.Kd())?!0:a("Cannot filter float textures")},h:function(){b&&ba.h();r&&v&&(e.removeEventListener("webglcontextlost",
v,!1),v=null);g=f=m=e=null}};return k}(),ua=function(){function a(){null===c&&("undefined"!==typeof y?c=y:"undefined"!==typeof JEShaders&&(c=JEShaders))}var c=null;a();return{we:function(d){c!==d&&(c&&c.L(),c=d)},Pa:function(){return c.Pa()},la:function(){return c.la()},ab:function(d){return c.ab(d)},Mb:function(){return c.Mb()},L:function(){return c.L()},set:function(d){return c.set(d)},$a:function(d){a();return c.$a(d)},Kb:function(d){a();return c.Kb(d)},h:function(){return c.h()}}}(),Ca=function(){function a(p){b.bindTexture(b.TEXTURE_2D,
p)}function c(p){Q[0]=p;p=U[0];var K=p>>16&32768,I=p>>12&2047,q=p>>23&255;return 103>q?K:142<q?K|31744|((255==q?0:1)&&p&8388607):113>q?(I|=2048,K|(I>>114-q)+(I>>113-q&1)):K=(K|q-112<<10|I>>1)+(I&1)}function d(p){var K=new Uint16Array(p.length);p.forEach(function(I,q){K[q]=c(I)});return K}function e(){if(null!==da.ub)return da.ub;var p=f(d([1,1,1,1]));return null===p?!0:da.ub=p}function m(){if(null!==da.vb)return da.vb;var p=f(new Uint8Array([255,255,255,255]));return null===p?!0:da.vb=p}function f(p){if(!ua.Pa()||
!F)return null;var K=null;try{var I=b.getError();if("FUCKING_BIG_ERROR"===I)return!1;K=C.instance({isFloat:!1,K:!0,array:p,width:1});I=b.getError();if(I!==b.NO_ERROR)return!1}catch(q){return!1}ka.J();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);ua.set("s0");K.Xb(0);la.g(!0,!0);p=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,p);p=.9<p[0];K.remove();ka.Y();return p}var r=0,n=null,g=0,v=null,k=null,h=null,w=null,l=null,B=null,F=!1,H=[],N={isFloat:!1,isPot:!0,
isLinear:!1,isMipmap:!1,isAnisotropicFiltering:!1,isMirrorX:!1,isMirrorY:!1,isSrgb:!1,isKeepArray:!1,isFlipY:null,width:0,height:0,url:null,array:null,data:null,H:null,Yd:!1,K:!1,fa:null,Ta:4,zb:0},A=!1,E=null,M=null,u=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],t=!1,D=!1,Q=new Float32Array(1),U=new Int32Array(Q.buffer),da={ub:null,vb:null},C={m:function(){F||(l=[b.RGB,null,b.RGB,b.RGBA],B=[b.RGB,null,b.RGB,b.RGBA],n=[b.TEXTURE0,b.TEXTURE1,b.TEXTURE2,b.TEXTURE3,b.TEXTURE4,b.TEXTURE5,b.TEXTURE6,b.TEXTURE7],
t="undefined"!==typeof JEContext,D="undefined"!==typeof ba,t&&JEContext.Vf()&&n.push(b.TEXTURE8,b.TEXTURE9),v=[-1,-1,-1,-1,-1,-1,-1,-1],w=[b.UNSIGNED_BYTE,b.FLOAT,b.FLOAT],F=!0)},Vd:function(){if(!k){for(var p=new Float32Array(16384),K=0;16384>K;++K)p[K]=2*Math.random()-1;k={random:C.instance({isFloat:!0,isPot:!0,array:p,width:64}),dd:C.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}C.Je()},Mf:function(){return k.dd},Je:function(){w[1]=ba.sb(b)},te:function(){B=l=[b.RGBA,
b.RGBA,b.RGBA,b.RGBA]},Zf:function(p,K){y.set("s1");ka.J();var I=p.D(),q=p.R();b.viewport(0,0,I,q);p.b(0);la.g(!1,!1);b.readPixels(0,0,I,q,b.RGBA,b.UNSIGNED_BYTE,K)},pc:function(p,K,I,q,ea,va,Aa){p.activeTexture(p.TEXTURE0);var qa=p.createTexture();p.bindTexture(p.TEXTURE_2D,qa);ea=ea instanceof Float32Array?ea:new Float32Array(ea);0!==pa.de(ea.length)%1&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE));p.texParameteri(p.TEXTURE_2D,
p.TEXTURE_MAG_FILTER,p.NEAREST);p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST);p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,va);p.texImage2D(p.TEXTURE_2D,0,p.RGBA,I,q,0,p.RGBA,p.FLOAT,ea);p.bindTexture(p.TEXTURE_2D,null);p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!1);Aa&&(ka.Y(),y.set("s0"));p.viewport(0,0,I,q);p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,K,0);p.bindTexture(p.TEXTURE_2D,qa);Aa?la.g(!0,!0):S.Ja(p);p.deleteTexture(qa);F&&(v[0]=-1,h=null,r=0)},instance:function(p){function K(z){var L=
b.getError();if("FUCKING_BIG_ERROR"===L)return!1;b.texImage2D(b.TEXTURE_2D,0,fa,ca,ha,z);L=b.getError();L!==b.NO_ERROR&&ca!==b.RGBA&&(ca=b.RGBA,b.texImage2D(b.TEXTURE_2D,0,fa,ca,ha,z));return!0}function I(){if(!xb){a(ra);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,wa);q.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,q.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,q.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),
b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));q.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.Af().TEXTURE_MAX_ANISOTROPY_EXT,JESETTINGS.Me);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,q.isLinear?b.LINEAR:b.NEAREST);q.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,q.isMipmap&&!Ja?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,q.isMipmap&&!Ja?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);
ca=l[q.Ta-1];fa=B[q.Ta-1];ha=w[va];if(ba.ba()){var z=b.RGBA32F;ca===b.RGBA&&ha===b.FLOAT?q.isMipmap||q.isLinear?fa=Ea.Nd(b):ba.$b()?z&&(fa=z):fa=b.RGBA16F||b.RGBA:ca===b.RGB&&ha===b.FLOAT&&z&&(fa=z,ca=b.RGBA)}if(q.K&&!q.isFloat||q.isFloat&&q.isMipmap&&Ea.ce())(z=b.RGBA16F)&&(fa=z),ha=ba.sb(b);q.zb&&(Ya=q.zb);q.isSrgb&&4===q.Ta&&(ca=JEContext.Kf());if(q.H)K(q.H);else if(q.url)K(Fa);else if(xa){z=xa;try{"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,z),b.getError()!==
b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,O,P,0,b.RGBA,b.UNSIGNED_BYTE,null)))}catch(Yb){b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,null)}q.isKeepArray||(xa=null)}else z=b.getError(),"FUCKING_BIG_ERROR"!==z&&(b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,null),z=b.getError(),z!==b.NO_ERROR&&(ca=b.RGBA,q.K&&ha!==b.FLOAT&&(ha=b.FLOAT,b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,null))));if(q.isMipmap)if(!Ja&&Z)Z.rb(),Za=!0;
else if(Ja){z=Math.log2(Math.min(O,P));Ra=Array(1+z);Ra[0]=ra;for(var L=1;L<=z;++L){var ja=Math.pow(2,L),R=O/ja;ja=P/ja;var Ka=b.createTexture();a(Ka);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,fa,R,ja,0,ca,ha,null);a(null);Ra[L]=Ka}Za=!0}a(null);v[r]=-1;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);$a=!0;q.fa&&Z&&(q.fa(Z),q.fa=null)}}var q=Object.assign({},N,p),ea=g++;null===q.isFlipY&&(q.isFlipY=
q.url||q.array?!0:!1);q.data&&(q.array="string"===typeof q.data?Eb(q.data):q.isFloat?new Float32Array(q.data):new Uint8Array(q.data),q.isFlipY=!1);var va=0,Aa=q.H?!0:!1,qa=null,kb=null,yb=!1,lb=null;q.K=q.K||q.isFloat;q.K&&(va=1);q.Yd||ba.ba()||!q.isFloat||!D||ba.$b()||(q.isFloat=!1);q.isFloat&&(va=2);q.isAnisotropicFiltering&&t&&!JEContext.Pf()&&(q.isAnisotropicFiltering=!1);var ra=b.createTexture(),Fa=null,xa=!1,O=0,P=0,$a=!1,xb=!1,ab=!1,ya=null,Ba=null,mb=null,Ta=null,fa=null,ca=null,ha=null,wa=
q.isFlipY,Nb=(p=q.K&&q.isMipmap)&&Ea.rd(),Ja=p&&Nb?!0:!1,Ra=null,Ya=-1,Za=!1,La={Fc:!1,Yb:null,qc:null};q.width&&(O=q.width,P=q.height?q.height:O);var Z={get:function(){return ra},D:function(){return O},R:function(){return P},Nf:function(){return q.url},Qf:function(){return q.isFloat},Sf:function(){return q.K},Tf:function(){return q.isLinear},rb:function(){b.generateMipmap(b.TEXTURE_2D)},pd:function(z,L){Ja?(z||(z=Z.uc()),Z.eb(L),a(Ra[z]),v[L]=-1):Z.b(L)},uc:function(){-1===Ya&&(Ya=Math.log(O)/Math.log(2));
return Ya},Hd:function(z){if(Ja){z||(z=Z.uc());y.set("s11");Z.eb(0);for(var L=O,ja=P,R=1;R<=z;++R)L/=2,ja/=2,y.za("u7",.25/L,.25/ja),b.viewport(0,0,L,ja),a(Ra[R-1]),b.framebufferTexture2D(ka.Ma(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Ra[R],0),la.g(!1,1===R);v[0]=-1}else Z.rb()},eb:function(z){z!==r&&(b.activeTexture(n[z]),r=z)},b:function(z){if(!$a)return!1;Z.eb(z);if(v[z]===ea)return!1;a(ra);v[z]=ea;return!0},Xb:function(z){b.activeTexture(n[z]);r=z;a(ra);v[z]=ea},l:function(){h=Z;b.framebufferTexture2D(ka.Ma(),
b.COLOR_ATTACHMENT0,b.TEXTURE_2D,ra,0)},P:function(){h=Z;b.viewport(0,0,O,P);b.framebufferTexture2D(ka.Ma(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,ra,0)},Rb:C.Rb,resize:function(z,L){O=z;P=L;I()},clone:function(z){z=C.instance({width:O,height:P,K:q.K,isFloat:q.isFloat,isLinear:q.isLinear,isMirrorY:q.isMirrorY,isFlipY:z?!wa:wa,isPot:q.isPot});ua.set("s0");ka.Y();z.l();b.viewport(0,0,O,P);Z.b(0);la.g(!0,!0);return z},ye:function(){b.viewport(0,0,O,P)},remove:function(){b.deleteTexture(ra);xb=!0;H.splice(H.indexOf(Z),
1);Z=null},refresh:function(){Z.Xb(0);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,wa);Aa?b.texImage2D(b.TEXTURE_2D,0,fa,ca,b.UNSIGNED_BYTE,q.H):b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,xa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},dc:function(){var z=O*P*4;Ba=[new Uint8Array(z),new Uint8Array(z),new Uint8Array(z),new Uint8Array(z)];ya=[new Float32Array(Ba[0].buffer),new Float32Array(Ba[1].buffer),new Float32Array(Ba[2].buffer),new Float32Array(Ba[3].buffer)];mb=new Uint8Array(4*z);Ta=new Float32Array(mb.buffer);
ab=!0},Uc:function(){ab||Z.dc();b.readPixels(0,0,O,4*P,b.RGBA,b.UNSIGNED_BYTE,mb);for(var z=O*P,L=2*z,ja=3*z,R=0;R<z;++R)ya[0][R]=Ta[R],ya[1][R]=Ta[R+z],ya[2][R]=Ta[R+L],ya[3][R]=Ta[R+ja];return ya},pe:function(){La.Fc||(La.Yb=new Uint8Array(O*P*4),La.qc=new Float32Array(La.buffer),La.Fc=!0);b.readPixels(0,0,O,P,b.RGBA,b.UNSIGNED_BYTE,La.Yb);return La.qc},ec:function(z){ka.J();y.set("s12");Z.b(0);if(z)b.viewport(0,0,O,P),y.Lb("u8",.25,.25,.25,.25),la.g(!1,!0);else for(z=0;4>z;++z)b.viewport(0,P*z,
O,P),y.Lb("u8",u[z]),la.g(!1,0===z)},Ie:function(z){var L=ha===w[0]&&!m();a(ra);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);L?(yb||(qa=document.createElement("canvas"),qa.width=O,qa.height=P,kb=qa.getContext("2d"),lb=kb.createImageData(O,P),yb=!0),lb.data.set(z),kb.putImageData(lb,0,0),b.texImage2D(b.TEXTURE_2D,0,fa,ca,ha,qa)):b.texImage2D(b.TEXTURE_2D,0,fa,O,P,0,ca,ha,z);v[r]=ea;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},og:function(z,L){a(ra);L&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D,
0,fa,ca,ha,z);v[r]=ea;L&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},dg:function(z,L){var ja=O*P,R=4*ja;z=q.K?z?"RGBE":"JSON":"RGBA";L&&(z=L);L=ba.ba()&&!1;var Ka=null;switch(z){case "RGBE":Ka="s42";break;case "JSON":Ka=L?"s0":"s12";break;case "RGBA":case "RGBAARRAY":Ka="s6"}ab||("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z?(Ba=new Uint8Array(R),ab=!0):"JSON"!==z||L||Z.dc());ka.J();y.set(Ka);Z.b(0);R=null;if("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z){b.viewport(0,0,O,P);la.g(!0,!0);b.readPixels(0,0,O,P,b.RGBA,
b.UNSIGNED_BYTE,Ba);if("RGBAARRAY"===z)return{data:Ba};A||(E=document.createElement("canvas"),M=E.getContext("2d"),A=!0);E.width=O;E.height=P;ja=M.createImageData(O,P);ja.data.set(Ba);M.putImageData(ja,0,0);R=E.toDataURL("image/png")}else if("JSON"===z)if(L)R=new Float32Array(ja),b.viewport(0,0,O,P),la.g(!0,!0),b.readPixels(0,0,O,P,b.RGBA,b.FLOAT,R);else{for(R=0;4>R;++R)b.viewport(0,P*R,O,P),y.Lb("u8",u[R]),la.g(!R,!R);Z.Uc();R=Array(ja);for(L=0;L<ja;++L)R[4*L]=ya[0][L],R[4*L+1]=ya[1][L],R[4*L+2]=
ya[2][L],R[4*L+3]=ya[3][L]}return{format:z,data:R,width:O,height:P,isMirrorY:q.isMirrorY,isFlipY:"RGBA"===z?q.isFlipY:!q.isFlipY}}};q.isMipmap&&!Ja&&$a&&!Za&&(Z.rb(),Za=!0);if(q.url)a(ra),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,1,1,0,b.RGBA,b.UNSIGNED_BYTE,null),Fa=new Image,Fa.Ye="Anonymous",Fa.crossOrigin="Anonymous",Fa.src=q.url,Fa.onload=function(){O=Fa.width;P=Fa.height;I()};else if(q.H){var zb=function(){O=void 0!==q.H.videoWidth?q.H.videoWidth:q.H.width;P=void 0!==q.H.videoHeight?q.H.videoHeight:
q.H.height;O?I():setTimeout(zb,1)};zb()}else q.array?(q.K&&!q.isFloat?q.array instanceof Uint16Array?(xa=q.array,I()):e()?(xa=d(q.array),I()):(I(),C.pc(b,ra,Z.D(),Z.R(),q.array,wa,!0)):(xa=q.isFloat?q.array instanceof Float32Array?q.array:new Float32Array(q.array):q.array instanceof Uint8Array?q.array:new Uint8Array(q.array),I()),q.isKeepArray||(xa&&xa!==q.array&&(xa=null),delete q.array)):I();Z.Jf=Z.D;q.fa&&$a&&(q.fa(Z),q.fa=null);H.push(Z);return Z},J:function(p){p!==r&&(b.activeTexture(n[p]),r=
p);v[p]=-1;a(null)},Pe:function(p){k.random.b(p)},Rb:function(){h=null;b.framebufferTexture2D(ka.Ma(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0)},reset:function(){for(var p=0;p<n.length;++p)v[p]=-1;r=-1},bg:function(){r=-1},Fe:function(){for(var p=0;p<n.length;++p)C.J(p)},rc:function(){k&&(k.random.remove(),k.dd.remove())},ng:function(p,K){if("RGBA"===p.format||"RGBE"===p.format){var I=new Image;I.src=p.data;I.onload=function(){C.instance({isMirrorY:p.isMirrorY,isFlipY:p.isFlipY,isFloat:!1,H:I,fa:function(q){if("RGBA"===
p.format)K(q);else{var ea=p.width,va=p.height,Aa=C.instance({isMirrorY:p.isMirrorY,isFloat:!0,width:ea,height:va,isFlipY:p.isFlipY});ka.Y();b.viewport(0,0,ea,va);y.set("s43");Aa.l();q.b(0);la.g(!0,!0);C.J(0);K(Aa);b.flush();setTimeout(q.remove,50)}}})}}else"JSON"===p.format?K(C.instance({isFloat:!0,isFlipY:p.isFlipY,width:p.width,height:p.height,array:new Float32Array(p.data)})):K(!1)},h:function(){h&&(sa.Y(),C.Rb(),sa.J());C.Fe();H.slice(0).forEach(function(p){p.remove()});H.splice(0);F=!1;g=0;"undefined"!==
typeof Ea&&Ea.h()}};return C}(),Gb=function(){return{instance:function(a){var c=[Ca.instance(a),Ca.instance(a)],d=[c[1],c[0]],e=d,m={ve:function(f){e[1].l();e[0].b(f);m.ad()},eg:function(f){e[1].P();e[0].b(f);m.ad()},ad:function(){e=e===c?d:c},refresh:function(){e[0].refresh();e[1].refresh()},b:function(f){e[0].b(f)},Oe:function(f){e[1].b(f)},Ef:function(){return e[0]},remove:function(){e[0].remove();e[1].remove();e=null}};return m}}}(),la=function(){function a(g){var v={X:null,F:null};v.X=g.createBuffer();
g.bindBuffer(g.ARRAY_BUFFER,v.X);g.bufferData(g.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),g.STATIC_DRAW);v.F=g.createBuffer();g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,v.F);g.bufferData(g.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2]),g.STATIC_DRAW);return v}var c=null,d=0,e=!1,m=[],f=-2,r=-2,n={reset:function(){r=f=-2},m:function(){e||(c=a(b),n.ra(),e=!0)},instance:function(g){var v=d++,k=g.F?g.F.length:0,h="undefined"===typeof g.mode?b.STATIC_DRAW:g.mode,w=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,
w);b.bufferData(b.ARRAY_BUFFER,g.X instanceof Float32Array?g.X:new Float32Array(g.X),h);f=v;var l=null,B=null,F=null;if(g.F){l=b.createBuffer();b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,l);var H=null;65536>g.F.length?(H=Uint16Array,B=b.UNSIGNED_SHORT,F=2):(H=Uint32Array,B=b.UNSIGNED_INT,F=4);H=g.F instanceof H?g.F:new H(g.F);b.bufferData(b.ELEMENT_ARRAY_BUFFER,H,h);r=v}var N={qd:function(A){f!==v&&(b.bindBuffer(b.ARRAY_BUFFER,w),f=v);A&&ua.Mb()},nd:function(){r!==v&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
l),r=v)},bind:function(A){N.qd(A);N.nd()},$e:function(){b.drawElements(b.TRIANGLES,k,B,0)},af:function(A,E){b.drawElements(b.TRIANGLES,A,B,E*F)},remove:function(){b.deleteBuffer(w);g.F&&b.deleteBuffer(l);N=null}};m.push(N);return N},ra:function(){-1!==f&&(b.bindBuffer(b.ARRAY_BUFFER,c.X),f=-1);-1!==r&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c.F),r=-1)},g:function(g,v){g&&la.ra();v&&ua.la();b.drawElements(b.TRIANGLES,3,b.UNSIGNED_SHORT,0)},Ja:function(g){g=g||b;var v=a(g);g.bindBuffer(g.ARRAY_BUFFER,
v.X);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,v.F);ua.ab(g);g.drawElements(g.TRIANGLES,3,g.UNSIGNED_SHORT,0);g.deleteBuffer(v.X);g.deleteBuffer(v.F);n.reset();e&&(n.ra(),ua.la())},rc:function(){var g=b,v=c;g.deleteBuffer(v.X);g.deleteBuffer(v.F)},h:function(){n.rc();m.forEach(function(g){g.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);n.reset();e=!1;m.splice(0);d=0}};return n}(),ka=function(){var a=null,c=null,d=null,e=!1,m=[],f={v:-2,oc:1},r={Pa:function(){return e},
m:function(){if(!e){a=b.createFramebuffer();var n=ba.ba();c=n&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=n&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER;e=!0}},Bf:function(){return c},Od:function(){return d},Ma:function(){return b.FRAMEBUFFER},If:function(){return f},tf:function(){return a},instance:function(n){void 0===n.Ac&&(n.Ac=!1);var g=n.ca?n.ca:null,v=n.width,k=void 0!==n.height?n.height:n.width,h=a,w=null,l=!1,B=!1,F=0;g&&(v=v?v:g.D(),k=k?k:g.R());var H={Xc:function(){l||
(h=b.createFramebuffer(),l=!0,F=f.oc++)},fd:function(){H.Xc();H.l();w=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,w);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,v,k);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,w);b.clearDepth(1)},bind:function(N,A){F!==f.v&&(b.bindFramebuffer(c,h),f.v=F);g&&g.l();A&&b.viewport(0,0,v,k);N&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},Ne:function(){F!==f.v&&(b.bindFramebuffer(c,h),f.v=F)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|
b.DEPTH_BUFFER_BIT)},Ve:function(){b.clear(b.COLOR_BUFFER_BIT)},We:function(){b.clear(b.DEPTH_BUFFER_BIT)},ye:function(){b.viewport(0,0,v,k)},l:function(){F!==f.v&&(b.bindFramebuffer(c,h),f.v=F)},rtt:function(N){g=N;f.v!==F&&(b.bindFramebuffer(b.FRAMEBUFFER,h),f.v=F);N.l()},J:function(){b.bindFramebuffer(c,null);f.v=-1},resize:function(N,A){v=N;k=A;w&&(b.bindRenderbuffer(b.RENDERBUFFER,w),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,v,k))},remove:function(){h===a||B||(b.bindFramebuffer(c,
h),b.framebufferTexture2D(c,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),w&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(h),w&&b.deleteRenderbuffer(w));B=!0}};n.Ac&&H.fd();m.push(H);return H},J:function(){b.bindFramebuffer(c,null);f.v=-1},Ge:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,ba.D(),ba.R());f.v=-1},reset:function(){f.v=-2},Y:function(){0!==f.v&&(b.bindFramebuffer(c,a),f.v=
0)},clear:function(){b.viewport(0,0,ba.D(),ba.R());b.clear(b.COLOR_BUFFER_BIT)},h:function(){r.J();m.forEach(function(n){n.remove()});b.deleteFramebuffer(a);r.reset();e=!1;m.splice(0);f.v=-2;f.oc=1}};return r}(),ba=function(){function a(){d="undefined"===typeof Qa?JEContext:Qa;e=!0}function c(k,h){for(var w=0;w<k.length;++w){var l=h.getExtension(k[w]);if(l)return l}return null}var d=null,e=!1,m={Cc:!1,Nb:null,Ob:null,Gc:!1,ae:!1,Pb:null,Hc:!1,Qb:null,Dc:!1,fb:null,Wd:!1,gb:null,Xd:!1},f=null,r={$:!0,
aa:!0,qb:!0},n=null,g="undefined"===typeof window?{}:window,v={m:function(){if(e)return!0;f=Object.assign({},m);n=Object.assign({},r);e||a();var k=b;if(!f.Cc){f.Nb=v.kc(k);g.GL_EXT_FLOAT=f.Nb;f.Gc=f.Nb?!0:!1;if(f.Gc||v.ba())f.Ob=v.lc(k),f.ae=f.Ob?!0:!1,g.GL_EXT_FLOATLINEAR=f.Ob;f.Cc=!0}if(!f.Dc){f.Pb=v.Ia(k);f.Pb&&(f.Hc=!0,g.GL_EXT_HALFFLOAT=f.Pb);if(f.Hc||v.ba())f.Qb=v.mc(k),g.GL_EXT_HALFFLOATLINEAR=f.Qb;f.Of=f.Qb?!0:!1;f.Dc=!0}f.fb=v.ic(k);f.Wd=f.fb?!0:!1;g.GL_EXT_COLORBUFFERFLOAT=f.fb;f.gb=v.jc(k);
f.Xd=f.gb?!0:!1;g.GL_EXT_COLORBUFFERHALFFLOAT=f.gb;ka.m();Ca.m();if(!v.Ad())return!1;la.m();Ca.Vd();return!0},D:function(){e||a();return d.D()},R:function(){e||a();return d.R()},ba:function(){e||a();return d.ba()},hc:function(k){v.ic(k);v.jc(k);v.kc(k);v.lc(k);v.Ia(k);v.mc(k)},ic:c.bind(null,["EXT_color_buffer_float","WEBGL_color_buffer_float","OES_color_buffer_float"]),jc:c.bind(null,["EXT_color_buffer_half_float","WEBGL_color_buffer_half_float","OES_color_buffer_half_float"]),kc:c.bind(null,["OES_texture_float",
"MOZ_OES_texture_float","WEBKIT_OES_texture_float"]),lc:c.bind(null,["OES_texture_float_linear","MOZ_OES_texture_float_linear","WEBKIT_OES_texture_float_linear"]),Ia:c.bind(null,["OES_texture_half_float","MOZ_OES_texture_half_float","WEBKIT_OES_texture_half_float"]),mc:c.bind(null,["OES_texture_half_float_linear","MOZ_OES_texture_half_float_linear","WEBKIT_OES_texture_half_float_linear"]),sb:function(k){var h=v.Ia(k);return h&&h.HALF_FLOAT_OES?h.HALF_FLOAT_OES:k.HALF_FLOAT||k.FLOAT},Kd:function(){return n},
$b:function(){return n.$},Re:function(){return n.aa},Qe:function(){return n.qb},bb:function(k,h,w){function l(){k.bindTexture(k.TEXTURE_2D,null);k.bindFramebuffer(B,null);k.deleteTexture(N);k.deleteFramebuffer(H)}var B=k.FRAMEBUFFER,F=k.NEAREST,H=k.createFramebuffer();k.bindFramebuffer(B,H);var N=k.createTexture();k.bindTexture(k.TEXTURE_2D,N);k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,F);k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,F);k.texImage2D(k.TEXTURE_2D,0,h,1,1,0,k.RGBA,w,null);
k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_2D,N,0);if(k.checkFramebufferStatus(k.READ_FRAMEBUFFER||k.FRAMEBUFFER)!==k.FRAMEBUFFER_COMPLETE)return l(),!1;ua.Kb(k);k.clearColor(0,0,0,0);k.viewport(0,0,1,1);k.disable(k.DEPTH_TEST);k.clear(k.COLOR_BUFFER_BIT);la.Ja(k);k.bindFramebuffer(B,null);ua.$a(k);k.activeTexture(k.TEXTURE0);k.bindTexture(k.TEXTURE_2D,N);la.Ja(k);h=new Uint8Array(4);k.readPixels(0,0,1,1,k.RGBA,k.UNSIGNED_BYTE,h);l();return 3<Math.abs(h[0]-127)?!1:!0},ib:function(k){var h=
{$:!1,aa:!1};k.disable(k.BLEND);k.clearColor(0,0,0,0);k.clear(k.COLOR_BUFFER_BIT);k.RGBA32F&&v.bb(k,k.RGBA32F,k.FLOAT)&&(h.$=!0);!h.$&&v.bb(k,k.RGBA,k.FLOAT)&&(h.$=!0);var w=v.sb(k);k.RGBA16F&&v.bb(k,k.RGBA16F,w)&&(h.aa=!0);!h.aa&&v.bb(k,k.RGBA,w)&&(h.aa=!0);return h},Bd:function(){var k=ka.instance({width:1});k.Xc();var h=Ca.instance({width:1,isFloat:!0,Ta:3});k.l();h.l();b.flush();b.checkFramebufferStatus(ka.Od())!==b.FRAMEBUFFER_COMPLETE?(Ca.te(),n.qb=!1):n.qb=!0;k.remove();h.remove()},Ad:function(){var k=
v.ib(b);Object.assign(n,k);if(!n.$&&!n.aa)return!1;v.Bd();return!0},h:function(){Ca.h();ua.h();ka.h();la.h();e=!1}};return v}(),S=la,sa=ka,X=Ca,Ea=function(){function a(A,E,M,u){l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,u?l.NEAREST_MIPMAP_NEAREST:l.LINEAR);var t=null;if(null!==M)try{t=l.getError();if("FUCKING_BIG_ERROR"===t)return!1;l.texImage2D(l.TEXTURE_2D,0,A,2,2,0,l.RGBA,E,M);t=l.getError();if(t!==l.NO_ERROR)return!1}catch(D){return!1}u&&l.generateMipmap(l.TEXTURE_2D);l.clear(l.COLOR_BUFFER_BIT);
S.Ja(l);t=l.getError();if("FUCKING_BIG_ERROR"===t)return!1;l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,k);t=l.getError();t===l.INVALID_OPERATION&&"undefined"!==typeof l.PIXEL_PACK_BUFFER&&(l.bindBuffer(l.PIXEL_PACK_BUFFER,null),l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,k),t=l.getError());if(t!==l.NO_ERROR)return!1;if(M=0!==k[0])g.Sc=E,g.zc=A;return M}function c(A,E){return B.$&&a(A,l.FLOAT,new Float32Array(w),E)?(n=r.Ub,!0):!1}function d(A,E,M){if(!B.aa)return!1;var u=ba.Ia(l);if(u&&u.HALF_FLOAT_OES&&
a(A,u.HALF_FLOAT_OES,new Uint16Array(w),E)||l.HALF_FLOAT&&a(A,l.HALF_FLOAT,new Uint16Array(w),E)||a(A,l.FLOAT,new Float32Array(w),E))return n=r.oa,!0;l.bindTexture(l.TEXTURE_2D,M);l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,null);l.bindFramebuffer(g.Ga,N);Ca.pc(l,M,1,1,new Float32Array(w),!1,!1);l.bindFramebuffer(g.Ga,null);l.bindTexture(l.TEXTURE_2D,M);return a(A,null,null,E)?(n=r.oa,!0):!1}function e(A,E,M){v=!0;if(d(A,!0,M)||c(E,!0))return!0;v=!1;return d(A,!1,M)||c(E,!1)?!0:
!1}function m(A){if(n===r.L){l=A||b;n=r.RGBA8;v=!0;ba.hc(l);B||(B=ba.ib(l));sa.reset();N=l.createFramebuffer();g.Ga=l.DRAW_FRAMEBUFFER||l.FRAMEBUFFER;l.bindFramebuffer(g.Ga,null);l.clearColor(0,0,0,0);l.viewport(0,0,1,1);y.L();F=y.$a(l);A=l.createTexture();l.activeTexture(l.TEXTURE0);l.bindTexture(l.TEXTURE_2D,A);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.REPEAT);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.REPEAT);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);H=A;var E=A=l.RGBA,
M=l.RGBA16F,u=l.RGBA32F;u&&(A=u);M&&(E=M);if((M||u)&&e(E,A,H))return f(),!0;A=E=l.RGBA;if(e(E,A,H))return f(),!0;n=r.RGBA8;f();return!1}}function f(){l.deleteProgram(F.ha);l.deleteTexture(H);H=F=null}var r={L:-1,Ub:3,oa:2,RGBA8:0},n=r.L,g={Sc:null,zc:null,Ga:null},v=!0,k=new Uint8Array(4),h=[.8,1,.8,1],w=h.concat(h,h,h),l=null,B=null,F=null,H=null,N=null;return{rd:function(A){m(A);return v},Zb:function(A,E){n===r.L&&(typeof("undefined"!==E)&&(B=E),m(A));return n!==r.RGBA8},Rf:function(A){m(A);return n===
r.Ub},ce:function(A){m(A);return n===r.oa},Cf:function(A){m(A);return g.Sc},Nd:function(A){m(A);return g.zc},h:function(){l=null;v=!0;n=r.L;B=null}}}(),Ob=function(){return{instance:function(a){var c=X.instance(a.alpha),d=X.instance(a.beta);return{Dd:function(){c.b(1);d.b(2)}}}}}(),Cb=function(){return{instance:function(a){var c=null,d=!1,e=!1,m=null,f=!1,r=!1,n=null,g="undefined"===typeof a.preprocessing?!1:a.preprocessing,v="undefined"===typeof a.preprocessingSize?a.size:a.preprocessingSize;a.mask&&
(d=!0,Y&&void 0!==Y.md&&(a.mask=Y.md+a.mask),c=X.instance({isFloat:!1,url:a.mask}));var k=!1;a.customInputShader&&(k="s44",y.Vb({name:"_",id:k,a:a.customInputShader,mg:["uSource"],precision:"lowp"}),y.N(k,[{type:"1i",name:"_",value:0}]));switch(g){case "sobel":n="s31";f=!0;break;case "meanNormalization":n="s32";f=!0;break;case "grayScale":n="s28";f=!1;break;case "grayScaleTilt":n="s29";r=!0;f=!1;break;case "rgbGrayTilt":n="s30";r=!0;f=!1;break;case "copy":n=k?k:"s0";break;case "inputLightRegulation":n=
k?k:"s28";m=Pb.instance({yc:v,Rc:a.size,Nc:a.nBlurPass,be:!1});e=!0;break;case "direct":case "none":n=!1;break;default:n="s3"}r&&y.N(n,[{name:"u26",type:"1f",value:a.tilt}]);d&&(n+="Mask");var h=X.instance({isFloat:!1,isPot:!1,width:a.size}),w={D:function(){return v},tb:function(){return w.D()},Rd:function(){return e?m.vc():h},M:function(){sa.Y();n&&(y.set(n),f&&y.B("u27",1/a.size),h.P(),d&&c.b(1),S.g(!1,!1),h.b(0),e&&m.process(h))},h:function(){h.remove();d&&c.remove()}};return w}}}(),Db=function(){return{instance:function(a){"undefined"===
typeof a.normalize&&(a.normalize=!1);var c={input:null,Da:null,wb:null,U:null,Va:null,Eb:null,Fb:null},d=null,e=[],m=[],f=!1,r=null,n=!0,g=-1,v=a.isReorganize?a.isReorganize:!1,k=a.kernelsCount?!0:!1,h=a.dynPelu?Ob.instance(a.dynPelu):!1,w=h?!0:!1,l={isEnabled:!1};a.$d?(a.sparsity="undefined"!==typeof a.sparsity?a.sparsity:a.Xa.tb(),n=!1):"full"===a.connectivityUp&&(a.sparsity=a.Xa.tb());var B={elu:"s15",elu01:"s16",relu:"s14",arctan:"s18",sigmoid:"s13",copy:"s0",softplus:"s19",dynPelu:"s17"}[a.activation],
F=a.sparsity*a.sparsity,H=!1,N=a.size,A="";if(a.maxPooling){switch(a.maxPooling.size){case 2:A="s33";break;case 4:A="s34"}H=!0;N/=a.maxPooling.size;c.Eb=X.instance({isFloat:!0,isPot:!1,width:N})}var E=void 0!==a.je&&a.je?!0:!1,M=null,u=null,t=null;if(E){M="s45"+a.index.toString();y.xc("s45",M,[((a.normalization.n-1)/2).toFixed(1)]);y.N(M,[{type:"1i",name:"u1",value:0},{type:"2f",name:"u7",value:[1/a.size,1/a.size]},{type:"1f",name:"u6",value:a.normalization.alpha},{type:"1f",name:"u9",value:a.normalization.beta},
{type:"1f",name:"u31",value:a.normalization.k}]);var D={isFloat:!0,isPot:!0,width:a.size};u=X.instance(D);t=X.instance(D)}var Q=-1,U=null;n&&(c.U=X.instance({isFloat:!0,isPot:!1,width:a.size}));c.Da=X.instance(a.bias);var da={D:function(){return a.size},tb:function(){return N},sc:function(){return a.classesCount},od:function(C){d.b(C)},me:function(){a.remap&&a.remap.isEnabled&&(l={isEnabled:!0,fe:X.instance({isFloat:!1,isFlipY:!1,array:new Uint8Array(a.remap.maskTexture.data),width:a.remap.maskTexture.width,
isPot:!1}),Qa:a.remap.layers.map(function(C){return a.parent.Qd(C)}),depth:a.remap.depth})},ue:function(){switch(a.connectivityUp){case "direct":U=Qb.instance(a.connectivity);break;case "square":U=Rb.instance(a.connectivity);break;case "squareFast":U=Sb.instance(a.connectivity,a.activation);break;case "full":U=Tb.instance(a.connectivity);break;case "conv":g=a.kernelsCount,U=Ub.instance(a.connectivity),v&&(c.Va=X.instance({width:N,isFloat:!0,isFlipY:!1,isPot:!1}))}if(U.ma){var C=a.size*a.sparsity;
Q=Math.log(C/a.size)/Math.log(2);c.input=X.instance({isMipmap:!0,isFloat:!0,isPot:!0,width:C,zb:Q});c.wb=X.instance({isFloat:!0,isPot:!0,width:a.size})}},M:function(C){d=C;U.ma?(c.input.P(),k&&c.Da.b(2),U.M(l),c.input.b(0),c.input.Hd(Q),c.wb.P(),k?y.set("s0"):(y.set("s27"),y.B("u25",F),c.Da.b(1)),c.input.pd(Q,0),S.g(!1,!1),y.set(B),E?u.l():c.U.l(),c.wb.b(0),w&&h.Dd(),S.g(!1,!1)):(c.U.P(),c.Da.b(1),U.M());E&&(y.set(M),t.l(),u.b(0),S.g(!1,!1),y.set("s46"),y.B("u6",1),c.U.l(),t.b(1),S.g(!1,!1));if(n)return H?
(c.Eb.P(),c.U.b(0),y.set(A),y.za("u7",1/a.size,1/a.size),S.g(!1,!1),C=c.Eb):C=c.U,C.b(0),v&&(c.Va.l(),y.set("s21"),y.za("u12",g,N/g),S.g(!1,!1),C=c.Va,c.Va.b(0)),C;C=c.U;a.normalize&&(y.set("gpuRawAvg"===f?"s8":"s7"),y.B("u4",1/a.size),c.Fb.P(),c.U.b(0),S.g(!1,!1),C=c.Fb);switch(f){case "cpuRGBA2Float":C.ec(!1);C=da.oe(C);r(C);break;case "cpuMeanFloat":C.ec(!0);C=C.pe();r(C);break;case "gpuRawAvg":case "gpuRaw":C.b(0);case "none":null!==r&&r(C)}return!1},yd:function(C){C&&(f=C.Gb||"none",r=C.Db||
null);c.U=X.instance({isFloat:!0,isPot:!0,isMipmap:!1,width:a.size});C="undefined"!==typeof a.classesCount&&a.classesCount?a.classesCount:a.size*a.size;for(var p=0,K=0,I=0;p<C;++p)e.push(K+(a.size-1-I)*a.size),m.push([-1,-1,-1,-1]),++K,K===a.size&&(K=0,++I);a.normalize&&(c.Fb=X.instance({isFloat:!0,isPot:!0,width:a.size}))},oe:function(C){var p=C.Uc();e.forEach(function(K,I){m[I][0]=p[0][K];m[I][1]=p[1][K];m[I][2]=p[2][K];m[I][3]=p[3][K]});return m},h:function(){for(var C in c){var p=c[C];p&&p.remove()}U&&
(U.h(),U=null)}};a.Xa&&da.ue(a.Xa);return da}}}(),Qb=function(){return{instance:function(a){var c=X.instance(a.weights);delete a.weights.data;return{ma:!0,La:function(){return 1},h:function(){c.remove()},Ud:function(){return c},M:function(){y.set("s26");c.b(1);S.g(!1,!1)}}}}}(),Tb=function(){return{instance:function(a){var c=a.fromLayerSize,d=X.instance(a.weights);delete a.weights.data;return{ma:!0,La:function(){return c},h:function(){d.remove()},M:function(e){if(e.isEnabled){y.set("s24");e.fe.b(3);
var m,f=Math.min(e.Qa.length,e.depth);for(m=0;m<f;++m)e.Qa[m].od(4+m)}else y.set("s23");y.B("u16",a.toLayerSize);d.b(1);S.g(!1,!1)}}}}}(),Rb=function(){return{instance:function(a){for(var c=a.fromLayerSize,d=a.toLayerSize,e=a.toSparsity,m=e*d,f=m/c,r=c/d,n=0,g=0,v=0,k=Array(e*d*e*d*4),h=Array(e*d*e*d*4),w=Array(c*c),l=0;l<w.length;++l)w[l]=0;l=Math.floor(e/2);for(var B=.5/d,F=.5/c,H=.5/m,N=0;N<d;++N)for(var A=Math.round(N*r),E=0;E<d;++E){var M=Math.round(E*r),u=N/d,t=E/d;u+=B;t+=B;for(var D=0;D<e;++D){var Q=
A+D-l;0>Q&&(Q+=c);Q>=c&&(Q-=c);for(var U=0;U<e;++U){var da=n/m,C=g/m,p=M+U-l;0>p&&(p+=c);p>=c&&(p-=c);var K=Q/c,I=p/c;C=1-C-1/m;K+=F;I+=F;da+=H;C+=H;var q=N*e+D,ea=E*e+U;ea=d*e-ea-1;q=ea*d*e+q;k[4*q]=da;k[4*q+1]=C;k[4*q+2]=K;k[4*q+3]=I;I=w[p*c+Q]++;q=I%f;K=Q*f+q;p=p*f+(I-q)/f;p=c*f-1-p;p=p*c*f+K;h[4*p]=da;h[4*p+1]=C;h[4*p+2]=u;h[4*p+3]=t;++n>=m&&(n=0,++g);++v}}}w=null;var va=X.instance(a.weights);delete a.weights.data;var Aa=X.instance({width:m,isFloat:!0,array:new Float32Array(h),isPot:!0});h=null;
var qa=X.instance({width:m,isFloat:!0,array:new Float32Array(k),isPot:!0});k=null;return{ma:!0,La:function(){return f},h:function(){Aa.remove();qa.remove();va.remove()},M:function(){y.set("s22");va.b(1);qa.b(2);S.g(!1,!1)}}}}}(),Ub=function(){return{instance:function(a){var c=a.kernelsCount,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,m=X.instance(a.weights);delete a.weights.data;return{ma:!0,La:function(){return e},Lf:function(){return d},Ud:function(){return m},h:function(){m.remove()},M:function(){y.set("s25");
y.B("u22",c);y.B("u23",d);y.B("u16",a.toLayerSize);y.B("u24",a.fromLayerSize);m.b(1);S.g(!1,!1)}}}}}(),Sb=function(){return{instance:function(a,c){var d=a.fromLayerSize,e=a.toLayerSize,m=a.toSparsity,f=a.stride?a.stride:1,r=m*e/d,n=e<d,g=d/e,v=X.instance(a.weights);delete a.weights.data;var k="s47"+[d.toString(),e.toString(),m.toString(),f.toString(),c].join("_");y.Fd(k)||(a=Mb.Id(c,"gl_FragColor","gl_FragColor"),e=[{type:"1f",name:"u16",value:e},{type:"1f",name:"u30",value:f}],n&&e.push({type:"1f",
name:"u24",value:d}),d=[(n?r:m).toFixed(1),a],n&&d.push(g.toFixed(1)),y.xc(n?"s39":"s38",k,d),y.N(k,e.concat([{type:"1i",name:"u14",value:0},{type:"1i",name:"u21",value:1},{type:"1i",name:"u13",value:3}])));return{ma:!1,La:function(){return r},h:function(){v.remove()},M:function(){y.set(k);v.b(3);S.g(!1,!1)}}}}}(),Pb=function(){return{instance:function(a){var c=a.Nc?a.Nc:3,d=a.yc?a.yc:64,e=a.Rc?a.Rc:64,m=a.be?!0:!1;a={isFloat:!1,width:d,isPot:!1,isFlipY:!1};var f=X.instance(a),r=X.instance(a),n=X.instance(a),
g=X.instance(a),v=X.instance({isFloat:!0,width:e,isPot:!1,isFlipY:!1}),k=1/d;return{process:function(h){y.set("s35");g.l();S.g(m,!1);y.set("s36");for(var w=0;w<c;++w)f.l(),y.za("u7",k,0),S.g(m,!1),n.l(),g.b(0),S.g(m,!1),r.l(),f.b(0),y.za("u7",0,k),S.g(m,!1),g.l(),n.b(0),S.g(m,!1),w!==c-1&&r.b(0);y.set("s37");v.l();h.b(0);r.b(1);g.b(2);S.g(m,!1);v.b(0)},vc:function(){return v}}}}}(),V={Td:function(){return V.cc()?document.createElement("video"):!1},ua:function(a,c){a[c]=!0;a.setAttribute(c,"true")},
ud:function(){var a=!1,c=navigator.userAgent||navigator.vendor||window.opera;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(c)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(c.substr(0,
4)))a=!0;return a},ac:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},Jd:function(){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return 2<a.length?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3]||0,10)]:[0,0,0]},Ic:function(){try{return window.matchMedia("(orientation: portrait)").matches?!0:!1}catch(a){return window.innerHeight>window.innerWidth}},td:function(){return V.bc()||V.ac()},bc:function(){var a=navigator.userAgent.toLowerCase();return-1!==
a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},rf:function(){return V.ud()?V.Ic()?window.innerHeight/window.innerWidth*45:45:45},cc:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},cg:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},wd:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var m={};"undefined"!==typeof e.min&&(m.min=e.min);"undefined"!==typeof e.max&&
(m.max=e.max);"undefined"!==typeof e.ideal&&(m.ideal=e.ideal);return m};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},bd:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},xd:function(a){function c(h){return[480,
576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(w,l){return Math.abs(w-h)-Math.abs(l-h)})}function d(h){var w=V.wd(a);e.push(h(w))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var m=c(a.video.width.ideal).slice(0,3),f=c(a.video.height.ideal).slice(0,3),r={},n=0;for(r.ea=void 0;n<m.length;r={ea:r.ea},++n){r.ea=m[n];var g={},v=0;for(g.da=void 0;v<f.length;g={da:g.da},++v)if(g.da=f[v],r.ea!==a.video.width.ideal||
g.da!==a.video.height.ideal){var k=Math.max(r.ea,g.da)/Math.min(r.ea,g.da);k<4/3-.1||k>16/9+.1||d(function(h,w){return function(l){l.video.width.ideal=h.ea;l.video.height.ideal=w.da;return l}}(r,g))}}}d(function(h){return V.bd(h)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(h){delete h.video.width.ideal;delete h.video.height.ideal;return h}),d(function(h){delete h.video.width;delete h.video.height;return h}));a.video.facingMode&&(d(function(h){delete h.video.facingMode;
return h}),a.video.width&&a.video.height&&d(function(h){V.bd(h);delete h.video.facingMode;return h}));e.push({audio:a.audio,video:!0});return e},Ce:function(a){if(V.Ic()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Sa:function(a){a.volume=0;V.ua(a,"muted");if(V.bc()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart",
c,!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;V.ua(a,"muted")},5)}},cd:function(a,c,d){return new Promise(function(e,m){if(a.srcObject&&a.srcObject.getVideoTracks){var f=a.srcObject.getVideoTracks();1!==f.length?m("INVALID_TRACKNUMBER"):(f=f[0],c?V.get(a,e,m,d):(f.stop(),e()))}else m("BAD_IMPLEMENTATION")})},wc:function(a,c,d,e){function m(r){f||(f=!0,d(r))}var f=!1;return navigator.mediaDevices.getUserMedia(e).then(function(r){function n(){setTimeout(function(){if(a.currentTime){var g=
a.videoWidth,v=a.videoHeight;if(0===g||0===v)m("VIDEO_NULLSIZE");else{g&&(a.style.width=g.toString()+"px");v&&(a.style.height=v.toString()+"px");g={sd:null,ze:null,ge:null};try{var k=r.getVideoTracks()[0];k&&(g.ge=k,g.sd=k.getCapabilities(),g.ze=k.getSettings())}catch(h){}V.td()?a.parentNode&&null!==a.parentNode?(f||c(a,r,g),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),V.Sa(a),f||c(a,r,g),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed";
a.style.bottom="0px";a.style.right="0px";V.Sa(a);setTimeout(function(){a.play()},100)},80)):f||c(a,r,g)}}else m("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=r:(a.src=window.URL.createObjectURL(r),a.videoStream=r);V.Sa(a);a.addEventListener("loadeddata",function(){var g=a.play();V.Sa(a);"undefined"===typeof g?n():g.then(function(){n()}).catch(function(){m("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(r){m(r)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"),
!1;if(!V.cc())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(V.ac()){var m=V.Jd();(12>m[0]||12===m[0]&&2>m[1])&&V.Ce(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}V.ua(a,"autoplay");V.ua(a,"playsinline");e&&e.audio?a.volume=0:V.ua(a,"muted");V.wc(a,c,function(){function f(n){if(0===n.length)d("INVALID_FALLBACKCONSTRAINTS");else{var g=n.shift();V.wc(a,c,function(){f(n)},g)}}
var r=V.xd(e);f(r)},e)},Sd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0<c.length?a(c,!1):a(!1,"NODEVICESFOUND")}).catch(function(){a(!1,"PROMISEREJECTED")})},Se:function(a,c,d){var e={};e[c]=d;c=[];c.push(e);a.applyConstraints({advanced:c}).catch(function(){})}},
za=function(){var a={n:5,Ab:1,Kc:0,Ka:[30,45],Ha:[2,200],k:.7,He:200,le:.05},c=-1,d=null,e=-1,m=-1,f=0,r=-1,n=-1,g=0,v=0,k=a.Ha[1],h={tc:function(){switch(c){case -1:return-1;case 0:return n+d.Kc;case 1:return g}},vf:function(w){return Math.pow(Math.min(Math.max(r,0),d.n-1)/(d.n-1),w||1)},m:function(w){d=Object.assign({},a,w);r=n=d.Ab;c=0},De:function(w){w=("undefined"===typeof w?Date.now():w)||0;var l=Math.min(Math.max(w-v,d.Ha[0]),d.Ha[1]);k=l;v=w;var B=-1===e?0:d.k;e=Math.min(Math.max(1E3/l,5),
120)*(1-B)+e*B;w-m>d.He&&5<++f&&(l=d.k,r=r*(1-l)+(e<d.Ka[0]?n-1:e>d.Ka[1]?n+1:n)*l,Math.abs(r-n)>1-d.le&&(l=Math.min(Math.max(Math.round(r),0),d.n-1),l!==n&&(r=n=l,e=(d.Ka[1]-d.Ka[0])/2)),m=w)},Yc:function(w){g=w;c=1},ed:function(){c=0;h.reset()},reset:function(){k=a.Ha[1];m=e=-1;f=0},Md:function(){return k}};return h}(),qb=function(){var a={Pc:4,Wa:[1.5,1.5,2],I:[.1,.1,.1],Vc:1,C:-1,A:-1,Be:2,ke:1,Wc:!0,Ed:.8},c=null,d=[],e=0,m=[.5,.5,1];return{m:function(f){c=Object.assign({},a,f);d.splice(0);f=
c.Wa[0]*c.I[0];var r=c.Wa[1]*c.I[1],n=1/(1+c.Wa[2]*c.I[2]),g=c.Vc*Math.min(c.C,c.A),v=g/c.C;g/=c.A;var k=.5*c.Ed;k*=k;for(var h=0;h<c.Pc;++h){var w=Math.pow(n,h),l=v*w,B=g*w;w=l*f;var F=B*r,H=l/2;B/=2;for(var N=1+(1-H-H)/w,A=1+(1-B-B)/F,E=0;E<A;++E)for(var M=B+E*F,u=M-.5,t=0;t<N;++t){var D=H+t*w,Q=D-.5;Q*Q+u*u>k||d.push([D,M,l*c.ke])}}c.Wc&&d.sort(function(U,da){var C=U[0]-.5;U=U[1]-.5;var p=da[0]-.5;da=da[1]-.5;return C*C+U*U-(p*p+da*da)})},get:function(){var f=d.length;if(0===f)return m;e>=f&&(e=
0);var r=d[Math.floor(e)];e=(e+1/c.Be)%f;return r}}}(),Y={neuralNetworkPath:"NN_DEFAULT.json",Wb:0,ld:25,cb:[2,7],qe:{threshold:1,nScaleLevels:3,scale0Factor:.8,overlapFactors:[2,2,3],scanCenterFirst:!0,nDetectsPerLoop:-1},Ee:50,Mc:.5,Lc:.4,he:8,Ae:{translationFactorRange:[.0015,.005],rotationFactorRange:[.003,.02],qualityFactorRange:[.9,.98],alphaRange:[.05,1]},xa:[.65,1,.262],I:[.092,.092,.3],hd:.2,kd:2,jd:.1,ie:8,Oc:1,Gd:Wa.Ra.bind(null,.3,.7),Ke:20,
$c:3},ma={facingMode:"user",idealWidth:800,idealHeight:600,minWidth:480,maxWidth:1280,minHeight:480,maxHeight:1280,rotate:0,flipX:!1},aa={Bb:-3,ee:-1,error:-2,ready:1,play:2,pause:3},ia=aa.Bb,x=null,Vb={yb:!1,element:null,ca:null,W:null,u:[0,0],G:[.5,.5],o:[.5,0,0,.5],Ya:0,ta:null,Na:!1},J=null,Wb={sa:null,Ea:null,antialias:!0,Tb:"./",na:null,Z:null,Ba:Y.Wb,Tc:Y.Wb,Oa:!1,ja:!1},Oa=null,na=null,ta=null,Pa=1,Na={Jb:-1,jb:-1},T=null,Xb={C:0,A:0,u:[0,0],wa:null},W={Aa:null,buffer:null,I:null,xa:null,
T:Y.Oc,va:null},Sa=null,oa=null,Va=null,Ma=null,G={i:1,ga:0,O:null,Ec:!1,Jc:0,Cb:0},fb=[],gb=[],Ab={VERSION:"1.3.6",init:function(a){function c(){ia!==aa.error&&2===++e&&(Ia(),ub(),Ha(),J.sa&&(ia=aa.ready,J.sa(!1,{GL:b,canvasElement:J.Z,videoTexture:x.W.get(),maxFacesDetected:G.i,videoElement:x.element}),db()),cb())}if(ia!==aa.Bb)return a.callbackReady&&a.callbackReady("ALREADY_INITIALIZED"),!1;ia=aa.ee;x=Object.assign({},Vb);J=Object.assign({},Wb);T=Object.assign({},Xb);G.O=[0];W.I=Y.I.slice(0);
W.xa=Y.xa.slice(0);"undefined"!==typeof a.antialias&&(J.antialias=a.antialias);a.callbackReady&&(J.sa=a.callbackReady);a.callbackTrack&&(J.Ea=a.callbackTrack);a.nExpressions&&(W.T=a.nExpressions);a.expressionsEasings&&(W.va=a.expressionsEasings);"undefined"!==typeof a.animateDelay&&(J.Ba=a.animateDelay);"undefined"!==typeof a.NNCPath&&(J.Tb=a.NNCPath);"undefined"!==typeof a.NNC&&(J.na=a.NNC);"undefined"!==typeof a.maxFacesDetected&&(G.i=Math.max(1,a.maxFacesDetected));"undefined"!==typeof a.followZRot&&
(J.ja=a.followZRot?!0:!1);if(G.i>Y.he)return Ga("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ga("NO_CANVASID"),!1;J.Z=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!J.Z)return Ga("INVALID_CANVASID"),!1;T.C=J.Z.width;T.A=J.Z.height;if(!T.C||!T.A)return Ga("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;d<G.i;++d)fb.push(new Float32Array(Y.ie)),gb.push(0);za.m({Ab:0,n:Y.cb[1]-Y.cb[0]+1,Kc:Y.cb[0]});na=Object.create(Y.qe);a.scanSettings&&(Object.assign(na,a.scanSettings),-1!==na.nDetectsPerLoop?
za.Yc(na.nDetectsPerLoop):za.ed());ta=Object.create(Y.Ae);a.stabilizationSettings&&Object.assign(ta,a.stabilizationSettings);var e=0;a.videoSettings&&a.videoSettings.videoElement?Xa(a.videoSettings.videoElement,c):(a.videoSettings&&Object.assign(ma,a.videoSettings),wb(a.onWebcamAsk,a.onWebcamGet,function(m){Xa(m,c)}));Ib(function(m){if(!Jb())return!1;Oa=new Bb({Qa:m.layers,Gb:"gpuRawAvg",Db:Lb});y.gd([{id:"s50",name:"_",ia:"attribute vec2 a0;uniform mat2 u32;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=vec2(.5,.5)+u32*a0*vec2(1.,-1.);}",
Ca:["a0"],pa:[2],a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:["u1","u32"],precision:"lowp"},{id:"s51",name:"_",a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",ia:"attribute vec2 a0;uniform sampler2D u33;uniform vec2 u34;uniform float u35,u36,u37;varying vec2 vv0;void main(){vec4 a=texture2D(u33,vec2(.17,u35));vec2 f=a.gb,g=a.a*u34,b=a0;b.x*=u37;float c=cos(u36),d=sin(u36);vec2 h=mat2(c,d,-d,c)*b;vv0=f+h*.5*g,gl_Position=vec4(a0,0.,1.);}",
Ca:["a0"],pa:[2],c:"u1 u33 u34 u35 u36 u37".split(" "),precision:"lowp"},{id:"s52",name:"_",a:"uniform sampler2D u38,u33;uniform vec3 u39,u40;uniform float u41,u42,u35,u43,u36,u44;const vec4 e=vec4(.25,.25,.25,.25);void main(){vec4 d=texture2D(u38,vec2(.625,.625)),f=texture2D(u38,vec2(.875,.625)),a=texture2D(u33,vec2(.17,u35));float g=dot(d-f,e);bool h=g>u42;h?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u43;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float i=dot(e,texture2D(u38,vec2(.875,.875))),j=dot(e,texture2D(u38,vec2(.125,.625))),k=dot(e,texture2D(u38,vec2(.375,.625))),b=cos(u36),c=sin(u36);vec2 l=mat2(b,c*u44,-c/u44,b)*vec2(i,j);a.gba+=vec3(l,k)*u40*a.a;}gl_FragColor=a;}",
ia:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u43 u36 u44 u42 u35".split(" ")},{id:"s53",name:"_",ia:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}",
c:["u38"]},{id:"s54",name:"_",ia:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s49",name:"_",a:"uniform sampler2D u33;uniform vec2 u45;uniform float u46;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u45);a.a=mix(a.a*u46,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}",
c:["u33","u46","u45"]}]);pb();Hb();ib();hb();c()});return!0},destroy:function(){return new Promise(function(a,c){Ab.toggle_pause(!0,!0).catch(function(){c()}).then(function(){Oa&&Oa.h();Qa.h();Oa=oa=Sa=null;fb.splice(0);gb.splice(0);ia=aa.Bb;a()})})},toggle_pause:function(a,c){if(!Ua())return Promise.reject();var d=null;d=x.Na?Promise.resolve():c?V.cd(x.element,!a,x.ta):Promise.resolve();a?ob():d.then(function(){cb()});return d},update_videoSettings:function(a){ob();return new Promise(function(c){V.cd(x.element,
!1,x.ta).then(function(){Object.assign(ma,a);wb(null,null,function(d){Xa(d,function(){Ia();Ha();cb();c()})})})})},toggle_slow:function(a){Ua()&&ia===aa.play&&(a&&!J.Oa?(J.Tc=J.Ba,na.nDetectsPerLoop=1,this.set_animateDelay(100),J.Oa=!0):!a&&J.Oa&&(na.nDetectsPerLoop=-1,this.set_animateDelay(J.Tc),J.Oa=!1))},set_animateDelay:function(a){J.Ba=a},resize:function(){if(!Ua())return!1;var a=J.Z.width,c=J.Z.height;if(!jb()&&a===T.C&&c===T.A)return!1;T.C=a;T.A=c;ib();hb();Ia();Ha();x.W&&x.W.resize(T.C,T.A);
return!0},set_inputTexture:function(a,c,d){x.u[0]=c;x.u[1]=d;x.yb=!0;Ia();db();Ha();y.set("s50");x.W.P();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);S.g(!0,!0)},reset_GLState:function(){db();T.wa.remove();W.Aa.remove();pb()},render_video:function(){sa.J();y.set("s1");b.viewport(0,0,T.C,T.A);x.W.b(0);S.g(!0,!0)},reset_inputTexture:function(){jb();x.yb=!1;Ia();Ha()},get_videoDevices:function(a){return V.Sd(a)},set_scanSettings:function(a){Object.assign(na,a);-1!==na.nDetectsPerLoop?za.Yc(na.nDetectsPerLoop):
za.ed();ib();hb()},set_stabilizationSettings:function(a){Object.assign(ta,a)},set_videoOrientation:function(a,c){Ua()&&(ma.flipX=c,ma.rotate=a,Ia(),Ha())},update_videoElement:function(a,c){Xa(a?a:x.element,function(){ub();Ia();Ha();c&&c()})}};return Ab};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN();
;return JEEFACEFILTERAPI||window.JEEFACEFILTERAPI;})();