1import{a4 as Li,c9 as zE,x as Au,j as aA,o as jt,f as Hn,a as Sn,y as bn,e as WE,g as tr,n as Oh,t as dy,c as $r,z as ws,F as py,i as my,D as si,U as KE,r as tf,b as Ya,Z as vd,w as il,T as XE,E as ni,K as jE,ay as Pa,h as Su}from"./app.0910bc5f.js";import{s as lu,R as Pf,a as YE}from"./ripple.esm.4dd86dd7.js";import{F as qE,s as g2}from"./focustrap.esm.fa167002.js";import{s as JE}from"./slider.esm.01abd0e6.js";import{s as ZE}from"./progressspinner.esm.af967411.js";import{s as y2}from"./message.esm.26cf8b90.js";import{s as eS}from"./portal.esm.e7473283.js";import{s as gy,a as tS}from"./index.esm.de052757.js";import{s as yy}from"./index.esm.e87d3cb0.js";import{s as nS}from"./index.esm.2501d83a.js";import{_ as rS}from"./_plugin-vue_export-helper.cdc0426e.js";import"./index.esm.71f75d81.js";import"./index.esm.2be4ce49.js";import"./index.esm.c2643f12.js";function iS(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}/** 2 * @license 3 * Copyright 2010-2025 Three.js Authors 4 * SPDX-License-Identifier: MIT 5 */const eg="176",ll={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},sl={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3}
vendor: 6,950 bytes, line 5
5,sS=0,v2=1,aS=2,vy=1,oS=2,fa=3,_a=0,Bi=1,$s=2,lo=0,cl=1,w2=2,x2=3,b2=4,AS=5,Go=100,lS=101,cS=102,uS=103,hS=104,fS=200,dS=201,pS=202,mS=203,jp=204,Yp=205,gS=206,yS=207,vS=208,wS=209,xS=210,bS=211,CS=212,_S=213,BS=214,qp=0,Jp=1,Zp=2,yl=3,em=4,tm=5,nm=6,rm=7,wy=0,ES=1,SS=2,co=0,TS=1,IS=2,FS=3,RS=4,US=5,MS=6,NS=7,C2="attached",DS="detached",xy=300,vl=301,wl=302,im=303,sm=304,kf=306,xl=1e3,to=1001,nf=1002,li=1003,by=1004,gc=1005,Ni=1006,Ph=1007,ya=1008,Ks=1009,Cy=1010,_y=1011,$c=1012,tg=1013,oA=1014,_s=1015,cu=1016,ng=1017,rg=1018,Qc=1020,By=35902,Ey=1021,Sy=1022,Zi=1023,Hc=1026,Vc=1027,ig=1028,sg=1029,Ty=1030,ag=1031,og=1033,kh=33776,$h=33777,Qh=33778,Hh=33779,am=35840,om=35841,Am=35842,lm=35843,cm=36196,um=37492,hm=37496,fm=37808,dm=37809,pm=37810,mm=37811,gm=37812,ym=37813,vm=37814,wm=37815,xm=37816,bm=37817,Cm=37818,_m=37819,Bm=37820,Em=37821,Vh=36492,Sm=36494,Tm=36495,Iy=36283,Im=36284,Fm=36285,Rm=36286,Gc=2300,zc=2301,wd=2302,_2=2400,B2=2401,E2=2402,LS=2500,OS=0,Fy=1,Um=2,PS=3200,kS=3201,Ry=0,$S=1,eo="",kr="srgb",ui="srgb-linear",rf="linear",Dn="srgb",RA=7680,S2=519,QS=512,HS=513,VS=514,Uy=515,GS=516,zS=517,WS=518,KS=519,Mm=35044,T2="300 es",va=2e3,sf=2001;class xA{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const r=t[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const zr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let I2=1234567;const Fc=Math.PI/180,bl=180/Math.PI;function Bs(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(zr[n&255]+zr[n>>8&255]+zr[n>>16&255]+zr[n>>24&255]+"-"+zr[e&255]+zr[e>>8&255]+"-"+zr[e>>16&15|64]+zr[e>>24&255]+"-"+zr[t&63|128]+zr[t>>8&255]+"-"+zr[t>>16&255]+zr[t>>24&255]+zr[r&255]+zr[r>>8&255]+zr[r>>16&255]+zr[r>>24&255]).toLowerCase()}function hn(n,e,t){return Math.max(e,Math.min(t,n))}function Ag(n,e){return(n%e+e)%e}function XS(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function jS(n,e,t){return n!==e?(t-n)/(e-n):0}function Rc(n,e,t){return(1-t)*n+t*e}function YS(n,e,t,r){return Rc(n,e,1-Math.exp(-t*r))}function qS(n,e=1){return e-Math.abs(Ag(n,e*2)-e)}function JS(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function ZS(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function eT(n,e){return n+Math.floor(Math.random()*(e-n+1))}function tT(n,e){return n+Math.random()*(e-n)}function nT(n){return n*(.5-Math.random())}function rT(n){n!==void 0&&(I2=n);let e=I2+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function iT(n){return n*Fc}function sT(n){return n*bl}function aT(n){return(n&n-1)===0&&n!==0}function oT(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function AT(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function lT(n,e,t,r,i){const s=Math.cos,a=Math.sin,o=s(t/2),A=a(t/2),l=s((e+r)/2),c=a((e+r)/2),u=s((e-r)/2),h=a((e-r)/2),f=s((r-e)/2),d=a((r-e)/2);switch(i){case"XYX":n.set(o*c,A*u,A*h,o*l);break;case"YZY":n.set(A*h,o*c,A*u,o*l);break;case"ZXZ":n.set(A*u,A*h,o*c,o*l);break;case"XZX":n.set(o*c,A*d,A*f,o*l);break;case"YXY":n.set(A*f,o*c,A*d,o*l);break;case"ZYZ":n.set(A*d,A*f,o*c,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function xs(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Fn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const My={DEG2RAD:Fc,RAD2DEG:bl,generateUUID:Bs,clamp:hn,euclideanModulo:Ag,mapLinear:XS,inverseLerp:jS,lerp:Rc,damp:YS,pingpong:qS,smoothstep:JS,smootherstep:ZS,randInt:eT,randFloat:tT,randFloatSpread:nT,seededRandom:rT,degToRad:iT,radToDeg:sT,isPowerOfTwo:aT,ceilPowerOfTwo:oT,floorPowerOfTwo:AT,setQuaternionFromProperEuler:lT,normalize:Fn,denormalize:xs};class Kt{constructor(e=0,t=0){Kt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 7,575 bytes, line 5
5sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=hn(this.x,e.x,t.x),this.y=hn(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=hn(this.x,e,t),this.y=hn(this.y,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(hn(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(hn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*r-a*i+e.x,this.y=s*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nn{constructor(e,t,r,i,s,a,o,A,l){nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,a,o,A,l)}set(e,t,r,i,s,a,o,A,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=s,c[5]=A,c[6]=r,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,a=r[0],o=r[3],A=r[6],l=r[1],c=r[4],u=r[7],h=r[2],f=r[5],d=r[8],g=i[0],m=i[3],p=i[6],w=i[1],C=i[4],b=i[7],U=i[2],F=i[5],D=i[8];return s[0]=a*g+o*w+A*U,s[3]=a*m+o*C+A*F,s[6]=a*p+o*b+A*D,s[1]=l*g+c*w+u*U,s[4]=l*m+c*C+u*F,s[7]=l*p+c*b+u*D,s[2]=h*g+f*w+d*U,s[5]=h*m+f*C+d*F,s[8]=h*p+f*b+d*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],A=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-r*s*c+r*o*A+i*s*l-i*a*A}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],A=e[6],l=e[7],c=e[8],u=c*a-o*l,h=o*A-c*s,f=l*s-a*A,d=t*u+r*h+i*f;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/d;return e[0]=u*g,e[1]=(i*l-c*r)*g,e[2]=(o*r-i*a)*g,e[3]=h*g,e[4]=(c*t-i*A)*g,e[5]=(i*s-o*t)*g,e[6]=f*g,e[7]=(r*A-l*t)*g,e[8]=(a*t-r*s)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,a,o){const A=Math.cos(s),l=Math.sin(s);return this.set(r*A,r*l,-r*(A*a+l*o)+a+e,-i*l,i*A,-i*(-l*a+A*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(xd.makeScale(e,t)),this}rotate(e){return this.premultiply(xd.makeRotation(-e)),this}translate(e,t){return this.premultiply(xd.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const xd=new nn;function Ny(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Wc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function cT(){const n=Wc("canvas");return n.style.display="block",n}const F2={};function Gh(n){n in F2||(F2[n]=!0,console.warn(n))}function uT(n,e,t){return new Promise(function(r,i){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:i();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:r()}}setTimeout(s,t)})}function hT(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function fT(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const R2=new nn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),U2=new nn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function dT(){const n={enabled:!0,workingColorSpace:ui,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Dn&&(i.r=ba(i.r),i.g=ba(i.g),i.b=ba(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Dn&&(i.r=ul(i.r),i.g=ul(i.g),i.b=ul(i.b))),i},fromWorkingColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},toWorkingColorSpace:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===eo?rf:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.space
vendor: 4,571 bytes, line 5
5s[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],r=[.3127,.329];return n.define({[ui]:{primaries:e,whitePoint:r,transfer:rf,toXYZ:R2,fromXYZ:U2,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:kr},outputColorSpaceConfig:{drawingBufferColorSpace:kr}},[kr]:{primaries:e,whitePoint:r,transfer:Dn,toXYZ:R2,fromXYZ:U2,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:kr}}}),n}const xn=dT();function ba(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ul(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let UA;class pT{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{UA===void 0&&(UA=Wc("canvas")),UA.width=e.width,UA.height=e.height;const i=UA.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=UA}return r.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Wc("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=ba(s[a]/255)*255;return r.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let r=0;r<t.length;r++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[r]=Math.floor(ba(t[r]/255)*255):t[r]=ba(t[r]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let mT=0;class lg{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:mT++}),this.uuid=Bs(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(bd(i[a].image)):s.push(bd(i[a]))}else s=bd(i);r.url=s}return t||(e.images[this.uuid]=r),r}}function bd(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?pT.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let gT=0;class Ur extends xA{constructor(e=Ur.DEFAULT_IMAGE,t=Ur.DEFAULT_MAPPING,r=to,i=to,s=Ni,a=ya,o=Zi,A=Ks,l=Ur.DEFAULT_ANISOTROPY,c=eo){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:gT++}),this.uuid=Bs(),this.name="",this.source=new lg(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=A,this.offset=new Kt(0,0),this.repeat=new Kt(1,1),this.center=new Kt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new nn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace
vendor: 5,659 bytes, line 5
5=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==xy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case xl:e.x=e.x-Math.floor(e.x);break;case to:e.x=e.x<0?0:1;break;case nf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case xl:e.y=e.y-Math.floor(e.y);break;case to:e.y=e.y<0?0:1;break;case nf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Ur.DEFAULT_IMAGE=null;Ur.DEFAULT_MAPPING=xy;Ur.DEFAULT_ANISOTROPY=1;class Tn{constructor(e=0,t=0,r=0,i=1){Tn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*r+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*r+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*r+a[11]*i+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const A=e.elements,l=A[0],c=A[4],u=A[8],h=A[1],f=A[5],d=A[9],g=A[2],m=A[6],p=A[10];if(Math.abs(c-h)<.01&&Math.abs(u-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+h)<.1&&Math.abs(u+g)<.1&&Math.abs(d+m)<.1&&Math.abs(l+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const C=(l+1)/2,b=(f+1)/2,U=(p+1)/2,F=(c+h)/4,D=(u+g)/4,O=(d+m)/4;return C>b&&C>U?C<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(C),i=F/r,s=D/r):b>U?b<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(b),r=F/i,s=O/i):U<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(U),r=D/s,i=O/s),this.set(r,i,s,t),this}let w=Math.sqrt((m-d)*(m-d)+(u-g)*(u-g)+(h-c)*(h-c));return Math.abs(w)<.001&&(w=1),this.x=(m-d)/w,this.y=(u-g)/w,this.z=(h-c)/w,this.w=Math.acos((l+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=hn(this.x,e.x,t.x),this.y=hn(this.y,e.y,t.y),this.z=hn(this.z,e.z,t.z),this.w=hn(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=hn(this.x,e,t),this.y=hn(this.y,e,t),this.z=hn(this.z,e,t),this.w=hn(this.w,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(hn(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}
vendor: 5,766 bytes, line 5
5round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class yT extends xA{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=r.depth?r.depth:1,this.scissor=new Tn(0,0,e,t),this.scissorTest=!1,this.viewport=new Tn(0,0,e,t);const i={width:e,height:t,depth:this.depth};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ni,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},r);const s=new Ur(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);s.flipY=!1,s.generateMipmaps=r.generateMipmaps,s.internalFormat=r.internalFormat,this.textures=[];const a=r.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=r;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,r=e.textures.length;t<r;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new lg(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class AA extends yT{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class Dy extends Ur{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=li,this.minFilter=li,this.wrapR=to,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class vT extends Ur{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=li,this.minFilter=li,this.wrapR=to,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Xs{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,s,a,o){let A=r[i+0],l=r[i+1],c=r[i+2],u=r[i+3];const h=s[a+0],f=s[a+1],d=s[a+2],g=s[a+3];if(o===0){e[t+0]=A,e[t+1]=l,e[t+2]=c,e[t+3]=u;return}if(o===1){e[t+0]=h,e[t+1]=f,e[t+2]=d,e[t+3]=g;return}if(u!==g||A!==h||l!==f||c!==d){let m=1-o;const p=A*h+l*f+c*d+u*g,w=p>=0?1:-1,C=1-p*p;if(C>Number.EPSILON){const U=Math.sqrt(C),F=Math.atan2(U,p*w);m=Math.sin(m*F)/U,o=Math.sin(o*F)/U}const b=o*w;if(A=A*m+h*b,l=l*m+f*b,c=c*m+d*b,u=u*m+g*b,m===1-o){const U=1/Math.sqrt(A*A+l*l+c*c+u*u);A*=U,l*=U,c*=U,u*=U}}e[t]=A,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,i,s,a){const o=r[i],A=r[i+1],l=r[i+2],c=r[i+3],u=s[a],h=s[a+1],f=s[a+2],d=s[a+3];return e[t]=o*d+c*u+A*f-l*h,e[t+1]=A*d+c*h+l*u-o*f,e[t+2]=l*d+c*f+o*h-A*u,e[t+3]=c*d-o*u-A*h-l*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}
vendor: 4,538 bytes, line 5
5set(e,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,i=e._y,s=e._z,a=e._order,o=Math.cos,A=Math.sin,l=o(r/2),c=o(i/2),u=o(s/2),h=A(r/2),f=A(i/2),d=A(s/2);switch(a){case"XYZ":this._x=h*c*u+l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u-h*f*d;break;case"YXZ":this._x=h*c*u+l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u+h*f*d;break;case"ZXY":this._x=h*c*u-l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u-h*f*d;break;case"ZYX":this._x=h*c*u-l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u+h*f*d;break;case"YZX":this._x=h*c*u+l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u-h*f*d;break;case"XZY":this._x=h*c*u-l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],a=t[1],o=t[5],A=t[9],l=t[2],c=t[6],u=t[10],h=r+o+u;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(c-A)*f,this._y=(s-l)*f,this._z=(a-i)*f}else if(r>o&&r>u){const f=2*Math.sqrt(1+r-o-u);this._w=(c-A)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+l)/f}else if(o>u){const f=2*Math.sqrt(1+o-r-u);this._w=(s-l)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(A+c)/f}else{const f=2*Math.sqrt(1+u-r-o);this._w=(a-i)/f,this._x=(s+l)/f,this._y=(A+c)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(hn(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,i=e._y,s=e._z,a=e._w,o=t._x,A=t._y,l=t._z,c=t._w;return this._x=r*c+a*o+i*l-s*A,this._y=i*c+a*A+s*o-r*l,this._z=s*c+a*l+r*A-i*o,this._w=a*c-r*o-i*A-s*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,a=this._w;let o=a*e._w+r*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=r,this._y=i,this._z=s,this;const A=1-o*o;if(A<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*r+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const l=Math.sqrt(A),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=a*u+this._w*h,this._x=r*u+this._x*h,this._y=i*u+this._y*h,this._z=s*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),s=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}
vendor: 12,883 bytes, line 5
5_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ae{constructor(e=0,t=0,r=0){Ae.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(M2.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(M2.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,a=e.y,o=e.z,A=e.w,l=2*(a*i-o*r),c=2*(o*t-s*i),u=2*(s*r-a*t);return this.x=t+A*l+a*u-o*c,this.y=r+A*c+o*l-s*u,this.z=i+A*u+s*c-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=hn(this.x,e.x,t.x),this.y=hn(this.y,e.y,t.y),this.z=hn(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=hn(this.x,e,t),this.y=hn(this.y,e,t),this.z=hn(this.z,e,t),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(hn(r,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,a=t.x,o=t.y,A=t.z;return this.x=i*A-s*o,this.y=s*a-r*A,this.z=r*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Cd.copy(this).projectOnVector(e),this.sub(Cd)}reflect(e){return this.sub(Cd.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(hn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Cd=new Ae,M2=new Xs;class Ua{constructor(e=new Ae(1/0,1/0,1/0),t=new Ae(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(fs.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(fs.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=fs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const s=r.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,fs):fs.fromBufferAttribute(s,a),fs.applyMatrix4(e.matrixWorld),this.expandByPoint(fs);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Tu.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),Tu.copy(r.boundingBox)),Tu.applyMatrix4(e.matrixWorld),this.union(Tu)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fs),fs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(tc),Iu.subVectors(this.max,tc),MA.subVectors(e.a,tc),NA.subVectors(e.b,tc),DA.subVectors(e.c,tc),ka.subVectors(NA,MA),$a.subVectors(DA,NA),Ro.subVectors(MA,DA);let t=[0,-ka.z,ka.y,0,-$a.z,$a.y,0,-Ro.z,Ro.y,ka.z,0,-ka.x,$a.z,0,-$a.x,Ro.z,0,-Ro.x,-ka.y,ka.x,0,-$a.y,$a.x,0,-Ro.y,Ro.x,0];return!_d(t,MA,NA,DA,Iu)||(t=[1,0,0,0,1,0,0,0,1],!_d(t,MA,NA,DA,Iu))?!1:(Fu.crossVectors(ka,$a),t=[Fu.x,Fu.y,Fu.z],_d(t,MA,NA,DA,Iu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fs).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(sa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),sa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),sa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),sa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),sa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),sa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),sa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),sa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(sa),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const sa=[new Ae,new Ae,new Ae,new Ae,new Ae,new Ae,new Ae,new Ae],fs=new Ae,Tu=new Ua,MA=new Ae,NA=new Ae,DA=new Ae,ka=new Ae,$a=new Ae,Ro=new Ae,tc=new Ae,Iu=new Ae,Fu=new Ae,Uo=new Ae;function _d(n,e,t,r,i){for(let s=0,a=n.length-3;s<=a;s+=3){Uo.fromArray(n,s);const o=i.x*Math.abs(Uo.x)+i.y*Math.abs(Uo.y)+i.z*Math.abs(Uo.z),A=e.dot(Uo),l=t.dot(Uo),c=r.dot(Uo);if(Math.max(-Math.max(A,l,c),Math.min(A,l,c))>o)return!1}return!0}const wT=new Ua,nc=new Ae,Bd=new Ae;class qs{constructor(e=new Ae,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):wT.setFromPoints(e).getCenter(r);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,r.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}
vendor: 16,271 bytes, line 5
5applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;nc.subVectors(e,this.center);const t=nc.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(nc,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Bd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(nc.copy(e.center).add(Bd)),this.expandByPoint(nc.copy(e.center).sub(Bd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const aa=new Ae,Ed=new Ae,Ru=new Ae,Qa=new Ae,Sd=new Ae,Uu=new Ae,Td=new Ae;class uu{constructor(e=new Ae,t=new Ae(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,aa)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=aa.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(aa.copy(this.origin).addScaledVector(this.direction,t),aa.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){Ed.copy(e).add(t).multiplyScalar(.5),Ru.copy(t).sub(e).normalize(),Qa.copy(this.origin).sub(Ed);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Ru),o=Qa.dot(this.direction),A=-Qa.dot(Ru),l=Qa.lengthSq(),c=Math.abs(1-a*a);let u,h,f,d;if(c>0)if(u=a*A-o,h=a*o-A,d=s*c,u>=0)if(h>=-d)if(h<=d){const g=1/c;u*=g,h*=g,f=u*(u+a*h+2*o)+h*(a*u+h+2*A)+l}else h=s,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*A)+l;else h=-s,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*A)+l;else h<=-d?(u=Math.max(0,-(-a*s+o)),h=u>0?-s:Math.min(Math.max(-s,-A),s),f=-u*u+h*(h+2*A)+l):h<=d?(u=0,h=Math.min(Math.max(-s,-A),s),f=h*(h+2*A)+l):(u=Math.max(0,-(a*s+o)),h=u>0?s:Math.min(Math.max(-s,-A),s),f=-u*u+h*(h+2*A)+l);else h=a>0?-s:s,u=Math.max(0,-(a*h+o)),f=-u*u+h*(h+2*A)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Ed).addScaledVector(Ru,h),f}intersectSphere(e,t){aa.subVectors(e.center,this.origin);const r=aa.dot(this.direction),i=aa.dot(aa)-r*r,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=r-a,A=r+a;return A<0?null:o<0?this.at(A,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,a,o,A;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(r=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(r=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),c>=0?(s=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(s=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),r>a||s>i||((s>r||isNaN(r))&&(r=s),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-h.z)*u,A=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,A=(e.min.z-h.z)*u),r>A||o>i)||((o>r||r!==r)&&(r=o),(A<i||i!==i)&&(i=A),i<0)?null:this.at(r>=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,aa)!==null}intersectTriangle(e,t,r,i,s){Sd.subVectors(t,e),Uu.subVectors(r,e),Td.crossVectors(Sd,Uu);let a=this.direction.dot(Td),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Qa.subVectors(this.origin,e);const A=o*this.direction.dot(Uu.crossVectors(Qa,Uu));if(A<0)return null;const l=o*this.direction.dot(Sd.cross(Qa));if(l<0||A+l>a)return null;const c=-o*Qa.dot(Td);return c<0?null:this.at(c/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class an{constructor(e,t,r,i,s,a,o,A,l,c,u,h,f,d,g,m){an.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,a,o,A,l,c,u,h,f,d,g,m)}set(e,t,r,i,s,a,o,A,l,c,u,h,f,d,g,m){const p=this.elements;return p[0]=e,p[4]=t,p[8]=r,p[12]=i,p[1]=s,p[5]=a,p[9]=o,p[13]=A,p[2]=l,p[6]=c,p[10]=u,p[14]=h,p[3]=f,p[7]=d,p[11]=g,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new an().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/LA.setFromMatrixColumn(e,0).length(),s=1/LA.setFromMatrixColumn(e,1).length(),a=1/LA.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,a=Math.cos(r),o=Math.sin(r),A=Math.cos(i),l=Math.sin(i),c=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const h=a*c,f=a*u,d=o*c,g=o*u;t[0]=A*c,t[4]=-A*u,t[8]=l,t[1]=f+d*l,t[5]=h-g*l,t[9]=-o*A,t[2]=g-h*l,t[6]=d+f*l,t[10]=a*A}else if(e.order==="YXZ"){const h=A*c,f=A*u,d=l*c,g=l*u;t[0]=h+g*o,t[4]=d*o-f,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=f*o-d,t[6]=g+h*o,t[10]=a*A}else if(e.order==="ZXY"){const h=A*c,f=A*u,d=l*c,g=l*u;t[0]=h-g*o,t[4]=-a*u,t[8]=d+f*o,t[1]=f+d*o,t[5]=a*c,t[9]=g-h*o,t[2]=-a*l,t[6]=o,t[10]=a*A}else if(e.order==="ZYX"){const h=a*c,f=a*u,d=o*c,g=o*u;t[0]=A*c,t[4]=d*l-f,t[8]=h*l+g,t[1]=A*u,t[5]=g*l+h,t[9]=f*l-d,t[2]=-l,t[6]=o*A,t[10]=a*A}else if(e.order==="YZX"){const h=a*A,f=a*l,d=o*A,g=o*l;t[0]=A*c,t[4]=g-h*u,t[8]=d*u+f,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=f*u+d,t[10]=h-g*u}else if(e.order==="XZY"){const h=a*A,f=a*l,d=o*A,g=o*l;t[0]=A*c,t[4]=-u,t[8]=l*c,t[1]=h*u+g,t[5]=a*c,t[9]=f*u-d,t[2]=d*u-f,t[6]=o*c,t[10]=g*u+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xT,e,bT)}lookAt(e,t,r){const i=this.elements;return Fi.subVectors(e,t),Fi.lengthSq()===0&&(Fi.z=1),Fi.normalize(),Ha.crossVectors(r,Fi),Ha.lengthSq()===0&&(Math.abs(r.z)===1?Fi.x+=1e-4:Fi.z+=1e-4,Fi.normalize(),Ha.crossVectors(r,Fi)),Ha.normalize(),Mu.crossVectors(Fi,Ha),i[0]=Ha.x,i[4]=Mu.x,i[8]=Fi.x,i[1]=Ha.y,i[5]=Mu.y,i[9]=Fi.y,i[2]=Ha.z,i[6]=Mu.z,i[10]=Fi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,a=r[0],o=r[4],A=r[8],l=r[12],c=r[1],u=r[5],h=r[9],f=r[13],d=r[2],g=r[6],m=r[10],p=r[14],w=r[3],C=r[7],b=r[11],U=r[15],F=i[0],D=i[4],O=i[8],I=i[12],R=i[1],V=i[5],re=i[9],Y=i[13],se=i[2],ge=i[6],ue=i[10],Ce=i[14],ae=i[3],we=i[7],Pe=i[11],$e=i[15];return s[0]=a*F+o*R+A*se+l*ae,s[4]=a*D+o*V+A*ge+l*we,s[8]=a*O+o*re+A*ue+l*Pe,s[12]=a*I+o*Y+A*Ce+l*$e,s[1]=c*F+u*R+h*se+f*ae,s[5]=c*D+u*V+h*ge+f*we,s[9]=c*O+u*re+h*ue+f*Pe,s[13]=c*I+u*Y+h*Ce+f*$e,s[2]=d*F+g*R+m*se+p*ae,s[6]=d*D+g*V+m*ge+p*we,s[10]=d*O+g*re+m*ue+p*Pe,s[14]=d*I+g*Y+m*Ce+p*$e,s[3]=w*F+C*R+b*se+U*ae,s[7]=w*D+C*V+b*ge+U*we,s[11]=w*O+C*re+b*ue+U*Pe,s[15]=w*I+C*Y+b*Ce+U*$e,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[12],a=e[1],o=e[5],A=e[9],l=e[13],c=e[2],u=e[6],h=e[10],f=e[14],d=e[3],g=e[7],m=e[11],p=e[15];return d*(+s*A*u-i*l*u-s*o*h+r*l*h+i*o*f-r*A*f)+g*(+t*A*f-t*l*h+s*a*h-i*a*f+i*l*c-s*A*c)+m*(+t*l*u-t*o*f-s*a*u+r*a*f+s*o*c-r*l*c)+p*(-i*o*c-t*A*u+t*o*h+i*a*u-r*a*h+r*A*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],A=e[6],l=e[7],c=e[8],u=e[9],h=e[10],f=e[11],d=e[12],g=e[13],m=e[14],p=e[15],w=u*m*l-g*h*l+g*A*f-o*m*f-u*A*p+o*h*p,C=d*h*l-c*m*l-d*A*f+a*m*f+c*A*p-a*h*p,b=c*g*l-d*u*l+d*o*f-a*g*f-c*o*p+a*u*p,U=d*u*A-c*g*A-d*o*h+a*g*h+c*o*m-a*u*m,F=t*w+r*C+i*b+s*U;if(F===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/F;return e[0]=w*D,e[1]=(g*h*s-u*m*s-g*i*f+r*m*f+u*i*p-r*h*p)*D,e[2]=(o*m*s-g*A*s+g*i*l-r*m*l-o*i*p+r*A*p)*D,e[3]=(u*A*s-o*h*s-u*i*l+r*h*l+o*i*f-r*A*f)*D,e[4]=C*D,e[5]=(c*m*s-d*h*s+d*i*f-t*m*f-c*i*p+t*h*p)*D,e[6]=(d*A*s-a*m*s-d*i*l+t*m*l+a*i*p-t*A*p)*D,e[7]=(a*h*s-c*A*s+c*i*l-t*h*l-a*i*f+t*A*f)*D,e[8]=b*D,e[9]=(d*u*s-c*g*s-d*r*f+t*g*f+c*r*p-t*u*p)*D,e[10]=(a*g*s-d*o*s+d*r*l-t*g*l-a*r*p+t*o*p)*D,e[11]=(c*o*s-a*u*s-c*r*l+t*u*l+a*r*f-t*o*f)*D,e[12]=U*D,e[13]=(c*g*i-d*u*i+d*r*h-t*g*h-c*r*m+t*u*m)*D,e[14]=(d*o*i-a*g*i-d*r*A+t*g*A+a*r*m-t*o*m)*D,e[15]=(a*u*i-c*o*i+c*r*A-t*u*A-a*r*h+t*o*h)*D,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,a=e.x,o=e.y,A=e.z,l=s*a,c=s*o;return this.set(l*a+r,l*o-i*A,l*A+i*o,0,l*o+i*A,c*o+r,c*A-i*a,0,l*A-i*o,c*A+i*a,s*A*A+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,a){return this.set(1,r,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,a=t._y,o=t._z,A=t._w,l=s+s,c=a+a,u=o+o,h=s*l,f=s*c,d=s*u,g=a*c,m=a*u,p=o*u,w=A*l,C=A*c,b=A*u,U=r.x,F=r.y,D=r.z;return i[0]=(1-(g+p))*U,i[1]=(f+b)*U,i[2]=(d-C)*U,i[3]=0,i[4]=(f-b)*F,i[5]=(1-(h+p))*F,i[6]=(m+w)*F,i[7]=0,i[8]=(d+C)*D,i[9]=(m-w)*D,i[10]=(1-(h+g))*D,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=LA.set(i[0],i[1],i[2]).length();const a=LA.set(i[4],i[5],i[6]).length(),o=LA.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],ds.copy(this);const l=1/s,c=1/a,u=1/o;return ds.elements[0]*=l,ds.elements[1]*=l,ds.elements[2]*=l,ds.elements[4]*=c,ds.elements[5]*=c,ds.elements[6]*=c,ds.elements[8]*=u,ds.elements[9]*=u,ds.elements[10]*=u,t.setFromRotationMatrix(ds),r.x=s,r.y=a,r.z=o,this}makePerspective(e,t,r,i,s,a,o=va){const A=this.elements,l=2*s/(t-e),c=2*s/(r-i),u=(t+e)/(t-e),h=(r+i)/(r-i);let f,d;if(o===va)f=-(a+s)/(a-s),d=-2*a*s/(a-s);else if(o===sf)f=-a/(a-s),d=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return A[0]=l,A[4]=0,A[8]=u,A[12]=0,A[1]=0,A[5]=c,A[9]=h,A[13]=0,A[2]=0,A[6]=0,A[10]=f,A[14]=d,A[3]=0,A[7]=0,A[11]=-1,A[15]=0,this}makeOrthographic(e,t,r,i,s,a,o=va){const A=this.elements,l=1/(t-e),c=1/(r-i),u=1/(a-s),h=(t+e)*l,f=(r+i)*c;let d,g;if(o===va)d=(a+s)*u,g=-2*u;else if(o===sf)d=s*u,g=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return A[0]=2*l,A[4]=0,A[8]=0,A[12]=-h,A[1]=0,A[5]=2*c,A[9]=0,A[13]=-f,A[2]=0,A[6]=0,A[10]=g,A[14]=-d,A[3]=0,A[7]=0,A[11]=0,A[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const LA=new Ae,ds=new an,xT=new Ae(0,0,0),bT=new Ae(1,1,1),Ha=new Ae,Mu=new Ae,Fi=new Ae,N2=new an,D2=new Xs;class js{constructor(e=0,t=0,r=0,i=js.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const i=e.elements,s=i[0],a=i[4],o=i[8],A=i[1],l=i[5],c=i[9],u=i[2],h=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(hn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-hn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(A,l)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(hn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(A,s));break;case"ZYX":this._y=Math.asin(-hn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(A,s)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(hn(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-hn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-c,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return N2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(N2,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return D2.setFromEuler(this),this.setFromQuaternion(D2,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}js.DEFAULT_ORDER="XYZ";class Ly{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}
vendor: 5,651 bytes, line 5
5isEnabled(e){return(this.mask&(1<<e|0))!==0}}let CT=0;const L2=new Ae,OA=new Xs,oa=new an,Nu=new Ae,rc=new Ae,_T=new Ae,BT=new Xs,O2=new Ae(1,0,0),P2=new Ae(0,1,0),k2=new Ae(0,0,1),$2={type:"added"},ET={type:"removed"},PA={type:"childadded",child:null},Id={type:"childremoved",child:null};class or extends xA{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:CT++}),this.uuid=Bs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=or.DEFAULT_UP.clone();const e=new Ae,t=new js,r=new Xs,i=new Ae(1,1,1);function s(){r.setFromEuler(t,!1)}function a(){t.setFromQuaternion(r,void 0,!1)}t._onChange(s),r._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new an},normalMatrix:{value:new nn}}),this.matrix=new an,this.matrixWorld=new an,this.matrixAutoUpdate=or.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=or.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Ly,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return OA.setFromAxisAngle(e,t),this.quaternion.multiply(OA),this}rotateOnWorldAxis(e,t){return OA.setFromAxisAngle(e,t),this.quaternion.premultiply(OA),this}rotateX(e){return this.rotateOnAxis(O2,e)}rotateY(e){return this.rotateOnAxis(P2,e)}rotateZ(e){return this.rotateOnAxis(k2,e)}translateOnAxis(e,t){return L2.copy(e).applyQuaternion(this.quaternion),this.position.add(L2.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(O2,e)}translateY(e){return this.translateOnAxis(P2,e)}translateZ(e){return this.translateOnAxis(k2,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(oa.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?Nu.copy(e):Nu.set(e,t,r);const i=this.parent;this.updateWorldMatrix(!0,!1),rc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?oa.lookAt(rc,Nu,this.up):oa.lookAt(Nu,rc,this.up),this.quaternion.setFromRotationMatrix(oa),i&&(oa.extractRotation(i.matrixWorld),OA.setFromRotationMatrix(oa),this.quaternion.premultiply(OA.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent($2),PA.child=e,this.dispatchEvent(PA),PA.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(ET),Id.child=e,this.dispatchEvent(Id),Id.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),oa.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),oa.multiply(e.parent.matrixWorld)),e.applyMatrix4(oa),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent($2),PA.child=e,this.dispatchEvent(PA),PA.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,i=this.children.length;r<i;r++){const a=this.children[r].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(rc,e,_T),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(rc,BT,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
5):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].updateMatrixWorld(e)}updateWorldMatrix(e,t){const r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?{min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}:void 0,boundingSphere:o.boundingSphere?{radius:o.boundingSphere.radius,center:o.boundingSphere.center.toArray()}:void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function s(o,A){return o[A.uuid]===void 0&&(o[A.uuid]=A.toJSON(e)),A.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const A=o.shapes;if(Array.isArray(A))for(let l=0,c=A.length;l<c;l++){const u=A[l];s(e.shapes,u)}else s(e.shapes,A)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let A=0,l=this.material.length;A<l;A++)o.push(s(e.materials,this.material[A]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const A=this.animations[o];i.animations.push(s(e.animations,A))}}if(t){const o=a(e.geometries),A=a(e.materials),l=a(e.textures),c=a(e.images),u=a(e.shapes),h=a(e.skeletons),f=a(e.animations),d=a(e.n
vendor: 7,318 bytes, line 5
5odes);o.length>0&&(r.geometries=o),A.length>0&&(r.materials=A),l.length>0&&(r.textures=l),c.length>0&&(r.images=c),u.length>0&&(r.shapes=u),h.length>0&&(r.skeletons=h),f.length>0&&(r.animations=f),d.length>0&&(r.nodes=d)}return r.object=i,r;function a(o){const A=[];for(const l in o){const c=o[l];delete c.metadata,A.push(c)}return A}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}or.DEFAULT_UP=new Ae(0,1,0);or.DEFAULT_MATRIX_AUTO_UPDATE=!0;or.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ps=new Ae,Aa=new Ae,Fd=new Ae,la=new Ae,kA=new Ae,$A=new Ae,Q2=new Ae,Rd=new Ae,Ud=new Ae,Md=new Ae,Nd=new Tn,Dd=new Tn,Ld=new Tn;class bs{constructor(e=new Ae,t=new Ae,r=new Ae){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,i){i.subVectors(r,t),ps.subVectors(e,t),i.cross(ps);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){ps.subVectors(i,t),Aa.subVectors(r,t),Fd.subVectors(e,t);const a=ps.dot(ps),o=ps.dot(Aa),A=ps.dot(Fd),l=Aa.dot(Aa),c=Aa.dot(Fd),u=a*l-o*o;if(u===0)return s.set(0,0,0),null;const h=1/u,f=(l*A-o*c)*h,d=(a*c-o*A)*h;return s.set(1-f-d,d,f)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,la)===null?!1:la.x>=0&&la.y>=0&&la.x+la.y<=1}static getInterpolation(e,t,r,i,s,a,o,A){return this.getBarycoord(e,t,r,i,la)===null?(A.x=0,A.y=0,"z"in A&&(A.z=0),"w"in A&&(A.w=0),null):(A.setScalar(0),A.addScaledVector(s,la.x),A.addScaledVector(a,la.y),A.addScaledVector(o,la.z),A)}static getInterpolatedAttribute(e,t,r,i,s,a){return Nd.setScalar(0),Dd.setScalar(0),Ld.setScalar(0),Nd.fromBufferAttribute(e,t),Dd.fromBufferAttribute(e,r),Ld.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Nd,s.x),a.addScaledVector(Dd,s.y),a.addScaledVector(Ld,s.z),a}static isFrontFacing(e,t,r,i){return ps.subVectors(r,t),Aa.subVectors(e,t),ps.cross(Aa).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ps.subVectors(this.c,this.b),Aa.subVectors(this.a,this.b),ps.cross(Aa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return bs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return bs.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,s){return bs.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return bs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return bs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let a,o;kA.subVectors(i,r),$A.subVectors(s,r),Rd.subVectors(e,r);const A=kA.dot(Rd),l=$A.dot(Rd);if(A<=0&&l<=0)return t.copy(r);Ud.subVectors(e,i);const c=kA.dot(Ud),u=$A.dot(Ud);if(c>=0&&u<=c)return t.copy(i);const h=A*u-c*l;if(h<=0&&A>=0&&c<=0)return a=A/(A-c),t.copy(r).addScaledVector(kA,a);Md.subVectors(e,s);const f=kA.dot(Md),d=$A.dot(Md);if(d>=0&&f<=d)return t.copy(s);const g=f*l-A*d;if(g<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(r).addScaledVector($A,o);const m=c*d-f*u;if(m<=0&&u-c>=0&&f-d>=0)return Q2.subVectors(s,i),o=(u-c)/(u-c+(f-d)),t.copy(i).addScaledVector(Q2,o);const p=1/(m+g+h);return a=g*p,o=h*p,t.copy(r).addScaledVector(kA,a).addScaledVector($A,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Oy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Va={h:0,s:0,l:0},Du={h:0,s:0,l:0};function Od(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}
vendor: 6,788 bytes, line 5
5class Yt{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,xn.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=xn.workingColorSpace){return this.r=e,this.g=t,this.b=r,xn.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=xn.workingColorSpace){if(e=Ag(e,1),t=hn(t,0,1),r=hn(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,a=2*r-s;this.r=Od(a,s,e+1/3),this.g=Od(a,s,e),this.b=Od(a,s,e-1/3)}return xn.toWorkingColorSpace(this,i),this}setStyle(e,t=kr){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kr){const r=Oy[e.toLowerCase()];return r!==void 0?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ba(e.r),this.g=ba(e.g),this.b=ba(e.b),this}copyLinearToSRGB(e){return this.r=ul(e.r),this.g=ul(e.g),this.b=ul(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kr){return xn.fromWorkingColorSpace(Wr.copy(this),e),Math.round(hn(Wr.r*255,0,255))*65536+Math.round(hn(Wr.g*255,0,255))*256+Math.round(hn(Wr.b*255,0,255))}getHexString(e=kr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xn.workingColorSpace){xn.fromWorkingColorSpace(Wr.copy(this),t);const r=Wr.r,i=Wr.g,s=Wr.b,a=Math.max(r,i,s),o=Math.min(r,i,s);let A,l;const c=(o+a)/2;if(o===a)A=0,l=0;else{const u=a-o;switch(l=c<=.5?u/(a+o):u/(2-a-o),a){case r:A=(i-s)/u+(i<s?6:0);break;case i:A=(s-r)/u+2;break;case s:A=(r-i)/u+4;break}A/=6}return e.h=A,e.s=l,e.l=c,e}getRGB(e,t=xn.workingColorSpace){return xn.fromWorkingColorSpace(Wr.copy(this),t),e.r=Wr.r,e.g=Wr.g,e.b=Wr.b,e}getStyle(e=kr){xn.fromWorkingColorSpace(Wr.copy(this),e);const t=Wr.r,r=Wr.g,i=Wr.b;return e!==kr?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,t,r){return this.getHSL(Va),this.setHSL(Va.h+e,Va.s+t,Va.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Va),e.getHSL(Du);const r=Rc(Va.h,Du.h,t),i=Rc(Va.s,Du.s,t),s=Rc(Va.l,Du.l,t);return this.setHSL(r,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*r+s[6]*i,this.g=s[1]*t+s[4]*r+s[7]*i,this.b=s[2]*t+s[5]*r+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Wr=new Yt;Yt.NAMES=Oy;let ST=0;class Vs extends xA{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ST++}),this.uuid=Bs(),this.name="",this.type="Material",this.blending=cl,this.side=_a,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=jp,this.blendDst=Yp,this.blendEquation=Go,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Yt(0,0,0),this.blendAlpha=0,this.depthFunc=yl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=S2,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=RA,this.stencilZFail=RA,this.stencilZPass=RA,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};
vendor: 13,749 bytes, line 5
5r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==cl&&(r.blending=this.blending),this.side!==_a&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==jp&&(r.blendSrc=this.blendSrc),this.blendDst!==Yp&&(r.blendDst=this.blendDst),this.blendEquation!==Go&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==yl&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==S2&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==RA&&(r.stencilFail=this.stencilFail),this.stencilZFail!==RA&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==RA&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const a=[];for(const o in s){const A=s[o];delete A.metadata,a.push(A)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(r.textures=s),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class no extends Vs{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Yt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new js,this.combine=wy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const dr=new Ae,Lu=new Kt;let TT=0;class ci{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:TT++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=Mm,this.updateRanges=[],this.gpuType=_s,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,r=this.count;t<r;t++)Lu.fromBufferAttribute(this,t),Lu.applyMatrix3(e),this.setXY(t,Lu.x,Lu.y);else if(this.itemSize===3)for(let t=0,r=this.count;t<r;t++)dr.fromBufferAttribute(this,t),dr.applyMatrix3(e),this.setXYZ(t,dr.x,dr.y,dr.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)dr.fromBufferAttribute(this,t),dr.applyMatrix4(e),this.setXYZ(t,dr.x,dr.y,dr.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)dr.fromBufferAttribute(this,t),dr.applyNormalMatrix(e),this.setXYZ(t,dr.x,dr.y,dr.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)dr.fromBufferAttribute(this,t),dr.transformDirection(e),this.setXYZ(t,dr.x,dr.y,dr.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=xs(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Fn(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=xs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Fn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=xs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Fn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=xs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Fn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=xs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Fn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Fn(t,this.array),r=Fn(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Fn(t,this.array),r=Fn(r,this.array),i=Fn(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=Fn(t,this.array),r=Fn(r,this.array),i=Fn(i,this.array),s=Fn(s,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,this}
vendor: 4,782 bytes, line 5
5onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Mm&&(e.usage=this.usage),e}}class Py extends ci{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class ky extends ci{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class Gs extends ci{constructor(e,t,r){super(new Float32Array(e),t,r)}}let IT=0;const Wi=new an,Pd=new or,QA=new Ae,Ri=new Ua,ic=new Ua,Tr=new Ae;class Is extends xA{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:IT++}),this.uuid=Bs(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Ny(e)?ky:Py)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const s=new nn().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Wi.makeRotationFromQuaternion(e),this.applyMatrix4(Wi),this}rotateX(e){return Wi.makeRotationX(e),this.applyMatrix4(Wi),this}rotateY(e){return Wi.makeRotationY(e),this.applyMatrix4(Wi),this}rotateZ(e){return Wi.makeRotationZ(e),this.applyMatrix4(Wi),this}translate(e,t,r){return Wi.makeTranslation(e,t,r),this.applyMatrix4(Wi),this}scale(e,t,r){return Wi.makeScale(e,t,r),this.applyMatrix4(Wi),this}lookAt(e){return Pd.lookAt(e),Pd.updateMatrix(),this.applyMatrix4(Pd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(QA).negate(),this.translate(QA.x,QA.y,QA.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const r=[];for(let i=0,s=e.length;i<s;i++){const a=e[i];r.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Gs(r,3))}else{const r=Math.min(e.length,t.count);for(let i=0;i<r;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ua);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Ae(-1/0,-1/0,-1/0),new Ae(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){const s=t[r];Ri.setFromBufferAttribute(s),this.morphTargetsRelative?(Tr.addVectors(this.boundingBox.min,Ri.min),this.boundingBox.expandByPoint(Tr),Tr.addVectors(this.boundingBox.max,Ri.max),this.boundingBox.expandByPoint(Tr)):(this.boundingBox.expandByPoint(Ri.min),this.boundingBox.expandByPoint(Ri.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new qs);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Ae,1/0);return}if(e){const r=this.boundingSphere.center;if(Ri.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];ic.setFromBufferAttribute(o),this.morphTargetsRelative?(Tr.addVectors(Ri.min,ic.min),Ri.expandByPoint(Tr),Tr.addVectors(Ri.max,ic.max),Ri.expandByPoint(Tr)):(Ri.expandByPoint(ic.min),Ri.expandByPoint(ic.max)
vendor: 3,124 bytes, line 5
5)}Ri.getCenter(r);let i=0;for(let s=0,a=e.count;s<a;s++)Tr.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(Tr));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],A=this.morphTargetsRelative;for(let l=0,c=o.count;l<c;l++)Tr.fromBufferAttribute(o,l),A&&(QA.fromBufferAttribute(e,l),Tr.add(QA)),i=Math.max(i,r.distanceToSquared(Tr))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ci(new Float32Array(4*r.count),4));const a=this.getAttribute("tangent"),o=[],A=[];for(let O=0;O<r.count;O++)o[O]=new Ae,A[O]=new Ae;const l=new Ae,c=new Ae,u=new Ae,h=new Kt,f=new Kt,d=new Kt,g=new Ae,m=new Ae;function p(O,I,R){l.fromBufferAttribute(r,O),c.fromBufferAttribute(r,I),u.fromBufferAttribute(r,R),h.fromBufferAttribute(s,O),f.fromBufferAttribute(s,I),d.fromBufferAttribute(s,R),c.sub(l),u.sub(l),f.sub(h),d.sub(h);const V=1/(f.x*d.y-d.x*f.y);!isFinite(V)||(g.copy(c).multiplyScalar(d.y).addScaledVector(u,-f.y).multiplyScalar(V),m.copy(u).multiplyScalar(f.x).addScaledVector(c,-d.x).multiplyScalar(V),o[O].add(g),o[I].add(g),o[R].add(g),A[O].add(m),A[I].add(m),A[R].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let O=0,I=w.length;O<I;++O){const R=w[O],V=R.start,re=R.count;for(let Y=V,se=V+re;Y<se;Y+=3)p(e.getX(Y+0),e.getX(Y+1),e.getX(Y+2))}const C=new Ae,b=new Ae,U=new Ae,F=new Ae;function D(O){U.fromBufferAttribute(i,O),F.copy(U);const I=o[O];C.copy(I),C.sub(U.multiplyScalar(U.dot(I))).normalize(),b.crossVectors(F,I);const V=b.dot(A[O])<0?-1:1;a.setXYZW(O,C.x,C.y,C.z,V)}for(let O=0,I=w.length;O<I;++O){const R=w[O],V=R.start,re=R.count;for(let Y=V,se=V+re;Y<se;Y+=3)D(e.getX(Y+0)),D(e.getX(Y+1)),D(e.getX(Y+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new ci(new Float32Array(t.count*3),3),this.setAttribute("normal",r);else for(let h=0,f=r.count;h<f;h++)r.setXYZ(h,0,0,0);const i=new Ae,s=new Ae,a=new Ae,o=new Ae,A=new Ae,l=new Ae,c=new Ae,u=new Ae;if(e)for(let h=0,f=e.count;h<f;h+=3){const d=e.getX(h+0),g=e.getX(h+1),m=e.getX(h+2);i.fromBufferAttribute(t,d),s.fromBufferAttribute(t,g),a.fromBufferAttribute(t,m),c.subVectors(a,s),u.subVectors(i,s),c.cross(u),o.fromBufferAttribute(r,d),A.fromBufferAttribute(r,g),l.fromBufferAttribute(r,m),o.add(c),A.add(c),l.add(c),r.setXYZ(d,o.x,o.y,o.z),r.setXYZ(g,A.x,A.y,A.z),r.setXYZ(m,l.x,l.y,l.z)}else for(let h=0,f=t.count;h<f;h+=3)i.fromBufferAttribute(t,h+0),s.fromBufferAttribute(t,h+1),a.fromBufferAttribute(t,h+2),c.subVectors(a,s),u.subVectors(i,s),c.cross(u),r.setXYZ(h+0,c.x,c.y,c.z),r.setXYZ(h+1,
vendor: 12,696 bytes, lines 5-9
5c.x,c.y,c.z),r.setXYZ(h+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)Tr.fromBufferAttribute(e,t),Tr.normalize(),e.setXYZ(t,Tr.x,Tr.y,Tr.z)}toNonIndexed(){function e(o,A){const l=o.array,c=o.itemSize,u=o.normalized,h=new l.constructor(A.length*c);let f=0,d=0;for(let g=0,m=A.length;g<m;g++){o.isInterleavedBufferAttribute?f=A[g]*o.data.stride+o.offset:f=A[g]*c;for(let p=0;p<c;p++)h[d++]=l[f++]}return new ci(h,c,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Is,r=this.index.array,i=this.attributes;for(const o in i){const A=i[o],l=e(A,r);t.setAttribute(o,l)}const s=this.morphAttributes;for(const o in s){const A=[],l=s[o];for(let c=0,u=l.length;c<u;c++){const h=l[c],f=e(h,r);A.push(f)}t.morphAttributes[o]=A}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,A=a.length;o<A;o++){const l=a[o];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const A=this.parameters;for(const l in A)A[l]!==void 0&&(e[l]=A[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const A in r){const l=r[A];e.data.attributes[A]=l.toJSON(e.data)}const i={};let s=!1;for(const A in this.morphAttributes){const l=this.morphAttributes[A],c=[];for(let u=0,h=l.length;u<h;u++){const f=l[u];c.push(f.toJSON(e.data))}c.length>0&&(i[A]=c,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const l in i){const c=i[l];this.setAttribute(l,c.clone(t))}const s=e.morphAttributes;for(const l in s){const c=[],u=s[l];for(let h=0,f=u.length;h<f;h++)c.push(u[h].clone(t));this.morphAttributes[l]=c}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,c=a.length;l<c;l++){const u=a[l];this.addGroup(u.start,u.count,u.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const A=e.boundingSphere;return A!==null&&(this.boundingSphere=A.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const H2=new an,Mo=new uu,Ou=new qs,V2=new Ae,Pu=new Ae,ku=new Ae,$u=new Ae,kd=new Ae,Qu=new Ae,G2=new Ae,Hu=new Ae;class Ci extends or{constructor(e=new Is,t=new no){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,a=r.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Qu.set(0,0,0);for(let A=0,l=s.length;A<l;A++){const c=o[A],u=s[A];c!==0&&(kd.fromBufferAttribute(u,e),a?Qu.addScaledVector(kd,c):Qu.addScaledVector(kd.sub(t),c))}t.add(Qu)}return t}raycast(e,t){const r=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),Ou.copy(r.boundingSphere),Ou.applyMatrix4(s),Mo.copy(e.ray).recast(e.near),!(Ou.containsPoint(Mo.origin)===!1&&(Mo.intersectSphere(Ou,V2)===null||Mo.origin.distanceToSquared(V2)>(e.far-e.near)**2))&&(H2.copy(s).invert(),Mo.copy(e.ray).applyMatrix4(H2),!(r.boundingBox!==null&&Mo.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,Mo)))}_computeIntersections(e,t,r){let i;const s=this.geometry,a=this.material,o=s.index,A=s.attributes.position,l=s.attributes.uv,c=s.attributes.uv1,u=s.attributes.normal,h=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let d=0,g=h.length;d<g;d++){const m=h[d],p=a[m.materialIndex],w=Math.max(m.start,f.start),C=Math.min(o.count,Math.min(m.start+m.count,f.start+f.count));for(let b=w,U=C;b<U;b+=3){const F=o.getX(b),D=o.getX(b+1),O=o.getX(b+2);i=Vu(this,p,e,r,l,c,u,F,D,O),i&&(i.faceIndex=Math.floor(b/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const d=Math.max(0,f.start),g=Math.min(o.count,f.start+f.count);for(let m=d,p=g;m<p;m+=3){const w=o.getX(m),C=o.getX(m+1),b=o.getX(m+2);i=Vu(this,a,e,r,l,c,u,w,C,b),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(A!==void 0)if(Array.isArray(a))for(let d=0,g=h.length;d<g;d++){const m=h[d],p=a[m.materialIndex],w=Math.max(m.start,f.start),C=Math.min(A.count,Math.min(m.start+m.count,f.start+f.count));for(let b=w,U=C;b<U;b+=3){const F=b,D=b+1,O=b+2;i=Vu(this,p,e,r,l,c,u,F,D,O),i&&(i.faceIndex=Math.floor(b/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const d=Math.max(0,f.start),g=Math.min(A.count,f.start+f.count);for(let m=d,p=g;m<p;m+=3){const w=m,C=m+1,b=m+2;i=Vu(this,a,e,r,l,c,u,w,C,b),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function FT(n,e,t,r,i,s,a,o){let A;if(e.side===Bi?A=r.intersectTriangle(a,s,i,!0,o):A=r.intersectTriangle(i,s,a,e.side===_a,o),A===null)return null;Hu.copy(o),Hu.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(Hu);return l<t.near||l>t.far?null:{distance:l,point:Hu.clone(),object:n}}function Vu(n,e,t,r,i,s,a,o,A,l){n.getVertexPosition(o,Pu),n.getVertexPosition(A,ku),n.getVertexPosition(l,$u);const c=FT(n,e,t,r,Pu,ku,$u,G2);if(c){const u=new Ae;bs.getBarycoord(G2,Pu,ku,$u,u),i&&(c.uv=bs.getInterpolatedAttribute(i,o,A,l,u,new Kt)),s&&(c.uv1=bs.getInterpolatedAttribute(s,o,A,l,u,new Kt)),a&&(c.normal=bs.getInterpolatedAttribute(a,o,A,l,u,new Ae),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const h={a:o,b:A,c:l,normal:new Ae,materialIndex:0};bs.getNormal(Pu,ku,$u,h.normal),c.face=h,c.barycoord=u}return c}class hu extends Is{constructor(e=1,t=1,r=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const A=[],l=[],c=[],u=[];let h=0,f=0;d("z","y","x",-1,-1,r,t,e,a,s,0),d("z","y","x",1,-1,r,t,-e,a,s,1),d("x","z","y",1,1,e,r,t,i,a,2),d("x","z","y",1,-1,e,r,-t,i,a,3),d("x","y","z",1,-1,e,t,r,i,s,4),d("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(A),this.setAttribute("position",new Gs(l,3)),this.setAttribute("normal",new Gs(c,3)),this.setAttribute("uv",new Gs(u,2));function d(g,m,p,w,C,b,U,F,D,O,I){const R=b/D,V=U/O,re=b/2,Y=U/2,se=F/2,ge=D+1,ue=O+1;let Ce=0,ae=0;const we=new Ae;for(let Pe=0;Pe<ue;Pe++){const $e=Pe*V-Y;for(let yt=0;yt<ge;yt++){const Dt=yt*R-re;we[g]=Dt*w,we[m]=$e*C,we[p]=se,l.push(we.x,we.y,we.z),we[g]=0,we[m]=0,we[p]=F>0?1:-1,c.push(we.x,we.y,we.z),u.push(yt/D),u.push(1-Pe/O),Ce+=1}}for(let Pe=0;Pe<O;Pe++)for(let $e=0;$e<D;$e++){const yt=h+$e+ge*Pe,Dt=h+$e+ge*(Pe+1),Be=h+($e+1)+ge*(Pe+1),De=h+($e+1)+ge*Pe;A.push(yt,Dt,De),A.push(Dt,Be,De),ae+=6}o.addGroup(f,ae,I),f+=ae,h+=Ce}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Cl(n){const e={};for(const t in n){e[t]={};for(const r in n[t]){const i=n[t][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][r]=null):e[t][r]=i.clone():Array.isArray(i)?e[t][r]=i.slice():e[t][r]=i}}return e}function ii(n){const e={};for(let t=0;t<n.length;t++){const r=Cl(n[t]);for(const i in r)e[i]=r[i]}return e}function RT(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function $y(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:xn.workingColorSpace}const UT={clone:Cl,merge:ii};var MT=`void main() { 6 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 7}`,NT=`void main() { 8 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 9}`;class yo extends Vs{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=MT,this.fragmentShader=NT,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Cl(e.uniforms),this.uniformsGroups=RT(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class Qy extends or{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new an,this.projectionMatrix=new an,this.projectionMatrixInverse=new an,this.coordinateSystem=va}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ga=new Ae,z2=new Kt,W2=new Kt;class oi extends Qy{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=bl*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Fc*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,357 bytes, line 9
9getEffectiveFOV(){return bl*2*Math.atan(Math.tan(Fc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){Ga.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ga.x,Ga.y).multiplyScalar(-e/Ga.z),Ga.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Ga.x,Ga.y).multiplyScalar(-e/Ga.z)}getViewSize(e,t){return this.getViewBounds(e,z2,W2),t.subVectors(W2,z2)}setViewOffset(e,t,r,i,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Fc*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const A=a.fullWidth,l=a.fullHeight;s+=a.offsetX*i/A,t-=a.offsetY*r/l,i*=a.width/A,r*=a.height/l}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const HA=-90,VA=1;class DT extends or{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new oi(HA,VA,e,t);i.layers=this.layers,this.add(i);const s=new oi(HA,VA,e,t);s.layers=this.layers,this.add(s);const a=new oi(HA,VA,e,t);a.layers=this.layers,this.add(a);const o=new oi(HA,VA,e,t);o.layers=this.layers,this.add(o);const A=new oi(HA,VA,e,t);A.layers=this.layers,this.add(A);const l=new oi(HA,VA,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,s,a,o,A]=t;for(const l of t)this.remove(l);if(e===va)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),A.up.set(0,1,0),A.lookAt(0,0,-1);else if(e===sf)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),A.up.set(0,-1,0),A.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,A,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,s),e.setRenderTarget(r,1,i),e.render(t,a),e.setRenderTarget(r,2,i),e.render(t,o),e.setRenderTarget(r,3,i),e.render(t,A),e.setRenderTarget(r,4,i),e.render(t,l),r.texture.generateMipmaps=g,e.setRenderTarget(r,5,i),e.render(t,c),e.setRenderTarget(u,h,f),e.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class Hy extends Ur{constructor(e=[],t=vl,r,i,s,a,o,A,l,c){super(e,t,r,i,s,a,o,A,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class LT extends AA{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new Hy(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Ni}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 6,144 bytes, lines 9-44
9=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` 10 11 varying vec3 vWorldDirection; 12 13 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 14 15 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 16 17 } 18 19 void main() { 20 21 vWorldDirection = transformDirection( position, modelMatrix ); 22 23 #include <begin_vertex> 24 #include <project_vertex> 25 26 } 27 `,fragmentShader:` 28 29 uniform sampler2D tEquirect; 30 31 varying vec3 vWorldDirection; 32 33 #include <common> 34 35 void main() { 36 37 vec3 direction = normalize( vWorldDirection ); 38 39 vec2 sampleUV = equirectUv( direction ); 40 41 gl_FragColor = texture2D( tEquirect, sampleUV ); 42 43 } 44 `},i=new hu(5,5,5),s=new yo({name:"CubemapFromEquirect",uniforms:Cl(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Bi,blending:lo});s.uniforms.tEquirect.value=t;const a=new Ci(i,s),o=t.minFilter;return t.minFilter===ya&&(t.minFilter=Ni),new DT(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,r=!0,i=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,r,i);e.setRenderTarget(s)}}class qo extends or{constructor(){super(),this.isGroup=!0,this.type="Group"}}const OT={type:"move"};class $d{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new qo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ae),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ae),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let i=null,s=null,a=null;const o=this._targetRay,A=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){a=!0;for(const g of e.hand.values()){const m=t.getJointPose(g,r),p=this._getHandJoint(l,g);m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=m.radius),p.visible=m!==null}const c=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],h=c.position.distanceTo(u.position),f=.02,d=.005;l.inputState.pinching&&h>f+d?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&h<=f-d&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else A!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(A.matrix.fromArray(s.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.matrixWorldNeedsUpdate=!0,s.linearVelocity?(A.hasLinearVelocity=!0,A.linearVelocity.copy(s.linearVelocity)):A.hasLinearVelocity=!1,s.angularVelocity?(A.hasAngularVelocity=!0,A.angularVelocity.copy(s.angularVelocity)):A.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(OT)))}return o!==null&&(o.visible=i!==null),A!==null&&(A.visible=s!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new qo;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class PT extends or{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new js,this.environmentIntensity=1,this.environmentRotation=new js,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}
vendor: 9,562 bytes, line 44
44class kT{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Mm,this.updateRanges=[],this.version=0,this.uuid=Bs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Bs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Bs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const ri=new Ae;class cg{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)ri.fromBufferAttribute(this,t),ri.applyMatrix4(e),this.setXYZ(t,ri.x,ri.y,ri.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)ri.fromBufferAttribute(this,t),ri.applyNormalMatrix(e),this.setXYZ(t,ri.x,ri.y,ri.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)ri.fromBufferAttribute(this,t),ri.transformDirection(e),this.setXYZ(t,ri.x,ri.y,ri.z);return this}getComponent(e,t){let r=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(r=xs(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Fn(r,this.array)),this.data.array[e*this.data.stride+this.offset+t]=r,this}setX(e,t){return this.normalized&&(t=Fn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Fn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Fn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Fn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=xs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=xs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=xs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=xs(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Fn(t,this.array),r=Fn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Fn(t,this.array),r=Fn(r,this.array),i=Fn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Fn(t,this.array),r=Fn(r,this.array),i=Fn(i,this.array),s=Fn(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new ci(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new cg(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const K2=new Ae,X2=new Tn,j2=new Tn,$T=new Ae,Y2=new an,Gu=new Ae,Qd=new qs,q2=new an,Hd=new uu;class QT extends Ci{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=C2,this.bindMatrix=new an,this.bindMatrixInverse=new an,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ua),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,Gu),this.boundingBox.expandByPoint(Gu)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new qs),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,Gu),this.boundingSphere.expandByPoint(Gu)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const r=this.material,i=this.matrixWorld;r!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Qd.copy(this.boundingSphere),Qd.applyMatrix4(i),e.ray.intersectsSphere(Qd)!==!1&&(q2.copy(i).invert(),Hd.copy(e.ray).applyMatrix4(q2),!(this.boundingBox!==null&&Hd.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Hd)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Tn,t=this.geometry.attributes.skinWeight;for(let r=0,i=t.count;r<i;r++){e.fromBufferAttribute(t,r);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===C2?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===DS?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const r=this.skeleton,i=this.geometry;X2.fromBufferAttribute(i.attributes.skinIndex,e),j2.fromBufferAttribute(i.attributes.skinWeight,e),K2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const a=j2.getComponent(s);if(a!==0){const o=X2.getComponent(s);Y2.multiplyMatrices(r.bones[o].matrixWorld,r.boneInverses[o]),t.addScaledVector($T.copy(K2).applyMatrix4(Y2),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Vy extends or{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Gy extends Ur{constructor(e=null,t=1,r=1,i,s,a,o,A,l=li,c=li,u,h){super(null,a,o,A,l,c,i,s,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const J2=new an,HT=new an;class ug{constructor(e=[],t=[]){this.uuid=Bs(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new an)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const r=new an;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let s=0,a=e.length;s<a;s++){const o=e[s]?e[s].matrixWorld:HT;
vendor: 13,527 bytes, line 44
44J2.multiplyMatrices(o,t[s]),J2.toArray(r,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new ug(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new Gy(t,e,e,Zi,_s);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const s=e.bones[r];let a=t[s];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),a=new Vy),this.bones.push(a),this.boneInverses.push(new an().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const a=t[i];e.bones.push(a.uuid);const o=r[i];e.boneInverses.push(o.toArray())}return e}}class Nm extends ci{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const GA=new an,Z2=new an,zu=[],e0=new Ua,VT=new an,sc=new Ci,ac=new qs;class GT extends Ci{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Nm(new Float32Array(r*16),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<r;i++)this.setMatrixAt(i,VT)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ua),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,GA),e0.copy(e.boundingBox).applyMatrix4(GA),this.boundingBox.union(e0)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new qs),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,GA),ac.copy(e.boundingSphere).applyMatrix4(GA),this.boundingSphere.union(ac)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const r=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=r.length+1,a=e*s+1;for(let o=0;o<r.length;o++)r[o]=i[a+o]}raycast(e,t){const r=this.matrixWorld,i=this.count;if(sc.geometry=this.geometry,sc.material=this.material,sc.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ac.copy(this.boundingSphere),ac.applyMatrix4(r),e.ray.intersectsSphere(ac)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,GA),Z2.multiplyMatrices(r,GA),sc.matrixWorld=Z2,sc.raycast(e,zu);for(let a=0,o=zu.length;a<o;a++){const A=zu[a];A.instanceId=s,A.object=this,t.push(A)}zu.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Nm(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const r=t.morphTargetInfluences,i=r.length+1;this.morphTexture===null&&(this.morphTexture=new Gy(new Float32Array(i*this.count),i,this.count,ig,_s));const s=this.morphTexture.source.data.data;let a=0;for(let l=0;l<r.length;l++)a+=r[l];const o=this.geometry.morphTargetsRelative?1:1-a,A=i*e;s[A]=o,s.set(r,A+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Vd=new Ae,zT=new Ae,WT=new nn;class qa{constructor(e=new Ae(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=Vd.subVectors(r,t).cross(zT.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(Vd),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||WT.getNormalMatrix(e),i=this.coplanarPoint(Vd).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const No=new qs,Wu=new Ae;class hg{constructor(e=new qa,t=new qa,r=new qa,i=new qa,s=new qa,a=new qa){this.planes=[e,t,r,i,s,a]}set(e,t,r,i,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=va){const r=this.planes,i=e.elements,s=i[0],a=i[1],o=i[2],A=i[3],l=i[4],c=i[5],u=i[6],h=i[7],f=i[8],d=i[9],g=i[10],m=i[11],p=i[12],w=i[13],C=i[14],b=i[15];if(r[0].setComponents(A-s,h-l,m-f,b-p).normalize(),r[1].setComponents(A+s,h+l,m+f,b+p).normalize(),r[2].setComponents(A+a,h+c,m+d,b+w).normalize(),r[3].setComponents(A-a,h-c,m-d,b-w).normalize(),r[4].setComponents(A-o,h-u,m-g,b-C).normalize(),t===va)r[5].setComponents(A+o,h+u,m+g,b+C).normalize();else if(t===sf)r[5].setComponents(o,u,g,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),No.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),No.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(No)}intersectsSprite(e){return No.center.set(0,0,0),No.radius=.7071067811865476,No.applyMatrix4(e.matrixWorld),this.intersectsSphere(No)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(Wu.x=i.normal.x>0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class zy extends Vs{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Yt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const af=new Ae,of=new Ae,t0=new an,oc=new uu,Ku=new qs,Gd=new Ae,n0=new Ae;class fg extends or{constructor(e=new Is,t=new zy){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[0];for(let i=1,s=t.count;i<s;i++)af.fromBufferAttribute(t,i-1),of.fromBufferAttribute(t,i),r[i]=r[i-1],r[i]+=af.distanceTo(of);e.setAttribute("lineDistance",new Gs(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Ku.copy(r.boundingSphere),Ku.applyMatrix4(i),Ku.radius+=s,e.ray.intersectsSphere(Ku)===!1)return;t0.copy(i).invert(),oc.copy(e.ray).applyMatrix4(t0);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),A=o*o,l=this.isLineSegments?2:1,c=r.index,h=r.attributes.position;if(c!==null){const f=Math.max(0,a.start),d=Math.min(c.count,a.start+a.count);for(let g=f,m=d-1;g<m;g+=l){const p=c.getX(g),w=c.getX(g+1),C=Xu(this,e,oc,A,p,w,g);C&&t.push(C)}if(this.isLineLoop){const g=c.getX(d-1),m=c.getX(f),p=Xu(this,e,oc,A,g,m,d-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),d=Math.min(h.count,a.start+a.count);for(let g=f,m=d-1;g<m;g+=l){const p=Xu(this,e,oc,A,g,g+1,g);p&&t.push(p)}if(this.isLineLoop){const g=Xu(this,e,oc,A,d-1,f,d-1);g&&t.push(g)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function Xu(n,e,t,r,i,s,a){const o=n.geometry.attributes.position;if(af.fromBufferAttribute(o,i),of.fromBufferAttribute(o,s),t.distanceSqToSegment(af,of,Gd,n0)>r)return;Gd.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(Gd);if(!(l<e.near||l>e.far))return{distance:l,point:n0.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}const r0=new Ae,i0=new Ae;class KT extends fg{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[];for(let i=0,s=t.count;i<s;i+=2)r0.fromBufferAttribute(t,i),i0.fromBufferAttribute(t,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+r0.distanceTo(i0);e.setAttribute("lineDistance",new Gs(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class XT extends fg{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Wy extends Vs{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Yt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const s0=new an,Dm=new uu,ju=new qs,Yu=new Ae;class jT extends or{constructor(e=new Is,t=new Wy){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),ju.copy(r.boundingSphere),ju.applyMatrix4(i),ju.radius+=s,e.ray.intersectsSphere(ju)===!1)return;s0.copy(i).invert(),Dm.copy(e.ray).applyMatrix4(s0);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),A=o*o,l=r.index,u=r.attributes.position;if(l!==null){const h=Math.max(0,a.start),f=Math.min(l.count,a.start+a.count);for(let d=h,g=f;d<g;d++){const m=l.getX(d);Yu.fromBufferAttribute(u,m),a0(Yu,m,A,i,e,t,this)}}else{const h=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let d=h,g=f;d<g;d++)Yu.fromBufferAttribute(u,d),a0(Yu,d,A,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function a0(n,e,t,r,i,s,a){const o=Dm.distanceSqToPoint(n);if(o<t){const A=new Ae;Dm.closestPointToPoint(n,A),A.applyMatrix4(r);const l=i.ray.origin.distanceTo(A);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:A,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}
vendor: 8,223 bytes, line 44
44class Ky extends Ur{constructor(e,t,r=oA,i,s,a,o=li,A=li,l,c=Hc){if(c!==Hc&&c!==Vc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,i,s,a,o,A,c,r,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new lg(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class $f extends Is{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const s=e/2,a=t/2,o=Math.floor(r),A=Math.floor(i),l=o+1,c=A+1,u=e/o,h=t/A,f=[],d=[],g=[],m=[];for(let p=0;p<c;p++){const w=p*h-a;for(let C=0;C<l;C++){const b=C*u-s;d.push(b,-w,0),g.push(0,0,1),m.push(C/o),m.push(1-p/A)}}for(let p=0;p<A;p++)for(let w=0;w<o;w++){const C=w+l*p,b=w+l*(p+1),U=w+1+l*(p+1),F=w+1+l*p;f.push(C,b,F),f.push(b,U,F)}this.setIndex(f),this.setAttribute("position",new Gs(d,3)),this.setAttribute("normal",new Gs(g,3)),this.setAttribute("uv",new Gs(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $f(e.width,e.height,e.widthSegments,e.heightSegments)}}class dg extends Vs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Yt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Yt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ry,this.normalScale=new Kt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new js,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Js extends dg{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Kt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return hn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Yt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Yt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Yt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class YT extends Vs{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=PS,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class qT extends Vs{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function qu(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function JT(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function ZT(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function o0(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,a=0;a!==r;++s){const o=t[s]*e;for(let A=0;A!==e;++A)i[a++]=n[o+A]}return i}function Xy(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let a=s[r];if(a!==void 0)if(Array.isArray(a))do a=s[r],a!==void 0&&(e.push(s.time),t.push(...a)),s=n[i++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[r],a!==void 0&&(e.push(s.time),a.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do a=s[r],a!==void 0&&(e.push(s.time),t.push(a)),s=n[i++];while(s!==void 0)}
vendor: 10,723 bytes, line 44
44class fu{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,i=t[r],s=t[r-1];e:{t:{let a;n:{r:if(!(e<i)){for(let o=r+2;;){if(i===void 0){if(e<s)break r;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===o)break;if(s=i,i=t[++r],e<i)break t}a=t.length;break n}if(!(e>=s)){const o=t[1];e<o&&(r=2,s=o);for(let A=r-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===A)break;if(i=s,s=t[--r-1],e>=s)break t}a=r,r=0;break n}break e}for(;r<a;){const o=r+a>>>1;e<t[o]?a=o:r=o+1}if(i=t[r],s=t[r-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,s,i)}return this.interpolate_(r,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i;for(let a=0;a!==i;++a)t[a]=r[s+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class eI extends fu{constructor(e,t,r,i){super(e,t,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:_2,endingEnd:_2}}intervalChanged_(e,t,r){const i=this.parameterPositions;let s=e-2,a=e+1,o=i[s],A=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case B2:s=e,o=2*t-r;break;case E2:s=i.length-2,o=t+i[s]-i[s+1];break;default:s=e,o=r}if(A===void 0)switch(this.getSettings_().endingEnd){case B2:a=e,A=2*r-t;break;case E2:a=1,A=r+i[1]-i[0];break;default:a=e-1,A=t}const l=(r-t)*.5,c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(A-r),this._offsetPrev=s*c,this._offsetNext=a*c}interpolate_(e,t,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,A=e*o,l=A-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,f=this._weightNext,d=(r-t)/(i-t),g=d*d,m=g*d,p=-h*m+2*h*g-h*d,w=(1+h)*m+(-1.5-2*h)*g+(-.5+h)*d+1,C=(-1-f)*m+(1.5+f)*g+.5*d,b=f*m-f*g;for(let U=0;U!==o;++U)s[U]=p*a[c+U]+w*a[l+U]+C*a[A+U]+b*a[u+U];return s}}class tI extends fu{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,A=e*o,l=A-o,c=(r-t)/(i-t),u=1-c;for(let h=0;h!==o;++h)s[h]=a[l+h]*u+a[A+h]*c;return s}}class nI extends fu{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Fs{constructor(e,t,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=qu(t,this.TimeBufferType),this.values=qu(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:qu(e.times,Array),values:qu(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new nI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new tI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new eI(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Gc:t=this.InterpolantFactoryMethodDiscrete;break;case zc:t=this.InterpolantFactoryMethodLinear;break;case wd:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Gc;case this.InterpolantFactoryMethodLinear:return zc;case this.InterpolantFactoryMethodSmooth:return wd}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this}trim(e,t){const r=this.times,i=r.length;let s=0,a=i-1;for(;s!==i&&r[s]<e;)++s;for(;a!==-1&&r[a]>t;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=r.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==s;o++){const A=r[o];if(typeof A=="number"&&isNaN(A)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,A),e=!1;break}if(a!==null&&a>A){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,A,a),e=!1;break}a=A}if(i!==void 0&&JT(i))for(let o=0,A=i.length;o!==A;++o){const l=i[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===wd,s=e.length-1;let a=1;for(let o=1;o<s;++o){let A=!1;const l=e[o],c=e[o+1];if(l!==c&&(o!==1||l!==e[0]))if(i)A=!0;else{const u=o*r,h=u-r,f=u+r;for(let d=0;d!==r;++d){const g=t[u+d];if(g!==t[h+d]||g!==t[f+d]){A=!0;break}}}if(A){if(o!==a){e[a]=e[o];const u=o*r,h=a*r;for(let f=0;f!==r;++f)t[h+f]=t[u+f]}++a}}if(s>0){e[a]=e[s];for(let o=s*r,A=a*r,l=0;l!==r;++l)t[A+l]=t[o+l];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Fs.prototype.ValueTypeName="";Fs.prototype.TimeBufferType=Float32Array;Fs.prototype.ValueBufferType=Float32Array;Fs.prototype.DefaultInterpolation=zc;class Ol extends Fs{constructor(e,t,r){super(e,t,r)}}Ol.prototype.ValueTypeName="bool";Ol.prototype.ValueBufferType=Array;Ol.prototype.DefaultInterpolation=Gc;Ol.prototype.InterpolantFactoryMethodLinear=void 0;Ol.prototype.InterpolantFactoryMethodSmooth=void 0;class jy extends Fs{constructor(e,t,r,i){super(e,t,r,i)}}jy.prototype.ValueTypeName="color";class _l extends Fs{constructor(e,t,r,i){super(e,t,r,i)}}_l.prototype.ValueTypeName="number";class rI extends fu{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,A=(r-t)/(i-t);let l=e*o;for(let c=l+o;l!==c;l+=4)Xs.slerpFlat(s,0,a,l-o,a,l,A);return s}}class Bl extends Fs{constructor(e,t,r,i){super(e,t,r,i)}InterpolantFactoryMethodLinear(e){return new rI(this.times,this.values,this.getValueSize(),e)}}Bl.prototype.ValueTypeName="quaternion";Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class Pl extends Fs{constructor(e,t,r){super(e,t,r)}}Pl.prototype.ValueTypeName="string";Pl.prototype.ValueBufferType=Array;Pl.prototype.DefaultInterpolation=Gc;Pl.prototype.InterpolantFactoryMethodLinear=void 0;Pl.prototype.InterpolantFactoryMethodSmooth=void 0;class El extends Fs{constructor(e,t,r,i){super(e,t,r,i)}}El.prototype.ValueTypeName="vector";class iI{constructor(e="",t=-1,r=[],i=LS){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Bs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,o=r.length;a!==o;++a)t.push(aI(r[a]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,a=r.length;s!==a;++s)t.push(Fs.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,a=[];for(let o=0;o<s;o++){let A=[],l=[];A.push((o+s-1)%s,o,(o+1)%s),l.push(0,1,0);const c=ZT(A);A=o0(A,1,c),l=o0(l,1,c),!i&&A[0]===0&&(A.push(s),l.push(l[0])),a.push(new _l(".morphTargetInfluences["+t[o].name+"]",A,l).scale(1/r))}return new this(e,-1,a)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const i=e;r=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const i={},s=/^([\w-]*?)([\d]+)$/;for(let o=0,A=e.length;o<A;o++){const l=e[o],c=l.name.match(s);if(c&&c.length>1){const u=c[1];let h=i[u];h||(i[u]=h=[]),h.push(l)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,r));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(u,h,f,d,g){if(f.length!==0){const m=[],p=[];Xy(f,m,p,d),m.length!==0&&g.push(new u(h,m,p))}},i=[],s=e.name||"default",a=e.fps||30,o=e.blendMode;let A=e.length||-1;const l=e.hierarchy||[];for(let u=0;u<l.length;u++){const h=l[u].keys;if(!(!h||h.length===0))if(h[0].morphTargets){const f={};let d;for(d=0;d<h.length;d++)if(h[d].morphTargets)for(let g=0;g<h[d].morphTargets.length;g++)f[h[d].morphTargets[g]]=-1;for(const g in f){const m=[],p=[];for(let w=0;w!==h[d].morphTargets.length;++w){const C=h[d];m.push(C.time),p.push(C.morphTarget===g?1:0)}i.push(new _l(".morphTargetInfluence["+g+"]",m,p))}A=f.length*a}else{const f=".bones["+t[u].name+"]";r(El,f+".position",h,"pos",i),r(Bl,f+".quaternion",h,"rot",i),r(El,f+".scale",h,"scl",i)}}return i.length===0?null:new this(s,A,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let r=0,i=e.length;r!==i;++r){const s=this.tracks[r];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function sI(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return _l;
vendor: 10,060 bytes, line 44
44case"vector":case"vector2":case"vector3":case"vector4":return El;case"color":return jy;case"quaternion":return Bl;case"bool":case"boolean":return Ol;case"string":return Pl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function aI(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=sI(n.type);if(n.times===void 0){const t=[],r=[];Xy(n.keys,t,r,"value"),n.times=t,n.values=r}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const ro={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class oI{constructor(e,t,r){const i=this;let s=!1,a=0,o=0,A;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(c){o++,s===!1&&i.onStart!==void 0&&i.onStart(c,a,o),s=!0},this.itemEnd=function(c){a++,i.onProgress!==void 0&&i.onProgress(c,a,o),a===o&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return A?A(c):c},this.setURLModifier=function(c){return A=c,this},this.addHandler=function(c,u){return l.push(c,u),this},this.removeHandler=function(c){const u=l.indexOf(c);return u!==-1&&l.splice(u,2),this},this.getHandler=function(c){for(let u=0,h=l.length;u<h;u+=2){const f=l[u],d=l[u+1];if(f.global&&(f.lastIndex=0),f.test(c))return d}return null}}}const AI=new oI;class kl{constructor(e){this.manager=e!==void 0?e:AI,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise(function(i,s){r.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}kl.DEFAULT_MATERIAL_NAME="__DEFAULT";const ca={};class lI extends Error{constructor(e,t){super(e),this.response=t}}class Yy extends kl{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=ro.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ca[e]!==void 0){ca[e].push({onLoad:t,onProgress:r,onError:i});return}ca[e]=[],ca[e].push({onLoad:t,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,A=this.responseType;fetch(a).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const c=ca[e],u=l.body.getReader(),h=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=h?parseInt(h):0,d=f!==0;let g=0;const m=new ReadableStream({start(p){w();function w(){u.read().then(({done:C,value:b})=>{if(C)p.close();else{g+=b.byteLength;const U=new ProgressEvent("progress",{lengthComputable:d,loaded:g,total:f});for(let F=0,D=c.length;F<D;F++){const O=c[F];O.onProgress&&O.onProgress(U)}p.enqueue(b),w()}},C=>{p.error(C)})}}});return new Response(m)}else throw new lI(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(A){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return l.json();default:if(o==="")return l.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),h=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(h);return l.arrayBuffer().then(d=>f.decode(d))}}}).then(l=>{ro.add(e,l);const c=ca[e];delete ca[e];for(let u=0,h=c.length;u<h;u++){const f=c[u];f.onLoad&&f.onLoad(l)}}).catch(l=>{const c=ca[e];if(c===void 0)throw this.manager.itemError(e),l;delete ca[e];for(let u=0,h=c.length;u<h;u++){const f=c[u];f.onError&&f.onError(l)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class cI extends kl{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=ro.get(e);if(a!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a;const o=Wc("img");function A(){c(),ro.add(e,this),t&&t(this),s.manager.itemEnd(e)}function l(u){c(),i&&i(u),s.manager.itemError(e),s.manager.itemEnd(e)}function c(){o.removeEventListener("load",A,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",A,!1),o.addEventListener("error",l,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),s.manager.itemStart(e),o.src=e,o}}class uI extends kl{constructor(e){super(e)}load(e,t,r,i){const s=new Ur,a=new cI(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){s.image=o,s.needsUpdate=!0,t!==void 0&&t(s)},r,i),s}}class pg extends or{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Yt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const zd=new an,A0=new Ae,l0=new Ae;class mg{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Kt(512,512),this.mapType=Ks,this.map=null,this.mapPass=null,this.matrix=new an,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new hg,this._frameExtents=new Kt(1,1),this._viewportCount=1,this._viewports=[new Tn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;A0.setFromMatrixPosition(e.matrixWorld),t.position.copy(A0),l0.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(l0),t.updateMatrixWorld(),zd.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(zd),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(zd)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class hI extends mg{constructor(){super(new oi(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=bl*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(r!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class fI extends pg{constructor(e,t,r=0,i=Math.PI/3,s=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(or.DEFAULT_UP),this.updateMatrix(),this.target=new or,this.distance=r,this.angle=i,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new hI}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const c0=new an,Ac=new Ae,Wd=new Ae;class dI extends mg{constructor(){super(new oi(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Kt(4,2),this._viewportCount=6,this._viewports=[new Tn(2,1,1,1),new Tn(0,1,1,1),new Tn(3,1,1,1),new Tn(1,1,1,1),new Tn(3,0,1,1),new Tn(1,0,1,1)],this._cubeDirections=[new Ae(1,0,0),new Ae(-1,0,0),new Ae(0,0,1),new Ae(0,0,-1),new Ae(0,1,0),new Ae(0,-1,0)],this._cubeUps=[new Ae(0,1,0),new Ae(0,1,0),new Ae(0,1,0),new Ae(0,1,0),new Ae(0,0,1),new Ae(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,i=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),Ac.setFromMatrixPosition(e.matrixWorld),r.position.copy(Ac),Wd.copy(r.position),Wd.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(Wd),r.updateMatrixWorld(),i.makeTranslation(-Ac.x,-Ac.y,-Ac.z),c0.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(c0)}}class pI extends pg{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new dI}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Qf extends Qy{constructor(e=-1,t=1,r=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
44phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,i,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,a=r+e,o=i+t,A=i-t;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=l*this.view.offsetX,a=s+l*this.view.width,o-=c*this.view.offsetY,A=o-c*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,A,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class mI extends mg{constructor(){super(new Qf(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Lm extends pg{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(or.DEFAULT_UP),this.updateMatrix(),this.target=new or,this.shadow=new mI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Uc{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class gI extends kl{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=ro.get(e);if(a!==void 0){if(s.manager.itemStart(e),a.then){a.then(l=>{t&&t(l),s.manager.itemEnd(e)}).catch(l=>{i&&i(l)});return}return setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const A=fetch(e,o).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){return ro.add(e,l),t&&t(l),s.manager.itemEnd(e),l}).catch(function(l){i&&i(l),ro.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});ro.add(e,A),s.manager.itemStart(e)}}class yI extends oi{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const gg="\\[\\]\\.:\\/",vI=new RegExp("["+gg+"]","g"),yg="[^"+gg+"]",wI="[^"+gg.replace("\\.","")+"]",xI=/((?:WC+[\/:])*)/.source.replace("WC",yg),bI=/(WCOD+)?/.source.replace("WCOD",wI),CI=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",yg),_I=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",yg),BI=new RegExp("^"+xI+bI+CI+_I+"$"),EI=["material","materials","bones","map"];class SI{constructor(e,t,r){const i=r||Rn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Rn{constructor(e,t,r){this.path=t,this.parsedPath=r||Rn.parseTrackName(t),this.node=Rn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Rn.Composite(e,t,r):new Rn(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(vI,"")}static parseTrackName(e){const t=BI.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);EI.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let a=0;a<s.length;a++){const o=s[a];if(o.name===t||o.uuid===t)return o;const A=r(o.children);if(A)return A}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)e[t++]=r[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,351 bytes, line 44
44_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Rn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let l=t.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===l){l=c;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}const a=e[i];if(a===void 0){const l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let A=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}A=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(A=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(A=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[A],this.setValue=this.SetterByBindingTypeAndVersioning[A][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Rn.Composite=SI;Rn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Rn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Rn.prototype.GetterByBindingType=[Rn.prototype._getValue_direct,Rn.prototype._getValue_array,Rn.prototype._getValue_arrayElement,Rn.prototype._getValue_toArray];Rn.prototype.SetterByBindingTypeAndVersioning=[[Rn.prototype._setValue_direct,Rn.prototype._setValue_direct_setNeedsUpdate,Rn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Rn.prototype._setValue_array,Rn.prototype._setValue_array_setNeedsUpdate,Rn.prototype._setValue_array_setMatr
vendor: 4,958 bytes, lines 44-48
44ixWorldNeedsUpdate],[Rn.prototype._setValue_arrayElement,Rn.prototype._setValue_arrayElement_setNeedsUpdate,Rn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Rn.prototype._setValue_fromArray,Rn.prototype._setValue_fromArray_setNeedsUpdate,Rn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class u0{constructor(e=1,t=0,r=0){this.radius=e,this.phi=t,this.theta=r}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=hn(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(hn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class TI extends xA{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function h0(n,e,t,r){const i=II(r);switch(t){case Ey:return n*e;case ig:return n*e/i.components*i.byteLength;case sg:return n*e/i.components*i.byteLength;case Ty:return n*e*2/i.components*i.byteLength;case ag:return n*e*2/i.components*i.byteLength;case Sy:return n*e*3/i.components*i.byteLength;case Zi:return n*e*4/i.components*i.byteLength;case og:return n*e*4/i.components*i.byteLength;case kh:case $h:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Qh:case Hh:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case om:case lm:return Math.max(n,16)*Math.max(e,8)/4;case am:case Am:return Math.max(n,8)*Math.max(e,8)/2;case cm:case um:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case hm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case fm:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case dm:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case pm:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case mm:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case gm:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case ym:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case vm:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case wm:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case xm:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case bm:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Cm:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case _m:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Bm:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Em:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Vh:case Sm:case Tm:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Iy:case Im:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Fm:case Rm:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function II(n){switch(n){case Ks:case Cy:return{byteLength:1,components:1};case $c:case _y:case cu:return{byteLength:2,components:1};case ng:case rg:return{byteLength:2,components:4};case oA:case tg:case _s:return{byteLength:4,components:1};case By:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:eg}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=eg);/** 45 * @license 46 * Copyright 2010-2025 Three.js Authors 47 * SPDX-License-Identifier: MIT 48 */function qy(){let n=null,e=!1,t=null,r=null;function i(s,a){t(s,a),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function FI(n){const e=new WeakMap;function t(o,A){const l=o.array,c=o.usage,u=l.byteLength,h=n.createBuffer();n.bindBuffer(A,h),n.bufferData(A,l,c),o.onUploadCallback();let f;if(l instanceof Float32Array)f=n.FLOAT;else if(l instanceof Uint16Array)o.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(l instanceof Int16Array)f=n.SHORT;else if(l instanceof Uint32Array)f=n.UNSIGNED_INT;else if(l instanceof Int32Array)f=n.INT;else if(l instanceof Int8Array)f=n.BYTE;else if(l instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:h,type:f,bytesPerElement:l.BYTES_PER_ELEMENT,version:o.version,size:u}}function r(o,A,l){const c=A.array,u=A.updateRanges;if(n.bindBuffer(l,o),u.length===0)n.bufferSubData(l,0,c);else{u.sort((f,d)=>
vendor: 5,235 bytes, lines 48-161
48f.start-d.start);let h=0;for(let f=1;f<u.length;f++){const d=u[h],g=u[f];g.start<=d.start+d.count+1?d.count=Math.max(d.count,g.start+g.count-d.start):(++h,u[h]=g)}u.length=h+1;for(let f=0,d=u.length;f<d;f++){const g=u[f];n.bufferSubData(l,g.start*c.BYTES_PER_ELEMENT,c,g.start,g.count)}A.clearUpdateRanges()}A.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const A=e.get(o);A&&(n.deleteBuffer(A.buffer),e.delete(o))}function a(o,A){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const c=e.get(o);(!c||c.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const l=e.get(o);if(l===void 0)e.set(o,t(o,A));else if(l.version<o.version){if(l.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");r(l.buffer,o,A),l.version=o.version}}return{get:i,remove:s,update:a}}var RI=`#ifdef USE_ALPHAHASH 49 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 50#endif`,UI=`#ifdef USE_ALPHAHASH 51 const float ALPHA_HASH_SCALE = 0.05; 52 float hash2D( vec2 value ) { 53 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 54 } 55 float hash3D( vec3 value ) { 56 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 57 } 58 float getAlphaHashThreshold( vec3 position ) { 59 float maxDeriv = max( 60 length( dFdx( position.xyz ) ), 61 length( dFdy( position.xyz ) ) 62 ); 63 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 64 vec2 pixScales = vec2( 65 exp2( floor( log2( pixScale ) ) ), 66 exp2( ceil( log2( pixScale ) ) ) 67 ); 68 vec2 alpha = vec2( 69 hash3D( floor( pixScales.x * position.xyz ) ), 70 hash3D( floor( pixScales.y * position.xyz ) ) 71 ); 72 float lerpFactor = fract( log2( pixScale ) ); 73 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 74 float a = min( lerpFactor, 1.0 - lerpFactor ); 75 vec3 cases = vec3( 76 x * x / ( 2.0 * a * ( 1.0 - a ) ), 77 ( x - 0.5 * a ) / ( 1.0 - a ), 78 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 79 ); 80 float threshold = ( x < ( 1.0 - a ) ) 81 ? ( ( x < a ) ? cases.x : cases.y ) 82 : cases.z; 83 return clamp( threshold , 1.0e-6, 1.0 ); 84 } 85#endif`,MI=`#ifdef USE_ALPHAMAP 86 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 87#endif`,NI=`#ifdef USE_ALPHAMAP 88 uniform sampler2D alphaMap; 89#endif`,DI=`#ifdef USE_ALPHATEST 90 #ifdef ALPHA_TO_COVERAGE 91 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 92 if ( diffuseColor.a == 0.0 ) discard; 93 #else 94 if ( diffuseColor.a < alphaTest ) discard; 95 #endif 96#endif`,LI=`#ifdef USE_ALPHATEST 97 uniform float alphaTest; 98#endif`,OI=`#ifdef USE_AOMAP 99 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 100 reflectedLight.indirectDiffuse *= ambientOcclusion; 101 #if defined( USE_CLEARCOAT ) 102 clearcoatSpecularIndirect *= ambientOcclusion; 103 #endif 104 #if defined( USE_SHEEN ) 105 sheenSpecularIndirect *= ambientOcclusion; 106 #endif 107 #if defined( USE_ENVMAP ) && defined( STANDARD ) 108 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 109 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 110 #endif 111#endif`,PI=`#ifdef USE_AOMAP 112 uniform sampler2D aoMap; 113 uniform float aoMapIntensity; 114#endif`,kI=`#ifdef USE_BATCHING 115 #if ! defined( GL_ANGLE_multi_draw ) 116 #define gl_DrawID _gl_DrawID 117 uniform int _gl_DrawID; 118 #endif 119 uniform highp sampler2D batchingTexture; 120 uniform highp usampler2D batchingIdTexture; 121 mat4 getBatchingMatrix( const in float i ) { 122 int size = textureSize( batchingTexture, 0 ).x; 123 int j = int( i ) * 4; 124 int x = j % size; 125 int y = j / size; 126 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 127 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 128 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 129 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 130 return mat4( v1, v2, v3, v4 ); 131 } 132 float getIndirectIndex( const in int i ) { 133 int size = textureSize( batchingIdTexture, 0 ).x; 134 int x = i % size; 135 int y = i / size; 136 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 137 } 138#endif 139#ifdef USE_BATCHING_COLOR 140 uniform sampler2D batchingColorTexture; 141 vec3 getBatchingColor( const in float i ) { 142 int size = textureSize( batchingColorTexture, 0 ).x; 143 int j = int( i ); 144 int x = j % size; 145 int y = j / size; 146 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; 147 } 148#endif`,$I=`#ifdef USE_BATCHING 149 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 150#endif`,QI=`vec3 transformed = vec3( position ); 151#ifdef USE_ALPHAHASH 152 vPosition = vec3( position ); 153#endif`,HI=`vec3 objectNormal = vec3( normal ); 154#ifdef USE_TANGENT 155 vec3 objectTangent = vec3( tangent.xyz ); 156#endif`,VI=`float G_BlinnPhong_Implicit( ) { 157 return 0.25; 158} 159float D_BlinnPhong( const in float shininess, const in float dotNH ) { 160 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 161}
162vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 163 vec3 halfDir = normalize( lightDir + viewDir ); 164 float dotNH = saturate( dot( normal, halfDir ) ); 165 float dotVH = saturate( dot( viewDir, halfDir ) ); 166 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 167 float G = G_BlinnPhong_Implicit( ); 168 float D = D_BlinnPhong( shininess, dotNH ); 169 return F * ( G * D ); 170} // validated`,GI=`#ifdef USE_IRIDESCENCE 171 const mat3 XYZ_TO_REC709 = mat3( 172 3.2404542, -0.9692660, 0.0556434, 173 -1.5371385, 1.8760108, -0.2040259, 174 -0.4985314, 0.0415560, 1.0572252 175 ); 176 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 177 vec3 sqrtF0 = sqrt( fresnel0 ); 178 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 179 } 180 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 181 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 182 } 183 float IorToFresnel0( float transmittedIor, float incidentIor ) { 184 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 185 } 186 vec3 evalSensitivity( float OPD, vec3 shift ) { 187 float phase = 2.0 * PI * OPD * 1.0e-9; 188 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 189 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 190 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 191 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 192 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 193 xyz /= 1.0685e-7; 194 vec3 rgb = XYZ_TO_REC709 * xyz; 195 return rgb; 196 } 197 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 198 vec3 I; 199 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 200 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 201 float cosTheta2Sq = 1.0 - sinTheta2Sq; 202 if ( cosTheta2Sq < 0.0 ) { 203 return vec3( 1.0 ); 204 } 205 float cosTheta2 = sqrt( cosTheta2Sq ); 206 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 207 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
208 float T121 = 1.0 - R12; 209 float phi12 = 0.0; 210 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 211 float phi21 = PI - phi12; 212 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 213 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 214 vec3 phi23 = vec3( 0.0 ); 215 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 216 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 217 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 218 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 219 vec3 phi = vec3( phi21 ) + phi23; 220 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 221 vec3 r123 = sqrt( R123 ); 222 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 223 vec3 C0 = R12 + Rs; 224 I = C0; 225 vec3 Cm = Rs - T121; 226 for ( int m = 1; m <= 2; ++ m ) { 227 Cm *= r123; 228 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 229 I += Cm * Sm; 230 } 231 return max( I, vec3( 0.0 ) ); 232 } 233#endif`,zI=`#ifdef USE_BUMPMAP 234 uniform sampler2D bumpMap; 235 uniform float bumpScale; 236 vec2 dHdxy_fwd() { 237 vec2 dSTdx = dFdx( vBumpMapUv ); 238 vec2 dSTdy = dFdy( vBumpMapUv ); 239 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 240 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 241 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 242 return vec2( dBx, dBy ); 243 } 244 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 245 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 246 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 247 vec3 vN = surf_norm; 248 vec3 R1 = cross( vSigmaY, vN ); 249 vec3 R2 = cross( vN, vSigmaX ); 250 float fDet = dot( vSigmaX, R1 ) * faceDirection; 251 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 252 return normalize( abs( fDet ) * surf_norm - vGrad ); 253 } 254#endif`,WI=`#if NUM_CLIPPING_PLANES > 0 255 vec4 plane; 256 #ifdef ALPHA_TO_COVERAGE 257 float distanceToPlane, distanceGradient; 258 float clipOpacity = 1.0; 259 #pragma unroll_loop_start 260 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 261 plane = clippingPlanes[ i ]; 262 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 263 distanceGradient = fwidth( distanceToPlane ) / 2.0; 264 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 265 if ( clipOpacity == 0.0 ) discard; 266 } 267 #pragma unroll_loop_end 268 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 269 float unionClipOpacity = 1.0; 270 #pragma unroll_loop_start 271 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 272 plane = clippingPlanes[ i ]; 273 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 274 distanceGradient = fwidth( distanceToPlane ) / 2.0; 275 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 276 } 277 #pragma unroll_loop_end 278 clipOpacity *= 1.0 - unionClipOpacity; 279 #endif 280 diffuseColor.a *= clipOpacity; 281 if ( diffuseColor.a == 0.0 ) discard; 282 #else 283 #pragma unroll_loop_start 284 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 285 plane = clippingPlanes[ i ]; 286 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 287 } 288 #pragma unroll_loop_end 289 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 290 bool clipped = true; 291 #pragma unroll_loop_start 292 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 293 plane = clippingPlanes[ i ]; 294 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 295 } 296 #pragma unroll_loop_end 297 if ( clipped ) discard; 298 #endif 299 #endif 300#endif`,KI=`#if NUM_CLIPPING_PLANES > 0 301 varying vec3 vClipPosition; 302 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 303#endif`,XI=`#if NUM_CLIPPING_PLANES > 0 304 varying vec3 vClipPosition; 305#endif`,jI=`#if NUM_CLIPPING_PLANES > 0 306 vClipPosition = - mvPosition.xyz; 307#endif`,YI=`#if defined( USE_COLOR_ALPHA ) 308 diffuseColor *= vColor; 309#elif defined( USE_COLOR ) 310 diffuseColor.rgb *= vColor; 311#endif`,qI=`#if defined( USE_COLOR_ALPHA ) 312 varying vec4 vColor; 313#elif defined( USE_COLOR ) 314 varying vec3 vColor; 315#endif`,JI=`#if defined( USE_COLOR_ALPHA ) 316 varying vec4 vColor; 317#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 318 varying vec3 vColor; 319#endif`,ZI=`#if defined( USE_COLOR_ALPHA ) 320 vColor = vec4( 1.0 ); 321#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 322 vColor = vec3( 1.0 ); 323#endif 324#ifdef USE_COLOR 325 vColor *= color; 326#endif 327#ifdef USE_INSTANCING_COLOR 328 vColor.xyz *= instanceColor.xyz; 329#endif 330#ifdef USE_BATCHING_COLOR 331 vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); 332 vColor.xyz *= batchingColor.xyz; 333#endif`,eF=`#define PI 3.141592653589793 334#define PI2 6.283185307179586 335#define PI_HALF 1.5707963267948966 336#define RECIPROCAL_PI 0.3183098861837907 337#define RECIPROCAL_PI2 0.15915494309189535 338#define EPSILON 1e-6 339#ifndef saturate 340#define saturate( a ) clamp( a, 0.0, 1.0 ) 341#endif 342#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 343float pow2( const in float x ) { return x*x; } 344vec3 pow2( const in vec3 x ) { return x*x; } 345float pow3( const in float x ) { return x*x*x; } 346float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 347float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 348float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 349highp float rand( const in vec2 uv ) { 350 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 351 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 352 return fract( sin( sn ) * c ); 353} 354#ifdef HIGH_PRECISION 355 float precisionSafeLength( vec3 v ) { return length( v ); } 356#else 357 float precisionSafeLength( vec3 v ) { 358 float maxComponent = max3( abs( v ) ); 359 return length( v / maxComponent ) * maxComponent; 360 } 361#endif 362struct IncidentLight { 363 vec3 color; 364 vec3 direction; 365 bool visible; 366}; 367struct ReflectedLight { 368 vec3 directDiffuse; 369 vec3 directSpecular; 370 vec3 indirectDiffuse; 371 vec3 indirectSpecular; 372}; 373#ifdef USE_ALPHAHASH 374 varying vec3 vPosition; 375#endif 376vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 377 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 378} 379vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 380 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 381} 382mat3 transposeMat3( const in mat3 m ) { 383 mat3 tmp; 384 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 385 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 386 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 387 return tmp; 388} 389bool isPerspectiveMatrix( mat4 m ) { 390 return m[ 2 ][ 3 ] == - 1.0; 391} 392vec2 equirectUv( in vec3 dir ) { 393 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 394 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 395 return vec2( u, v ); 396}
397vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 398 return RECIPROCAL_PI * diffuseColor; 399} 400vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 401 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 402 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 403} 404float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 405 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 406 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 407} // validated`,tF=`#ifdef ENVMAP_TYPE_CUBE_UV 408 #define cubeUV_minMipLevel 4.0 409 #define cubeUV_minTileSize 16.0 410 float getFace( vec3 direction ) { 411 vec3 absDirection = abs( direction ); 412 float face = - 1.0; 413 if ( absDirection.x > absDirection.z ) { 414 if ( absDirection.x > absDirection.y ) 415 face = direction.x > 0.0 ? 0.0 : 3.0; 416 else 417 face = direction.y > 0.0 ? 1.0 : 4.0; 418 } else { 419 if ( absDirection.z > absDirection.y ) 420 face = direction.z > 0.0 ? 2.0 : 5.0; 421 else 422 face = direction.y > 0.0 ? 1.0 : 4.0; 423 } 424 return face; 425 } 426 vec2 getUV( vec3 direction, float face ) { 427 vec2 uv; 428 if ( face == 0.0 ) { 429 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 430 } else if ( face == 1.0 ) { 431 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 432 } else if ( face == 2.0 ) { 433 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 434 } else if ( face == 3.0 ) { 435 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 436 } else if ( face == 4.0 ) { 437 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 438 } else { 439 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 440 } 441 return 0.5 * ( uv + 1.0 ); 442 } 443 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 444 float face = getFace( direction ); 445 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 446 mipInt = max( mipInt, cubeUV_minMipLevel ); 447 float faceSize = exp2( mipInt ); 448 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 449 if ( face > 2.0 ) { 450 uv.y += faceSize; 451 face -= 3.0; 452 } 453 uv.x += face * faceSize; 454 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 455 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 456 uv.x *= CUBEUV_TEXEL_WIDTH; 457 uv.y *= CUBEUV_TEXEL_HEIGHT; 458 #ifdef texture2DGradEXT 459 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 460 #else 461 return texture2D( envMap, uv ).rgb; 462 #endif 463 } 464 #define cubeUV_r0 1.0 465 #define cubeUV_m0 - 2.0 466 #define cubeUV_r1 0.8 467 #define cubeUV_m1 - 1.0 468 #define cubeUV_r4 0.4 469 #define cubeUV_m4 2.0 470 #define cubeUV_r5 0.305 471 #define cubeUV_m5 3.0 472 #define cubeUV_r6 0.21 473 #define cubeUV_m6 4.0 474 float roughnessToMip( float roughness ) { 475 float mip = 0.0; 476 if ( roughness >= cubeUV_r1 ) { 477 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 478 } else if ( roughness >= cubeUV_r4 ) { 479 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 480 } else if ( roughness >= cubeUV_r5 ) { 481 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 482 } else if ( roughness >= cubeUV_r6 ) { 483 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 484 } else { 485 mip = - 2.0 * log2( 1.16 * roughness ); } 486 return mip; 487 } 488 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 489 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 490 float mipF = fract( mip ); 491 float mipInt = floor( mip ); 492 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 493 if ( mipF == 0.0 ) { 494 return vec4( color0, 1.0 ); 495 } else { 496 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 497 return vec4( mix( color0, color1, mipF ), 1.0 ); 498 } 499 } 500#endif`,nF=`vec3 transformedNormal = objectNormal; 501#ifdef USE_TANGENT 502 vec3 transformedTangent = objectTangent; 503#endif 504#ifdef USE_BATCHING 505 mat3 bm = mat3( batchingMatrix ); 506 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 507 transformedNormal = bm * transformedNormal; 508 #ifdef USE_TANGENT 509 transformedTangent = bm * transformedTangent; 510 #endif 511#endif 512#ifdef USE_INSTANCING 513 mat3 im = mat3( instanceMatrix ); 514 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 515 transformedNormal = im * transformedNormal; 516 #ifdef USE_TANGENT 517 transformedTangent = im * transformedTangent; 518 #endif 519#endif 520transformedNormal = normalMatrix * transformedNormal; 521#ifdef FLIP_SIDED 522 transformedNormal = - transformedNormal; 523#endif 524#ifdef USE_TANGENT 525 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 526 #ifdef FLIP_SIDED 527 transformedTangent = - transformedTangent; 528 #endif 529#endif`,rF=`#ifdef USE_DISPLACEMENTMAP 530 uniform sampler2D displacementMap; 531 uniform float displacementScale; 532 uniform float displacementBias; 533#endif`,iF=`#ifdef USE_DISPLACEMENTMAP 534 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
534placementBias ); 535#endif`,sF=`#ifdef USE_EMISSIVEMAP 536 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 537 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 538 emissiveColor = sRGBTransferEOTF( emissiveColor ); 539 #endif 540 totalEmissiveRadiance *= emissiveColor.rgb; 541#endif`,aF=`#ifdef USE_EMISSIVEMAP 542 uniform sampler2D emissiveMap; 543#endif`,oF="gl_FragColor = linearToOutputTexel( gl_FragColor );",AF=`vec4 LinearTransferOETF( in vec4 value ) { 544 return value; 545} 546vec4 sRGBTransferEOTF( in vec4 value ) { 547 return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); 548} 549vec4 sRGBTransferOETF( in vec4 value ) { 550 return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); 551}`,lF=`#ifdef USE_ENVMAP 552 #ifdef ENV_WORLDPOS 553 vec3 cameraToFrag; 554 if ( isOrthographic ) { 555 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 556 } else { 557 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 558 } 559 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 560 #ifdef ENVMAP_MODE_REFLECTION 561 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 562 #else 563 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 564 #endif 565 #else 566 vec3 reflectVec = vReflect; 567 #endif 568 #ifdef ENVMAP_TYPE_CUBE 569 vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 570 #else 571 vec4 envColor = vec4( 0.0 ); 572 #endif 573 #ifdef ENVMAP_BLENDING_MULTIPLY 574 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 575 #elif defined( ENVMAP_BLENDING_MIX ) 576 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 577 #elif defined( ENVMAP_BLENDING_ADD ) 578 outgoingLight += envColor.xyz * specularStrength * reflectivity; 579 #endif 580#endif`,cF=`#ifdef USE_ENVMAP 581 uniform float envMapIntensity; 582 uniform float flipEnvMap; 583 uniform mat3 envMapRotation; 584 #ifdef ENVMAP_TYPE_CUBE 585 uniform samplerCube envMap; 586 #else 587 uniform sampler2D envMap; 588 #endif 589 590#endif`,uF=`#ifdef USE_ENVMAP 591 uniform float reflectivity; 592 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 593 #define ENV_WORLDPOS 594 #endif 595 #ifdef ENV_WORLDPOS 596 varying vec3 vWorldPosition; 597 uniform float refractionRatio; 598 #else 599 varying vec3 vReflect; 600 #endif 601#endif`,hF=`#ifdef USE_ENVMAP 602 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 603 #define ENV_WORLDPOS 604 #endif 605 #ifdef ENV_WORLDPOS 606 607 varying vec3 vWorldPosition; 608 #else 609 varying vec3 vReflect; 610 uniform float refractionRatio; 611 #endif 612#endif`,fF=`#ifdef USE_ENVMAP 613 #ifdef ENV_WORLDPOS 614 vWorldPosition = worldPosition.xyz; 615 #else 616 vec3 cameraToVertex; 617 if ( isOrthographic ) { 618 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 619 } else {
620 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 621 } 622 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 623 #ifdef ENVMAP_MODE_REFLECTION 624 vReflect = reflect( cameraToVertex, worldNormal ); 625 #else 626 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 627 #endif 628 #endif 629#endif`,dF=`#ifdef USE_FOG 630 vFogDepth = - mvPosition.z; 631#endif`,pF=`#ifdef USE_FOG 632 varying float vFogDepth; 633#endif`,mF=`#ifdef USE_FOG 634 #ifdef FOG_EXP2 635 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 636 #else 637 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 638 #endif 639 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 640#endif`,gF=`#ifdef USE_FOG 641 uniform vec3 fogColor; 642 varying float vFogDepth; 643 #ifdef FOG_EXP2 644 uniform float fogDensity; 645 #else 646 uniform float fogNear; 647 uniform float fogFar; 648 #endif 649#endif`,yF=`#ifdef USE_GRADIENTMAP 650 uniform sampler2D gradientMap; 651#endif 652vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 653 float dotNL = dot( normal, lightDirection ); 654 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 655 #ifdef USE_GRADIENTMAP 656 return vec3( texture2D( gradientMap, coord ).r ); 657 #else 658 vec2 fw = fwidth( coord ) * 0.5; 659 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 660 #endif 661}`,vF=`#ifdef USE_LIGHTMAP 662 uniform sampler2D lightMap; 663 uniform float lightMapIntensity; 664#endif`,wF=`LambertMaterial material; 665material.diffuseColor = diffuseColor.rgb; 666material.specularStrength = specularStrength;`,xF=`varying vec3 vViewPosition; 667struct LambertMaterial { 668 vec3 diffuseColor; 669 float specularStrength; 670}; 671void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 672 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 673 vec3 irradiance = dotNL * directLight.color; 674 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 675} 676void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 677 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 678} 679#define RE_Direct RE_Direct_Lambert 680#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,bF=`uniform bool receiveShadow; 681uniform vec3 ambientLightColor; 682#if defined( USE_LIGHT_PROBES ) 683 uniform vec3 lightProbe[ 9 ]; 684#endif 685vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 686 float x = normal.x, y = normal.y, z = normal.z; 687 vec3 result = shCoefficients[ 0 ] * 0.886227; 688 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 689 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 690 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 691 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 692 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 693 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 694 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 695 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 696 return result; 697} 698vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 699 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 700 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 701 return irradiance; 702} 703vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 704 vec3 irradiance = ambientLightColor; 705 return irradiance; 706} 707float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 708 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 709 if ( cutoffDistance > 0.0 ) { 710 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 711 } 712 return distanceFalloff; 713} 714float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 715 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 716} 717#if NUM_DIR_LIGHTS > 0 718 struct DirectionalLight { 719 vec3 direction; 720 vec3 color; 721 }; 722 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 723 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 724 light.color = directionalLight.color; 725 light.direction = directionalLight.direction; 726 light.visible = true; 727 } 728#endif 729#if NUM_POINT_LIGHTS > 0 730 struct PointLight { 731 vec3 position; 732 vec3 color; 733 float distance; 734 float decay; 735 }; 736 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 737 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 738 vec3 lVector = pointLight.position - geometryPosition; 739 light.direction = normalize( lVector ); 740 float lightDistance = length( lVector ); 741 light.color = pointLight.color; 742 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 743 light.visible = ( light.color != vec3( 0.0 ) ); 744 } 745#endif
746#if NUM_SPOT_LIGHTS > 0 747 struct SpotLight { 748 vec3 position; 749 vec3 direction; 750 vec3 color; 751 float distance; 752 float decay; 753 float coneCos; 754 float penumbraCos; 755 }; 756 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 757 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 758 vec3 lVector = spotLight.position - geometryPosition; 759 light.direction = normalize( lVector ); 760 float angleCos = dot( light.direction, spotLight.direction ); 761 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 762 if ( spotAttenuation > 0.0 ) { 763 float lightDistance = length( lVector ); 764 light.color = spotLight.color * spotAttenuation; 765 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 766 light.visible = ( light.color != vec3( 0.0 ) ); 767 } else { 768 light.color = vec3( 0.0 ); 769 light.visible = false; 770 } 771 } 772#endif 773#if NUM_RECT_AREA_LIGHTS > 0 774 struct RectAreaLight { 775 vec3 color; 776 vec3 position; 777 vec3 halfWidth; 778 vec3 halfHeight; 779 }; 780 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 781 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 782#endif 783#if NUM_HEMI_LIGHTS > 0 784 struct HemisphereLight { 785 vec3 direction; 786 vec3 skyColor; 787 vec3 groundColor; 788 }; 789 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 790 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 791 float dotNL = dot( normal, hemiLight.direction ); 792 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 793 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 794 return irradiance; 795 } 796#endif`,CF=`#ifdef USE_ENVMAP 797 vec3 getIBLIrradiance( const in vec3 normal ) { 798 #ifdef ENVMAP_TYPE_CUBE_UV 799 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 800 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 801 return PI * envMapColor.rgb * envMapIntensity; 802 #else 803 return vec3( 0.0 ); 804 #endif 805 } 806 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 807 #ifdef ENVMAP_TYPE_CUBE_UV 808 vec3 reflectVec = reflect( - viewDir, normal ); 809 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 810 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 811 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 812 return envMapColor.rgb * envMapIntensity; 813 #else 814 return vec3( 0.0 ); 815 #endif 816 } 817 #ifdef USE_ANISOTROPY 818 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 819 #ifdef ENVMAP_TYPE_CUBE_UV 820 vec3 bentNormal = cross( bitangent, viewDir ); 821 bentNormal = normalize( cross( bentNormal, bitangent ) ); 822 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 823 return getIBLRadiance( viewDir, bentNormal, roughness ); 824 #else 825 return vec3( 0.0 ); 826 #endif 827 } 828 #endif 829#endif`,_F=`ToonMaterial material; 830material.diffuseColor = diffuseColor.rgb;`,BF=`varying vec3 vViewPosition; 831struct ToonMaterial { 832 vec3 diffuseColor; 833}; 834void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 835 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 836 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 837} 838void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 839 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 840} 841#define RE_Direct RE_Direct_Toon 842#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,EF=`BlinnPhongMaterial material; 843material.diffuseColor = diffuseColor.rgb; 844material.specularColor = specular; 845material.specularShininess = shininess; 846material.specularStrength = specularStrength;`,SF=`varying vec3 vViewPosition; 847struct BlinnPhongMaterial { 848 vec3 diffuseColor; 849 vec3 specularColor; 850 float specularShininess; 851 float specularStrength; 852}; 853void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
854 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 855 vec3 irradiance = dotNL * directLight.color; 856 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 857 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 858} 859void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 860 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 861} 862#define RE_Direct RE_Direct_BlinnPhong 863#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,TF=`PhysicalMaterial material; 864material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 865vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 866float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 867material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 868material.roughness = min( material.roughness, 1.0 ); 869#ifdef IOR 870 material.ior = ior; 871 #ifdef USE_SPECULAR 872 float specularIntensityFactor = specularIntensity; 873 vec3 specularColorFactor = specularColor; 874 #ifdef USE_SPECULAR_COLORMAP 875 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 876 #endif 877 #ifdef USE_SPECULAR_INTENSITYMAP 878 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 879 #endif 880 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 881 #else 882 float specularIntensityFactor = 1.0; 883 vec3 specularColorFactor = vec3( 1.0 ); 884 material.specularF90 = 1.0; 885 #endif 886 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 887#else 888 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 889 material.specularF90 = 1.0; 890#endif 891#ifdef USE_CLEARCOAT 892 material.clearcoat = clearcoat; 893 material.clearcoatRoughness = clearcoatRoughness; 894 material.clearcoatF0 = vec3( 0.04 ); 895 material.clearcoatF90 = 1.0; 896 #ifdef USE_CLEARCOATMAP 897 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 898 #endif 899 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 900 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 901 #endif 902 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 903 material.clearcoatRoughness += geometryRoughness; 904 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 905#endif 906#ifdef USE_DISPERSION 907 material.dispersion = dispersion; 908#endif 909#ifdef USE_IRIDESCENCE 910 material.iridescence = iridescence; 911 material.iridescenceIOR = iridescenceIOR; 912 #ifdef USE_IRIDESCENCEMAP 913 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 914 #endif 915 #ifdef USE_IRIDESCENCE_THICKNESSMAP 916 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 917 #else 918 material.iridescenceThickness = iridescenceThicknessMaximum; 919 #endif 920#endif 921#ifdef USE_SHEEN 922 material.sheenColor = sheenColor; 923 #ifdef USE_SHEEN_COLORMAP 924 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 925 #endif 926 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 927 #ifdef USE_SHEEN_ROUGHNESSMAP 928 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 929 #endif 930#endif 931#ifdef USE_ANISOTROPY 932 #ifdef USE_ANISOTROPYMAP 933 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 934 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 935 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 936 #else 937 vec2 anisotropyV = anisotropyVector; 938 #endif 939 material.anisotropy = length( anisotropyV ); 940 if( material.anisotropy == 0.0 ) { 941 anisotropyV = vec2( 1.0, 0.0 ); 942 } else { 943 anisotropyV /= material.anisotropy; 944 material.anisotropy = saturate( material.anisotropy ); 945 } 946 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
947 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 948 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 949#endif`,IF
vendor: 14,687 bytes, lines 949-1250
949=`struct PhysicalMaterial { 950 vec3 diffuseColor; 951 float roughness; 952 vec3 specularColor; 953 float specularF90; 954 float dispersion; 955 #ifdef USE_CLEARCOAT 956 float clearcoat; 957 float clearcoatRoughness; 958 vec3 clearcoatF0; 959 float clearcoatF90; 960 #endif 961 #ifdef USE_IRIDESCENCE 962 float iridescence; 963 float iridescenceIOR; 964 float iridescenceThickness; 965 vec3 iridescenceFresnel; 966 vec3 iridescenceF0; 967 #endif 968 #ifdef USE_SHEEN 969 vec3 sheenColor; 970 float sheenRoughness; 971 #endif 972 #ifdef IOR 973 float ior; 974 #endif 975 #ifdef USE_TRANSMISSION 976 float transmission; 977 float transmissionAlpha; 978 float thickness; 979 float attenuationDistance; 980 vec3 attenuationColor; 981 #endif 982 #ifdef USE_ANISOTROPY 983 float anisotropy; 984 float alphaT; 985 vec3 anisotropyT; 986 vec3 anisotropyB; 987 #endif 988}; 989vec3 clearcoatSpecularDirect = vec3( 0.0 ); 990vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 991vec3 sheenSpecularDirect = vec3( 0.0 ); 992vec3 sheenSpecularIndirect = vec3(0.0 ); 993vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 994 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 995 float x2 = x * x; 996 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 997 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 998} 999float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1000 float a2 = pow2( alpha ); 1001 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1002 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1003 return 0.5 / max( gv + gl, EPSILON ); 1004} 1005float D_GGX( const in float alpha, const in float dotNH ) { 1006 float a2 = pow2( alpha ); 1007 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1008 return RECIPROCAL_PI * a2 / pow2( denom ); 1009} 1010#ifdef USE_ANISOTROPY 1011 float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { 1012 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1013 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1014 float v = 0.5 / ( gv + gl ); 1015 return saturate(v); 1016 } 1017 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1018 float a2 = alphaT * alphaB; 1019 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1020 highp float v2 = dot( v, v ); 1021 float w2 = a2 / v2; 1022 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1023 } 1024#endif 1025#ifdef USE_CLEARCOAT 1026 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1027 vec3 f0 = material.clearcoatF0; 1028 float f90 = material.clearcoatF90; 1029 float roughness = material.clearcoatRoughness; 1030 float alpha = pow2( roughness ); 1031 vec3 halfDir = normalize( lightDir + viewDir ); 1032 float dotNL = saturate( dot( normal, lightDir ) ); 1033 float dotNV = saturate( dot( normal, viewDir ) ); 1034 float dotNH = saturate( dot( normal, halfDir ) ); 1035 float dotVH = saturate( dot( viewDir, halfDir ) ); 1036 vec3 F = F_Schlick( f0, f90, dotVH ); 1037 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1038 float D = D_GGX( alpha, dotNH ); 1039 return F * ( V * D ); 1040 } 1041#endif 1042vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1043 vec3 f0 = material.specularColor; 1044 float f90 = material.specularF90; 1045 float roughness = material.roughness; 1046 float alpha = pow2( roughness ); 1047 vec3 halfDir = normalize( lightDir + viewDir ); 1048 float dotNL = saturate( dot( normal, lightDir ) ); 1049 float dotNV = saturate( dot( normal, viewDir ) ); 1050 float dotNH = saturate( dot( normal, halfDir ) ); 1051 float dotVH = saturate( dot( viewDir, halfDir ) ); 1052 vec3 F = F_Schlick( f0, f90, dotVH ); 1053 #ifdef USE_IRIDESCENCE 1054 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1055 #endif 1056 #ifdef USE_ANISOTROPY 1057 float dotTL = dot( material.anisotropyT, lightDir ); 1058 float dotTV = dot( material.anisotropyT, viewDir ); 1059 float dotTH = dot( material.anisotropyT, halfDir ); 1060 float dotBL = dot( material.anisotropyB, lightDir ); 1061 float dotBV = dot( material.anisotropyB, viewDir ); 1062 float dotBH = dot( material.anisotropyB, halfDir ); 1063 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1064 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1065 #else 1066 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1067 float D = D_GGX( alpha, dotNH ); 1068 #endif 1069 return F * ( V * D ); 1070} 1071vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1072 const float LUT_SIZE = 64.0; 1073 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1074 const float LUT_BIAS = 0.5 / LUT_SIZE; 1075 float dotNV = saturate( dot( N, V ) ); 1076 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1077 uv = uv * LUT_SCALE + LUT_BIAS; 1078 return uv; 1079} 1080float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1081 float l = length( f ); 1082 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1083} 1084vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1085 float x = dot( v1, v2 ); 1086 float y = abs( x ); 1087 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1088 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1089 float v = a / b; 1090 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1091 return cross( v1, v2 ) * theta_sintheta; 1092} 1093vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1094 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1095 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1096 vec3 lightNormal = cross( v1, v2 ); 1097 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1098 vec3 T1, T2; 1099 T1 = normalize( V - N * dot( V, N ) ); 1100 T2 = - cross( N, T1 ); 1101 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1102 vec3 coords[ 4 ]; 1103 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1104 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1105 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1106 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1107 coords[ 0 ] = normalize( coords[ 0 ] ); 1108 coords[ 1 ] = normalize( coords[ 1 ] ); 1109 coords[ 2 ] = normalize( coords[ 2 ] ); 1110 coords[ 3 ] = normalize( coords[ 3 ] ); 1111 vec3 vectorFormFactor = vec3( 0.0 ); 1112 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1113 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1114 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1115 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1116 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1117 return vec3( result ); 1118} 1119#if defined( USE_SHEEN ) 1120float D_Charlie( float roughness, float dotNH ) { 1121 float alpha = pow2( roughness ); 1122 float invAlpha = 1.0 / alpha; 1123 float cos2h = dotNH * dotNH; 1124 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1125 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1126} 1127float V_Neubelt( float dotNV, float dotNL ) { 1128 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1129} 1130vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1131 vec3 halfDir = normalize( lightDir + viewDir ); 1132 float dotNL = saturate( dot( normal, lightDir ) ); 1133 float dotNV = saturate( dot( normal, viewDir ) ); 1134 float dotNH = saturate( dot( normal, halfDir ) ); 1135 float D = D_Charlie( sheenRoughness, dotNH ); 1136 float V = V_Neubelt( dotNV, dotNL ); 1137 return sheenColor * ( D * V ); 1138} 1139#endif 1140float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1141 float dotNV = saturate( dot( normal, viewDir ) ); 1142 float r2 = roughness * roughness; 1143 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1144 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1145 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1146 return saturate( DG * RECIPROCAL_PI ); 1147} 1148vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1149 float dotNV = saturate( dot( normal, viewDir ) ); 1150 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1151 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1152 vec4 r = roughness * c0 + c1; 1153 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1154 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1155 return fab; 1156} 1157vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1158 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1159 return specularColor * fab.x + specularF90 * fab.y; 1160} 1161#ifdef USE_IRIDESCENCE 1162void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1163#else 1164void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1165#endif 1166 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1167 #ifdef USE_IRIDESCENCE 1168 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1169 #else 1170 vec3 Fr = specularColor; 1171 #endif 1172 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1173 float Ess = fab.x + fab.y; 1174 float Ems = 1.0 - Ess; 1175 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1176 singleScatter += FssEss; 1177 multiScatter += Fms * Ems; 1178} 1179#if NUM_RECT_AREA_LIGHTS > 0 1180 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1181 vec3 normal = geometryNormal; 1182 vec3 viewDir = geometryViewDir; 1183 vec3 position = geometryPosition; 1184 vec3 lightPos = rectAreaLight.position; 1185 vec3 halfWidth = rectAreaLight.halfWidth; 1186 vec3 halfHeight = rectAreaLight.halfHeight; 1187 vec3 lightColor = rectAreaLight.color; 1188 float roughness = material.roughness; 1189 vec3 rectCoords[ 4 ]; 1190 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1191 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1192 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1193 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1194 vec4 t1 = texture2D( ltc_1, uv ); 1195 vec4 t2 = texture2D( ltc_2, uv ); 1196 mat3 mInv = mat3( 1197 vec3( t1.x, 0, t1.y ), 1198 vec3( 0, 1, 0 ), 1199 vec3( t1.z, 0, t1.w ) 1200 ); 1201 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1202 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1203 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1204 } 1205#endif 1206void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1207 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1208 vec3 irradiance = dotNL * directLight.color; 1209 #ifdef USE_CLEARCOAT 1210 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1211 vec3 ccIrradiance = dotNLcc * directLight.color; 1212 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1213 #endif 1214 #ifdef USE_SHEEN 1215 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1216 #endif 1217 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1218 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1219} 1220void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1221 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1222} 1223void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 1224 #ifdef USE_CLEARCOAT 1225 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1226 #endif 1227 #ifdef USE_SHEEN 1228 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1229 #endif 1230 vec3 singleScattering = vec3( 0.0 ); 1231 vec3 multiScattering = vec3( 0.0 ); 1232 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1233 #ifdef USE_IRIDESCENCE 1234 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 1235 #else 1236 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 1237 #endif 1238 vec3 totalScattering = singleScattering + multiScattering; 1239 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 1240 reflectedLight.indirectSpecular += radiance * singleScattering; 1241 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 1242 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 1243} 1244#define RE_Direct RE_Direct_Physical 1245#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1246#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1247#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1248float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1249 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1250}`,
1250FF=` 1251vec3 geometryPosition = - vViewPosition; 1252vec3 geometryNormal = normal; 1253vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1254vec3 geometryClearcoatNormal = vec3( 0.0 ); 1255#ifdef USE_CLEARCOAT 1256 geometryClearcoatNormal = clearcoatNormal; 1257#endif 1258#ifdef USE_IRIDESCENCE 1259 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1260 if ( material.iridescenceThickness == 0.0 ) { 1261 material.iridescence = 0.0; 1262 } else { 1263 material.iridescence = saturate( material.iridescence ); 1264 } 1265 if ( material.iridescence > 0.0 ) { 1266 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1267 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1268 } 1269#endif 1270IncidentLight directLight; 1271#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1272 PointLight pointLight; 1273 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1274 PointLightShadow pointLightShadow; 1275 #endif 1276 #pragma unroll_loop_start 1277 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1278 pointLight = pointLights[ i ]; 1279 getPointLightInfo( pointLight, geometryPosition, directLight ); 1280 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1281 pointLightShadow = pointLightShadows[ i ]; 1282 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1283 #endif 1284 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1285 } 1286 #pragma unroll_loop_end 1287#endif 1288#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1289 SpotLight spotLight; 1290 vec4 spotColor; 1291 vec3 spotLightCoord; 1292 bool inSpotLightMap; 1293 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1294 SpotLightShadow spotLightShadow; 1295 #endif 1296 #pragma unroll_loop_start 1297 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1298 spotLight = spotLights[ i ]; 1299 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1300 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1301 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1302 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1303 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1304 #else 1305 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1306 #endif 1307 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1308 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1309 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1310 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1311 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1312 #endif 1313 #undef SPOT_LIGHT_MAP_INDEX 1314 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1315 spotLightShadow = spotLightShadows[ i ]; 1316 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1317 #endif 1318 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1319 } 1320 #pragma unroll_loop_end 1321#endif 1322#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1323 DirectionalLight directionalLight; 1324 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1325 DirectionalLightShadow directionalLightShadow; 1326 #endif 1327 #pragma unroll_loop_start 1328 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1329 directionalLight = directionalLights[ i ]; 1330 getDirectionalLightInfo( directionalLight, directLight ); 1331 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1332 directionalLightShadow = directionalLightShadows[ i ]; 1333 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1334 #endif 1335 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1336 } 1337 #pragma unroll_loop_end 1338#endif 1339#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1340 RectAreaLight rectAreaLight; 1341 #pragma unroll_loop_start 1342 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1343 rectAreaLight = rectAreaLights[ i ]; 1344 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1345 } 1346 #pragma unroll_loop_end 1347#endif 1348#if defined( RE_IndirectDiffuse ) 1349 vec3 iblIrradiance = vec3( 0.0 ); 1350 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1351 #if defined( USE_LIGHT_PROBES ) 1352 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1353 #endif 1354 #if ( NUM_HEMI_LIGHTS > 0 ) 1355 #pragma unroll_loop_start 1356 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1357 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1358 } 1359 #pragma unroll_loop_end 1360 #endif 1361#endif 1362#if defined( RE_IndirectSpecular ) 1363 vec3 radiance = vec3( 0.0 ); 1364 vec3 clearcoatRadiance = vec3( 0.0 ); 1365#endif`,RF=`#if defined( RE_IndirectDiffuse ) 1366 #ifdef USE_LIGHTMAP 1367 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1368 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1369 irradiance += lightMapIrradiance; 1370 #endif 1371 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1372 iblIrradiance += getIBLIrradiance( geometryNormal ); 1373 #endif 1374#endif 1375#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1376 #ifdef USE_ANISOTROPY 1377 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1378 #else 1379 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1380 #endif 1381 #ifdef USE_CLEARCOAT 1382 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1383 #endif 1384#endif`,UF=`#if defined( RE_IndirectDiffuse ) 1385 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1386#endif 1387#if defined( RE_IndirectSpecular ) 1388 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1389#endif`,MF=`#if defined( USE_LOGDEPTHBUF ) 1390 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1391#endif`,NF=`#if defined( USE_LOGDEPTHBUF ) 1392 uniform float logDepthBufFC; 1393 varying float vFragDepth; 1394 varying float vIsPerspective; 1395#endif`,DF=`#ifdef USE_LOGDEPTHBUF 1396 varying float vFragDepth; 1397 varying float vIsPerspective; 1398#endif`,LF=`#ifdef USE_LOGDEPTHBUF 1399 vFragDepth = 1.0 + gl_Position.w; 1400 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1401#endif`,OF=`#ifdef USE_MAP 1402 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1403 #ifdef DECODE_VIDEO_TEXTURE 1404 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1405 #endif 1406 diffuseColor *= sampledDiffuseColor; 1407#endif`,PF=`#ifdef USE_MAP 1408 uniform sampler2D map; 1409#endif`,kF=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1410 #if defined( USE_POINTS_UV ) 1411 vec2 uv = vUv; 1412 #else 1413 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1414 #endif 1415#endif 1416#ifdef USE_MAP 1417 diffuseColor *= texture2D( map, uv ); 1418#endif 1419#ifdef USE_ALPHAMAP 1420 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1421#endif`,$F=`#if defined( USE_POINTS_UV ) 1422 varying vec2 vUv; 1423#else 1424 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1425 uniform mat3 uvTransform; 1426 #endif 1427#endif 1428#ifdef USE_MAP 1429 uniform sampler2D map; 1430#endif 1431#ifdef USE_ALPHAMAP 1432 uniform sampler2D alphaMap; 1433#endif`,QF=`float metalnessFactor = metalness; 1434#ifdef USE_METALNESSMAP 1435 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1436 metalnessFactor *= texelMetalness.b; 1437#endif`,HF=`#ifdef USE_METALNESSMAP 1438 uniform sampler2D metalnessMap; 1439#endif`,VF=`#ifdef USE_INSTANCING_MORPH 1440 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1441 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1442 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1443 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1444 } 1445#endif`,GF=`#if defined( USE_MORPHCOLORS ) 1446 vColor *= morphTargetBaseInfluence; 1447 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1448 #if defined( USE_COLOR_ALPHA ) 1449 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1450 #elif defined( USE_COLOR ) 1451 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1452 #endif 1453 } 1454#endif`,zF=`#ifdef USE_MORPHNORMALS 1455 objectNormal *= morphTargetBaseInfluence; 1456 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1457 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1458 } 1459#endif`,WF=`#ifdef USE_MORPHTARGETS 1460 #ifndef USE_INSTANCING_MORPH 1461 uniform float morphTargetBaseInfluence; 1462 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1463 #endif 1464 uniform sampler2DArray morphTargetsTexture; 1465 uniform ivec2 morphTargetsTextureSize; 1466 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1467 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1468 int y = texelIndex / morphTargetsTextureSize.x; 1469 int x = texelIndex - y * morphTargetsTextureSize.x; 1470 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1471 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1472 } 1473#endif`,KF=`#ifdef USE_MORPHTARGETS 1474 transformed *= morphTargetBaseInfluence; 1475 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1476 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1477 } 1478#endif`,XF=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1479#ifdef FLAT_SHADED 1480 vec3 fdx = dFdx( vViewPosition ); 1481 vec3 fdy = dFdy( vViewPosition ); 1482 vec3 normal = normalize( cross( fdx, fdy ) ); 1483#else 1484 vec3 normal = normalize( vNormal ); 1485 #ifdef DOUBLE_SIDED 1486 normal *= faceDirection; 1487 #endif 1488#endif 1489#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1490 #ifdef USE_TANGENT 1491 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1492 #else 1493 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1494 #if defined( USE_NORMALMAP ) 1495 vNormalMapUv 1496 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1497 vClearcoatNormalMapUv 1498 #else 1499 vUv 1500 #endif 1501 ); 1502 #endif 1503 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1504 tbn[0] *= faceDirection; 1505 tbn[1] *= faceDirection; 1506 #endif 1507#endif 1508#ifdef USE_CLEARCOAT_NORMALMAP 1509 #ifdef USE_TANGENT 1510 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1511 #else 1512 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1513 #endif 1514 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1515 tbn2[0] *= faceDirection; 1516 tbn2[1] *= faceDirection; 1517 #endif 1518#endif 1519vec3 nonPerturbedNormal = normal;`,jF=`#ifdef USE_NORMALMAP_OBJECTSPACE 1520 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1521 #ifdef FLIP_SIDED 1522 normal = - normal; 1523 #endif 1524 #ifdef DOUBLE_SIDED 1525 normal = normal * faceDirection; 1526 #endif 1527 normal = normalize( normalMatrix * normal ); 1528#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1529 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1530 mapN.xy *= normalScale; 1531 normal = normalize( tbn * mapN ); 1532#elif defined( USE_BUMPMAP )
1533 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1534#endif`,YF=`#ifndef FLAT_SHADED 1535 varying vec3 vNormal; 1536 #ifdef USE_TANGENT 1537 varying vec3 vTangent; 1538 varying vec3 vBitangent; 1539 #endif 1540#endif`,qF=`#ifndef FLAT_SHADED 1541 varying vec3 vNormal; 1542 #ifdef USE_TANGENT 1543 varying vec3 vTangent; 1544 varying vec3 vBitangent; 1545 #endif 1546#endif`,JF=`#ifndef FLAT_SHADED 1547 vNormal = normalize( transformedNormal ); 1548 #ifdef USE_TANGENT 1549 vTangent = normalize( transformedTangent ); 1550 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1551 #endif 1552#endif`,ZF=`#ifdef USE_NORMALMAP 1553 uniform sampler2D normalMap; 1554 uniform vec2 normalScale; 1555#endif 1556#ifdef USE_NORMALMAP_OBJECTSPACE 1557 uniform mat3 normalMatrix; 1558#endif 1559#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1560 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1561 vec3 q0 = dFdx( eye_pos.xyz ); 1562 vec3 q1 = dFdy( eye_pos.xyz ); 1563 vec2 st0 = dFdx( uv.st ); 1564 vec2 st1 = dFdy( uv.st ); 1565 vec3 N = surf_norm; 1566 vec3 q1perp = cross( q1, N ); 1567 vec3 q0perp = cross( N, q0 ); 1568 vec3 T = q1perp * st0.x + q0perp * st1.x; 1569 vec3 B = q1perp * st0.y + q0perp * st1.y; 1570 float det = max( dot( T, T ), dot( B, B ) ); 1571 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1572 return mat3( T * scale, B * scale, N ); 1573 } 1574#endif`,e6=`#ifdef USE_CLEARCOAT 1575 vec3 clearcoatNormal = nonPerturbedNormal; 1576#endif`,t6=`#ifdef USE_CLEARCOAT_NORMALMAP 1577 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1578 clearcoatMapN.xy *= clearcoatNormalScale; 1579 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1580#endif`,n6=`#ifdef USE_CLEARCOATMAP 1581 uniform sampler2D clearcoatMap; 1582#endif 1583#ifdef USE_CLEARCOAT_NORMALMAP 1584 uniform sampler2D clearcoatNormalMap; 1585 uniform vec2 clearcoatNormalScale; 1586#endif 1587#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1588 uniform sampler2D clearcoatRoughnessMap; 1589#endif`,r6=`#ifdef USE_IRIDESCENCEMAP 1590 uniform sampler2D iridescenceMap; 1591#endif 1592#ifdef USE_IRIDESCENCE_THICKNESSMAP 1593 uniform sampler2D iridescenceThicknessMap; 1594#endif`,i6=`#ifdef OPAQUE 1595diffuseColor.a = 1.0; 1596#endif 1597#ifdef USE_TRANSMISSION 1598diffuseColor.a *= material.transmissionAlpha; 1599#endif 1600gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,s6=`vec3 packNormalToRGB( const in vec3 normal ) { 1601 return normalize( normal ) * 0.5 + 0.5; 1602} 1603vec3 unpackRGBToNormal( const in vec3 rgb ) { 1604 return 2.0 * rgb.xyz - 1.0; 1605} 1606const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1607const float Inv255 = 1. / 255.; 1608const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1609const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1610const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1611const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1612vec4 packDepthToRGBA( const in float v ) { 1613 if( v <= 0.0 ) 1614 return vec4( 0., 0., 0., 0. ); 1615 if( v >= 1.0 ) 1616 return vec4( 1., 1., 1., 1. ); 1617 float vuf; 1618 float af = modf( v * PackFactors.a, vuf ); 1619 float bf = modf( vuf * ShiftRight8, vuf ); 1620 float gf = modf( vuf * ShiftRight8, vuf ); 1621 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1622} 1623vec3 packDepthToRGB( const in float v ) { 1624 if( v <= 0.0 ) 1625 return vec3( 0., 0., 0. ); 1626 if( v >= 1.0 ) 1627 return vec3( 1., 1., 1. ); 1628 float vuf; 1629 float bf = modf( v * PackFactors.b, vuf ); 1630 float gf = modf( vuf * ShiftRight8, vuf ); 1631 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1632} 1633vec2 packDepthToRG( const in float v ) { 1634 if( v <= 0.0 ) 1635 return vec2( 0., 0. ); 1636 if( v >= 1.0 ) 1637 return vec2( 1., 1. ); 1638 float vuf; 1639 float gf = modf( v * 256., vuf ); 1640 return vec2( vuf * Inv255, gf ); 1641} 1642float unpackRGBAToDepth( const in vec4 v ) { 1643 return dot( v, UnpackFactors4 ); 1644} 1645float unpackRGBToDepth( const in vec3 v ) { 1646 return dot( v, UnpackFactors3 ); 1647} 1648float unpackRGToDepth( const in vec2 v ) { 1649 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1650} 1651vec4 pack2HalfToRGBA( const in vec2 v ) {
1652 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1653 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1654} 1655vec2 unpackRGBATo2Half( const in vec4 v ) { 1656 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1657} 1658float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1659 return ( viewZ + near ) / ( near - far ); 1660} 1661float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1662 return depth * ( near - far ) - near; 1663} 1664float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1665 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1666} 1667float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1668 return ( near * far ) / ( ( far - near ) * depth - far ); 1669}`,a6=`#ifdef PREMULTIPLIED_ALPHA 1670 gl_FragColor.rgb *= gl_FragColor.a; 1671#endif`,o6=`vec4 mvPosition = vec4( transformed, 1.0 ); 1672#ifdef USE_BATCHING 1673 mvPosition = batchingMatrix * mvPosition; 1674#endif 1675#ifdef USE_INSTANCING 1676 mvPosition = instanceMatrix * mvPosition; 1677#endif 1678mvPosition = modelViewMatrix * mvPosition; 1679gl_Position = projectionMatrix * mvPosition;`,A6=`#ifdef DITHERING 1680 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1681#endif`,l6=`#ifdef DITHERING 1682 vec3 dithering( vec3 color ) { 1683 float grid_position = rand( gl_FragCoord.xy ); 1684 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1685 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1686 return color + dither_shift_RGB; 1687 } 1688#endif`,c6=`float roughnessFactor = roughness; 1689#ifdef USE_ROUGHNESSMAP 1690 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1691 roughnessFactor *= texelRoughness.g; 1692#endif`,u6=`#ifdef USE_ROUGHNESSMAP 1693 uniform sampler2D roughnessMap; 1694#endif`,h6=
vendor: 8,887 bytes, lines 1694-1880
1694`#if NUM_SPOT_LIGHT_COORDS > 0 1695 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1696#endif 1697#if NUM_SPOT_LIGHT_MAPS > 0 1698 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1699#endif 1700#ifdef USE_SHADOWMAP 1701 #if NUM_DIR_LIGHT_SHADOWS > 0 1702 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1703 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1704 struct DirectionalLightShadow { 1705 float shadowIntensity; 1706 float shadowBias; 1707 float shadowNormalBias; 1708 float shadowRadius; 1709 vec2 shadowMapSize; 1710 }; 1711 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1712 #endif 1713 #if NUM_SPOT_LIGHT_SHADOWS > 0 1714 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1715 struct SpotLightShadow { 1716 float shadowIntensity; 1717 float shadowBias; 1718 float shadowNormalBias; 1719 float shadowRadius; 1720 vec2 shadowMapSize; 1721 }; 1722 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1723 #endif 1724 #if NUM_POINT_LIGHT_SHADOWS > 0 1725 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1726 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1727 struct PointLightShadow { 1728 float shadowIntensity; 1729 float shadowBias; 1730 float shadowNormalBias; 1731 float shadowRadius; 1732 vec2 shadowMapSize; 1733 float shadowCameraNear; 1734 float shadowCameraFar; 1735 }; 1736 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1737 #endif 1738 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 1739 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 1740 } 1741 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 1742 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 1743 } 1744 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 1745 float occlusion = 1.0; 1746 vec2 distribution = texture2DDistribution( shadow, uv ); 1747 float hard_shadow = step( compare , distribution.x ); 1748 if (hard_shadow != 1.0 ) { 1749 float distance = compare - distribution.x ; 1750 float variance = max( 0.00000, distribution.y * distribution.y ); 1751 float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); 1752 } 1753 return occlusion; 1754 } 1755 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1756 float shadow = 1.0; 1757 shadowCoord.xyz /= shadowCoord.w; 1758 shadowCoord.z += shadowBias; 1759 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1760 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1761 if ( frustumTest ) { 1762 #if defined( SHADOWMAP_TYPE_PCF ) 1763 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1764 float dx0 = - texelSize.x * shadowRadius; 1765 float dy0 = - texelSize.y * shadowRadius; 1766 float dx1 = + texelSize.x * shadowRadius; 1767 float dy1 = + texelSize.y * shadowRadius; 1768 float dx2 = dx0 / 2.0; 1769 float dy2 = dy0 / 2.0; 1770 float dx3 = dx1 / 2.0; 1771 float dy3 = dy1 / 2.0; 1772 shadow = ( 1773 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 1774 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 1775 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 1776 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 1777 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 1778 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 1779 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 1780 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 1781 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 1782 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 1783 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 1784 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 1785 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 1786 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 1787 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 1788 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 1789 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 1790 ) * ( 1.0 / 17.0 ); 1791 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 1792 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1793 float dx = texelSize.x; 1794 float dy = texelSize.y; 1795 vec2 uv = shadowCoord.xy; 1796 vec2 f = fract( uv * shadowMapSize + 0.5 ); 1797 uv -= f * texelSize; 1798 shadow = ( 1799 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 1800 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 1801 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 1802 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 1803 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 1804 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 1805 f.x ) + 1806 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 1807 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 1808 f.x ) + 1809 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 1810 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 1811 f.y ) + 1812 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 1813 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 1814 f.y ) + 1815 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 1816 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 1817 f.x ), 1818 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 1819 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 1820 f.x ), 1821 f.y ) 1822 ) * ( 1.0 / 9.0 ); 1823 #elif defined( SHADOWMAP_TYPE_VSM ) 1824 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 1825 #else 1826 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 1827 #endif 1828 } 1829 return mix( 1.0, shadow, shadowIntensity ); 1830 } 1831 vec2 cubeToUV( vec3 v, float texelSizeY ) { 1832 vec3 absV = abs( v ); 1833 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 1834 absV *= scaleToCube; 1835 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 1836 vec2 planar = v.xy; 1837 float almostATexel = 1.5 * texelSizeY; 1838 float almostOne = 1.0 - almostATexel; 1839 if ( absV.z >= almostOne ) { 1840 if ( v.z > 0.0 ) 1841 planar.x = 4.0 - v.x; 1842 } else if ( absV.x >= almostOne ) { 1843 float signX = sign( v.x ); 1844 planar.x = v.z * signX + 2.0 * signX; 1845 } else if ( absV.y >= almostOne ) { 1846 float signY = sign( v.y ); 1847 planar.x = v.x + 2.0 * signY + 2.0; 1848 planar.y = v.z * signY - 2.0; 1849 } 1850 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 1851 } 1852 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1853 float shadow = 1.0; 1854 vec3 lightToPosition = shadowCoord.xyz; 1855 1856 float lightToPositionLength = length( lightToPosition ); 1857 if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { 1858 float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 1859 vec3 bd3D = normalize( lightToPosition ); 1860 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 1861 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 1862 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 1863 shadow = ( 1864 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 1865 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 1866 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 1867 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 1868 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 1869 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 1870 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 1871 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 1872 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 1873 ) * ( 1.0 / 9.0 ); 1874 #else 1875 shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 1876 #endif 1877 } 1878 return mix( 1.0, shadow, shadowIntensity ); 1879 } 1880#endif`,
1880f6=`#if NUM_SPOT_LIGHT_COORDS > 0 1881 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1882 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1883#endif 1884#ifdef USE_SHADOWMAP 1885 #if NUM_DIR_LIGHT_SHADOWS > 0 1886 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1887 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1888 struct DirectionalLightShadow { 1889 float shadowIntensity; 1890 float shadowBias; 1891 float shadowNormalBias; 1892 float shadowRadius; 1893 vec2 shadowMapSize; 1894 }; 1895 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1896 #endif 1897 #if NUM_SPOT_LIGHT_SHADOWS > 0 1898 struct SpotLightShadow { 1899 float shadowIntensity; 1900 float shadowBias; 1901 float shadowNormalBias; 1902 float shadowRadius; 1903 vec2 shadowMapSize; 1904 }; 1905 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1906 #endif 1907 #if NUM_POINT_LIGHT_SHADOWS > 0 1908 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1909 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1910 struct PointLightShadow { 1911 float shadowIntensity; 1912 float shadowBias; 1913 float shadowNormalBias; 1914 float shadowRadius; 1915 vec2 shadowMapSize; 1916 float shadowCameraNear; 1917 float shadowCameraFar; 1918 }; 1919 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1920 #endif 1921#endif`,d6=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 1922 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1923 vec4 shadowWorldPosition; 1924#endif 1925#if defined( USE_SHADOWMAP ) 1926 #if NUM_DIR_LIGHT_SHADOWS > 0 1927 #pragma unroll_loop_start 1928 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1929 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 1930 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 1931 } 1932 #pragma unroll_loop_end 1933 #endif 1934 #if NUM_POINT_LIGHT_SHADOWS > 0 1935 #pragma unroll_loop_start 1936 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1937 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 1938 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 1939 } 1940 #pragma unroll_loop_end 1941 #endif 1942#endif 1943#if NUM_SPOT_LIGHT_COORDS > 0 1944 #pragma unroll_loop_start 1945 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 1946 shadowWorldPosition = worldPosition; 1947 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1948 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 1949 #endif 1950 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 1951 } 1952 #pragma unroll_loop_end 1953#endif`,p6=`float getShadowMask() { 1954 float shadow = 1.0; 1955 #ifdef USE_SHADOWMAP 1956 #if NUM_DIR_LIGHT_SHADOWS > 0 1957 DirectionalLightShadow directionalLight; 1958 #pragma unroll_loop_start 1959 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1960 directionalLight = directionalLightShadows[ i ]; 1961 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1962 } 1963 #pragma unroll_loop_end 1964 #endif 1965 #if NUM_SPOT_LIGHT_SHADOWS > 0 1966 SpotLightShadow spotLight; 1967 #pragma unroll_loop_start 1968 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 1969 spotLight = spotLightShadows[ i ]; 1970 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1971 } 1972 #pragma unroll_loop_end 1973 #endif 1974 #if NUM_POINT_LIGHT_SHADOWS > 0 1975 PointLightShadow pointLight; 1976 #pragma unroll_loop_start 1977 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1978 pointLight = pointLightShadows[ i ]; 1979 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 1980 } 1981 #pragma unroll_loop_end 1982 #endif 1983 #endif 1984 return shadow; 1985}`,m6=`#ifdef USE_SKINNING 1986 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 1987 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 1988 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 1989 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 1990#endif`,g6=`#ifdef USE_SKINNING 1991 uniform mat4 bindMatrix; 1992 uniform mat4 bindMatrixInverse; 1993 uniform highp sampler2D boneTexture; 1994 mat4 getBoneMatrix( const in float i ) { 1995 int size = textureSize( boneTexture, 0 ).x; 1996 int j = int( i ) * 4; 1997 int x = j % size; 1998 int y = j / size; 1999 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2000 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2001 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2002 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2003 return mat4( v1, v2, v3, v4 ); 2004 } 2005#endif`,y6=`#ifdef USE_SKINNING 2006 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2007 vec4 skinned = vec4( 0.0 ); 2008 skinned += boneMatX * skinVertex * skinWeight.x; 2009 skinned += boneMatY * skinVertex * skinWeight.y; 2010 skinned += boneMatZ * skinVertex * skinWeight.z; 2011 skinned += boneMatW * skinVertex * skinWeight.w; 2012 transformed = ( bindMatrixInverse * skinned ).xyz; 2013#endif`,v6=`#ifdef USE_SKINNING 2014 mat4 skinMatrix = mat4( 0.0 ); 2015 skinMatrix += skinWeight.x * boneMatX; 2016 skinMatrix += skinWeight.y * boneMatY; 2017 skinMatrix += skinWeight.z * boneMatZ; 2018 skinMatrix += skinWeight.w * boneMatW; 2019 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2020 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2021 #ifdef USE_TANGENT 2022 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2023 #endif 2024#endif`,w6=`float specularStrength; 2025#ifdef USE_SPECULARMAP 2026 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2027 specularStrength = texelSpecular.r; 2028#else 2029 specularStrength = 1.0; 2030#endif`,x6=`#ifdef USE_SPECULARMAP 2031 uniform sampler2D specularMap; 2032#endif`,b6=`#if defined( TONE_MAPPING ) 2033 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2034#endif`,C6=`#ifndef saturate 2035#define saturate( a ) clamp( a, 0.0, 1.0 ) 2036#endif 2037uniform float toneMappingExposure; 2038vec3 LinearToneMapping( vec3 color ) { 2039 return saturate( toneMappingExposure * color ); 2040} 2041vec3 ReinhardToneMapping( vec3 color ) { 2042 color *= toneMappingExposure; 2043 return saturate( color / ( vec3( 1.0 ) + color ) ); 2044} 2045vec3 CineonToneMapping( vec3 color ) { 2046 color *= toneMappingExposure; 2047 color = max( vec3( 0.0 ), color - 0.004 ); 2048 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2049} 2050vec3 RRTAndODTFit( vec3 v ) { 2051 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2052 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2053 return a / b; 2054} 2055vec3 ACESFilmicToneMapping( vec3 color ) { 2056 const mat3 ACESInputMat = mat3( 2057 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2058 vec3( 0.04823, 0.01566, 0.83777 ) 2059 ); 2060 const mat3 ACESOutputMat = mat3( 2061 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2062 vec3( -0.07367, -0.00605, 1.07602 ) 2063 ); 2064 color *= toneMappingExposure / 0.6; 2065 color = ACESInputMat * color; 2066 color = RRTAndODTFit( color ); 2067 color = ACESOutputMat * color; 2068 return saturate( color ); 2069} 2070const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2071 vec3( 1.6605, - 0.1246, - 0.0182 ), 2072 vec3( - 0.5876, 1.1329, - 0.1006 ), 2073 vec3( - 0.0728, - 0.0083, 1.1187 ) 2074); 2075const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2076 vec3( 0.6274, 0.0691, 0.0164 ), 2077 vec3( 0.3293, 0.9195, 0.0880 ), 2078 vec3( 0.0433, 0.0113, 0.8956 ) 2079); 2080vec3 agxDefaultContrastApprox( vec3 x ) { 2081 vec3 x2 = x * x; 2082 vec3 x4 = x2 * x2; 2083 return + 15.5 * x4 * x2 2084 - 40.14 * x4 * x 2085 + 31.96 * x4 2086 - 6.868 * x2 * x 2087 + 0.4298 * x2 2088 + 0.1191 * x 2089 - 0.00232; 2090} 2091vec3 AgXToneMapping( vec3 color ) { 2092 const mat3 AgXInsetMatrix = mat3( 2093 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2094 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2095 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2096 );
2097 const mat3 AgXOutsetMatrix = mat3( 2098 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2099 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2100 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2101 ); 2102 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2103 color *= toneMappingExposure; 2104 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2105 color = AgXInsetMatrix * color; 2106 color = max( color, 1e-10 ); color = log2( color ); 2107 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2108 color = clamp( color, 0.0, 1.0 ); 2109 color = agxDefaultContrastApprox( color ); 2110 color = AgXOutsetMatrix * color; 2111 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2112 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2113 color = clamp( color, 0.0, 1.0 ); 2114 return color; 2115} 2116vec3 NeutralToneMapping( vec3 color ) { 2117 const float StartCompression = 0.8 - 0.04; 2118 const float Desaturation = 0.15; 2119 color *= toneMappingExposure; 2120 float x = min( color.r, min( color.g, color.b ) ); 2121 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2122 color -= offset; 2123 float peak = max( color.r, max( color.g, color.b ) ); 2124 if ( peak < StartCompression ) return color; 2125 float d = 1. - StartCompression; 2126 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2127 color *= newPeak / peak; 2128 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2129 return mix( color, vec3( newPeak ), g ); 2130} 2131vec3 CustomToneMapping( vec3 color ) { return color; }`,_6=`#ifdef USE_TRANSMISSION 2132 material.transmission = transmission; 2133 material.transmissionAlpha = 1.0; 2134 material.thickness = thickness; 2135 material.attenuationDistance = attenuationDistance; 2136 material.attenuationColor = attenuationColor; 2137 #ifdef USE_TRANSMISSIONMAP 2138 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2139 #endif 2140 #ifdef USE_THICKNESSMAP 2141 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2142 #endif 2143 vec3 pos = vWorldPosition; 2144 vec3 v = normalize( cameraPosition - pos ); 2145 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2146 vec4 transmitted = getIBLVolumeRefraction( 2147 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2148 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2149 material.attenuationColor, material.attenuationDistance ); 2150 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2151 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2152#endif`,B6=`#ifdef USE_TRANSMISSION 2153 uniform float transmission; 2154 uniform float thickness; 2155 uniform float attenuationDistance; 2156 uniform vec3 attenuationColor; 2157 #ifdef USE_TRANSMISSIONMAP 2158 uniform sampler2D transmissionMap; 2159 #endif 2160 #ifdef USE_THICKNESSMAP 2161 uniform sampler2D thicknessMap; 2162 #endif 2163 uniform vec2 transmissionSamplerSize; 2164 uniform sampler2D transmissionSamplerMap; 2165 uniform mat4 modelMatrix; 2166 uniform mat4 projectionMatrix; 2167 varying vec3 vWorldPosition; 2168 float w0( float a ) { 2169 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2170 } 2171 float w1( float a ) { 2172 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2173 } 2174 float w2( float a ){ 2175 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2176 } 2177 float w3( float a ) { 2178 return ( 1.0 / 6.0 ) * ( a * a * a ); 2179 } 2180 float g0( float a ) { 2181 return w0( a ) + w1( a ); 2182 } 2183 float g1( float a ) { 2184 return w2( a ) + w3( a ); 2185 } 2186 float h0( float a ) { 2187 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2188 } 2189 float h1( float a ) { 2190 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2191 } 2192 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2193 uv = uv * texelSize.zw + 0.5; 2194 vec2 iuv = floor( uv ); 2195 vec2 fuv = fract( uv ); 2196 float g0x = g0( fuv.x ); 2197 float g1x = g1( fuv.x ); 2198 float h0x = h0( fuv.x ); 2199 float h1x = h1( fuv.x ); 2200 float h0y = h0( fuv.y ); 2201 float h1y = h1( fuv.y ); 2202 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2203 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2204 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2205 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2206 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2207 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2208 } 2209 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2210 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2211 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2212 vec2 fLodSizeInv = 1.0 / fLodSize; 2213 vec2 cLodSizeInv = 1.0 / cLodSize; 2214 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2215 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2216 return mix( fSample, cSample, fract( lod ) ); 2217 } 2218 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2219 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2220 vec3 modelScale; 2221 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2222 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2223 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2224 return normalize( refractionVector ) * thickness * modelScale; 2225 } 2226 float applyIorToRoughness( const in float roughness, const in float ior ) { 2227 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2228 } 2229 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2230 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2231 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2232 } 2233 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2234 if ( isinf( attenuationDistance ) ) { 2235 return vec3( 1.0 ); 2236 } else { 2237 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2238 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2239 } 2240 } 2241 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2242 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2243 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2244 const in vec3 attenuationColor, const in float attenuationDistance ) { 2245 vec4 transmittedLight; 2246 vec3 transmittance; 2247 #ifdef USE_DISPERSION 2248 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2249 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2250 for ( int i = 0; i < 3; i ++ ) { 2251 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2252 vec3 refractedRayExit = position + transmissionRay; 2253 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2254 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2255 refractionCoords += 1.0; 2256 refractionCoords /= 2.0; 2257 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2258 transmittedLight[ i ] = transmissionSample[ i ]; 2259 transmittedLight.a += transmissionSample.a; 2260 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2261 } 2262 transmittedLight.a /= 3.0; 2263 #else 2264 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2265 vec3 refractedRayExit = position + transmissionRay; 2266 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2267 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2268 refractionCoords += 1.0; 2269 refractionCoords /= 2.0; 2270 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2271 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2272 #endif 2273 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2274 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2275 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2276 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2277 } 2278#endif`,E6=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2279 varying vec2 vUv; 2280#endif 2281#ifdef USE_MAP 2282 varying vec2 vMapUv; 2283#endif 2284#ifdef USE_ALPHAMAP
2285 varying vec2 vAlphaMapUv; 2286#endif 2287#ifdef USE_LIGHTMAP 2288 varying vec2 vLightMapUv; 2289#endif 2290#ifdef USE_AOMAP 2291 varying vec2 vAoMapUv; 2292#endif 2293#ifdef USE_BUMPMAP 2294 varying vec2 vBumpMapUv; 2295#endif 2296#ifdef USE_NORMALMAP 2297 varying vec2 vNormalMapUv; 2298#endif 2299#ifdef USE_EMISSIVEMAP 2300 varying vec2 vEmissiveMapUv; 2301#endif 2302#ifdef USE_METALNESSMAP 2303 varying vec2 vMetalnessMapUv; 2304#endif 2305#ifdef USE_ROUGHNESSMAP 2306 varying vec2 vRoughnessMapUv; 2307#endif 2308#ifdef USE_ANISOTROPYMAP 2309 varying vec2 vAnisotropyMapUv; 2310#endif 2311#ifdef USE_CLEARCOATMAP 2312 varying vec2 vClearcoatMapUv; 2313#endif 2314#ifdef USE_CLEARCOAT_NORMALMAP 2315 varying vec2 vClearcoatNormalMapUv; 2316#endif 2317#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2318 varying vec2 vClearcoatRoughnessMapUv; 2319#endif 2320#ifdef USE_IRIDESCENCEMAP 2321 varying vec2 vIridescenceMapUv; 2322#endif 2323#ifdef USE_IRIDESCENCE_THICKNESSMAP 2324 varying vec2 vIridescenceThicknessMapUv; 2325#endif 2326#ifdef USE_SHEEN_COLORMAP 2327 varying vec2 vSheenColorMapUv; 2328#endif 2329#ifdef USE_SHEEN_ROUGHNESSMAP 2330 varying vec2 vSheenRoughnessMapUv; 2331#endif 2332#ifdef USE_SPECULARMAP 2333 varying vec2 vSpecularMapUv; 2334#endif 2335#ifdef USE_SPECULAR_COLORMAP 2336 varying vec2 vSpecularColorMapUv; 2337#endif 2338#ifdef USE_SPECULAR_INTENSITYMAP 2339 varying vec2 vSpecularIntensityMapUv; 2340#endif 2341#ifdef USE_TRANSMISSIONMAP 2342 uniform mat3 transmissionMapTransform; 2343 varying vec2 vTransmissionMapUv; 2344#endif 2345#ifdef USE_THICKNESSMAP 2346 uniform mat3 thicknessMapTransform; 2347 varying vec2 vThicknessMapUv; 2348#endif`,S6=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2349 varying vec2 vUv; 2350#endif 2351#ifdef USE_MAP 2352 uniform mat3 mapTransform; 2353 varying vec2 vMapUv; 2354#endif 2355#ifdef USE_ALPHAMAP 2356 uniform mat3 alphaMapTransform; 2357 varying vec2 vAlphaMapUv; 2358#endif 2359#ifdef USE_LIGHTMAP 2360 uniform mat3 lightMapTransform; 2361 varying vec2 vLightMapUv; 2362#endif 2363#ifdef USE_AOMAP 2364 uniform mat3 aoMapTransform; 2365 varying vec2 vAoMapUv; 2366#endif 2367#ifdef USE_BUMPMAP 2368 uniform mat3 bumpMapTransform; 2369 varying vec2 vBumpMapUv; 2370#endif 2371#ifdef USE_NORMALMAP 2372 uniform mat3 normalMapTransform; 2373 varying vec2 vNormalMapUv; 2374#endif 2375#ifdef USE_DISPLACEMENTMAP 2376 uniform mat3 displacementMapTransform; 2377 varying vec2 vDisplacementMapUv; 2378#endif 2379#ifdef USE_EMISSIVEMAP 2380 uniform mat3 emissiveMapTransform; 2381 varying vec2 vEmissiveMapUv; 2382#endif 2383#ifdef USE_METALNESSMAP 2384 uniform mat3 metalnessMapTransform; 2385 varying vec2 vMetalnessMapUv; 2386#endif 2387#ifdef USE_ROUGHNESSMAP 2388 uniform mat3 roughnessMapTransform; 2389 varying vec2 vRoughnessMapUv; 2390#endif 2391#ifdef USE_ANISOTROPYMAP 2392 uniform mat3 anisotropyMapTransform; 2393 varying vec2 vAnisotropyMapUv; 2394#endif 2395#ifdef USE_CLEARCOATMAP 2396 uniform mat3 clearcoatMapTransform; 2397 varying vec2 vClearcoatMapUv; 2398#endif 2399#ifdef USE_CLEARCOAT_NORMALMAP 2400 uniform mat3 clearcoatNormalMapTransform; 2401 varying vec2 vClearcoatNormalMapUv; 2402#endif 2403#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2404 uniform mat3 clearcoatRoughnessMapTransform; 2405 varying vec2 vClearcoatRoughnessMapUv; 2406#endif 2407#ifdef USE_SHEEN_COLORMAP 2408 uniform mat3 sheenColorMapTransform; 2409 varying vec2 vSheenColorMapUv; 2410#endif 2411#ifdef USE_SHEEN_ROUGHNESSMAP 2412 uniform mat3 sheenRoughnessMapTransform; 2413 varying vec2 vSheenRoughnessMapUv; 2414#endif 2415#ifdef USE_IRIDESCENCEMAP 2416 uniform mat3 iridescenceMapTransform; 2417 varying vec2 vIridescenceMapUv; 2418#endif 2419#ifdef USE_IRIDESCENCE_THICKNESSMAP 2420 uniform mat3 iridescenceThicknessMapTransform; 2421 varying vec2 vIridescenceThicknessMapUv; 2422#endif 2423#ifdef USE_SPECULARMAP 2424 uniform mat3 specularMapTransform; 2425 varying vec2 vSpecularMapUv; 2426#endif 2427#ifdef USE_SPECULAR_COLORMAP 2428 uniform mat3 specularColorMapTransform; 2429 varying vec2 vSpecularColorMapUv; 2430#endif 2431#ifdef USE_SPECULAR_INTENSITYMAP 2432 uniform mat3 specularIntensityMapTransform; 2433 varying vec2 vSpecularIntensityMapUv; 2434#endif 2435#ifdef USE_TRANSMISSIONMAP 2436 uniform mat3 transmissionMapTransform; 2437 varying vec2 vTransmissionMapUv; 2438#endif 2439#ifdef USE_THICKNESSMAP 2440 uniform mat3 thicknessMapTransform; 2441 varying vec2 vThicknessMapUv; 2442#endif`,T6=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2443 vUv = vec3( uv, 1 ).xy; 2444#endif 2445#ifdef USE_MAP 2446 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2447#endif 2448#ifdef USE_ALPHAMAP 2449 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2450#endif 2451#ifdef USE_LIGHTMAP 2452 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2453#endif 2454#ifdef USE_AOMAP 2455 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2456#endif 2457#ifdef USE_BUMPMAP 2458 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2459#endif 2460#ifdef USE_NORMALMAP 2461 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2462#endif 2463#ifdef USE_DISPLACEMENTMAP 2464 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2465#endif 2466#ifdef USE_EMISSIVEMAP 2467 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2468#endif 2469#ifdef USE_METALNESSMAP 2470 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2471#endif 2472#ifdef USE_ROUGHNESSMAP 2473 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2474#endif 2475#ifdef USE_ANISOTROPYMAP 2476 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2477#endif 2478#ifdef USE_CLEARCOATMAP 2479 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2480#endif 2481#ifdef USE_CLEARCOAT_NORMALMAP 2482 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2483#endif 2484#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2485 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2486#endif
2487#ifdef USE_IRIDESCENCEMAP 2488 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2489#endif 2490#ifdef USE_IRIDESCENCE_THICKNESSMAP 2491 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2492#endif 2493#ifdef USE_SHEEN_COLORMAP 2494 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2495#endif 2496#ifdef USE_SHEEN_ROUGHNESSMAP 2497 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2498#endif 2499#ifdef USE_SPECULARMAP 2500 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2501#endif 2502#ifdef USE_SPECULAR_COLORMAP 2503 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2504#endif 2505#ifdef USE_SPECULAR_INTENSITYMAP 2506 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2507#endif 2508#ifdef USE_TRANSMISSIONMAP 2509 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2510#endif 2511#ifdef USE_THICKNESSMAP 2512 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2513#endif`,I6=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2514 vec4 worldPosition = vec4( transformed, 1.0 ); 2515 #ifdef USE_BATCHING 2516 worldPosition = batchingMatrix * worldPosition; 2517 #endif 2518 #ifdef USE_INSTANCING 2519 worldPosition = instanceMatrix * worldPosition; 2520 #endif 2521 worldPosition = modelMatrix * worldPosition; 2522#endif`;const F6=`varying vec2 vUv; 2523uniform mat3 uvTransform; 2524void main() { 2525 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2526 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2527}`,R6=`uniform sampler2D t2D; 2528uniform float backgroundIntensity; 2529varying vec2 vUv; 2530void main() { 2531 vec4 texColor = texture2D( t2D, vUv ); 2532 #ifdef DECODE_VIDEO_TEXTURE 2533 texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); 2534 #endif 2535 texColor.rgb *= backgroundIntensity; 2536 gl_FragColor = texColor; 2537 #include <tonemapping_fragment> 2538 #include <colorspace_fragment> 2539}`,U6=`varying vec3 vWorldDirection; 2540#include <common> 2541void main() { 2542 vWorldDirection = transformDirection( position, modelMatrix ); 2543 #include <begin_vertex> 2544 #include <project_vertex> 2545 gl_Position.z = gl_Position.w; 2546}`,M6=`#ifdef ENVMAP_TYPE_CUBE 2547 uniform samplerCube envMap; 2548#elif defined( ENVMAP_TYPE_CUBE_UV ) 2549 uniform sampler2D envMap; 2550#endif 2551uniform float flipEnvMap; 2552uniform float backgroundBlurriness; 2553uniform float backgroundIntensity; 2554uniform mat3 backgroundRotation; 2555varying vec3 vWorldDirection; 2556#include <cube_uv_reflection_fragment> 2557void main() { 2558 #ifdef ENVMAP_TYPE_CUBE 2559 vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2560 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2561 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2562 #else 2563 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2564 #endif 2565 texColor.rgb *= backgroundIntensity; 2566 gl_FragColor = texColor; 2567 #include <tonemapping_fragment> 2568 #include <colorspace_fragment> 2569}`,N6=`varying vec3 vWorldDirection; 2570#include <common> 2571void main() { 2572 vWorldDirection = transformDirection( position, modelMatrix ); 2573 #include <begin_vertex> 2574 #include <project_vertex> 2575 gl_Position.z = gl_Position.w; 2576}`,D6=`uniform samplerCube tCube; 2577uniform float tFlip; 2578uniform float opacity; 2579varying vec3 vWorldDirection; 2580void main() { 2581 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2582 gl_FragColor = texColor; 2583 gl_FragColor.a *= opacity; 2584 #include <tonemapping_fragment> 2585 #include <colorspace_fragment> 2586}`,L6=`#include <common> 2587#include <batching_pars_vertex> 2588#include <uv_pars_vertex> 2589#include <displacementmap_pars_vertex> 2590#include <morphtarget_pars_vertex> 2591#include <skinning_pars_vertex> 2592#include <logdepthbuf_pars_vertex> 2593#include <clipping_planes_pars_vertex> 2594varying vec2 vHighPrecisionZW; 2595void main() { 2596 #include <uv_vertex> 2597 #include <batching_vertex> 2598 #include <skinbase_vertex> 2599 #include <morphinstance_vertex> 2600 #ifdef USE_DISPLACEMENTMAP 2601 #include <beginnormal_vertex> 2602 #include <morphnormal_vertex> 2603 #include <skinnormal_vertex> 2604 #endif 2605 #include <begin_vertex> 2606 #include <morphtarget_vertex> 2607 #include <skinning_vertex> 2608 #include <displacementmap_vertex> 2609 #include <project_vertex> 2610 #include <logdepthbuf_vertex> 2611 #include <clipping_planes_vertex> 2612 vHighPrecisionZW = gl_Position.zw; 2613}`,O6=`#if DEPTH_PACKING == 3200 2614 uniform float opacity; 2615#endif 2616#include <common> 2617#include <packing> 2618#include <uv_pars_fragment> 2619#include <map_pars_fragment> 2620#include <alphamap_pars_fragment> 2621#include <alphatest_pars_fragment> 2622#include <alphahash_pars_fragment> 2623#include <logdepthbuf_pars_fragment> 2624#include <clipping_planes_pars_fragment> 2625varying vec2 vHighPrecisionZW; 2626void main() { 2627 vec4 diffuseColor = vec4( 1.0 ); 2628 #include <clipping_planes_fragment> 2629 #if DEPTH_PACKING == 3200 2630 diffuseColor.a = opacity; 2631 #endif 2632 #include <map_fragment> 2633 #include <alphamap_fragment> 2634 #include <alphatest_fragment> 2635 #include <alphahash_fragment> 2636 #include <logdepthbuf_fragment> 2637 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 2638 #if DEPTH_PACKING == 3200 2639 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2640 #elif DEPTH_PACKING == 3201 2641 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2642 #elif DEPTH_PACKING == 3202 2643 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2644 #elif DEPTH_PACKING == 3203 2645 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2646 #endif 2647}`,P6=`#define DISTANCE 2648varying vec3 vWorldPosition; 2649#include <common> 2650#include <batching_pars_vertex> 2651#include <uv_pars_vertex> 2652#include <displacementmap_pars_vertex> 2653#include <morphtarget_pars_vertex> 2654#include <skinning_pars_vertex> 2655#include <clipping_planes_pars_vertex> 2656void main() { 2657 #include <uv_vertex> 2658 #include <batching_vertex> 2659 #include <skinbase_vertex> 2660 #include <morphinstance_vertex> 2661 #ifdef USE_DISPLACEMENTMAP 2662 #include <beginnormal_vertex> 2663 #include <morphnormal_vertex> 2664 #include <skinnormal_vertex> 2665 #endif 2666 #include <begin_vertex> 2667 #include <morphtarget_vertex> 2668 #include <skinning_vertex> 2669 #include <displacementmap_vertex> 2670 #include <project_vertex> 2671 #include <worldpos_vertex> 2672 #include <clipping_planes_vertex> 2673 vWorldPosition = worldPosition.xyz; 2674}`,k6=`#define DISTANCE 2675uniform vec3 referencePosition; 2676uniform float nearDistance; 2677uniform float farDistance; 2678varying vec3 vWorldPosition; 2679#include <common> 2680#include <packing> 2681#include <uv_pars_fragment> 2682#include <map_pars_fragment> 2683#include <alphamap_pars_fragment> 2684#include <alphatest_pars_fragment> 2685#include <alphahash_pars_fragment> 2686#include <clipping_planes_pars_fragment> 2687void main () { 2688 vec4 diffuseColor = vec4( 1.0 ); 2689 #include <clipping_planes_fragment> 2690 #include <map_fragment> 2691 #include <alphamap_fragment> 2692 #include <alphatest_fragment> 2693 #include <alphahash_fragment> 2694 float dist = length( vWorldPosition - referencePosition ); 2695 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2696 dist = saturate( dist ); 2697 gl_FragColor = packDepthToRGBA( dist ); 2698}`,$6=`varying vec3 vWorldDirection; 2699#include <common> 2700void main() { 2701 vWorldDirection = transformDirection( position, modelMatrix ); 2702 #include <begin_vertex> 2703 #include <project_vertex> 2704}`,Q6=`uniform sampler2D tEquirect; 2705varying vec3 vWorldDirection; 2706#include <common> 2707void main() { 2708 vec3 direction = normalize( vWorldDirection ); 2709 vec2 sampleUV = equirectUv( direction ); 2710 gl_FragColor = texture2D( tEquirect, sampleUV ); 2711 #include <tonemapping_fragment> 2712 #include <colorspace_fragment> 2713}`,H6=`uniform float scale; 2714attribute float lineDistance; 2715varying float vLineDistance; 2716#include <common> 2717#include <uv_pars_vertex> 2718#include <color_pars_vertex> 2719#include <fog_pars_vertex> 2720#include <morphtarget_pars_vertex> 2721#include <logdepthbuf_pars_vertex> 2722#include <clipping_planes_pars_vertex> 2723void main() { 2724 vLineDistance = scale * lineDistance; 2725 #include <uv_vertex> 2726 #include <color_vertex> 2727 #include <morphinstance_vertex> 2728 #include <morphcolor_vertex> 2729 #include <begin_vertex> 2730 #include <morphtarget_vertex> 2731 #include <project_vertex> 2732 #include <logdepthbuf_vertex> 2733 #include <clipping_planes_vertex> 2734 #include <fog_vertex> 2735}`,V6=`uniform vec3 diffuse; 2736uniform float opacity; 2737uniform float dashSize; 2738uniform float totalSize; 2739varying float vLineDistance; 2740#include <common> 2741#include <color_pars_fragment> 2742#include <uv_pars_fragment> 2743#include <map_pars_fragment> 2744#include <fog_pars_fragment> 2745#include <logdepthbuf_pars_fragment> 2746#include <clipping_planes_pars_fragment> 2747void main() { 2748 vec4 diffuseColor = vec4( diffuse, opacity ); 2749 #include <clipping_planes_fragment> 2750 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2751 discard; 2752 } 2753 vec3 outgoingLight = vec3( 0.0 ); 2754 #include <logdepthbuf_fragment> 2755 #include <map_fragment> 2756 #include <color_fragment> 2757 outgoingLight = diffuseColor.rgb; 2758 #include <opaque_fragment> 2759 #include <tonemapping_fragment> 2760 #include <colorspace_fragment> 2761 #include <fog_fragment> 2762 #include <premultiplied_alpha_fragment> 2763}`,G6=`#include <common> 2764#include <batching_pars_vertex> 2765#include <uv_pars_vertex> 2766#include <envmap_pars_vertex> 2767#include <color_pars_vertex> 2768#include <fog_pars_vertex> 2769#include <morphtarget_pars_vertex> 2770#include <skinning_pars_vertex> 2771#include <logdepthbuf_pars_vertex> 2772#include <clipping_planes_pars_vertex> 2773void main() { 2774 #include <uv_vertex> 2775 #include <color_vertex> 2776 #include <morphinstance_vertex> 2777 #include <morphcolor_vertex> 2778 #include <batching_vertex> 2779 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2780 #include <beginnormal_vertex> 2781 #include <morphnormal_vertex> 2782 #include <skinbase_vertex> 2783 #include <skinnormal_vertex> 2784 #include <defaultnormal_vertex> 2785 #endif 2786 #include <begin_vertex> 2787 #include <morphtarget_vertex> 2788 #include <skinning_vertex> 2789 #include <project_vertex> 2790 #include <logdepthbuf_vertex> 2791 #include <clipping_planes_vertex> 2792 #include <worldpos_vertex> 2793 #include <envmap_vertex> 2794 #include <fog_vertex> 2795}`,z6=`uniform vec3 diffuse; 2796uniform float opacity; 2797#ifndef FLAT_SHADED 2798 varying vec3 vNormal; 2799#endif 2800#include <common> 2801#include <dithering_pars_fragment> 2802#include <color_pars_fragment> 2803#include <uv_pars_fragment> 2804#include <map_pars_fragment> 2805#include <alphamap_pars_fragment> 2806#include <alphatest_pars_fragment> 2807#include <alphahash_pars_fragment> 2808#include <aomap_pars_fragment> 2809#include <lightmap_pars_fragment> 2810#include <envmap_common_pars_fragment> 2811#include <envmap_pars_fragment> 2812#include <fog_pars_fragment> 2813#include <specularmap_pars_fragment> 2814#include <logdepthbuf_pars_fragment> 2815#include <clipping_planes_pars_fragment> 2816void main() { 2817 vec4 diffuseColor = vec4( diffuse, opacity ); 2818 #include <clipping_planes_fragment> 2819 #include <logdepthbuf_fragment> 2820 #include <map_fragment> 2821 #include <color_fragment> 2822 #include <alphamap_fragment> 2823 #include <alphatest_fragment> 2824 #include <alphahash_fragment> 2825 #include <specularmap_fragment> 2826 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2827 #ifdef USE_LIGHTMAP 2828 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2829 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2830 #else 2831 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2832 #endif 2833 #include <aomap_fragment> 2834 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2835 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2836 #include <envmap_fragment> 2837 #include <opaque_fragment> 2838 #include <tonemapping_fragment> 2839 #include <colorspace_fragment> 2840 #include <fog_fragment> 2841 #include <premultiplied_alpha_fragment> 2842 #include <dithering_fragment> 2843}`,W6=`#define LAMBERT 2844varying vec3 vViewPosition; 2845#include <common> 2846#include <batching_pars_vertex> 2847#include <uv_pars_vertex> 2848#include <displacementmap_pars_vertex> 2849#include <envmap_pars_vertex> 2850#include <color_pars_vertex> 2851#include <fog_pars_vertex> 2852#include <normal_pars_vertex> 2853#include <morphtarget_pars_vertex> 2854#include <skinning_pars_vertex> 2855#include <shadowmap_pars_vertex> 2856#include <logdepthbuf_pars_vertex> 2857#include <clipping_planes_pars_vertex> 2858void main() { 2859 #include <uv_vertex> 2860 #include <color_vertex> 2861 #include <morphinstance_vertex> 2862 #include <morphcolor_vertex> 2863 #include <batching_vertex> 2864 #include <beginnormal_vertex> 2865 #include <morphnormal_vertex> 2866 #include <skinbase_vertex> 2867 #include <skinnormal_vertex> 2868 #include <defaultnormal_vertex> 2869 #include <normal_vertex> 2870 #include <begin_vertex> 2871 #include <morphtarget_vertex> 2872 #include <skinning_vertex> 2873 #include <displacementmap_vertex> 2874 #include <project_vertex> 2875 #include <logdepthbuf_vertex> 2876 #include <clipping_planes_vertex> 2877 vViewPosition = - mvPosition.xyz; 2878 #include <worldpos_vertex> 2879 #include <envmap_vertex> 2880 #include <shadowmap_vertex> 2881 #include <fog_vertex> 2882}`,K6=`#define LAMBERT 2883uniform vec3 diffuse; 2884uniform vec3 emissive; 2885uniform float opacity; 2886#include <common> 2887#include <packing> 2888#include <dithering_pars_fragment> 2889#include <color_pars_fragment> 2890#include <uv_pars_fragment> 2891#include <map_pars_fragment> 2892#include <alphamap_pars_fragment> 2893#include <alphatest_pars_fragment> 2894#include <alphahash_pars_fragment> 2895#include <aomap_pars_fragment> 2896#include <lightmap_pars_fragment> 2897#include <emissivemap_pars_fragment> 2898#include <envmap_common_pars_fragment> 2899#include <envmap_pars_fragment> 2900#include <fog_pars_fragment> 2901#include <bsdfs> 2902#include <lights_pars_begin> 2903#include <normal_pars_fragment> 2904#include <lights_lambert_pars_fragment> 2905#include <shadowmap_pars_fragment> 2906#include <bumpmap_pars_fragment> 2907#include <normalmap_pars_fragment> 2908#include <specularmap_pars_fragment> 2909#include <logdepthbuf_pars_fragment> 2910#include <clipping_planes_pars_fragment> 2911void main() { 2912 vec4 diffuseColor = vec4( diffuse, opacity ); 2913 #include <clipping_planes_fragment> 2914 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2915 vec3 totalEmissiveRadiance = emissive; 2916 #include <logdepthbuf_fragment> 2917 #include <map_fragment> 2918 #include <color_fragment> 2919 #include <alphamap_fragment> 2920 #include <alphatest_fragment> 2921 #include <alphahash_fragment> 2922 #include <specularmap_fragment> 2923 #include <normal_fragment_begin> 2924 #include <normal_fragment_maps> 2925 #include <emissivemap_fragment> 2926 #include <lights_lambert_fragment> 2927 #include <lights_fragment_begin> 2928 #include <lights_fragment_maps> 2929 #include <lights_fragment_end> 2930 #include <aomap_fragment> 2931 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2932 #include <envmap_fragment> 2933 #include <opaque_fragment> 2934 #include <tonemapping_fragment> 2935 #include <colorspace_fragment> 2936 #include <fog_fragment> 2937 #include <premultiplied_alpha_fragment> 2938 #include <dithering_fragment> 2939}`,X6=`#define MATCAP 2940varying vec3 vViewPosition; 2941#include <common> 2942#include <batching_pars_vertex> 2943#include <uv_pars_vertex> 2944#include <color_pars_vertex> 2945#include <displacementmap_pars_vertex> 2946#include <fog_pars_vertex> 2947#include <normal_pars_vertex> 2948#include <morphtarget_pars_vertex> 2949#include <skinning_pars_vertex> 2950#include <logdepthbuf_pars_vertex> 2951#include <clipping_planes_pars_vertex> 2952void main() { 2953 #include <uv_vertex> 2954 #include <color_vertex> 2955 #include <morphinstance_vertex> 2956 #include <morphcolor_vertex> 2957 #include <batching_vertex> 2958 #include <beginnormal_vertex> 2959 #include <morphnormal_vertex> 2960 #include <skinbase_vertex> 2961 #include <skinnormal_vertex> 2962 #include <defaultnormal_vertex> 2963 #include <normal_vertex> 2964 #include <begin_vertex> 2965 #include <morphtarget_vertex> 2966 #include <skinning_vertex> 2967 #include <displacementmap_vertex> 2968 #include <project_vertex> 2969 #include <logdepthbuf_vertex> 2970 #include <clipping_planes_vertex> 2971 #include <fog_vertex> 2972 vViewPosition = - mvPosition.xyz; 2973}`,j6=`#define MATCAP 2974uniform vec3 diffuse; 2975uniform float opacity; 2976uniform sampler2D matcap; 2977varying vec3 vViewPosition; 2978#include <common> 2979#include <dithering_pars_fragment> 2980#include <color_pars_fragment> 2981#include <uv_pars_fragment> 2982#include <map_pars_fragment> 2983#include <alphamap_pars_fragment> 2984#include <alphatest_pars_fragment> 2985#include <alphahash_pars_fragment> 2986#include <fog_pars_fragment> 2987#include <normal_pars_fragment> 2988#include <bumpmap_pars_fragment> 2989#include <normalmap_pars_fragment> 2990#include <logdepthbuf_pars_fragment> 2991#include <clipping_planes_pars_fragment> 2992void main() { 2993 ve
2993c4 diffuseColor = vec4( diffuse, opacity ); 2994 #include <clipping_planes_fragment> 2995 #include <logdepthbuf_fragment> 2996 #include <map_fragment> 2997 #include <color_fragment> 2998 #include <alphamap_fragment> 2999 #include <alphatest_fragment> 3000 #include <alphahash_fragment> 3001 #include <normal_fragment_begin> 3002 #include <normal_fragment_maps> 3003 vec3 viewDir = normalize( vViewPosition ); 3004 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3005 vec3 y = cross( viewDir, x ); 3006 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3007 #ifdef USE_MATCAP 3008 vec4 matcapColor = texture2D( matcap, uv ); 3009 #else 3010 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3011 #endif 3012 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3013 #include <opaque_fragment> 3014 #include <tonemapping_fragment> 3015 #include <colorspace_fragment> 3016 #include <fog_fragment> 3017 #include <premultiplied_alpha_fragment> 3018 #include <dithering_fragment> 3019}`,Y6=`#define NORMAL 3020#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3021 varying vec3 vViewPosition; 3022#endif 3023#include <common> 3024#include <batching_pars_vertex> 3025#include <uv_pars_vertex> 3026#include <displacementmap_pars_vertex> 3027#include <normal_pars_vertex> 3028#include <morphtarget_pars_vertex> 3029#include <skinning_pars_vertex> 3030#include <logdepthbuf_pars_vertex> 3031#include <clipping_planes_pars_vertex> 3032void main() { 3033 #include <uv_vertex> 3034 #include <batching_vertex> 3035 #include <beginnormal_vertex> 3036 #include <morphinstance_vertex> 3037 #include <morphnormal_vertex> 3038 #include <skinbase_vertex> 3039 #include <skinnormal_vertex> 3040 #include <defaultnormal_vertex> 3041 #include <normal_vertex> 3042 #include <begin_vertex> 3043 #include <morphtarget_vertex> 3044 #include <skinning_vertex> 3045 #include <displacementmap_vertex> 3046 #include <project_vertex> 3047 #include <logdepthbuf_vertex> 3048 #include <clipping_planes_vertex> 3049#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3050 vViewPosition = - mvPosition.xyz; 3051#endif 3052}`,q6=`#define NORMAL 3053uniform float opacity; 3054#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3055 varying vec3 vViewPosition; 3056#endif 3057#include <packing> 3058#include <uv_pars_fragment> 3059#include <normal_pars_fragment> 3060#include <bumpmap_pars_fragment> 3061#include <normalmap_pars_fragment> 3062#include <logdepthbuf_pars_fragment> 3063#include <clipping_planes_pars_fragment> 3064void main() { 3065 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3066 #include <clipping_planes_fragment> 3067 #include <logdepthbuf_fragment> 3068 #include <normal_fragment_begin> 3069 #include <normal_fragment_maps> 3070 gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); 3071 #ifdef OPAQUE 3072 gl_FragColor.a = 1.0; 3073 #endif 3074}`,J6=`#define PHONG 3075varying vec3 vViewPosition; 3076#include <common> 3077#include <batching_pars_vertex> 3078#include <uv_pars_vertex> 3079#include <displacementmap_pars_vertex> 3080#include <envmap_pars_vertex> 3081#include <color_pars_vertex> 3082#include <fog_pars_vertex> 3083#include <normal_pars_vertex> 3084#include <morphtarget_pars_vertex> 3085#include <skinning_pars_vertex> 3086#include <shadowmap_pars_vertex> 3087#include <logdepthbuf_pars_vertex> 3088#include <clipping_planes_pars_vertex> 3089void main() { 3090 #include <uv_vertex> 3091 #include <color_vertex> 3092 #include <morphcolor_vertex> 3093 #include <batching_vertex> 3094 #include <beginnormal_vertex> 3095 #include <morphinstance_vertex> 3096 #include <morphnormal_vertex> 3097 #include <skinbase_vertex> 3098 #include <skinnormal_vertex> 3099 #include <defaultnormal_vertex> 3100 #include <normal_vertex> 3101 #include <begin_vertex> 3102 #include <morphtarget_vertex> 3103 #include <skinning_vertex> 3104 #include <displacementmap_vertex> 3105 #include <project_vertex> 3106 #include <logdepthbuf_vertex> 3107 #include <clipping_planes_vertex> 3108 vViewPosition = - mvPosition.xyz; 3109 #include <worldpos_vertex> 3110 #include <envmap_vertex> 3111 #include <shadowmap_vertex> 3112 #include <fog_vertex> 3113}`,Z6=`#define PHONG 3114uniform vec3 diffuse; 3115uniform vec3 emissive; 3116uniform vec3 specular; 3117uniform float shininess; 3118uniform float opacity; 3119#include <common> 3120#include <packing> 3121#include <dithering_pars_fragment> 3122#include <color_pars_fragment> 3123#include <uv_pars_fragment> 3124#include <map_pars_fragment> 3125#include <alphamap_pars_fragment> 3126#include <alphatest_pars_fragment> 3127#include <alphahash_pars_fragment> 3128#include <aomap_pars_fragment> 3129#include <lightmap_pars_fragment> 3130#include <emissivemap_pars_fragment> 3131#include <envmap_common_pars_fragment> 3132#include <envmap_pars_fragment> 3133#include <fog_pars_fragment> 3134#include <bsdfs> 3135#include <lights_pars_begin> 3136#include <normal_pars_fragment> 3137#include <lights_phong_pars_fragment> 3138#include <shadowmap_pars_fragment> 3139#include <bumpmap_pars_fragment> 3140#include <normalmap_pars_fragment> 3141#include <specularmap_pars_fragment> 3142#include <logdepthbuf_pars_fragment> 3143#include <clipping_planes_pars_fragment> 3144void main() { 3145 vec4 diffuseColor = vec4( diffuse, opacity ); 3146 #include <clipping_planes_fragment> 3147 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3148 vec3 totalEmissiveRadiance = emissive; 3149 #include <logdepthbuf_fragment> 3150 #include <map_fragment> 3151 #include <color_fragment> 3152 #include <alphamap_fragment> 3153 #include <alphatest_fragment> 3154 #include <alphahash_fragment> 3155 #include <specularmap_fragment> 3156 #include <normal_fragment_begin> 3157 #include <normal_fragment_maps> 3158 #include <emissivemap_fragment> 3159 #include <lights_phong_fragment> 3160 #include <lights_fragment_begin> 3161 #include <lights_fragment_maps> 3162 #include <lights_fragment_end> 3163 #include <aomap_fragment> 3164 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3165 #include <envmap_fragment> 3166 #include <opaque_fragment> 3167 #include <tonemapping_fragment> 3168 #include <colorspace_fragment> 3169 #include <fog_fragment> 3170 #include <premultiplied_alpha_fragment> 3171 #include <dithering_fragment> 3172}`,e5=`#define STANDARD 3173varying vec3 vViewPosition; 3174#ifdef USE_TRANSMISSION 3175 varying vec3 vWorldPosition; 3176#endif 3177#include <common> 3178#include <batching_pars_vertex> 3179#include <uv_pars_vertex> 3180#include <displacementmap_pars_vertex> 3181#include <color_pars_vertex> 3182#include <fog_pars_vertex> 3183#include <normal_pars_vertex> 3184#include <morphtarget_pars_vertex> 3185#include <skinning_pars_vertex> 3186#include <shadowmap_pars_vertex> 3187#include <logdepthbuf_pars_vertex> 3188#include <clipping_planes_pars_vertex> 3189void main() { 3190 #include <uv_vertex> 3191 #include <color_vertex> 3192 #include <morphinstance_vertex> 3193 #include <morphcolor_vertex> 3194 #include <batching_vertex> 3195 #include <beginnormal_vertex> 3196 #include <morphnormal_vertex> 3197 #include <skinbase_vertex> 3198 #include <skinnormal_vertex> 3199 #include <defaultnormal_vertex> 3200 #include <normal_vertex> 3201 #include <begin_vertex> 3202 #include <morphtarget_vertex> 3203 #include <skinning_vertex> 3204 #include <displacementmap_vertex> 3205 #include <project_vertex> 3206 #include <logdepthbuf_vertex> 3207 #include <clipping_planes_vertex> 3208 vViewPosition = - mvPosition.xyz; 3209 #include <worldpos_vertex> 3210 #include <shadowmap_vertex> 3211 #include <fog_vertex> 3212#ifdef USE_TRANSMISSION 3213 vWorldPosition = worldPosition.xyz; 3214#endif 3215}`,t5=`#define STANDARD 3216#ifdef PHYSICAL 3217 #define IOR 3218 #define USE_SPECULAR 3219#endif 3220uniform vec3 diffuse; 3221uniform vec3 emissive; 3222uniform float roughness; 3223uniform float metalness; 3224uniform float opacity; 3225#ifdef IOR 3226 uniform float ior; 3227#endif 3228#ifdef USE_SPECULAR 3229 uniform float specularIntensity; 3230 uniform vec3 specularColor; 3231 #ifdef USE_SPECULAR_COLORMAP 3232 uniform sampler2D specularColorMap; 3233 #endif 3234 #ifdef USE_SPECULAR_INTENSITYMAP 3235 uniform sampler2D specularIntensityMap; 3236 #endif 3237#endif 3238#ifdef USE_CLEARCOAT 3239 uniform float clearcoat; 3240 uniform float clearcoatRoughness; 3241#endif 3242#ifdef USE_DISPERSION 3243 uniform float dispersion; 3244#endif
3245#ifdef USE_IRIDESCENCE 3246 uniform float iridescence; 3247 uniform float iridescenceIOR; 3248 uniform float iridescenceThicknessMinimum; 3249 uniform float iridescenceThicknessMaximum; 3250#endif 3251#ifdef USE_SHEEN 3252 uniform vec3 sheenColor; 3253 uniform float sheenRoughness; 3254 #ifdef USE_SHEEN_COLORMAP 3255 uniform sampler2D sheenColorMap; 3256 #endif 3257 #ifdef USE_SHEEN_ROUGHNESSMAP 3258 uniform sampler2D sheenRoughnessMap; 3259 #endif 3260#endif 3261#ifdef USE_ANISOTROPY 3262 uniform vec2 anisotropyVector; 3263 #ifdef USE_ANISOTROPYMAP 3264 uniform sampler2D anisotropyMap; 3265 #endif 3266#endif 3267varying vec3 vViewPosition; 3268#include <common> 3269#include <packing> 3270#include <dithering_pars_fragment> 3271#include <color_pars_fragment> 3272#include <uv_pars_fragment> 3273#include <map_pars_fragment> 3274#include <alphamap_pars_fragment> 3275#include <alphatest_pars_fragment> 3276#include <alphahash_pars_fragment> 3277#include <aomap_pars_fragment> 3278#include <lightmap_pars_fragment> 3279#include <emissivemap_pars_fragment> 3280#include <iridescence_fragment> 3281#include <cube_uv_reflection_fragment> 3282#include <envmap_common_pars_fragment> 3283#include <envmap_physical_pars_fragment> 3284#include <fog_pars_fragment> 3285#include <lights_pars_begin> 3286#include <normal_pars_fragment> 3287#include <lights_physical_pars_fragment> 3288#include <transmission_pars_fragment> 3289#include <shadowmap_pars_fragment> 3290#include <bumpmap_pars_fragment> 3291#include <normalmap_pars_fragment> 3292#include <clearcoat_pars_fragment> 3293#include <iridescence_pars_fragment> 3294#include <roughnessmap_pars_fragment> 3295#include <metalnessmap_pars_fragment> 3296#include <logdepthbuf_pars_fragment> 3297#include <clipping_planes_pars_fragment> 3298void main() { 3299 vec4 diffuseColor = vec4( diffuse, opacity ); 3300 #include <clipping_planes_fragment> 3301 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3302 vec3 totalEmissiveRadiance = emissive; 3303 #include <logdepthbuf_fragment> 3304 #include <map_fragment> 3305 #include <color_fragment> 3306 #include <alphamap_fragment> 3307 #include <alphatest_fragment> 3308 #include <alphahash_fragment> 3309 #include <roughnessmap_fragment> 3310 #include <metalnessmap_fragment> 3311 #include <normal_fragment_begin> 3312 #include <normal_fragment_maps> 3313 #include <clearcoat_normal_fragment_begin> 3314 #include <clearcoat_normal_fragment_maps> 3315 #include <emissivemap_fragment> 3316 #include <lights_physical_fragment> 3317 #include <lights_fragment_begin> 3318 #include <lights_fragment_maps> 3319 #include <lights_fragment_end> 3320 #include <aomap_fragment> 3321 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3322 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3323 #include <transmission_fragment> 3324 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3325 #ifdef USE_SHEEN 3326 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 3327 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 3328 #endif 3329 #ifdef USE_CLEARCOAT 3330 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3331 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3332 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3333 #endif 3334 #include <opaque_fragment> 3335 #include <tonemapping_fragment> 3336 #include <colorspace_fragment> 3337 #include <fog_fragment> 3338 #include <premultiplied_alpha_fragment> 3339 #include <dithering_fragment> 3340}`,n5=`#define TOON 3341varying vec3 vViewPosition; 3342#include <common> 3343#include <batching_pars_vertex> 3344#include <uv_pars_vertex> 3345#include <displacementmap_pars_vertex> 3346#include <color_pars_vertex> 3347#include <fog_pars_vertex> 3348#include <normal_pars_vertex> 3349#include <morphtarget_pars_vertex> 3350#include <skinning_pars_vertex> 3351#include <shadowmap_pars_vertex> 3352#include <logdepthbuf_pars_vertex> 3353#include <clipping_planes_pars_vertex> 3354void main() { 3355 #include <uv_vertex> 3356 #include <color_vertex> 3357 #include <morphinstance_vertex> 3358 #include <morphcolor_vertex> 3359 #include <batching_vertex> 3360 #include <beginnormal_vertex> 3361 #include <morphnormal_vertex> 3362 #include <skinbase_vertex> 3363 #include <skinnormal_vertex> 3364 #include <defaultnormal_vertex> 3365 #include <normal_vertex> 3366 #include <begin_vertex> 3367 #include <morphtarget_vertex> 3368 #include <skinning_vertex> 3369 #include <displacementmap_vertex> 3370 #include <project_vertex> 3371 #include <logdepthbuf_vertex> 3372 #include <clipping_planes_vertex> 3373 vViewPosition = - mvPosition.xyz; 3374 #include <worldpos_vertex> 3375 #include <shadowmap_vertex> 3376 #include <fog_vertex> 3377}`,r5=`#define TOON 3378uniform vec3 diffuse; 3379uniform vec3 emissive; 3380uniform float opacity; 3381#include <common> 3382#include <packing> 3383#include <dithering_pars_fragment> 3384#include <color_pars_fragment> 3385#include <uv_pars_fragment> 3386#include <map_pars_fragment> 3387#include <alphamap_pars_fragment> 3388#include <alphatest_pars_fragment> 3389#include <alphahash_pars_fragment> 3390#include <aomap_pars_fragment> 3391#include <lightmap_pars_fragment> 3392#include <emissivemap_pars_fragment> 3393#include <gradientmap_pars_fragment> 3394#include <fog_pars_fragment> 3395#include <bsdfs> 3396#include <lights_pars_begin> 3397#include <normal_pars_fragment> 3398#include <lights_toon_pars_fragment> 3399#include <shadowmap_pars_fragment> 3400#include <bumpmap_pars_fragment> 3401#include <normalmap_pars_fragment> 3402#include <logdepthbuf_pars_fragment> 3403#include <clipping_planes_pars_fragment> 3404void main() { 3405 vec4 diffuseColor = vec4( diffuse, opacity ); 3406 #include <clipping_planes_fragment> 3407 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3408 vec3 totalEmissiveRadiance = emissive; 3409 #include <logdepthbuf_fragment> 3410 #include <map_fragment> 3411 #include <color_fragment> 3412 #include <alphamap_fragment> 3413 #include <alphatest_fragment> 3414 #include <alphahash_fragment> 3415 #include <normal_fragment_begin> 3416 #include <normal_fragment_maps> 3417 #include <emissivemap_fragment> 3418 #include <lights_toon_fragment> 3419 #include <lights_fragment_begin> 3420 #include <lights_fragment_maps> 3421 #include <lights_fragment_end> 3422 #include <aomap_fragment> 3423 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3424 #include <opaque_fragment> 3425 #include <tonemapping_fragment> 3426 #include <colorspace_fragment> 3427 #include <fog_fragment> 3428 #include <premultiplied_alpha_fragment> 3429 #include <dithering_fragment> 3430}`,i5=`uniform float size; 3431uniform float scale; 3432#include <common> 3433#include <color_pars_vertex> 3434#include <fog_pars_vertex> 3435#include <morphtarget_pars_vertex> 3436#include <logdepthbuf_pars_vertex> 3437#include <clipping_planes_pars_vertex> 3438#ifdef USE_POINTS_UV 3439 varying vec2 vUv; 3440 uniform mat3 uvTransform; 3441#endif 3442void main() { 3443 #ifdef USE_POINTS_UV 3444 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3445 #endif 3446 #include <color_vertex> 3447 #include <morphinstance_vertex> 3448 #include <morphcolor_vertex> 3449 #include <begin_vertex> 3450 #include <morphtarget_vertex> 3451 #include <project_vertex> 3452 gl_PointSize = size; 3453 #ifdef USE_SIZEATTENUATION 3454 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3455 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3456 #endif 3457 #include <logdepthbuf_vertex> 3458 #include <clipping_planes_vertex> 3459 #include <worldpos_vertex> 3460 #include <fog_vertex> 3461}`,s5=`uniform vec3 diffuse; 3462uniform float opacity; 3463#include <common> 3464#include <color_pars_fragment> 3465#include <map_particle_pars_fragment> 3466#include <alphatest_pars_fragment> 3467#include <alphahash_pars_fragment> 3468#include <fog_pars_fragment> 3469#include <logdepthbuf_pars_fragment> 3470#include <clipping_planes_pars_fragment> 3471void main() { 3472 vec4 diffuseColor = vec4( diffuse, opacity ); 3473 #include <clipping_planes_fragment> 3474 vec3 outgoingLight = vec3( 0.0 ); 3475 #include <logdepthbuf_fragment> 3476 #include <map_particle_fragment> 3477 #include <color_fragment> 3478 #include <alphatest_fragment> 3479 #include <alphahash_fragment> 3480 outgoingLight = diffuseColor.rgb; 3481 #include <opaque_fragment> 3482 #include <tonemapping_fragment> 3483 #include <colorspace_fragment> 3484 #include <fog_fragment> 3485 #include <premultiplied_alpha_fragment> 3486}`,a5=`#include <common> 3487#include <batching_pars_vertex> 3488#include <fog_pars_vertex> 3489#include <morphtarget_pars_vertex> 3490#include <skinning_pars_vertex> 3491#include <logdepthbuf_pars_vertex> 3492#include <shadowmap_pars_vertex> 3493void main() { 3494 #include <batching_vertex> 3495 #include <beginnormal_vertex> 3496 #include <morphinstance_vertex> 3497 #include <morphnormal_vertex> 3498 #include <skinbase_vertex> 3499 #include <skinnormal_vertex> 3500 #include <defaultnormal_vertex> 3501 #include <begin_vertex> 3502 #include <morphtarget_vertex> 3503 #include <skinning_vertex> 3504 #include <project_vertex> 3505 #include <logdepthbuf_vertex> 3506 #include <worldpos_vertex> 3507 #include <shadowmap_vertex> 3508 #include <fog_vertex> 3509}`,o5=`uniform vec3 color; 3510uniform float opacity; 3511#include <common> 3512#include <packing> 3513#include <fog_pars_fragment> 3514#include <bsdfs> 3515#include <lights_pars_begin> 3516#include <logdepthbuf_pars_fragment> 3517#include <shadowmap_pars_fragment> 3518#include <shadowmask_pars_fragment> 3519void main() { 3520 #include <logdepthbuf_fragment> 3521 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3522 #include <tonemapping_fragment> 3523 #include <colorspace_fragment> 3524 #include <fog_fragment> 3525}`,A5=`uniform float rotation; 3526uniform vec2 center; 3527#include <common> 3528#include <uv_pars_vertex> 3529#include <fog_pars_vertex> 3530#include <logdepthbuf_pars_vertex> 3531#include <clipping_planes_pars_vertex> 3532void main() { 3533 #include <uv_vertex> 3534 vec4 mvPosition = modelViewMatrix[ 3 ]; 3535 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3536 #ifndef USE_SIZEATTENUATION 3537 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3538 if ( isPerspective ) scale *= - mvPosition.z; 3539 #endif 3540 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3541 vec2 rotatedPosition; 3542 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3543 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3544 mvPosition.xy += rotatedPosition; 3545 gl_Position = projectionMatrix * mvPosition; 3546 #include <logdepthbuf_vertex> 3547 #include <clipping_planes_vertex> 3548 #include <fog_vertex> 3549}`,l5=`uniform vec3 diffuse; 3550uniform float opacity; 3551#include <common> 3552#include <uv_pars_fragment> 3553#include <map_pars_fragment> 3554#include <alphamap_pars_fragment> 3555#include <alphatest_pars_fragment> 3556#include <alphahash_pars_fragment> 3557#include <fog_pars_fragment> 3558#include <logdepthbuf_pars_fragment> 3559#include <clipping_planes_pars_fragment> 3560void main() { 3561 vec4 diffuseColor = vec4( diffuse, opacity ); 3562 #include <clipping_planes_fragment> 3563 vec3 outgoingLight = vec3( 0.0 ); 3564 #include <logdepthbuf_fragment> 3565 #include <map_fragment> 3566 #include <alphamap_fragment> 3567 #include <alphatest_fragment> 3568 #include <alphahash_fragment> 3569 outgoingLight = diffuseColor.rgb; 3570 #include <opaque_fragment> 3571 #include <tonemapping_fragment> 3572 #include <colorspace_fragment> 3573 #include <fog_fragment> 3574}
3574`,ln={alphahash_fragment:RI,alphahash_pars_fragment:UI,alphamap_fragment:MI,alphamap_pars_fragment:NI,alphatest_fragment:DI,alphatest_pars_fragment:LI,aomap_fragment:OI,aomap_pars_fragment:PI,batching_pars_vertex:kI,batching_vertex:$I,begin_vertex:QI,beginnormal_vertex:HI,bsdfs:VI,iridescence_fragment:GI,bumpmap_pars_fragment:zI,clipping_planes_fragment:WI,clipping_planes_pars_fragment:KI,clipping_planes_pars_vertex:XI,clipping_planes_vertex:jI,color_fragment:YI,color_pars_fragment:qI,color_pars_vertex:JI,color_vertex:ZI,common:eF,cube_uv_reflection_fragment:tF,defaultnormal_vertex:nF,displacementmap_pars_vertex:rF,displacementmap_vertex:iF,emissivemap_fragment:sF,emissivemap_pars_fragment:aF,colorspace_fragment:oF,colorspace_pars_fragment:AF,envmap_fragment:lF,envmap_common_pars_fragment:cF,envmap_pars_fragment:uF,envmap_pars_vertex:hF,envmap_physical_pars_fragment:CF,envmap_vertex:fF,fog_vertex:dF,fog_pars_vertex:pF,fog_fragment:mF,fog_pars_fragment:gF,gradientmap_pars_fragment:yF,lightmap_pars_fragment:vF,lights_lambert_fragment:wF,lights_lambert_pars_fragment:xF,lights_pars_begin:bF,lights_toon_fragment:_F,lights_toon_pars_fragment:BF,lights_phong_fragment:EF,lights_phong_pars_fragment:SF,lights_physical_fragment:TF,lights_physical_pars_fragment:IF,lights_fragment_begin:FF,lights_fragment_maps:RF,lights_fragment_end:UF,logdepthbuf_fragment:MF,logdepthbuf_pars_fragment:NF,logdepthbuf_pars_vertex:DF,logdepthbuf_vertex:LF,map_fragment:OF,map_pars_fragment:PF,map_particle_fragment:kF,map_particle_pars_fragment:$F,metalnessmap_fragment:QF,metalnessmap_pars_fragment:HF,morphinstance_vertex:VF,morphcolor_vertex:GF,morphnormal_vertex:zF,morphtarget_pars_vertex:WF,morphtarget_vertex:KF,normal_fragment_begin:XF,normal_fragment_maps:jF,normal_pars_fragment:YF,normal_pars_vertex:qF,normal_vertex:JF,normalmap_pars_fragment:ZF,clearcoat_normal_fragment_begin:e6,clearcoat_normal_fragment_maps:t6,clearcoat_pars_fragment:n6,iridescence_pars_fragment:r6,opaque_fragment:i6,packing:s6,premultiplied_alpha_fragment:a6,project_vertex:o6,dithering_fragment:A6,dithering_pars_fragment:l6,roughnessmap_fragment:c6,roughnessmap_pars_fragment:u6,shadowmap_pars_fragment:h6,shadowmap_pars_vertex:f6,shadowmap_vertex:d6,shadowmask_pars_fragment:p6,skinbase_vertex:m6,skinning_pars_vertex:g6,skinning_vertex:y6,skinnormal_vertex:v6,specularmap_fragment:w6,specularmap_pars_fragment:x6,tonemapping_fragment:b6,tonemapping_pars_fragment:C6,transmission_fragment:_6,transmission_pars_fragment:B6,uv_pars_fragment:E6,uv_pars_vertex:S6,uv_vertex:T6,worldpos_vertex:I6,background_vert:F6,background_frag:R6,backgroundCube_vert:U6,backgroundCube_frag:M6,cube_vert:N6,cube_frag:D6,depth_vert:L6,depth_frag:O6,distanceRGBA_vert:P6,distanceRGBA_frag:k6,equirect_vert:$6,equirect_frag:Q6,linedashed_vert:H6,linedashed_frag:V6,meshbasic_vert:G6,meshbasic_frag:z6,meshlambert_vert:W6,meshlambert_frag:K6,meshmatcap_vert:X6,meshmatcap_frag:j6,meshnormal_vert:Y6,meshnormal_frag:q6,meshphong_vert:J6,meshphong_frag:Z6,meshphysical_vert:e5,meshphysical_frag:t5,meshtoon_vert:n5,meshtoon_frag:r5,points_vert:i5,points_frag:s5,shadow_vert:a5,shadow_frag:o5,sprite_vert:A5,sprite_frag:l5},at={common:{diffuse:{value:new Yt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nn}},envmap:{envMap:{value:null},envMapRotation:{value:new nn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nn},normalScale:{value:new Kt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Yt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Yt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0},uvTransform:{value:new nn}},sprite:{diffuse:{value:new Yt(16777215)},opacity:{value:1},center:{value:new Kt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}}},ks={basic:{uniforms:ii([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.fog]),vertexShader:ln.meshbasic_vert,fragmentShader:ln.meshbasic_frag},lambert:{uniforms:ii([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new Yt(0)}}]),vertexShader:ln.meshlambert_vert,fragmentShader:ln.meshlambert_frag},phong:{uniforms:ii([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new Yt(0)},specular:{value:new Yt(1118481)},shininess:{value:30}}]),vertexShader:ln.meshphong_vert,fragmentShader:ln.meshphong_frag},standard:{uniforms:ii([at.common,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.roughnessmap,at.metalnessmap,at.fog,at.lights,{emissive:{value:new Yt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ln.meshphysical_vert,fragmentShader:ln.meshphysical_frag},toon:{uniforms:ii([at.common,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.gradientmap,at.fog,at.lights,{emissive:{value:new Yt(0)}}]),vertexShader:ln.meshtoon_vert,fragmentShader:ln.meshtoon_frag},matcap:{uniforms:ii([at.common,at.bumpmap,at.normalmap,at.displacementmap,at.fog,{matc
vendor: 4,492 bytes, line 3574
3574ap:{value:null}}]),vertexShader:ln.meshmatcap_vert,fragmentShader:ln.meshmatcap_frag},points:{uniforms:ii([at.points,at.fog]),vertexShader:ln.points_vert,fragmentShader:ln.points_frag},dashed:{uniforms:ii([at.common,at.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ln.linedashed_vert,fragmentShader:ln.linedashed_frag},depth:{uniforms:ii([at.common,at.displacementmap]),vertexShader:ln.depth_vert,fragmentShader:ln.depth_frag},normal:{uniforms:ii([at.common,at.bumpmap,at.normalmap,at.displacementmap,{opacity:{value:1}}]),vertexShader:ln.meshnormal_vert,fragmentShader:ln.meshnormal_frag},sprite:{uniforms:ii([at.sprite,at.fog]),vertexShader:ln.sprite_vert,fragmentShader:ln.sprite_frag},background:{uniforms:{uvTransform:{value:new nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ln.background_vert,fragmentShader:ln.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nn}},vertexShader:ln.backgroundCube_vert,fragmentShader:ln.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ln.cube_vert,fragmentShader:ln.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ln.equirect_vert,fragmentShader:ln.equirect_frag},distanceRGBA:{uniforms:ii([at.common,at.displacementmap,{referencePosition:{value:new Ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ln.distanceRGBA_vert,fragmentShader:ln.distanceRGBA_frag},shadow:{uniforms:ii([at.lights,at.fog,{color:{value:new Yt(0)},opacity:{value:1}}]),vertexShader:ln.shadow_vert,fragmentShader:ln.shadow_frag}};ks.physical={uniforms:ii([ks.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nn},clearcoatNormalScale:{value:new Kt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nn},sheen:{value:0},sheenColor:{value:new Yt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nn},transmissionSamplerSize:{value:new Kt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nn},attenuationDistance:{value:0},attenuationColor:{value:new Yt(0)},specularColor:{value:new Yt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nn},anisotropyVector:{value:new Kt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nn}}]),vertexShader:ln.meshphysical_vert,fragmentShader:ln.meshphysical_frag};const Ju={r:0,b:0,g:0},Do=new js,c5=new an;function u5(n,e,t,r,i,s,a){const o=new Yt(0);let A=s===!0?0:1,l,c,u=null,h=0,f=null;function d(C){let b=C.isScene===!0?C.background:null;return b&&b.isTexture&&(b=(C.backgroundBlurriness>0?t:e).get(b)),b}function g(C){let b=!1;const U=d(C);U===null?p(o,A):U&&U.isColor&&(p(U,1),b=!0);const F=n.xr.getEnvironmentBlendMode();F==="additive"?r.buffers.color.setClear(0,0,0,1,a):F==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(n.autoClear||b)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function m(C,b){const U=d(b);U&&(U.isCubeTexture||U.mapping===kf)?(c===void 0&&(c=new Ci(new hu(1,1,1),new yo({name:"BackgroundCubeMaterial",uniforms:Cl(ks.backgroundCube.uniforms),vertexShader:ks.backgroundCube.vertexShader,fragmentShader:ks.backgroundCube.fragmentShader,side:Bi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(F,D,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}
vendor: 5,935 bytes, line 3574
3574),i.update(c)),Do.copy(b.backgroundRotation),Do.x*=-1,Do.y*=-1,Do.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Do.y*=-1,Do.z*=-1),c.material.uniforms.envMap.value=U,c.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(c5.makeRotationFromEuler(Do)),c.material.toneMapped=xn.getTransfer(U.colorSpace)!==Dn,(u!==U||h!==U.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,u=U,h=U.version,f=n.toneMapping),c.layers.enableAll(),C.unshift(c,c.geometry,c.material,0,0,null)):U&&U.isTexture&&(l===void 0&&(l=new Ci(new $f(2,2),new yo({name:"BackgroundMaterial",uniforms:Cl(ks.background.uniforms),vertexShader:ks.background.vertexShader,fragmentShader:ks.background.fragmentShader,side:_a,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=U,l.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,l.material.toneMapped=xn.getTransfer(U.colorSpace)!==Dn,U.matrixAutoUpdate===!0&&U.updateMatrix(),l.material.uniforms.uvTransform.value.copy(U.matrix),(u!==U||h!==U.version||f!==n.toneMapping)&&(l.material.needsUpdate=!0,u=U,h=U.version,f=n.toneMapping),l.layers.enableAll(),C.unshift(l,l.geometry,l.material,0,0,null))}function p(C,b){C.getRGB(Ju,$y(n)),r.buffers.color.setClear(Ju.r,Ju.g,Ju.b,b,a)}function w(){c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(C,b=1){o.set(C),A=b,p(o,A)},getClearAlpha:function(){return A},setClearAlpha:function(C){A=C,p(o,A)},render:g,addToRenderList:m,dispose:w}}function h5(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),r={},i=h(null);let s=i,a=!1;function o(R,V,re,Y,se){let ge=!1;const ue=u(Y,re,V);s!==ue&&(s=ue,l(s.object)),ge=f(R,Y,re,se),ge&&d(R,Y,re,se),se!==null&&e.update(se,n.ELEMENT_ARRAY_BUFFER),(ge||a)&&(a=!1,b(R,V,re,Y),se!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(se).buffer))}function A(){return n.createVertexArray()}function l(R){return n.bindVertexArray(R)}function c(R){return n.deleteVertexArray(R)}function u(R,V,re){const Y=re.wireframe===!0;let se=r[R.id];se===void 0&&(se={},r[R.id]=se);let ge=se[V.id];ge===void 0&&(ge={},se[V.id]=ge);let ue=ge[Y];return ue===void 0&&(ue=h(A()),ge[Y]=ue),ue}function h(R){const V=[],re=[],Y=[];for(let se=0;se<t;se++)V[se]=0,re[se]=0,Y[se]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:V,enabledAttributes:re,attributeDivisors:Y,object:R,attributes:{},index:null}}function f(R,V,re,Y){const se=s.attributes,ge=V.attributes;let ue=0;const Ce=re.getAttributes();for(const ae in Ce)if(Ce[ae].location>=0){const Pe=se[ae];let $e=ge[ae];if($e===void 0&&(ae==="instanceMatrix"&&R.instanceMatrix&&($e=R.instanceMatrix),ae==="instanceColor"&&R.instanceColor&&($e=R.instanceColor)),Pe===void 0||Pe.attribute!==$e||$e&&Pe.data!==$e.data)return!0;ue++}return s.attributesNum!==ue||s.index!==Y}function d(R,V,re,Y){const se={},ge=V.attributes;let ue=0;const Ce=re.getAttributes();for(const ae in Ce)if(Ce[ae].location>=0){let Pe=ge[ae];Pe===void 0&&(ae==="instanceMatrix"&&R.instanceMatrix&&(Pe=R.instanceMatrix),ae==="instanceColor"&&R.instanceColor&&(Pe=R.instanceColor));const $e={};$e.attribute=Pe,Pe&&Pe.data&&($e.data=Pe.data),se[ae]=$e,ue++}s.attributes=se,s.attributesNum=ue,s.index=Y}function g(){const R=s.newAttributes;for(let V=0,re=R.length;V<re;V++)R[V]=0}function m(R){p(R,0)}function p(R,V){const re=s.newAttributes,Y=s.enabledAttributes,se=s.attributeDivisors;re[R]=1,Y[R]===0&&(n.enableVertexAttribArray(R),Y[R]=1),se[R]!==V&&(n.vertexAttribDivisor(R,V),se[R]=V)}function w(){const R=s.newAttributes,V=s.enabledAttributes;for(let re=0,Y=V.length;re<Y;re++)V[re]!==R[re]&&(n.disableVertexAttribArray(re),V[re]=0)}function C(R,V,re,Y,se,ge,ue){ue===!0?n.vertexAttribIPointer(R,V,re,se,ge):n.vertexAttribPointer(R,V,re,Y,se,ge)}function b(R,V,re,Y){g();const se=Y.attributes,ge=re.getAttributes(),ue=V.defaultAttributeValues;for(const Ce in ge){const ae=ge[Ce];if(ae.location>=0){let we=se[Ce];if(we===void 0&&(Ce==="instanceMatrix"&&R.instanceMatrix&&(we=R.instanceMatrix),Ce==="instanceColor"&&R.instanceColor&&(we=R.instanceColor)),we!==void 0){const Pe=we.normalized,$e=we.itemSize,yt=e.get(we);if(yt===void 0)continue;const Dt=yt.buffer,Be=yt.type,De=yt.bytesPerElement,je=Be===n.INT||Be===n.UNSIGNED_INT||we.gpuType===tg;if(we.isInterleavedBufferAttribute){const Ke=we.data,xt=Ke.stride,It=we.offset;if(Ke.isInstancedInterleavedBuffer){for(let ht=0;ht<ae.locationSize;ht++)p(ae.location+ht,Ke.meshPerAttribute);R.isInstancedMesh!==!0&&Y._maxInstanceCount===void 0&&(Y._maxInstanceCount=Ke.meshPerAttribute*Ke.count)}else for(let ht=0;ht<ae.locationSize;ht++)m(ae.location+ht);n.bindBuffer(n.ARRAY_BUFFER,Dt);for(let ht=0;ht<ae.locationSize;ht++)C(ae.location+ht,$e/ae.locationSize,Be,Pe,xt*De,(It+$e/ae.locationSize*ht)*De,je)}else{if(we.isInstancedBufferAttribute){for(let Ke=0;Ke<ae.locationSize;Ke++)p(ae.location+Ke,we.meshPerAttribute);R.isInstancedMesh!==!0&&Y._maxInstanceCount===void 0&&(Y._maxInstanceCount=we.meshPerAttribute*we.count)}else for(let Ke=0;Ke<ae.locationSize;Ke++)m(ae.location+Ke);n.bindBuffer(n.ARRAY_BUFFER,Dt);for(let Ke=0;Ke<ae.locationSize;Ke++)C(ae.location+Ke,$e/ae.locationSize,Be,Pe,$e*De,$e/ae.locationSize*Ke*De,je)}}else if(ue!==void 0){const Pe=ue[Ce];if(Pe!==void 0)switch(Pe.length){case 2:n.vertexAttrib2fv(ae.location,Pe);break;case 3:n.vertexAttrib3fv(ae.location,Pe);break;case 4:n.vertexAttrib4fv(ae.location,Pe);break;default:n.vertexAttrib1fv(ae.location,Pe)}}}}w()}function U(){O();
vendor: 1,173 bytes, line 3574
3574for(const R in r){const V=r[R];for(const re in V){const Y=V[re];for(const se in Y)c(Y[se].object),delete Y[se];delete V[re]}delete r[R]}}function F(R){if(r[R.id]===void 0)return;const V=r[R.id];for(const re in V){const Y=V[re];for(const se in Y)c(Y[se].object),delete Y[se];delete V[re]}delete r[R.id]}function D(R){for(const V in r){const re=r[V];if(re[R.id]===void 0)continue;const Y=re[R.id];for(const se in Y)c(Y[se].object),delete Y[se];delete re[R.id]}}function O(){I(),a=!0,s!==i&&(s=i,l(s.object))}function I(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:O,resetDefaultState:I,dispose:U,releaseStatesOfGeometry:F,releaseStatesOfProgram:D,initAttributes:g,enableAttribute:m,disableUnusedAttributes:w}}function f5(n,e,t){let r;function i(l){r=l}function s(l,c){n.drawArrays(r,l,c),t.update(c,r,1)}function a(l,c,u){u!==0&&(n.drawArraysInstanced(r,l,c,u),t.update(c,r,u))}function o(l,c,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,l,0,c,0,u);let f=0;for(let d=0;d<u;d++)f+=c[d];t.update(f,r,1)}function A(l,c,u,h){if(u===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let d=0;d<l.length;d++)a(l[d],c[d],h[d]);
vendor: 12,579 bytes, lines 3574-3649
3574else{f.multiDrawArraysInstancedWEBGL(r,l,0,c,0,h,0,u);let d=0;for(let g=0;g<u;g++)d+=c[g]*h[g];t.update(d,r,1)}}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=A}function d5(n,e,t,r){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const D=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(D.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(D){return!(D!==Zi&&r.convert(D)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(D){const O=D===cu&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(D!==Ks&&r.convert(D)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&D!==_s&&!O)}function A(D){if(D==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";D="mediump"}return D==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=t.precision!==void 0?t.precision:"highp";const c=A(l);c!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",c,"instead."),l=c);const u=t.logarithmicDepthBuffer===!0,h=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),d=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_TEXTURE_SIZE),m=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),p=n.getParameter(n.MAX_VERTEX_ATTRIBS),w=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),C=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),U=d>0,F=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:A,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:u,reverseDepthBuffer:h,maxTextures:f,maxVertexTextures:d,maxTextureSize:g,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:w,maxVaryings:C,maxFragmentUniforms:b,vertexTextures:U,maxSamples:F}}function p5(n){const e=this;let t=null,r=0,i=!1,s=!1;const a=new qa,o=new nn,A={value:null,needsUpdate:!1};this.uniform=A,this.numPlanes=0,this.numIntersection=0,this.init=function(u,h){const f=u.length!==0||h||r!==0||i;return i=h,r=u.length,f},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,h){t=c(u,h,0)},this.setState=function(u,h,f){const d=u.clippingPlanes,g=u.clipIntersection,m=u.clipShadows,p=n.get(u);if(!i||d===null||d.length===0||s&&!m)s?c(null):l();else{const w=s?0:r,C=w*4;let b=p.clippingState||null;A.value=b,b=c(d,h,C,f);for(let U=0;U!==C;++U)b[U]=t[U];p.clippingState=b,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=w}};function l(){A.value!==t&&(A.value=t,A.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(u,h,f,d){const g=u!==null?u.length:0;let m=null;if(g!==0){if(m=A.value,d!==!0||m===null){const p=f+g*4,w=h.matrixWorldInverse;o.getNormalMatrix(w),(m===null||m.length<p)&&(m=new Float32Array(p));for(let C=0,b=f;C!==g;++C,b+=4)a.copy(u[C]).applyMatrix4(w,o),a.normal.toArray(m,b),m[b+3]=a.constant}A.value=m,A.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,m}}function m5(n){let e=new WeakMap;function t(a,o){return o===im?a.mapping=vl:o===sm&&(a.mapping=wl),a}function r(a){if(a&&a.isTexture){const o=a.mapping;if(o===im||o===sm)if(e.has(a)){const A=e.get(a).texture;return t(A,a.mapping)}else{const A=a.image;if(A&&A.height>0){const l=new LT(A.height);return l.fromEquirectangularTexture(n,a),e.set(a,l),a.addEventListener("dispose",i),t(l.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const A=e.get(o);A!==void 0&&(e.delete(o),A.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}const al=4,f0=[.125,.215,.35,.446,.526,.582],zo=20,Kd=new Qf,d0=new Yt;let Xd=null,jd=0,Yd=0,qd=!1;const Ho=(1+Math.sqrt(5))/2,zA=1/Ho,p0=[new Ae(-Ho,zA,0),new Ae(Ho,zA,0),new Ae(-zA,0,Ho),new Ae(zA,0,Ho),new Ae(0,Ho,-zA),new Ae(0,Ho,zA),new Ae(-1,1,-1),new Ae(1,1,-1),new Ae(-1,1,1),new Ae(1,1,1)],g5=new Ae;class m0{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,i=100,s={}){const{size:a=256,position:o=g5}=s;Xd=this._renderer.getRenderTarget(),jd=this._renderer.getActiveCubeFace(),Yd=this._renderer.getActiveMipmapLevel(),qd=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const A=this._allocateTargets();return A.depthBuffer=!0,this._sceneToCubeUV(e,r,i,A,o),t>0&&this._blur(A,0,0,t),this._applyPMREM(A),this._cleanup(A),A}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=v0(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=y0(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Xd,jd,Yd),this._renderer.xr.enabled=qd,e.scissorTest=!1,Zu(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===vl||e.mapping===wl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Xd=this._renderer.getRenderTarget(),jd=this._renderer.getActiveCubeFace(),Yd=this._renderer.getActiveMipmapLevel(),qd=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:Ni,minFilter:Ni,generateMipmaps:!1,type:cu,format:Zi,colorSpace:ui,depthBuffer:!1},i=g0(e,t,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=g0(e,t,r);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=y5(s)),this._blurMaterial=v5(s,e,t)}return i}_compileMaterial(e){const t=new Ci(this._lodPlanes[0],e);this._renderer.compile(t,Kd)}_sceneToCubeUV(e,t,r,i,s){const A=new oi(90,1,t,r),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,h=u.autoClear,f=u.toneMapping;u.getClearColor(d0),u.toneMapping=co,u.autoClear=!1;const d=new no({name:"PMREM.Background",side:Bi,depthWrite:!1,depthTest:!1}),g=new Ci(new hu,d);let m=!1;const p=e.background;p?p.isColor&&(d.color.copy(p),e.background=null,m=!0):(d.color.copy(d0),m=!0);for(let w=0;w<6;w++){const C=w%3;C===0?(A.up.set(0,l[w],0),A.position.set(s.x,s.y,s.z),A.lookAt(s.x+c[w],s.y,s.z)):C===1?(A.up.set(0,0,l[w]),A.position.set(s.x,s.y,s.z),A.lookAt(s.x,s.y+c[w],s.z)):(A.up.set(0,l[w],0),A.position.set(s.x,s.y,s.z),A.lookAt(s.x,s.y,s.z+c[w]));const b=this._cubeSize;Zu(i,C*b,w>2?b:0,b,b),u.setRenderTarget(i),m&&u.render(g,A),u.render(e,A)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=f,u.autoClear=h,e.background=p}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===vl||e.mapping===wl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=v0()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=y0());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Ci(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const A=this._cubeSize;Zu(t,0,0,3*A,2*A),r.setRenderTarget(t),r.render(a,Kd)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=p0[(i-s-1)%p0.length];this._blur(e,s-1,s,a,o)}t.autoClear=r}_blur(e,t,r,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,r,i,"latitudinal",s),this._halfBlur(a,e,r,r,i,"longitudinal",s)}_halfBlur(e,t,r,i,s,a,o){const A=this._renderer,l=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const c=3,u=new Ci(this._lodPlanes[i],l),h=l.uniforms,f=this._sizeLods[r]-1,d=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*zo-1),g=s/d,m=isFinite(s)?1+Math.floor(c*g):zo;m>zo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${zo}`);const p=[];let w=0;for(let D=0;D<zo;++D){const O=D/g,I=Math.exp(-O*O/2);p.push(I),D===0?w+=I:D<m&&(w+=2*I)}for(let D=0;D<p.length;D++)p[D]=p[D]/w;h.envMap.value=e.texture,h.samples.value=m,h.weights.value=p,h.latitudinal.value=a==="latitudinal",o&&(h.poleAxis.value=o);const{_lodMax:C}=this;h.dTheta.value=d,h.mipInt.value=C-r;const b=this._sizeLods[i],U=3*b*(i>C-al?i-C+al:0),F=4*(this._cubeSize-b);Zu(t,U,F,3*b,2*b),A.setRenderTarget(t),A.render(u,Kd)}}function y5(n){const e=[],t=[],r=[];let i=n;const s=n-al+1+f0.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);t.push(o);let A=1/o;a>n-al?A=f0[a-n+al-1]:a===0&&(A=0),r.push(A);const l=1/(o-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],f=6,d=6,g=3,m=2,p=1,w=new Float32Array(g*d*f),C=new Float32Array(m*d*f),b=new Float32Array(p*d*f);for(let F=0;F<f;F++){const D=F%3*2/3-1,O=F>2?0:-1,I=[D,O,0,D+2/3,O,0,D+2/3,O+1,0,D,O,0,D+2/3,O+1,0,D,O+1,0];w.set(I,g*d*F),C.set(h,m*d*F);const R=[F,F,F,F,F,F];b.set(R,p*d*F)}const U=new Is;U.setAttribute("position",new ci(w,g)),U.setAttribute("uv",new ci(C,m)),U.setAttribute("faceIndex",new ci(b,p)),e.push(U),i>al&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function g0(n,e,t){const r=new AA(n,e,t);return r.texture.mapping=kf,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Zu(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function v5(n,e,t){const r=new Float32Array(zo),i=new Ae(0,1,0);return new yo({name:"SphericalGaussianBlur",defines:{n:zo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:vg(),fragmentShader:` 3575 3576 precision mediump float; 3577 precision mediump int; 3578 3579 varying vec3 vOutputDirection; 3580 3581 uniform sampler2D envMap; 3582 uniform int samples; 3583 uniform float weights[ n ]; 3584 uniform bool latitudinal; 3585 uniform float dTheta; 3586 uniform float mipInt; 3587 uniform vec3 poleAxis; 3588 3589 #define ENVMAP_TYPE_CUBE_UV 3590 #include <cube_uv_reflection_fragment> 3591 3592 vec3 getSample( float theta, vec3 axis ) { 3593 3594 float cosTheta = cos( theta ); 3595 // Rodrigues' axis-angle rotation 3596 vec3 sampleDirection = vOutputDirection * cosTheta 3597 + cross( axis, vOutputDirection ) * sin( theta ) 3598 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3599 3600 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3601 3602 } 3603 3604 void main() { 3605 3606 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3607 3608 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3609 3610 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3611 3612 } 3613 3614 axis = normalize( axis ); 3615 3616 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3617 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3618 3619 for ( int i = 1; i < n; i++ ) { 3620 3621 if ( i >= samples ) { 3622 3623 break; 3624 3625 } 3626 3627 float theta = dTheta * float( i ); 3628 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3629 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3630 3631 } 3632 3633 } 3634 `,blending:lo,depthTest:!1,depthWrite:!1})}function y0(){return new yo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:vg(),fragmentShader:` 3635 3636 precision mediump float; 3637 precision mediump int; 3638 3639 varying vec3 vOutputDirection; 3640 3641 uniform sampler2D envMap; 3642 3643 #include <common> 3644 3645 void main() { 3646 3647 vec3 outputDirection = normalize( vOutputDirection ); 3648 vec2 uv = equirectUv( outputDirection ); 3649
3650 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3651 3652 } 3653 `,blending:lo,depthTest:!1,depthWrite:!1})}function v0(){return new yo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:vg(),fragmentShader:` 3654 3655 precision mediump float; 3656 precision mediump int; 3657 3658 uniform float flipEnvMap; 3659 3660 varying vec3 vOutputDirection; 3661 3662 uniform samplerCube envMap; 3663 3664 void main() { 3665 3666 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3667 3668 } 3669 `,blending:lo,depthTest:!1,depthWrite:!1})}function vg(){return` 3670 3671 precision mediump float; 3672 precision mediump int; 3673 3674 attribute float faceIndex; 3675 3676 varying vec3 vOutputDirection; 3677 3678 // RH coordinate system; PMREM face-indexing convention 3679 vec3 getDirection( vec2 uv, float face ) { 3680 3681 uv = 2.0 * uv - 1.0; 3682 3683 vec3 direction = vec3( uv, 1.0 ); 3684 3685 if ( face == 0.0 ) { 3686 3687 direction = direction.zyx; // ( 1, v, u ) pos x 3688 3689 } else if ( face == 1.0 ) { 3690 3691 direction = direction.xzy; 3692 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3693 3694 } else if ( face == 2.0 ) { 3695 3696 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3697 3698 } else if ( face == 3.0 ) { 3699 3700 direction = direction.zyx; 3701 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3702 3703 } else if ( face == 4.0 ) { 3704 3705 direction = direction.xzy; 3706 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3707 3708 } else if ( face == 5.0 ) { 3709 3710 direction.z *= -1.0; // ( u, v, -1 ) neg z 3711 3712 } 3713 3714 return direction; 3715 3716 } 3717 3718 void main() { 3719 3720 vOutputDirection = getDirection( uv, faceIndex ); 3721 gl_Position = vec4( position, 1.0 ); 3722 3723 } 3724 `}function w5(n){let e=new WeakMap,t=null;function r(o){if(o&&o.isTexture){const A=o.mapping,l=A===im||A===sm,c=A===vl||A===wl;if(l||c){let u=e.get(o);const h=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==h)return t===null&&(t=new m0(n)),u=l?t.fromEquirectangular(o,u):t.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return l&&f&&f.height>0||c&&f&&i(f)?(t===null&&(t=new m0(n)),u=l?t.fromEquirectangular(o):t.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),o.addEventListener("dispose",s),u.texture):null}}}return o}function i(o){let A=0;const l=6;for(let c=0;c<l;c++)o[c]!==void 0&&A++;return A===l}function s(o){const A=o.target;A.removeEventListener("dispose",s);const l=e.get(A);l!==void 0&&(e.delete(A),l.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:r,dispose:a}}function x5(n){const e={};function t(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(r)}return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(r){const i=t(r);return i===null&&Gh("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function b5(n,e,t,r){const i={},s=new WeakMap;function a(u){const h=u.target;h.index!==null&&e.remove(h.index);for(const d in h.attributes)e.remove(h.attributes[d]);h.removeEventListener("dispose",a),delete i[h.id];const f=s.get(h);f&&(e.remove(f),s.delete(h)),r.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,t.memory.geometries--}function o(u,h){return i[h.id]===!0||(h.addEventListener("dispose",a),i[h.id]=!0,t.memory.geometries++),h}function A(u){const h=u.attributes;for(const f in h)e.update(h[f],n.ARRAY_BUFFER)}function l(u){const h=[],f=u.index,d=u.attributes.position;let g=0;if(f!==null){const w=f.array;g=f.version;for(let C=0,b=w.length;C<b;
vendor: 17,808 bytes, lines 3724-3754
3724C+=3){const U=w[C+0],F=w[C+1],D=w[C+2];h.push(U,F,F,D,D,U)}}else if(d!==void 0){const w=d.array;g=d.version;for(let C=0,b=w.length/3-1;C<b;C+=3){const U=C+0,F=C+1,D=C+2;h.push(U,F,F,D,D,U)}}else return;const m=new(Ny(h)?ky:Py)(h,1);m.version=g;const p=s.get(u);p&&e.remove(p),s.set(u,m)}function c(u){const h=s.get(u);if(h){const f=u.index;f!==null&&h.version<f.version&&l(u)}else l(u);return s.get(u)}return{get:o,update:A,getWireframeAttribute:c}}function C5(n,e,t){let r;function i(h){r=h}let s,a;function o(h){s=h.type,a=h.bytesPerElement}function A(h,f){n.drawElements(r,f,s,h*a),t.update(f,r,1)}function l(h,f,d){d!==0&&(n.drawElementsInstanced(r,f,s,h*a,d),t.update(f,r,d))}function c(h,f,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,f,0,s,h,0,d);let m=0;for(let p=0;p<d;p++)m+=f[p];t.update(m,r,1)}function u(h,f,d,g){if(d===0)return;const m=e.get("WEBGL_multi_draw");if(m===null)for(let p=0;p<h.length;p++)l(h[p]/a,f[p],g[p]);else{m.multiDrawElementsInstancedWEBGL(r,f,0,s,h,0,g,0,d);let p=0;for(let w=0;w<d;w++)p+=f[w]*g[w];t.update(p,r,1)}}this.setMode=i,this.setIndex=o,this.render=A,this.renderInstances=l,this.renderMultiDraw=c,this.renderMultiDrawInstances=u}function _5(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,a,o){switch(t.calls++,a){case n.TRIANGLES:t.triangles+=o*(s/3);break;case n.LINES:t.lines+=o*(s/2);break;case n.LINE_STRIP:t.lines+=o*(s-1);break;case n.LINE_LOOP:t.lines+=o*s;break;case n.POINTS:t.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:r}}function B5(n,e,t){const r=new WeakMap,i=new Tn;function s(a,o,A){const l=a.morphTargetInfluences,c=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=c!==void 0?c.length:0;let h=r.get(o);if(h===void 0||h.count!==u){let I=function(){D.dispose(),r.delete(o),o.removeEventListener("dispose",I)};h!==void 0&&h.texture.dispose();const f=o.morphAttributes.position!==void 0,d=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,m=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],w=o.morphAttributes.color||[];let C=0;f===!0&&(C=1),d===!0&&(C=2),g===!0&&(C=3);let b=o.attributes.position.count*C,U=1;b>e.maxTextureSize&&(U=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const F=new Float32Array(b*U*4*u),D=new Dy(F,b,U,u);D.type=_s,D.needsUpdate=!0;const O=C*4;for(let R=0;R<u;R++){const V=m[R],re=p[R],Y=w[R],se=b*U*4*R;for(let ge=0;ge<V.count;ge++){const ue=ge*O;f===!0&&(i.fromBufferAttribute(V,ge),F[se+ue+0]=i.x,F[se+ue+1]=i.y,F[se+ue+2]=i.z,F[se+ue+3]=0),d===!0&&(i.fromBufferAttribute(re,ge),F[se+ue+4]=i.x,F[se+ue+5]=i.y,F[se+ue+6]=i.z,F[se+ue+7]=0),g===!0&&(i.fromBufferAttribute(Y,ge),F[se+ue+8]=i.x,F[se+ue+9]=i.y,F[se+ue+10]=i.z,F[se+ue+11]=Y.itemSize===4?i.w:1)}}h={count:u,texture:D,size:new Kt(b,U)},r.set(o,h),o.addEventListener("dispose",I)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)A.getUniforms().setValue(n,"morphTexture",a.morphTexture,t);else{let f=0;for(let g=0;g<l.length;g++)f+=l[g];const d=o.morphTargetsRelative?1:1-f;A.getUniforms().setValue(n,"morphTargetBaseInfluence",d),A.getUniforms().setValue(n,"morphTargetInfluences",l)}A.getUniforms().setValue(n,"morphTargetsTexture",h.texture,t),A.getUniforms().setValue(n,"morphTargetsTextureSize",h.size)}return{update:s}}function E5(n,e,t,r){let i=new WeakMap;function s(A){const l=r.render.frame,c=A.geometry,u=e.get(A,c);if(i.get(u)!==l&&(e.update(u),i.set(u,l)),A.isInstancedMesh&&(A.hasEventListener("dispose",o)===!1&&A.addEventListener("dispose",o),i.get(A)!==l&&(t.update(A.instanceMatrix,n.ARRAY_BUFFER),A.instanceColor!==null&&t.update(A.instanceColor,n.ARRAY_BUFFER),i.set(A,l))),A.isSkinnedMesh){const h=A.skeleton;i.get(h)!==l&&(h.update(),i.set(h,l))}return u}function a(){i=new WeakMap}function o(A){const l=A.target;l.removeEventListener("dispose",o),t.remove(l.instanceMatrix),l.instanceColor!==null&&t.remove(l.instanceColor)}return{update:s,dispose:a}}const Jy=new Ur,w0=new Ky(1,1),Zy=new Dy,ev=new vT,tv=new Hy,x0=[],b0=[],C0=new Float32Array(16),_0=new Float32Array(9),B0=new Float32Array(4);function $l(n,e,t){const r=n[0];if(r<=0||r>0)return n;const i=e*t;let s=x0[i];if(s===void 0&&(s=new Float32Array(i),x0[i]=s),e!==0){r.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,n[a].toArray(s,o)}return s}function Cr(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}function _r(n,e){for(let t=0,r=e.length;t<r;t++)n[t]=e[t]}function Hf(n,e){let t=b0[e];t===void 0&&(t=new Int32Array(e),b0[e]=t);for(let r=0;r!==e;++r)t[r]=n.allocateTextureUnit();return t}function S5(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function T5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cr(t,e))return;n.uniform2fv(this.addr,e),_r(t,e)}}function I5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Cr(t,e))return;n.uniform3fv(this.addr,e),_r(t,e)}}function F5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Cr(t,e))return;n.uniform4fv(this.addr,e),_r(t,e)}}function R5(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(Cr(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),_r(t,e)}else{if(Cr(t,r))return;B0.set(r),n.uniformMatrix2fv(this.addr,!1,B0),_r(t,r)}}function U5(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(Cr(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),_r(t,e)}else{if(Cr(t,r))return;_0.set(r),n.uniformMatrix3fv(this.addr,!1,_0),_r(t,r)}}function M5(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(Cr(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),_r(t,e)}else{if(Cr(t,r))return;C0.set(r),n.uniformMatrix4fv(this.addr,!1,C0),_r(t,r)}}function N5(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function D5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cr(t,e))return;n.uniform2iv(this.addr,e),_r(t,e)}}function L5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Cr(t,e))return;n.uniform3iv(this.addr,e),_r(t,e)}}function O5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Cr(t,e))return;n.uniform4iv(this.addr,e),_r(t,e)}}function P5(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function k5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cr(t,e))return;n.uniform2uiv(this.addr,e),_r(t,e)}}function $5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Cr(t,e))return;n.uniform3uiv(this.addr,e),_r(t,e)}}function Q5(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Cr(t,e))return;n.uniform4uiv(this.addr,e),_r(t,e)}}function H5(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i);let s;this.type===n.SAMPLER_2D_SHADOW?(w0.compareFunction=Uy,s=w0):s=Jy,t.setTexture2D(e||s,i)}function V5(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture3D(e||ev,i)}function G5(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTextureCube(e||tv,i)}function z5(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2DArray(e||Zy,i)}function W5(n){switch(n){case 5126:return S5;case 35664:return T5;case 35665:return I5;case 35666:return F5;case 35674:return R5;case 35675:return U5;case 35676:return M5;case 5124:case 35670:return N5;case 35667:case 35671:return D5;case 35668:case 35672:return L5;case 35669:case 35673:return O5;case 5125:return P5;case 36294:return k5;case 36295:return $5;case 36296:return Q5;case 35678:case 36198:case 36298:case 36306:case 35682:return H5;case 35679:case 36299:case 36307:return V5;case 35680:case 36300:case 36308:case 36293:return G5;case 36289:case 36303:case 36311:case 36292:return z5}}function K5(n,e){n.uniform1fv(this.addr,e)}function X5(n,e){const t=$l(e,this.size,2);n.uniform2fv(this.addr,t)}function j5(n,e){const t=$l(e,this.size,3);n.uniform3fv(this.addr,t)}function Y5(n,e){const t=$l(e,this.size,4);n.uniform4fv(this.addr,t)}function q5(n,e){const t=$l(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function J5(n,e){const t=$l(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function Z5(n,e){const t=$l(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function eR(n,e){n.uniform1iv(this.addr,e)}function tR(n,e){n.uniform2iv(this.addr,e)}function nR(n,e){n.uniform3iv(this.addr,e)}function rR(n,e){n.uniform4iv(this.addr,e)}function iR(n,e){n.uniform1uiv(this.addr,e)}function sR(n,e){n.uniform2uiv(this.addr,e)}function aR(n,e){n.uniform3uiv(this.addr,e)}function oR(n,e){n.uniform4uiv(this.addr,e)}function AR(n,e,t){const r=this.cache,i=e.length,s=Hf(t,i);Cr(r,s)||(n.uniform1iv(this.addr,s),_r(r,s));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Jy,s[a])}function lR(n,e,t){const r=this.cache,i=e.length,s=Hf(t,i);Cr(r,s)||(n.uniform1iv(this.addr,s),_r(r,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||ev,s[a])}function cR(n,e,t){const r=this.cache,i=e.length,s=Hf(t,i);Cr(r,s)||(n.uniform1iv(this.addr,s),_r(r,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||tv,s[a])}function uR(n,e,t){const r=this.cache,i=e.length,s=Hf(t,i);Cr(r,s)||(n.uniform1iv(this.addr,s),_r(r,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Zy,s[a])}function hR(n){switch(n){case 5126:return K5;case 35664:return X5;case 35665:return j5;case 35666:return Y5;case 35674:return q5;case 35675:return J5;case 35676:return Z5;case 5124:case 35670:return eR;case 35667:case 35671:return tR;case 35668:case 35672:return nR;case 35669:case 35673:return rR;case 5125:return iR;case 36294:return sR;case 36295:return aR;case 36296:return oR;case 35678:case 36198:case 36298:case 36306:case 35682:return AR;case 35679:case 36299:case 36307:return lR;case 35680:case 36300:case 36308:case 36293:return cR;case 36289:case 36303:case 36311:case 36292:return uR}}class fR{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=W5(t.type)}}class dR{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=hR(t.type)}}class pR{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,t[o.id],r)}}}const Jd=/(\w+)(\])?(\[|\.)?/g;function E0(n,e){n.seq.push(e),n.map[e.id]=e}function mR(n,e,t){const r=n.name,i=r.length;for(Jd.lastIndex=0;;){const s=Jd.exec(r),a=Jd.lastIndex;let o=s[1];const A=s[2]==="]",l=s[3];if(A&&(o=o|0),l===void 0||l==="["&&a+2===i){E0(t,l===void 0?new fR(o,n,e):new dR(o,n,e));break}else{let u=t.map[o];u===void 0&&(u=new pR(o),E0(t,u)),t=u}}}class zh{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<r;++i){const s=e.getActiveUniform(t,i),a=e.getUniformLocation(t,s.name);mR(s,a,this)}}setValue(e,t,r,i){const s=this.map[t];s!==void 0&&s.setValue(e,r,i)}setOptional(e,t,r){const i=t[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let s=0,a=t.length;s!==a;++s){const o=t[s],A=r[o.id];A.needsUpdate!==!1&&o.setValue(e,A.value,i)}}static seqWithValue(e,t){const r=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&r.push(a)}return r}}function S0(n,e,t){const r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r}const gR=37297;let yR=0;function vR(n,e){const t=n.split(` 3725`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=i;a<s;a++){const o=a+1;r.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return r.join(` 3726`)}const T0=new nn;function wR(n){xn._getMatrix(T0,xn.workingColorSpace,n);const e=`mat3( ${T0.elements.map(t=>t.toFixed(4))} )`;switch(xn.getTransfer(n)){case rf:return[e,"LinearTransferOETF"];case Dn:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function I0(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const a=parseInt(s[1]);return t.toUpperCase()+` 3727 3728`+i+` 3729 3730`+vR(n.getShaderSource(e),a)}else return i}function xR(n,e){const t=wR(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` 3731`)}function bR(n,e){let t;switch(e){case TS:t="Linear";break;case IS:t="Reinhard";break;case FS:t="Cineon";break;case RS:t="ACESFilmic";break;case MS:t="AgX";break;case NS:t="Neutral";break;case US:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const eh=new Ae;function CR(){xn.getLuminanceCoefficients(eh);const n=eh.x.toFixed(4),e=eh.y.toFixed(4),t=eh.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 3732`)}function _R(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(yc).join(` 3733`)}function BR(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` 3734`)}function ER(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=n.getActiveAttrib(e,i),a=s.name;let o=1;s.type===n.FLOAT_MAT2&&(o=2),s.type===n.FLOAT_MAT3&&(o=3),s.type===n.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:n.getAttribLocation(e,a),locationSize:o}}return t}function yc(n){return n!==""}function F0(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function R0(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const SR=/^[ \t]*#include +<([\w\d./]+)>/gm;function Om(n){return n.replace(SR,IR)}const TR=new Map;function IR(n,e){let t=ln[e];if(t===void 0){const r=TR.get(e);if(r!==void 0)t=ln[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return Om(t)}const FR=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function U0(n){return n.replace(FR,RR)}function RR(n,e,t,r){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function M0(n){let e=`precision ${n.precision} float; 3735 precision ${n.precision} int; 3736 precision ${n.precision} sampler2D; 3737 precision ${n.precision} samplerCube; 3738 precision ${n.precision} sampler3D; 3739 precision ${n.precision} sampler2DArray; 3740 precision ${n.precision} sampler2DShadow; 3741 precision ${n.precision} samplerCubeShadow; 3742 precision ${n.precision} sampler2DArrayShadow; 3743 precision ${n.precision} isampler2D; 3744 precision ${n.precision} isampler3D; 3745 precision ${n.precision} isamplerCube; 3746 precision ${n.precision} isampler2DArray; 3747 precision ${n.precision} usampler2D; 3748 precision ${n.precision} usampler3D; 3749 precision ${n.precision} usamplerCube; 3750 precision ${n.precision} usampler2DArray; 3751 `;return n.precision==="highp"?e+=` 3752#define HIGH_PRECISION`:n.precision==="mediump"?e+=` 3753#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=` 3754#define LOW_PRECISION`),e}function UR(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===vy?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===oS?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===fa&&(e="SHADOWMAP_TYPE_VSM"),e}function MR(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case vl:case wl:e="ENVMAP_TYPE_CUBE";break;case kf:e="ENVMAP_TYPE_CUBE_UV";break}return e}function NR(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case wl:e="ENVMAP_MODE_REFRACTION";break}return e}function DR(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case wy:e="ENVMAP_BLENDING_MULTIPLY";break;case ES:e="ENVMAP_BLENDING_MIX";break;case SS:e="ENVMAP_BLENDING_ADD";break}return e}function LR(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:r,max
vendor: 7,057 bytes, lines 3754-3761
3754Mip:t}}function OR(n,e,t,r){const i=n.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const A=UR(t),l=MR(t),c=NR(t),u=DR(t),h=LR(t),f=_R(t),d=BR(s),g=i.createProgram();let m,p,w=t.glslVersion?"#version "+t.glslVersion+` 3755`:"";t.isRawShaderMaterial?(m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,d].filter(yc).join(` 3756`),m.length>0&&(m+=` 3757`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,d].filter(yc).join(` 3758`),p.length>0&&(p+=` 3759`)):(m=[M0(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,d,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+A:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 3760`].filter(yc).join(` 3761`),p=[M0(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
3761IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+A:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==co?"#define TONE_MAPPING":"",t.toneMapping!==co?ln.tonemapping_pars_fragment:"",t.toneMapping!==co?bR("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ln.colorspace_pars_fragment,xR("linearToOutputTexel",t.outputColorSpace),CR(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 3762`].filter(yc).join(` 3763`)),a=Om(a),a=F0(a,t),a=R0(a,t),o=Om(o),o=F0(o,t),o=R0(o,t),a=U0(a),o=U0(o),t.isRawShaderMaterial!==!0&&(w=`#version 300 es 3764`,m=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` 3765`)+` 3766`+m,p=["#define varying in",t.glslVersion===T2?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===T2?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` 3767`)+` 3768`+p);const C=w+m+a,b=w+p+o,U=S0(i,i.VERTEX_SHADER,C),F=S0(i,i.FRAGMENT_SHADER,b);i.attachShader(g,U),i.attachShader(g,F),t.index0AttributeName!==void 0?i.bindAttribLocation(g,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g);function D(V){if(n.debug.checkShaderErrors){const re=i.getProgramInfoLog(g).trim(),Y=i.getShaderInfoLog(U).trim(),se=i.getShaderInfoLog(F).trim();let ge=!0,ue=!0;if(i.getProgramParameter(g,i.LINK_STATUS)===!1)if(ge=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,g,U,F);else{const Ce=I0(i,U,"vertex"),ae=I0(i,F,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,i.VALIDATE_STATUS)+` 3769 3770Material Name: `+V.name+` 3771Material Type: `+V.type+` 3772 3773Program Info Log: `+re+` 3774`+Ce+` 3775`+ae)}else re!==""?console.warn("THREE.WebGLProgram: Program Info Log:",re):(Y===""||se==="")&&(ue=!1);ue&&(V.diagnostics={runnable:ge,programLog:re,vertexShader:{log:Y,prefix:m},fragmentShader:{log:se,prefix:p}})}i.deleteShader(U),i.deleteShader(F),O=new zh(i,g),I=ER(i,g)}let O;this.getUniforms=function(){return O===void 0&&D(this),O};let I;this.getAttributes=function(){return I===void 0&&D(this),I};let R=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=i.getProgramParameter(g,gR)),R},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=yR++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=U,this.fragmentShader=F,this}let PR=0;class kR{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new $R(e),t.set(e,r)),r}}class $R{constructor(e){this.id=PR++,this.code=e,this.usedTimes=0}}function QR(n,e,t,r,i,s,a){const o=new Ly,A=new kR,l=new Set,c=[],u=i.logarithmicDepthBuffer,h=i.vertexTextures;let f=i.precision;
vendor: 18,980 bytes, lines 3775-3781
3775const d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(I){return l.add(I),I===0?"uv":`uv${I}`}function m(I,R,V,re,Y){const se=re.fog,ge=Y.geometry,ue=I.isMeshStandardMaterial?re.environment:null,Ce=(I.isMeshStandardMaterial?t:e).get(I.envMap||ue),ae=!!Ce&&Ce.mapping===kf?Ce.image.height:null,we=d[I.type];I.precision!==null&&(f=i.getMaxPrecision(I.precision),f!==I.precision&&console.warn("THREE.WebGLProgram.getParameters:",I.precision,"not supported, using",f,"instead."));const Pe=ge.morphAttributes.position||ge.morphAttributes.normal||ge.morphAttributes.color,$e=Pe!==void 0?Pe.length:0;let yt=0;ge.morphAttributes.position!==void 0&&(yt=1),ge.morphAttributes.normal!==void 0&&(yt=2),ge.morphAttributes.color!==void 0&&(yt=3);let Dt,Be,De,je;if(we){const on=ks[we];Dt=on.vertexShader,Be=on.fragmentShader}else Dt=I.vertexShader,Be=I.fragmentShader,A.update(I),De=A.getVertexShaderID(I),je=A.getFragmentShaderID(I);const Ke=n.getRenderTarget(),xt=n.state.buffers.depth.getReversed(),It=Y.isInstancedMesh===!0,ht=Y.isBatchedMesh===!0,pt=!!I.map,Pt=!!I.matcap,bt=!!Ce,Z=!!I.aoMap,cn=!!I.lightMap,Rt=!!I.bumpMap,kt=!!I.normalMap,st=!!I.displacementMap,Tt=!!I.emissiveMap,lt=!!I.metalnessMap,G=!!I.roughnessMap,L=I.anisotropy>0,he=I.clearcoat>0,Te=I.dispersion>0,Ne=I.iridescence>0,xe=I.sheen>0,qe=I.transmission>0,Ve=L&&!!I.anisotropyMap,vt=he&&!!I.clearcoatMap,Mt=he&&!!I.clearcoatNormalMap,Oe=he&&!!I.clearcoatRoughnessMap,ut=Ne&&!!I.iridescenceMap,Nt=Ne&&!!I.iridescenceThicknessMap,ft=xe&&!!I.sheenColorMap,Ge=xe&&!!I.sheenRoughnessMap,_t=!!I.specularMap,Bt=!!I.specularColorMap,un=!!I.specularIntensityMap,te=qe&&!!I.transmissionMap,Je=qe&&!!I.thicknessMap,be=!!I.gradientMap,Ee=!!I.alphaMap,Le=I.alphaTest>0,Ue=!!I.alphaHash,Ft=!!I.extensions;let wn=co;I.toneMapped&&(Ke===null||Ke.isXRRenderTarget===!0)&&(wn=n.toneMapping);const Pn={shaderID:we,shaderType:I.type,shaderName:I.name,vertexShader:Dt,fragmentShader:Be,defines:I.defines,customVertexShaderID:De,customFragmentShaderID:je,isRawShaderMaterial:I.isRawShaderMaterial===!0,glslVersion:I.glslVersion,precision:f,batching:ht,batchingColor:ht&&Y._colorsTexture!==null,instancing:It,instancingColor:It&&Y.instanceColor!==null,instancingMorph:It&&Y.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:Ke===null?n.outputColorSpace:Ke.isXRRenderTarget===!0?Ke.texture.colorSpace:ui,alphaToCoverage:!!I.alphaToCoverage,map:pt,matcap:Pt,envMap:bt,envMapMode:bt&&Ce.mapping,envMapCubeUVHeight:ae,aoMap:Z,lightMap:cn,bumpMap:Rt,normalMap:kt,displacementMap:h&&st,emissiveMap:Tt,normalMapObjectSpace:kt&&I.normalMapType===$S,normalMapTangentSpace:kt&&I.normalMapType===Ry,metalnessMap:lt,roughnessMap:G,anisotropy:L,anisotropyMap:Ve,clearcoat:he,clearcoatMap:vt,clearcoatNormalMap:Mt,clearcoatRoughnessMap:Oe,dispersion:Te,iridescence:Ne,iridescenceMap:ut,iridescenceThicknessMap:Nt,sheen:xe,sheenColorMap:ft,sheenRoughnessMap:Ge,specularMap:_t,specularColorMap:Bt,specularIntensityMap:un,transmission:qe,transmissionMap:te,thicknessMap:Je,gradientMap:be,opaque:I.transparent===!1&&I.blending===cl&&I.alphaToCoverage===!1,alphaMap:Ee,alphaTest:Le,alphaHash:Ue,combine:I.combine,mapUv:pt&&g(I.map.channel),aoMapUv:Z&&g(I.aoMap.channel),lightMapUv:cn&&g(I.lightMap.channel),bumpMapUv:Rt&&g(I.bumpMap.channel),normalMapUv:kt&&g(I.normalMap.channel),displacementMapUv:st&&g(I.displacementMap.channel),emissiveMapUv:Tt&&g(I.emissiveMap.channel),metalnessMapUv:lt&&g(I.metalnessMap.channel),roughnessMapUv:G&&g(I.roughnessMap.channel),anisotropyMapUv:Ve&&g(I.anisotropyMap.channel),clearcoatMapUv:vt&&g(I.clearcoatMap.channel),clearcoatNormalMapUv:Mt&&g(I.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Oe&&g(I.clearcoatRoughnessMap.channel),iridescenceMapUv:ut&&g(I.iridescenceMap.channel),iridescenceThicknessMapUv:Nt&&g(I.iridescenceThicknessMap.channel),sheenColorMapUv:ft&&g(I.sheenColorMap.channel),sheenRoughnessMapUv:Ge&&g(I.sheenRoughnessMap.channel),specularMapUv:_t&&g(I.specularMap.channel),specularColorMapUv:Bt&&g(I.specularColorMap.channel),specularIntensityMapUv:un&&g(I.specularIntensityMap.channel),transmissionMapUv:te&&g(I.transmissionMap.channel),thicknessMapUv:Je&&g(I.thicknessMap.channel),alphaMapUv:Ee&&g(I.alphaMap.channel),vertexTangents:!!ge.attributes.tangent&&(kt||L),vertexColors:I.vertexColors,vertexAlphas:I.vertexColors===!0&&!!ge.attributes.color&&ge.attributes.color.itemSize===4,pointsUvs:Y.isPoints===!0&&!!ge.attributes.uv&&(pt||Ee),fog:!!se,useFog:I.fog===!0,fogExp2:!!se&&se.isFogExp2,flatShading:I.flatShading===!0,sizeAttenuation:I.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:xt,skinning:Y.isSkinnedMesh===!0,morphTargets:ge.morphAttributes.position!==void 0,morphNormals:ge.morphAttributes.normal!==void 0,morphColors:ge.morphAttributes.color!==void 0,morphTargetsCount:$e,morphTextureStride:yt,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:I.dithering,shadowMapEnabled:n.shadowMap.enabled&&V.length>0,shadowMapType:n.shadowMap.type,toneMapping:wn,decodeVideoTexture:pt&&I.map.isVideoTexture===!0&&xn.getTransfer(I.map.colorSpace)===Dn,decodeVideoTextureEmissive:Tt&&I.emissiveMap.isVideoTexture===!0&&xn.getTransfer(I.emissiveMap.colorSpace)===Dn,premultipliedAlpha:I.premultipliedAlpha,doubleSided:I.side===$s,flipSided:I.side===Bi,useDepthPacking:I.depthPacking>=0,depthPacking:I.depthPacking||0,index0AttributeName:I.index0AttributeName,extensionClipCullDistance:Ft&&I.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ft&&I.extensions.multiDraw===!0||ht)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:I.customProgramCacheKey()};return Pn.vertexUv1s=l.has(1),Pn.vertexUv2s=l.has(2),Pn.vertexUv3s=l.has(3),l.clear(),Pn}function p(I){const R=[];if(I.shaderID?R.push(I.shaderID):(R.push(I.customVertexShaderID),R.push(I.customFragmentShaderID)),I.defines!==void 0)for(const V in I.defines)R.push(V),R.push(I.defines[V]);return I.isRawShaderMaterial===!1&&(w(R,I),C(R,I),R.push(n.outputColorSpace)),R.push(I.customProgramCacheKey),R.join()}function w(I,R){I.push(R.precision),I.push(R.outputColorSpace),I.push(R.envMapMode),I.push(R.envMapCubeUVHeight),I.push(R.mapUv),I.push(R.alphaMapUv),I.push(R.lightMapUv),I.push(R.aoMapUv),I.push(R.bumpMapUv),I.push(R.normalMapUv),I.push(R.displacementMapUv),I.push(R.emissiveMapUv),I.push(R.metalnessMapUv),I.push(R.roughnessMapUv),I.push(R.anisotropyMapUv),I.push(R.clearcoatMapUv),I.push(R.clearcoatNormalMapUv),I.push(R.clearcoatRoughnessMapUv),I.push(R.iridescenceMapUv),I.push(R.iridescenceThicknessMapUv),I.push(R.sheenColorMapUv),I.push(R.sheenRoughnessMapUv),I.push(R.specularMapUv),I.push(R.specularColorMapUv),I.push(R.specularIntensityMapUv),I.push(R.transmissionMapUv),I.push(R.thicknessMapUv),I.push(R.combine),I.push(R.fogExp2),I.push(R.sizeAttenuation),I.push(R.morphTargetsCount),I.push(R.morphAttributeCount),I.push(R.numDirLights),I.push(R.numPointLights),I.push(R.numSpotLights),I.push(R.numSpotLightMaps),I.push(R.numHemiLights),I.push(R.numRectAreaLights),I.push(R.numDirLightShadows),I.push(R.numPointLightShadows),I.push(R.numSpotLightShadows),I.push(R.numSpotLightShadowsWithMaps),I.push(R.numLightProbes),I.push(R.shadowMapType),I.push(R.toneMapping),I.push(R.numClippingPlanes),I.push(R.numClipIntersection),I.push(R.depthPacking)}function C(I,R){o.disableAll(),R.supportsVertexTextures&&o.enable(0),R.instancing&&o.enable(1),R.instancingColor&&o.enable(2),R.instancingMorph&&o.enable(3),R.matcap&&o.enable(4),R.envMap&&o.enable(5),R.normalMapObjectSpace&&o.enable(6),R.normalMapTangentSpace&&o.enable(7),R.clearcoat&&o.enable(8),R.iridescence&&o.enable(9),R.alphaTest&&o.enable(10),R.vertexColors&&o.enable(11),R.vertexAlphas&&o.enable(12),R.vertexUv1s&&o.enable(13),R.vertexUv2s&&o.enable(14),R.vertexUv3s&&o.enable(15),R.vertexTangents&&o.enable(16),R.anisotropy&&o.enable(17),R.alphaHash&&o.enable(18),R.batching&&o.enable(19),R.dispersion&&o.enable(20),R.batchingColor&&o.enable(21),I.push(o.mask),o.disableAll(),R.fog&&o.enable(0),R.useFog&&o.enable(1),R.flatShading&&o.enable(2),R.logarithmicDepthBuffer&&o.enable(3),R.reverseDepthBuffer&&o.enable(4),R.skinning&&o.enable(5),R.morphTargets&&o.enable(6),R.morphNormals&&o.enable(7),R.morphColors&&o.enable(8),R.premultipliedAlpha&&o.enable(9),R.shadowMapEnabled&&o.enable(10),R.doubleSided&&o.enable(11),R.flipSided&&o.enable(12),R.useDepthPacking&&o.enable(13),R.dithering&&o.enable(14),R.transmission&&o.enable(15),R.sheen&&o.enable(16),R.opaque&&o.enable(17),R.pointsUvs&&o.enable(18),R.decodeVideoTexture&&o.enable(19),R.decodeVideoTextureEmissive&&o.enable(20),R.alphaToCoverage&&o.enable(21),I.push(o.mask)}function b(I){const R=d[I.type];let V;if(R){const re=ks[R];V=UT.clone(re.uniforms)}else V=I.uniforms;return V}function U(I,R){let V;for(let re=0,Y=c.length;re<Y;re++){const se=c[re];if(se.cacheKey===R){V=se,++V.usedTimes;break}}return V===void 0&&(V=new OR(n,R,I,s),c.push(V)),V}function F(I){if(--I.usedTimes===0){const R=c.indexOf(I);c[R]=c[c.length-1],c.pop(),I.destroy()}}function D(I){A.remove(I)}function O(){A.dispose()}return{getParameters:m,getProgramCacheKey:p,getUniforms:b,acquireProgram:U,releaseProgram:F,releaseShaderCache:D,programs:c,dispose:O}}function HR(){let n=new WeakMap;function e(a){return n.has(a)}function t(a){let o=n.get(a);return o===void 0&&(o={},n.set(a,o)),o}function r(a){n.delete(a)}function i(a,o,A){n.get(a)[o]=A}function s(){n=new WeakMap}return{has:e,get:t,remove:r,update:i,dispose:s}}function VR(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function N0(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function D0(){const n=[];let e=0;const t=[],r=[],i=[];function s(){e=0,t.length=0,r.length=0,i.length=0}function a(u,h,f,d,g,m){let p=n[e];return p===void 0?(p={id:u.id,object:u,geometry:h,material:f,groupOrder:d,renderOrder:u.renderOrder,z:g,group:m},n[e]=p):(p.id=u.id,p.object=u,p.geometry=h,p.material=f,p.groupOrder=d,p.renderOrder=u.renderOrder,p.z=g,p.group=m),e++,p}function o(u,h,f,d,g,m){const p=a(u,h,f,d,g,m);f.transmission>0?r.push(p):f.transparent===!0?i.push(p):t.push(p)}function A(u,h,f,d,g,m){const p=a(u,h,f,d,g,m);f.transmission>0?r.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function l(u,h){t.length>1&&t.sort(u||VR),r.length>1&&r.sort(h||N0),i.length>1&&i.sort(h||N0)}function c(){for(let u=e,h=n.length;u<h;u++){const f=n[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:r,transparent:i,init:s,push:o,unshift:A,finish:c,sort:l}}function GR(){let n=new WeakMap;function e(r,i){const s=n.get(r);let a;return s===void 0?(a=new D0,n.set(r,[a])):i>=s.length?(a=new D0,s.push(a)):a=s[i],a}function t(){n=new WeakMap}return{get:e,dispose:t}}function zR(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Ae,color:new Yt};break;case"SpotLight":t={position:new Ae,direction:new Ae,color:new Yt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Ae,color:new Yt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Ae,skyColor:new Yt,groundColor:new Yt};break;case"RectAreaLight":t={color:new Yt,position:new Ae,halfWidth:new Ae,halfHeight:new Ae};break}return n[e.id]=t,t}}}function WR(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let KR=0;function XR(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function jR(n){const e=new zR,t=WR(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)r.probe.push(new Ae);const i=new Ae,s=new an,a=new an;function o(l){let c=0,u=0,h=0;for(let I=0;I<9;I++)r.probe[I].set(0,0,0);let f=0,d=0,g=0,m=0,p=0,w=0,C=0,b=0,U=0,F=0,D=0;l.sort(XR);for(let I=0,R=l.length;I<R;I++){const V=l[I],re=V.color,Y=V.intensity,se=V.distance,ge=V.shadow&&V.shadow.map?V.shadow.map.texture:null;if(V.isAmbientLight)c+=re.r*Y,u+=re.g*Y,h+=re.b*Y;else if(V.isLightProbe){for(let ue=0;ue<9;ue++)r.probe[ue].addScaledVector(V.sh.coefficients[ue],Y);D++}else if(V.isDirectionalLight){const ue=e.get(V);if(ue.color.copy(V.color).multiplyScalar(V.intensity),V.castShadow){const Ce=V.shadow,ae=t.get(V);ae.shadowIntensity=Ce.intensity,ae.shadowBias=Ce.bias,ae.shadowNormalBias=Ce.normalBias,ae.shadowRadius=Ce.radius,ae.shadowMapSize=Ce.mapSize,r.directionalShadow[f]=ae,r.directionalShadowMap[f]=ge,r.directionalShadowMatrix[f]=V.shadow.matrix,w++}r.directional[f]=ue,f++}else if(V.isSpotLight){const ue=e.get(V);ue.position.setFromMatrixPosition(V.matrixWorld),ue.color.copy(re).multiplyScalar(Y),ue.distance=se,ue.coneCos=Math.cos(V.angle),ue.penumbraCos=Math.cos(V.angle*(1-V.penumbra)),ue.decay=V.decay,r.spot[g]=ue;const Ce=V.shadow;if(V.map&&(r.spotLightMap[U]=V.map,U++,Ce.updateMatrices(V),V.castShadow&&F++),r.spotLightMatrix[g]=Ce.matrix,V.castShadow){const ae=t.get(V);ae.shadowIntensity=Ce.intensity,ae.shadowBias=Ce.bias,ae.shadowNormalBias=Ce.normalBias,ae.shadowRadius=Ce.radius,ae.shadowMapSize=Ce.mapSize,r.spotShadow[g]=ae,r.spotShadowMap[g]=ge,b++}g++}else if(V.isRectAreaLight){const ue=e.get(V);ue.color.copy(re).multiplyScalar(Y),ue.halfWidth.set(V.width*.5,0,0),ue.halfHeight.set(0,V.height*.5,0),r.rectArea[m]=ue,m++}else if(V.isPointLight){const ue=e.get(V);if(ue.color.copy(V.color).multiplyScalar(V.intensity),ue.distance=V.distance,ue.decay=V.decay,V.castShadow){const Ce=V.shadow,ae=t.get(V);ae.shadowIntensity=Ce.intensity,ae.shadowBias=Ce.bias,ae.shadowNormalBias=Ce.normalBias,ae.shadowRadius=Ce.radius,ae.shadowMapSize=Ce.mapSize,ae.shadowCameraNear=Ce.camera.near,ae.shadowCameraFar=Ce.camera.far,r.pointShadow[d]=ae,r.pointShadowMap[d]=ge,r.pointShadowMatrix[d]=V.shadow.matrix,C++}r.point[d]=ue,d++}else if(V.isHemisphereLight){const ue=e.get(V);ue.skyColor.copy(V.color).multiplyScalar(Y),ue.groundColor.copy(V.groundColor).multiplyScalar(Y),r.hemi[p]=ue,p++}}m>0&&(n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=at.LTC_FLOAT_1,r.rectAreaLTC2=at.LTC_FLOAT_2):(r.rectAreaLTC1=at.LTC_HALF_1,r.rectAreaLTC2=at.LTC_HALF_2)),r.ambient[0]=c,r.ambient[1]=u,r.ambient[2]=h;const O=r.hash;(O.directionalLength!==f||O.pointLength!==d||O.spotLength!==g||O.rectAreaLength!==m||O.hemiLength!==p||O.numDirectionalShadows!==w||O.numPointShadows!==C||O.numSpotShadows!==b||O.numSpotMaps!==U||O.numLightProbes!==D)&&(r.directional.length=f,r.spot.length=g,r.rectArea.length=m,r.point.length=d,r.hemi.length=p,r.directionalShadow.length=w,r.directionalShadowMap.length=w,r.pointShadow.length=C,r.pointShadowMap.length=C,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=w,r.pointShadowMatrix.length=C,r.spotLightMatrix.length=b+U-F,r.spotLightMap.length=U,r.numSpotLightShadowsWithMaps=F,r.numLightProbes=D,O.directionalLength=f,O.pointLength=d,O.spotLength=g,O.rectAreaLength=m,O.hemiLength=p,O.numDirectionalShadows=w,O.numPointShadows=C,O.numSpotShadows=b,O.numSpotMaps=U,O.numLightProbes=D,r.version=KR++)}function A(l,c){let u=0,h=0,f=0,d=0,g=0;const m=c.matrixWorldInverse;for(let p=0,w=l.length;p<w;p++){const C=l[p];if(C.isDirectionalLight){const b=r.directional[u];b.direction.setFromMatrixPosition(C.matrixWorld),i.setFromMatrixPosition(C.target.matrixWorld),b.direction.sub(i),b.direction.transformDirection(m),u++}else if(C.isSpotLight){const b=r.spot[f];b.position.setFromMatrixPosition(C.matrixWorld),b.position.applyMatrix4(m),b.direction.setFromMatrixPosition(C.matrixWorld),i.setFromMatrixPosition(C.target.matrixWorld),b.direction.sub(i),b.direction.transformDirection(m),f++}else if(C.isRectAreaLight){const b=r.rectArea[d];b.position.setFromMatrixPosition(C.matrixWorld),b.position.applyMatrix4(m),a.identity(),s.copy(C.matrixWorld),s.premultiply(m),a.extractRotation(s),b.halfWidth.set(C.width*.5,0,0),b.halfHeight.set(0,C.height*.5,0),b.halfWidth.applyMatrix4(a),b.halfHeight.applyMatrix4(a),d++}else if(C.isPointLight){const b=r.point[h];b.position.setFromMatrixPosition(C.matrixWorld),b.position.applyMatrix4(m),h++}else if(C.isHemisphereLight){const b=r.hemi[g];b.direction.setFromMatrixPosition(C.matrixWorld),b.direction.transformDirection(m),g++}}}return{setup:o,setupView:A,state:r}}function L0(n){const e=new jR(n),t=[],r=[];function i(c){l.camera=c,t.length=0,r.length=0}function s(c){t.push(c)}function a(c){r.push(c)}function o(){e.setup(t)}function A(c){e.setupView(t,c)}const l={lightsArray:t,shadowsArray:r,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:l,setupLights:o,setupLightsView:A,pushLight:s,pushShadow:a}}function YR(n){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new L0(n),e.set(i,[o])):s>=a.length?(o=new L0(n),a.push(o)):o=a[s],o}function r(){e=new WeakMap}return{get:t,dispose:r}}const qR=`void main() { 3776 gl_Position = vec4( position, 1.0 ); 3777}`,JR=`uniform sampler2D shadow_pass; 3778uniform vec2 resolution; 3779uniform float radius; 3780#include <packing> 3781void main() {
3782 const float samples = float( VSM_SAMPLES ); 3783 float mean = 0.0; 3784 float squared_mean = 0.0; 3785 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 3786 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 3787 for ( float i = 0.0; i < samples; i ++ ) { 3788 float uvOffset = uvStart + i * uvStride; 3789 #ifdef HORIZONTAL_PASS 3790 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3791 mean += distribution.x; 3792 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3793 #else 3794 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3795 mean += depth; 3796 squared_mean += depth * depth; 3797 #endif 3798 } 3799 mean = mean / samples; 3800 squared_mean = squared_mean / samples; 3801 float std_dev = sqrt( squared_mean - mean * mean ); 3802 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3803}`;function ZR(n,e,t){let r=new hg;const i=new Kt,s=new Kt,a=new Tn,o=new YT({depthPacking:kS}),A=new qT,l={},c=t.maxTextureSize,u={[_a]:Bi,[Bi]:_a,[$s]:$s},h=new yo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Kt},radius:{value:4}},vertexShader:qR,fragmentShader:JR}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const d=new Is;d.setAttribute("position",new ci(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Ci(d,h),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=vy;let p=this.type;this.render=function(F,D,O){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||F.length===0)return;const I=n.getRenderTarget(),R=n.getActiveCubeFace(),V=n.getActiveMipmapLevel(),re=n.state;re.setBlending(lo),re.buffers.color.setClear(1,1,1,1),re.buffers.depth.setTest(!0),re.setScissorTest(!1);const Y=p!==fa&&this.type===fa,se=p===fa&&this.type!==fa;for(let ge=0,ue=F.length;ge<ue;ge++){const Ce=F[ge],ae=Ce.shadow;if(ae===void 0){console.warn("THREE.WebGLShadowMap:",Ce,"has no shadow.");continue}if(ae.autoUpdate===!1&&ae.needsUpdate===!1)continue;i.copy(ae.mapSize);const we=ae.getFrameExtents();if(i.multiply(we),s.copy(ae.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(s.x=Math.floor(c/we.x),i.x=s.x*we.x,ae.mapSize.x=s.x),i.y>c&&(s.y=Math.floor(c/we.y),i.y=s.y*we.y,ae.mapSize.y=s.y)),ae.map===null||Y===!0||se===!0){const $e=this.type!==fa?{minFilter:li,magFilter:li}:{};ae.map!==null&&ae.map.dispose(),ae.map=new AA(i.x,i.y,$e),ae.map.texture.name=Ce.name+".shadowMap",ae.camera.updateProjectionMatrix()}n.setRenderTarget(ae.map),n.clear();const Pe=ae.getViewportCount();for(let $e=0;$e<Pe;$e++){const yt=ae.getViewport($e);a.set(s.x*yt.x,s.y*yt.y,s.x*yt.z,s.y*yt.w),re.viewport(a),ae.updateMatrices(Ce,$e),r=ae.getFrustum(),b(D,O,ae.camera,Ce,this.type)}ae.isPointLightShadow!==!0&&this.type===fa&&w(ae,O),ae.needsUpdate=!1}p=this.type,m.needsUpdate=!1,n.setRenderTarget(I,R,V)};function w(F,D){const O=e.update(g);h.defines.VSM_SAMPLES!==F.blurSamples&&(h.defines.VSM_SAMPLES=F.blurSamples,f.defines.VSM_SAMPLES=F.blurSamples,h.needsUpdate=!0,f.needsUpdate=!0),F.mapPass===null&&(F.mapPass=new AA(i.x,i.y)),h.uniforms.shadow_pass.value=F.map.texture,h.uniforms.resolution.value=F.mapSize,h.uniforms.radius.value=F.radius,n.setRenderTarget(F.mapPass),n.clear(),n.renderBufferDirect(D,null,O,h,g,null),f.uniforms.shadow_pass.value=F.mapPass.texture,f.uniforms.resolution.value=F.mapSize,f.uniforms.radius.value=F.radius,n.setRenderTarget(F.map),n.clear(),n.renderBufferDirect(D,null,O,f,g,null)}function C(F,D,O,I){let R=null;const V=O.isPointLight===!0?F.customDistanceMaterial:F.customDepthMaterial;if(V!==void 0)R=V;else if(R=O.isPointLight===!0?A:o,n.localClippingEnabled&&D.clipShadows===!0&&Array.isArray(D.clippingPlanes)&&D.clippingPlanes.length!==0||D.displacementMap&&D.displacementScale!==0||D.alphaMap&&D.alphaTest>0||D.map&&D.alphaTest>0||D.alphaToCoverage===!0){const re=R.uuid,Y=D.uuid;let se=l[re];se===void 0&&(se={},l[re]=se);let ge=se[Y];ge===void 0&&(ge=R.clone(),se[Y]=ge,D.addEventListener("dispose",U)),R=ge}if(R.visible=D.visible,R.wireframe=D.wireframe,I===fa?R.side=D.shadowSide!==null?D.shadowSide:D.side:R.side=D.shadowSide!==null?D.shadowSide:u[D.side],R.alphaMap=D.alphaMap,R.alphaTest=D.alphaToCoverage===!0?.5:D.alphaTest,R.map=D.map,R.clipShadows=D.clipShadows,R.clippingPlanes=D.clippingPlanes,R.clipIntersection=D.clipIntersection,R.displacementMap=D.displacementMap,R.displacementScale=D.displacementScale,R.displacementBias=D.displacementBias,R.wireframeLinewidth=D.wireframeLinewidth,R.linewidth=D.linewidth,O.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const re=n.properties.get(R);re.light=O}return R}function b(F,D,O,I,R){if(F.visible===!1)return;if(F.layers.test(D.layers)&&(F.isMesh||F.isLine||F.isPoints)&&(F.castShadow||F.receiveShadow&&R===fa)&&(!F.frustumCulled||r.intersectsObject(F))){F.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,F.matrixWorld);const Y=e.update(F),se=F.material;if(Array.isArray(se)){const ge=Y.groups;for(let ue=0,Ce=ge.length;ue<Ce;ue++){const ae=ge[ue],we=se[ae.materialIndex];if(we&&we.visible){const Pe=C(F,we,I,R);F.onBeforeShadow(n,F,D,O,Y,Pe,ae),n.renderBufferDirect(O,null,Y,Pe,F,ae),F.onAfterShadow(n,F,D,O,Y,Pe,ae)}}}else if(se.visible){const ge=C(F,se,I,R);F.onBeforeShadow(n,F,D,O,Y,ge,null),n.renderBufferDirect(O,null,Y,ge,F,null),F.onAfterShadow(n,F,D,O,Y,ge,null)}}const re=F.children;for(let Y=0,se=re.length;Y<se;Y++)b(re[Y],D,O,I,R)}function U(F){F.target.removeEventListener("dispose",U);for(const O in l){const I=l[O],R=F.target.uuid;R in I&&(I[R].dispose(),delete I[R])}}}const eU={[qp]:Jp,[Zp]:nm,[em]:rm,[yl]:tm,[Jp]:qp,[nm]:Zp,[rm]:em,[tm]:yl};function tU(n,e){function t(){let te=!1;const Je=new Tn;let be=null;const Ee=new Tn(0,0,0,0);return{setMask:function(Le){be!==Le&&!te&&(n.colorMask(Le,Le,Le,Le),be=Le)},setLocked:function(Le){te=Le},setClear:function(Le,Ue,Ft,wn,Pn){Pn===!0&&(Le*=wn,Ue*=wn,Ft*=wn),Je.set(Le,
vendor: 5,451 bytes, line 3803
3803Ue,Ft,wn),Ee.equals(Je)===!1&&(n.clearColor(Le,Ue,Ft,wn),Ee.copy(Je))},reset:function(){te=!1,be=null,Ee.set(-1,0,0,0)}}}function r(){let te=!1,Je=!1,be=null,Ee=null,Le=null;return{setReversed:function(Ue){if(Je!==Ue){const Ft=e.get("EXT_clip_control");Ue?Ft.clipControlEXT(Ft.LOWER_LEFT_EXT,Ft.ZERO_TO_ONE_EXT):Ft.clipControlEXT(Ft.LOWER_LEFT_EXT,Ft.NEGATIVE_ONE_TO_ONE_EXT),Je=Ue;const wn=Le;Le=null,this.setClear(wn)}},getReversed:function(){return Je},setTest:function(Ue){Ue?Ke(n.DEPTH_TEST):xt(n.DEPTH_TEST)},setMask:function(Ue){be!==Ue&&!te&&(n.depthMask(Ue),be=Ue)},setFunc:function(Ue){if(Je&&(Ue=eU[Ue]),Ee!==Ue){switch(Ue){case qp:n.depthFunc(n.NEVER);break;case Jp:n.depthFunc(n.ALWAYS);break;case Zp:n.depthFunc(n.LESS);break;case yl:n.depthFunc(n.LEQUAL);break;case em:n.depthFunc(n.EQUAL);break;case tm:n.depthFunc(n.GEQUAL);break;case nm:n.depthFunc(n.GREATER);break;case rm:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ee=Ue}},setLocked:function(Ue){te=Ue},setClear:function(Ue){Le!==Ue&&(Je&&(Ue=1-Ue),n.clearDepth(Ue),Le=Ue)},reset:function(){te=!1,be=null,Ee=null,Le=null,Je=!1}}}function i(){let te=!1,Je=null,be=null,Ee=null,Le=null,Ue=null,Ft=null,wn=null,Pn=null;return{setTest:function(on){te||(on?Ke(n.STENCIL_TEST):xt(n.STENCIL_TEST))},setMask:function(on){Je!==on&&!te&&(n.stencilMask(on),Je=on)},setFunc:function(on,Xn,Er){(be!==on||Ee!==Xn||Le!==Er)&&(n.stencilFunc(on,Xn,Er),be=on,Ee=Xn,Le=Er)},setOp:function(on,Xn,Er){(Ue!==on||Ft!==Xn||wn!==Er)&&(n.stencilOp(on,Xn,Er),Ue=on,Ft=Xn,wn=Er)},setLocked:function(on){te=on},setClear:function(on){Pn!==on&&(n.clearStencil(on),Pn=on)},reset:function(){te=!1,Je=null,be=null,Ee=null,Le=null,Ue=null,Ft=null,wn=null,Pn=null}}}const s=new t,a=new r,o=new i,A=new WeakMap,l=new WeakMap;let c={},u={},h=new WeakMap,f=[],d=null,g=!1,m=null,p=null,w=null,C=null,b=null,U=null,F=null,D=new Yt(0,0,0),O=0,I=!1,R=null,V=null,re=null,Y=null,se=null;const ge=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let ue=!1,Ce=0;const ae=n.getParameter(n.VERSION);ae.indexOf("WebGL")!==-1?(Ce=parseFloat(/^WebGL (\d)/.exec(ae)[1]),ue=Ce>=1):ae.indexOf("OpenGL ES")!==-1&&(Ce=parseFloat(/^OpenGL ES (\d)/.exec(ae)[1]),ue=Ce>=2);let we=null,Pe={};const $e=n.getParameter(n.SCISSOR_BOX),yt=n.getParameter(n.VIEWPORT),Dt=new Tn().fromArray($e),Be=new Tn().fromArray(yt);function De(te,Je,be,Ee){const Le=new Uint8Array(4),Ue=n.createTexture();n.bindTexture(te,Ue),n.texParameteri(te,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(te,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ft=0;Ft<be;Ft++)te===n.TEXTURE_3D||te===n.TEXTURE_2D_ARRAY?n.texImage3D(Je,0,n.RGBA,1,1,Ee,0,n.RGBA,n.UNSIGNED_BYTE,Le):n.texImage2D(Je+Ft,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,Le);return Ue}const je={};je[n.TEXTURE_2D]=De(n.TEXTURE_2D,n.TEXTURE_2D,1),je[n.TEXTURE_CUBE_MAP]=De(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),je[n.TEXTURE_2D_ARRAY]=De(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),je[n.TEXTURE_3D]=De(n.TEXTURE_3D,n.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),Ke(n.DEPTH_TEST),a.setFunc(yl),Rt(!1),kt(v2),Ke(n.CULL_FACE),Z(lo);function Ke(te){c[te]!==!0&&(n.enable(te),c[te]=!0)}function xt(te){c[te]!==!1&&(n.disable(te),c[te]=!1)}function It(te,Je){return u[te]!==Je?(n.bindFramebuffer(te,Je),u[te]=Je,te===n.DRAW_FRAMEBUFFER&&(u[n.FRAMEBUFFER]=Je),te===n.FRAMEBUFFER&&(u[n.DRAW_FRAMEBUFFER]=Je),!0):!1}function ht(te,Je){let be=f,Ee=!1;if(te){be=h.get(Je),be===void 0&&(be=[],h.set(Je,be));const Le=te.textures;if(be.length!==Le.length||be[0]!==n.COLOR_ATTACHMENT0){for(let Ue=0,Ft=Le.length;Ue<Ft;Ue++)be[Ue]=n.COLOR_ATTACHMENT0+Ue;be.length=Le.length,Ee=!0}}else be[0]!==n.BACK&&(be[0]=n.BACK,Ee=!0);Ee&&n.drawBuffers(be)}function pt(te){return d!==te?(n.useProgram(te),d=te,!0):!1}const Pt={[Go]:n.FUNC_ADD,[lS]:n.FUNC_SUBTRACT,[cS]:n.FUNC_REVERSE_SUBTRACT};Pt[uS]=n.MIN,Pt[hS]=n.MAX;const bt={[fS]:n.ZERO,[dS]:n.ONE,[pS]:n.SRC_COLOR,[jp]:n.SRC_ALPHA,[xS]:n.SRC_ALPHA_SATURATE,[vS]:n.DST_COLOR,[gS]:n.DST_ALPHA,[mS]:n.ONE_MINUS_SRC_COLOR,[Yp]:n.ONE_MINUS_SRC_ALPHA,[wS]:n.ONE_MINUS_DST_COLOR,[yS]:n.ONE_MINUS_DST_ALPHA,[bS]:n.CONSTANT_COLOR,[CS]:n.ONE_MINUS_CONSTANT_COLOR,[_S]:n.CONSTANT_ALPHA,[BS]:n.ONE_MINUS_CONSTANT_ALPHA};function Z(te,Je,be,Ee,Le,Ue,Ft,wn,Pn,on){if(te===lo){g===!0&&(xt(n.BLEND),g=!1);return}if(g===!1&&(Ke(n.BLEND),g=!0),te!==AS){if(te!==m||on!==I){if((p!==Go||b!==Go)&&(n.blendEquation(n.FUNC_ADD),p=Go,b=Go),on)switch(te){case cl:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case w2:n.blendFunc(n.ONE,n.ONE);break;case x2:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case b2:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}else switch(te){case cl:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case w2:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case x2:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case b2:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}w=null,C=null,U=null,F=null,D.set(0,0,0),O=0,m=te,I=on}return}Le=Le||Je,Ue=Ue||be,Ft=Ft||Ee,(Je!==p||Le!==b)&&(n.blendEquationSeparate(Pt[Je],Pt[Le]),p=Je,b=Le),(be!==w||Ee!==C||Ue!==U||Ft!==F)&&(n.blendFuncSeparate(bt[be],bt[Ee],bt[Ue],bt[Ft]),w=be,C=Ee,U=Ue,F=Ft),(wn.equals(D)===!1||Pn!==O)&&(n.blendColor
vendor: 3,516 bytes, line 3803
3803(wn.r,wn.g,wn.b,Pn),D.copy(wn),O=Pn),m=te,I=!1}function cn(te,Je){te.side===$s?xt(n.CULL_FACE):Ke(n.CULL_FACE);let be=te.side===Bi;Je&&(be=!be),Rt(be),te.blending===cl&&te.transparent===!1?Z(lo):Z(te.blending,te.blendEquation,te.blendSrc,te.blendDst,te.blendEquationAlpha,te.blendSrcAlpha,te.blendDstAlpha,te.blendColor,te.blendAlpha,te.premultipliedAlpha),a.setFunc(te.depthFunc),a.setTest(te.depthTest),a.setMask(te.depthWrite),s.setMask(te.colorWrite);const Ee=te.stencilWrite;o.setTest(Ee),Ee&&(o.setMask(te.stencilWriteMask),o.setFunc(te.stencilFunc,te.stencilRef,te.stencilFuncMask),o.setOp(te.stencilFail,te.stencilZFail,te.stencilZPass)),Tt(te.polygonOffset,te.polygonOffsetFactor,te.polygonOffsetUnits),te.alphaToCoverage===!0?Ke(n.SAMPLE_ALPHA_TO_COVERAGE):xt(n.SAMPLE_ALPHA_TO_COVERAGE)}function Rt(te){R!==te&&(te?n.frontFace(n.CW):n.frontFace(n.CCW),R=te)}function kt(te){te!==sS?(Ke(n.CULL_FACE),te!==V&&(te===v2?n.cullFace(n.BACK):te===aS?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):xt(n.CULL_FACE),V=te}function st(te){te!==re&&(ue&&n.lineWidth(te),re=te)}function Tt(te,Je,be){te?(Ke(n.POLYGON_OFFSET_FILL),(Y!==Je||se!==be)&&(n.polygonOffset(Je,be),Y=Je,se=be)):xt(n.POLYGON_OFFSET_FILL)}function lt(te){te?Ke(n.SCISSOR_TEST):xt(n.SCISSOR_TEST)}function G(te){te===void 0&&(te=n.TEXTURE0+ge-1),we!==te&&(n.activeTexture(te),we=te)}function L(te,Je,be){be===void 0&&(we===null?be=n.TEXTURE0+ge-1:be=we);let Ee=Pe[be];Ee===void 0&&(Ee={type:void 0,texture:void 0},Pe[be]=Ee),(Ee.type!==te||Ee.texture!==Je)&&(we!==be&&(n.activeTexture(be),we=be),n.bindTexture(te,Je||je[te]),Ee.type=te,Ee.texture=Je)}function he(){const te=Pe[we];te!==void 0&&te.type!==void 0&&(n.bindTexture(te.type,null),te.type=void 0,te.texture=void 0)}function Te(){try{n.compressedTexImage2D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Ne(){try{n.compressedTexImage3D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function xe(){try{n.texSubImage2D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function qe(){try{n.texSubImage3D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Ve(){try{n.compressedTexSubImage2D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function vt(){try{n.compressedTexSubImage3D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Mt(){try{n.texStorage2D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Oe(){try{n.texStorage3D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function ut(){try{n.texImage2D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function Nt(){try{n.texImage3D(...arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function ft(te){Dt.equals(te)===!1&&(n.scissor(te.x,te.y,te.z,te.w),Dt.copy(te))}function Ge(te){Be.equals(te)===!1&&(n.viewport(te.x,te.y,te.z,te.w),Be.copy(te))}function _t(te,Je){let be=l.get(Je);be===void 0&&(be=new WeakMap,l.set(Je,be));let Ee=be.get(te);Ee===void 0&&(Ee=n.getUniformBlockIndex(Je,te.name),be.set(te,Ee))}function Bt(te,Je){const Ee=l.get(Je).get(te);A.get(Je)!==Ee&&(n.uniformBlockBinding(Je,Ee,te.__bindingPointIndex),A.set(Je,Ee))}function un(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor
vendor: 32,883 bytes, line 3803
3803(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),a.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),c={},we=null,Pe={},u={},h=new WeakMap,f=[],d=null,g=!1,m=null,p=null,w=null,C=null,b=null,U=null,F=null,D=new Yt(0,0,0),O=0,I=!1,R=null,V=null,re=null,Y=null,se=null,Dt.set(0,0,n.canvas.width,n.canvas.height),Be.set(0,0,n.canvas.width,n.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:Ke,disable:xt,bindFramebuffer:It,drawBuffers:ht,useProgram:pt,setBlending:Z,setMaterial:cn,setFlipSided:Rt,setCullFace:kt,setLineWidth:st,setPolygonOffset:Tt,setScissorTest:lt,activeTexture:G,bindTexture:L,unbindTexture:he,compressedTexImage2D:Te,compressedTexImage3D:Ne,texImage2D:ut,texImage3D:Nt,updateUBOMapping:_t,uniformBlockBinding:Bt,texStorage2D:Mt,texStorage3D:Oe,texSubImage2D:xe,texSubImage3D:qe,compressedTexSubImage2D:Ve,compressedTexSubImage3D:vt,scissor:ft,viewport:Ge,reset:un}}function nU(n,e,t,r,i,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,A=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Kt,c=new WeakMap;let u;const h=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(G,L){return f?new OffscreenCanvas(G,L):Wc("canvas")}function g(G,L,he){let Te=1;const Ne=lt(G);if((Ne.width>he||Ne.height>he)&&(Te=he/Math.max(Ne.width,Ne.height)),Te<1)if(typeof HTMLImageElement<"u"&&G instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&G instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&G instanceof ImageBitmap||typeof VideoFrame<"u"&&G instanceof VideoFrame){const xe=Math.floor(Te*Ne.width),qe=Math.floor(Te*Ne.height);u===void 0&&(u=d(xe,qe));const Ve=L?d(xe,qe):u;return Ve.width=xe,Ve.height=qe,Ve.getContext("2d").drawImage(G,0,0,xe,qe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ne.width+"x"+Ne.height+") to ("+xe+"x"+qe+")."),Ve}else return"data"in G&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ne.width+"x"+Ne.height+")."),G;return G}function m(G){return G.generateMipmaps}function p(G){n.generateMipmap(G)}function w(G){return G.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:G.isWebGL3DRenderTarget?n.TEXTURE_3D:G.isWebGLArrayRenderTarget||G.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function C(G,L,he,Te,Ne=!1){if(G!==null){if(n[G]!==void 0)return n[G];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+G+"'")}let xe=L;if(L===n.RED&&(he===n.FLOAT&&(xe=n.R32F),he===n.HALF_FLOAT&&(xe=n.R16F),he===n.UNSIGNED_BYTE&&(xe=n.R8)),L===n.RED_INTEGER&&(he===n.UNSIGNED_BYTE&&(xe=n.R8UI),he===n.UNSIGNED_SHORT&&(xe=n.R16UI),he===n.UNSIGNED_INT&&(xe=n.R32UI),he===n.BYTE&&(xe=n.R8I),he===n.SHORT&&(xe=n.R16I),he===n.INT&&(xe=n.R32I)),L===n.RG&&(he===n.FLOAT&&(xe=n.RG32F),he===n.HALF_FLOAT&&(xe=n.RG16F),he===n.UNSIGNED_BYTE&&(xe=n.RG8)),L===n.RG_INTEGER&&(he===n.UNSIGNED_BYTE&&(xe=n.RG8UI),he===n.UNSIGNED_SHORT&&(xe=n.RG16UI),he===n.UNSIGNED_INT&&(xe=n.RG32UI),he===n.BYTE&&(xe=n.RG8I),he===n.SHORT&&(xe=n.RG16I),he===n.INT&&(xe=n.RG32I)),L===n.RGB_INTEGER&&(he===n.UNSIGNED_BYTE&&(xe=n.RGB8UI),he===n.UNSIGNED_SHORT&&(xe=n.RGB16UI),he===n.UNSIGNED_INT&&(xe=n.RGB32UI),he===n.BYTE&&(xe=n.RGB8I),he===n.SHORT&&(xe=n.RGB16I),he===n.INT&&(xe=n.RGB32I)),L===n.RGBA_INTEGER&&(he===n.UNSIGNED_BYTE&&(xe=n.RGBA8UI),he===n.UNSIGNED_SHORT&&(xe=n.RGBA16UI),he===n.UNSIGNED_INT&&(xe=n.RGBA32UI),he===n.BYTE&&(xe=n.RGBA8I),he===n.SHORT&&(xe=n.RGBA16I),he===n.INT&&(xe=n.RGBA32I)),L===n.RGB&&he===n.UNSIGNED_INT_5_9_9_9_REV&&(xe=n.RGB9_E5),L===n.RGBA){const qe=Ne?rf:xn.getTransfer(Te);he===n.FLOAT&&(xe=n.RGBA32F),he===n.HALF_FLOAT&&(xe=n.RGBA16F),he===n.UNSIGNED_BYTE&&(xe=qe===Dn?n.SRGB8_ALPHA8:n.RGBA8),he===n.UNSIGNED_SHORT_4_4_4_4&&(xe=n.RGBA4),he===n.UNSIGNED_SHORT_5_5_5_1&&(xe=n.RGB5_A1)}return(xe===n.R16F||xe===n.R32F||xe===n.RG16F||xe===n.RG32F||xe===n.RGBA16F||xe===n.RGBA32F)&&e.get("EXT_color_buffer_float"),xe}function b(G,L){let he;return G?L===null||L===oA||L===Qc?he=n.DEPTH24_STENCIL8:L===_s?he=n.DEPTH32F_STENCIL8:L===$c&&(he=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):L===null||L===oA||L===Qc?he=n.DEPTH_COMPONENT24:L===_s?he=n.DEPTH_COMPONENT32F:L===$c&&(he=n.DEPTH_COMPONENT16),he}function U(G,L){return m(G)===!0||G.isFramebufferTexture&&G.minFilter!==li&&G.minFilter!==Ni?Math.log2(Math.max(L.width,L.height))+1:G.mipmaps!==void 0&&G.mipmaps.length>0?G.mipmaps.length:G.isCompressedTexture&&Array.isArray(G.image)?L.mipmaps.length:1}function F(G){const L=G.target;L.removeEventListener("dispose",F),O(L),L.isVideoTexture&&c.delete(L)}function D(G){const L=G.target;L.removeEventListener("dispose",D),R(L)}function O(G){const L=r.get(G);if(L.__webglInit===void 0)return;const he=G.source,Te=h.get(he);if(Te){const Ne=Te[L.__cacheKey];Ne.usedTimes--,Ne.usedTimes===0&&I(G),Object.keys(Te).length===0&&h.delete(he)}r.remove(G)}function I(G){const L=r.get(G);n.deleteTexture(L.__webglTexture);const he=G.source,Te=h.get(he);delete Te[L.__cacheKey],a.memory.textures--}function R(G){const L=r.get(G);if(G.depthTexture&&(G.depthTexture.dispose(),r.remove(G.depthTexture)),G.isWebGLCubeRenderTarget)for(let Te=0;Te<6;Te++){if(Array.isArray(L.__webglFramebuffer[Te]))for(let Ne=0;Ne<L.__webglFramebuffer[Te].length;Ne++)n.deleteFramebuffer(L.__webglFramebuffer[Te][Ne]);else n.deleteFramebuffer(L.__webglFramebuffer[Te]);L.__webglDepthbuffer&&n.deleteRenderbuffer(L.__webglDepthbuffer[Te])}else{if(Array.isArray(L.__webglFramebuffer))for(let Te=0;Te<L.__webglFramebuffer.length;Te++)n.deleteFramebuffer(L.__webglFramebuffer[Te]);else n.deleteFramebuffer(L.__webglFramebuffer);if(L.__webglDepthbuffer&&n.deleteRenderbuffer(L.__webglDepthbuffer),L.__webglMultisampledFramebuffer&&n.deleteFramebuffer(L.__webglMultisampledFramebuffer),L.__webglColorRenderbuffer)for(let Te=0;Te<L.__webglColorRenderbuffer.length;Te++)L.__webglColorRenderbuffer[Te]&&n.deleteRenderbuffer(L.__webglColorRenderbuffer[Te]);L.__webglDepthRenderbuffer&&n.deleteRenderbuffer(L.__webglDepthRenderbuffer)}const he=G.textures;for(let Te=0,Ne=he.length;Te<Ne;Te++){const xe=r.get(he[Te]);xe.__webglTexture&&(n.deleteTexture(xe.__webglTexture),a.memory.textures--),r.remove(he[Te])}r.remove(G)}let V=0;function re(){V=0}function Y(){const G=V;return G>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+G+" texture units while this GPU supports only "+i.maxTextures),V+=1,G}function se(G){const L=[];return L.push(G.wrapS),L.push(G.wrapT),L.push(G.wrapR||0),L.push(G.magFilter),L.push(G.minFilter),L.push(G.anisotropy),L.push(G.internalFormat),L.push(G.format),L.push(G.type),L.push(G.generateMipmaps),L.push(G.premultiplyAlpha),L.push(G.flipY),L.push(G.unpackAlignment),L.push(G.colorSpace),L.join()}function ge(G,L){const he=r.get(G);if(G.isVideoTexture&&st(G),G.isRenderTargetTexture===!1&&G.version>0&&he.__version!==G.version){const Te=G.image;if(Te===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Te.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Be(he,G,L);return}}t.bindTexture(n.TEXTURE_2D,he.__webglTexture,n.TEXTURE0+L)}function ue(G,L){const he=r.get(G);if(G.version>0&&he.__version!==G.version){Be(he,G,L);return}t.bindTexture(n.TEXTURE_2D_ARRAY,he.__webglTexture,n.TEXTURE0+L)}function Ce(G,L){const he=r.get(G);if(G.version>0&&he.__version!==G.version){Be(he,G,L);return}t.bindTexture(n.TEXTURE_3D,he.__webglTexture,n.TEXTURE0+L)}function ae(G,L){const he=r.get(G);if(G.version>0&&he.__version!==G.version){De(he,G,L);return}t.bindTexture(n.TEXTURE_CUBE_MAP,he.__webglTexture,n.TEXTURE0+L)}const we={[xl]:n.REPEAT,[to]:n.CLAMP_TO_EDGE,[nf]:n.MIRRORED_REPEAT},Pe={[li]:n.NEAREST,[by]:n.NEAREST_MIPMAP_NEAREST,[gc]:n.NEAREST_MIPMAP_LINEAR,[Ni]:n.LINEAR,[Ph]:n.LINEAR_MIPMAP_NEAREST,[ya]:n.LINEAR_MIPMAP_LINEAR},$e={[QS]:n.NEVER,[KS]:n.ALWAYS,[HS]:n.LESS,[Uy]:n.LEQUAL,[VS]:n.EQUAL,[WS]:n.GEQUAL,[GS]:n.GREATER,[zS]:n.NOTEQUAL};function yt(G,L){if(L.type===_s&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===Ni||L.magFilter===Ph||L.magFilter===gc||L.magFilter===ya||L.minFilter===Ni||L.minFilter===Ph||L.minFilter===gc||L.minFilter===ya)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(G,n.TEXTURE_WRAP_S,we[L.wrapS]),n.texParameteri(G,n.TEXTURE_WRAP_T,we[L.wrapT]),(G===n.TEXTURE_3D||G===n.TEXTURE_2D_ARRAY)&&n.texParameteri(G,n.TEXTURE_WRAP_R,we[L.wrapR]),n.texParameteri(G,n.TEXTURE_MAG_FILTER,Pe[L.magFilter]),n.texParameteri(G,n.TEXTURE_MIN_FILTER,Pe[L.minFilter]),L.compareFunction&&(n.texParameteri(G,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(G,n.TEXTURE_COMPARE_FUNC,$e[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===li||L.minFilter!==gc&&L.minFilter!==ya||L.type===_s&&e.has("OES_texture_float_linear")===!1)return;if(L.anisotropy>1||r.get(L).__currentAnisotropy){const he=e.get("EXT_texture_filter_anisotropic");n.texParameterf(G,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,i.getMaxAnisotropy())),r.get(L).__currentAnisotropy=L.anisotropy}}}function Dt(G,L){let he=!1;G.__webglInit===void 0&&(G.__webglInit=!0,L.addEventListener("dispose",F));const Te=L.source;let Ne=h.get(Te);Ne===void 0&&(Ne={},h.set(Te,Ne));const xe=se(L);if(xe!==G.__cacheKey){Ne[xe]===void 0&&(Ne[xe]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,he=!0),Ne[xe].usedTimes++;const qe=Ne[G.__cacheKey];qe!==void 0&&(Ne[G.__cacheKey].usedTimes--,qe.usedTimes===0&&I(L)),G.__cacheKey=xe,G.__webglTexture=Ne[xe].texture}return he}function Be(G,L,he){let Te=n.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(Te=n.TEXTURE_2D_ARRAY),L.isData3DTexture&&(Te=n.TEXTURE_3D);const Ne=Dt(G,L),xe=L.source;t.bindTexture(Te,G.__webglTexture,n.TEXTURE0+he);const qe=r.get(xe);if(xe.version!==qe.__version||Ne===!0){t.activeTexture(n.TEXTURE0+he);const Ve=xn.getPrimaries(xn.workingColorSpace),vt=L.colorSpace===eo?null:xn.getPrimaries(L.colorSpace),Mt=L.colorSpace===eo||Ve===vt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,L.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,L.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Mt);let Oe=g(L.image,!1,i.maxTextureSize);Oe=Tt(L,Oe);const ut=s.convert(L.format,L.colorSpace),Nt=s.convert(L.type);let ft=C(L.internalFormat,ut,Nt,L.colorSpace,L.isVideoTexture);yt(Te,L);let Ge;const _t=L.mipmaps,Bt=L.isVideoTexture!==!0,un=qe.__version===void 0||Ne===!0,te=xe.dataReady,Je=U(L,Oe);if(L.isDepthTexture)ft=b(L.format===Vc,L.type),un&&(Bt?t.texStorage2D(n.TEXTURE_2D,1,ft,Oe.width,Oe.height):t.texImage2D(n.TEXTURE_2D,0,ft,Oe.width,Oe.height,0,ut,Nt,null));else if(L.isDataTexture)if(_t.length>0){Bt&&un&&t.texStorage2D(n.TEXTURE_2D,Je,ft,_t[0].width,_t[0].height);for(let be=0,Ee=_t.length;be<Ee;be++)Ge=_t[be],Bt?te&&t.texSubImage2D(n.TEXTURE_2D,be,0,0,Ge.width,Ge.height,ut,Nt,Ge.data):t.texImage2D(n.TEXTURE_2D,be,ft,Ge.width,Ge.height,0,ut,Nt,Ge.data);L.generateMipmaps=!1}else Bt?(un&&t.texStorage2D(n.TEXTURE_2D,Je,ft,Oe.width,Oe.height),te&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Oe.width,Oe.height,ut,Nt,Oe.data)):t.texImage2D(n.TEXTURE_2D,0,ft,Oe.width,Oe.height,0,ut,Nt,Oe.data);else if(L.isCompressedTexture)if(L.isCompressedArrayTexture){Bt&&un&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Je,ft,_t[0].width,_t[0].height,Oe.depth);for(let be=0,Ee=_t.length;be<Ee;be++)if(Ge=_t[be],L.format!==Zi)if(ut!==null)if(Bt){if(te)if(L.layerUpdates.size>0){const Le=h0(Ge.width,Ge.height,L.format,L.type);for(const Ue of L.layerUpdates){const Ft=Ge.data.subarray(Ue*Le/Ge.data.BYTES_PER_ELEMENT,(Ue+1)*Le/Ge.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,be,0,0,Ue,Ge.width,Ge.height,1,ut,Ft)}L.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,be,0,0,0,Ge.width,Ge.height,Oe.depth,ut,Ge.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,be,ft,Ge.width,Ge.height,Oe.depth,0,Ge.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Bt?te&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,be,0,0,0,Ge.width,Ge.height,Oe.depth,ut,Nt,Ge.data):t.texImage3D(n.TEXTURE_2D_ARRAY,be,ft,Ge.width,Ge.height,Oe.depth,0,ut,Nt,Ge.data)}else{Bt&&un&&t.texStorage2D(n.TEXTURE_2D,Je,ft,_t[0].width,_t[0].height);for(let be=0,Ee=_t.length;be<Ee;be++)Ge=_t[be],L.format!==Zi?ut!==null?Bt?te&&t.compressedTexSubImage2D(n.TEXTURE_2D,be,0,0,Ge.width,Ge.height,ut,Ge.data):t.compressedTexImage2D(n.TEXTURE_2D,be,ft,Ge.width,Ge.height,0,Ge.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Bt?te&&t.texSubImage2D(n.TEXTURE_2D,be,0,0,Ge.width,Ge.height,ut,Nt,Ge.data):t.texImage2D(n.TEXTURE_2D,be,ft,Ge.width,Ge.height,0,ut,Nt,Ge.data)}else if(L.isDataArrayTexture)if(Bt){if(un&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Je,ft,Oe.width,Oe.height,Oe.depth),te)if(L.layerUpdates.size>0){const be=h0(Oe.width,Oe.height,L.format,L.type);for(const Ee of L.layerUpdates){const Le=Oe.data.subarray(Ee*be/Oe.data.BYTES_PER_ELEMENT,(Ee+1)*be/Oe.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Ee,Oe.width,Oe.height,1,ut,Nt,Le)}L.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Oe.width,Oe.height,Oe.depth,ut,Nt,Oe.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,ft,Oe.width,Oe.height,Oe.depth,0,ut,Nt,Oe.data);else if(L.isData3DTexture)Bt?(un&&t.texStorage3D(n.TEXTURE_3D,Je,ft,Oe.width,Oe.height,Oe.depth),te&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Oe.width,Oe.height,Oe.depth,ut,Nt,Oe.data)):t.texImage3D(n.TEXTURE_3D,0,ft,Oe.width,Oe.height,Oe.depth,0,ut,Nt,Oe.data);else if(L.isFramebufferTexture){if(un)if(Bt)t.texStorage2D(n.TEXTURE_2D,Je,ft,Oe.width,Oe.height);else{let be=Oe.width,Ee=Oe.height;for(let Le=0;Le<Je;Le++)t.texImage2D(n.TEXTURE_2D,Le,ft,be,Ee,0,ut,Nt,null),be>>=1,Ee>>=1}}else if(_t.length>0){if(Bt&&un){const be=lt(_t[0]);t.texStorage2D(n.TEXTURE_2D,Je,ft,be.width,be.height)}for(let be=0,Ee=_t.length;be<Ee;be++)Ge=_t[be],Bt?te&&t.texSubImage2D(n.TEXTURE_2D,be,0,0,ut,Nt,Ge):t.texImage2D(n.TEXTURE_2D,be,ft,ut,Nt,Ge);L.generateMipmaps=!1}else if(Bt){if(un){const be=lt(Oe);t.texStorage2D(n.TEXTURE_2D,Je,ft,be.width,be.height)}te&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,ut,Nt,Oe)}else t.texImage2D(n.TEXTURE_2D,0,ft,ut,Nt,Oe);m(L)&&p(Te),qe.__version=xe.version,L.onUpdate&&L.onUpdate(L)}G.__version=L.version}function De(G,L,he){if(L.image.length!==6)return;const Te=Dt(G,L),Ne=L.source;t.bindTexture(n.TEXTURE_CUBE_MAP,G.__webglTexture,n.TEXTURE0+he);const xe=r.get(Ne);if(Ne.version!==xe.__version||Te===!0){t.activeTexture(n.TEXTURE0+he);const qe=xn.getPrimaries(xn.workingColorSpace),Ve=L.colorSpace===eo?null:xn.getPrimaries(L.colorSpace),vt=L.colorSpace===eo||qe===Ve?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,L.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,L.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,vt);const Mt=L.isCompressedTexture||L.image[0].isCompressedTexture,Oe=L.image[0]&&L.image[0].isDataTexture,ut=[];for(let Ee=0;Ee<6;Ee++)!Mt&&!Oe?ut[Ee]=g(L.image[Ee],!0,i.maxCubemapSize):ut[Ee]=Oe?L.image[Ee].image:L.image[Ee],ut[Ee]=Tt(L,ut[Ee]);const Nt=ut[0],ft=s.convert(L.format,L.colorSpace),Ge=s.convert(L.type),_t=C(L.internalFormat,ft,Ge,L.colorSpace),Bt=L.isVideoTexture!==!0,un=xe.__version===void 0||Te===!0,te=Ne.dataReady;let Je=U(L,Nt);yt(n.TEXTURE_CUBE_MAP,L);let be;if(Mt){Bt&&un&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Je,_t,Nt.width,Nt.height);for(let Ee=0;Ee<6;Ee++){be=ut[Ee].mipmaps;for(let Le=0;Le<be.length;Le++){const Ue=be[Le];L.format!==Zi?ft!==null?Bt?te&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le,0,0,Ue.width,Ue.height,ft,Ue.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le,_t,Ue.width,Ue.height,0,Ue.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Bt?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le,0,0,Ue.width,Ue.height,ft,Ge,Ue.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le,_t,Ue.width,Ue.height,0,ft,Ge,Ue.data)}}}else{if(be=L.mipmaps,Bt&&un){be.length>0&&Je++;const Ee=lt(ut[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Je,_t,Ee.width,Ee.height)}for(let Ee=0;Ee<6;Ee++)if(Oe){Bt?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,0,0,ut[Ee].width,ut[Ee].height,ft,Ge,ut[Ee].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,_t,ut[Ee].width,ut[Ee].height,0,ft,Ge,ut[Ee].data);for(let Le=0;Le<be.length;Le++){const Ft=be[Le].image[Ee].image;Bt?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le+1,0,0,Ft.width,Ft.height,ft,Ge,Ft.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le+1,_t,Ft.width,Ft.height,0,ft,Ge,Ft.data)}}else{Bt?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,0,0,ft,Ge,ut[Ee]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0,_t,ft,Ge,ut[Ee]);for(let Le=0;Le<be.length;Le++){const Ue=be[Le];Bt?te&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le+1,0,0,ft,Ge,Ue.image[Ee]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Le+1,_t,ft,Ge,Ue.image[Ee])}}}m(L)&&p(n.TEXTURE_CUBE_MAP),xe.__version=Ne.version,L.onUpdate&&L.onUpdate(L)}G.__version=L.version}function je(G,L,he,Te,Ne,xe){const qe=s.convert(he.format,he.colorSpace),Ve=s.convert(he.type),vt=C(he.internalFormat,qe,Ve,he.colorSpace),Mt=r.get(L),Oe=r.get(he);if(Oe.__renderTarget=L,!Mt.__hasExternalTextures){const ut=Math.max(1,L.width>>xe),Nt=Math.max(1,L.height>>xe);Ne===n.TEXTURE_3D||Ne===n.TEXTURE_2D_ARRAY?t.texImage3D(Ne,xe,vt,ut,Nt,L.depth,0,qe,Ve,null):t.texImage2D(Ne,xe,vt,ut,Nt,0,qe,Ve,null)}t.bindFramebuffer(n.FRAMEBUFFER,G),kt(L)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Te,Ne,Oe.__webglTexture,0,Rt(L)):(Ne===n.TEXTURE_2D||Ne>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Ne<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Te,Ne,Oe.__webglTexture,xe),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ke(G,L,he){if(n.bindRenderbuffer(n.RENDERBUFFER,G),L.depthBuffer){const Te=L.depthTexture,Ne=Te&&Te.isDepthTexture?Te.type:null,xe=b(L.stencilBuffer,Ne),qe=L.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ve=Rt(L);kt(L)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ve,xe,L.width,L.height):he?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ve,xe,L.width,L.height):n.renderbufferStorage(n.RENDERBUFFER,xe,L.width,L.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,qe,n.RENDERBUFFER,G)}else{const Te=L.textures;for(let Ne=0;Ne<Te.length;Ne++){const xe=Te[Ne],qe=s.convert(xe.format,xe.colorSpace),Ve=s.convert(xe.type),vt=C(xe.internalFormat,qe,Ve,xe.colorSpace),Mt=Rt(L);he&&kt(L)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Mt,vt,L.width,L.height):kt(L)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Mt,vt,L.width,L.height):n.renderbufferStorage(n.RENDERBUFFER,vt,L.width,L.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function xt(G,L){if(L&&L.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,G),!(L.depthTexture&&L.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Te=r.get(L.depthTexture);Te.__renderTarget=L,(!Te.__webglTexture||L.depthTexture.image.width!==L.width||L.depthTexture.image.height!==L.height)&&(L.depthTexture.image.width=L.width,L.depthTexture.image.height=L.height,L.depthTexture.needsUpdate=!0),ge(L.depthTexture,0);const Ne=Te.__webglTexture,xe=Rt(L);if(L.depthTexture.format===Hc)kt(L)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,Ne,0,xe):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,Ne,0);else if(L.depthTexture.format===Vc)kt(L)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,Ne,0,xe):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,Ne,0);else throw new Error("Unknown depthTexture format")}function It(G){const L=r.get(G),he=G.isWebGLCubeRenderTarget===!0;if(L.__boundDepthTexture!==G.depthTexture){const Te=G.depthTexture;if(L.__depthDisposeCallback&&L.__depthDisposeCallback(),Te){const Ne=()=>{delete L.__boundDepthTexture,delete L.__depthDisposeCallback,Te.removeEventListener("dispose",Ne)};Te.addEventListener("dispose",Ne),L.__depthDisposeCallback=Ne}L.__boundDepthTexture=Te}if(G.depthTexture&&!L.__autoAllocateDepthBuffer){if(he)throw new Error("target.depthTexture not supported in Cube render targets");const Te=G.texture.mipmaps;Te&&Te.length>0?xt(L.__webglFramebuffer[0],G):xt(L.__webglFramebuffer,G)}else if(he){L.__webglDepthbuffer=[];for(let Te=0;Te<6;Te++)if(t.bindFramebuffer(n.FRAMEBUFFER,L.__webglFramebuffer[Te]),L.__webglDepthbuffer[Te]===void 0)L.__webglDepthbuffer[Te]=n.createRenderbuffer(),Ke(L.__webglDepthbuffer[Te],G,!1);else{const Ne=G.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,xe=L.__webglDepthbuffer[Te];n.bindRenderbuffer(n.RENDERBUFFER,xe),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ne,n.RENDERBUFFER,xe)}}else{const Te=G.texture.mipmaps;if(Te&&Te.length>0?t.bindFramebuffer(n.FRAMEBUFFER,L.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,L.__webglFramebuffer),L.__webglDepthbuffer===void 0)L.__webglDepthbuffer=n.createRenderbuffer(),Ke(L.__webglDepthbuffer,G,!1);else{const Ne=G.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,xe=L.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,xe),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ne,n.RENDERBUFFER,xe)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ht(G,L,he){const Te=r.get(G);L!==void 0&&je(Te.__webglFramebuffer,G,G.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),he!==void 0&&It(G)}function pt(G){const L=G.texture,he=r.get(G),Te=r.get(L);G.addEventListener("dispose",D);const Ne=G.textures,xe=G.isWebGLCubeRenderTarget===!0,qe=Ne.length>1;if(qe||(Te.__webglTexture===void 0&&(Te.__webglTexture=n.createTexture()),Te.__version=L.version,a.memory.textures++),xe){he.__webglFramebuffer=[];for(let Ve=0;Ve<6;Ve++)if(L.mipmaps&&L.mipmaps.length>0){he.__webglFramebuffer[Ve]=[];for(let vt=0;vt<L.mipmaps.length;vt++)he.__webglFramebuffer[Ve][vt]=n.createFramebuffer()}else he.__webglFramebuffer[Ve]=n.createFramebuffer()}else{if(L.mipmaps&&L.mipmaps.length>0){he.__webglFramebuffer=[];for(let Ve=0;Ve<L.mipmaps.length;Ve++)he.__webglFramebuffer[Ve]=n.createFramebuffer()}else he.__webglFramebuffer=n.createFramebuffer();if(qe)for(let Ve=0,vt=Ne.length;Ve<vt;Ve++){const Mt=r.get(Ne[Ve]);Mt.__webglTexture===void 0&&(Mt.__webglTexture=n.createTexture(),a.memory.textures++)}if(G.samples>0&&kt(G)===!1){he.__webglMultisampledFramebuffer=n.createFramebuffer(),he.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,he.__webglMultisampledFramebuffer);for(let Ve=0;Ve<Ne.length;Ve++){const vt=Ne[Ve];he.__webglColorRenderbuffer[Ve]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,he.__webglColorRenderbuffer[Ve]);const Mt=s.convert(vt.format,vt.colorSpace),Oe=s.convert(vt.type),ut=C(vt.internalFormat,Mt,Oe,vt.colorSpace,G.isXRRenderTarget===!0),Nt=Rt(G);n.renderbufferStorageMultisample(n.RENDERBUFFER,Nt,ut,G.width,G.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ve,n.RENDERBUFFER,he.__webglColorRenderbuffer[Ve])}n.bindRenderbuffer(n.RENDERBUFFER,null),G.depthBuffer&&(he.__webglDepthRenderbuffer=n.createRenderbuffer(),Ke(he.__webglDepthRenderbuffer,G,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(xe){t.bindTexture(n.TEXTURE_CUBE_MAP,Te.__webglTexture),yt(n.TEXTURE_CUBE_MAP,L);for(let Ve=0;Ve<6;Ve++)if(L.mipmaps&&L.mipmaps.length>0)for(let vt=0;vt<L.mipmaps.length;vt++)je(he.__webglFramebuffer[Ve][vt],G,L,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,vt);else je(he.__webglFramebuffer[Ve],G,L,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0);m(L)&&p(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(qe){for(let Ve=0,vt=Ne.length;Ve<vt;Ve++){const Mt=Ne[Ve],Oe=r.get(Mt);t.bindTexture(n.TEXTURE_2D,Oe.__webglTexture),yt(n.TEXTURE_2D,Mt),je(he.__webglFramebuffer,G,Mt,n.COLOR_ATTACHMENT0+Ve,n.TEXTURE_2D,0),m(Mt)&&p(n.TEXTURE_2D)}t.unbindTexture()}else{let Ve=n.TEXTURE_2D;if((G.isWebGL3DRenderTarget||G.isWebGLArrayRenderTarget)&&(Ve=G.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Ve,Te.__webglTexture),yt(Ve,L),L.mipmaps&&L.mipmaps.length>0)for(let vt=0;vt<L.mipmaps.length;vt++)je(he.__webglFramebuffer[vt],G,L,n.COLOR_ATTACHMENT0,Ve,vt);else je(he.__webglFramebuffer,G,L,n.COLOR_ATTACHMENT0,Ve,0);m(L)&&p(Ve),t.unbindTexture()}G.depthBuffer&&It(G)}function Pt(G){const L=G.textures;for(let he=0,Te=L.length;he<Te;he++){const Ne=L[he];if(m(Ne)){const xe=w(G),qe=r.get(Ne).__webglTexture;t.bindTexture(xe,qe),p(xe),t.unbindTexture()}}}const bt=[],Z=[];function cn(G){if(G.samples>0){if(kt(G)===!1){const L=G.textures,he=G.width,Te=G.height;let Ne=n.COLOR_BUFFER_BIT;const xe=G.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,qe=r.get(G),Ve=L.length>1;if(Ve)for(let Mt=0;Mt<L.length;Mt++)t.bindFramebuffer(n.FRAMEBUFFER,qe.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Mt,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,qe.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Mt,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,qe.__webglMultisampledFramebuffer);const vt=G.texture.mipmaps;vt&&vt.length>0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,qe.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,qe.__webglFramebuffer);for(let Mt=0;Mt<L.length;Mt++){if(G.resolveDepthBuffer&&(G.depthBuffer&&(Ne|=n.DEPTH_BUFFER_BIT),G.stencilBuffer&&G.resolveStencilBuffer&&(Ne|=n.STENCIL_BUFFER_BIT)),Ve){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,qe.__webglColorRenderbuffer[Mt]);const Oe=r.get(L[Mt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,Oe,0)}n.blitFramebuffer(0,0,he,Te,0,0,he,Te,Ne,n.NEAREST),A===!0&&(bt.length=0,Z.length=0,bt.push(n.COLOR_ATTACHMENT0+Mt),G.depthBuffer&&G.resolveDepthBuffer===!1&&(bt.push(xe),Z.push(xe),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,Z)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,bt))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),Ve)for(let Mt=0;Mt<L.length;Mt++){t.bindFramebuffer(n.FRAMEBUFFER,qe.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Mt,n.RENDERBUFFER,qe.__webglColorRenderbuffer[Mt]);const Oe=r.get(L[Mt]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,qe.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Mt,n.TEXTURE_2D,Oe,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,qe.__webglMultisampledFramebuffer)}else if(G.depthBuffer&&G.resolveDepthBuffer===!1&&A){const L=G.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[L])}}}function Rt(G){return Math.min(i.maxSamples,G.samples)}function kt(G){const L=r.get(G);return G.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function st(G){const L=a.render.frame;c.get(G)!==L&&(c.set(G,L),G.update())}function Tt(G,L){const he=G.colorSpace,Te=G.format,Ne=G.type;return G.isCompressedTexture===!0||G.isVideoTexture===!0||he!==ui&&he!==eo&&(xn.getTransfer(he)===Dn?(Te!==Zi||Ne!==Ks)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",he)),L}function lt(G){return typeof HTMLImageElement<"u"&&G instanceof HTMLImageElement?(l.width=G.naturalWidth||G.width,l.height=G.naturalHeight||G.height):typeof VideoFrame<"u"&&G instanceof VideoFrame?(l.width=G.displayWidth,l.height=G.displayHeight):(l.width=G.width,l.height=G.height),l}this.allocateTextureUnit=Y,this.resetTextureUnits=re,this.setTexture2D=ge,this.setTexture2DArray=ue,this.setTexture3D=Ce,this.setTextureCube=ae,this.rebindTextures=ht,this.setupRenderTarget=pt,this.updateRenderTargetMipmap=Pt,this.updateMultisampleRenderTarget=cn,this.setupDepthRenderbuffer=It,this.setupFrameBufferTexture=je,this.useMultisampledRTT=kt}function rU(n,e){function t(r,i=eo){let s;const a=xn.getTransfer(i);if(r===Ks)return n.UNSIGNED_BYTE;if(r===ng)return n.UNSIGNED_SHORT_4_4_4_4;if(r===rg)return n.UNSIGNED_SHORT_5_5_5_1;if(r===By)return n.UNSIGNED_INT_5_9_9_9_REV;if(r===Cy)return n.BYTE;if(r===_y)return n.SHORT;if(r===$c)return n.UNSIGNED_SHORT;if(r===tg)return n.INT;if(r===oA)return n.UNSIGNED_INT;if(r===_s)return n.FLOAT;if(r===cu)return n.HALF_FLOAT;if(r===Ey)return n.ALPHA;if(r===Sy)return n.RGB;if(r===Zi)return n.RGBA;if(r===Hc)return n.DEPTH_COMPONENT;if(r===Vc)return n.DEPTH_STENCIL;if(r===ig)return n.RED;if(r===sg)return n.RED_INTEGER;if(r===Ty)return n.RG;if(r===ag)return n.RG_INTEGER;if(r===og)return n.RGBA_INTEGER;if(r===kh||r===$h||r===Qh||r===Hh)if(a===Dn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(r===kh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===$h)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Qh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Hh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(r===kh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===$h)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Qh)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Hh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===am||r===om||r===Am||r===lm)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(r===am)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===om)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Am)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===lm)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===cm||r===um||r===hm)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(r===cm||r===um)return a===Dn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(r===hm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===fm||r===dm||r===pm||r===mm||r===gm||r===ym||r===vm||r===wm||r===xm||r===bm||r===Cm||r===_m||r===Bm||r===Em)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(r===fm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===dm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===pm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===mm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===gm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===ym)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===vm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===wm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===xm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===bm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Cm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===_m)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===Bm)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Em)return a===Dn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Vh||r===Sm||r===Tm)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(r===Vh)return a===Dn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===Sm)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===Tm)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===Iy||r===Im||r===Fm||r===Rm)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(r===Vh)return s.COMPRESSED_RED_RGT
vendor: 10,164 bytes, lines 3803-3827
3803C1_EXT;if(r===Im)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Fm)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Rm)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Qc?n.UNSIGNED_INT_24_8:n[r]!==void 0?n[r]:null}return{convert:t}}const iU=` 3804void main() { 3805 3806 gl_Position = vec4( position, 1.0 ); 3807 3808}`,sU=` 3809uniform sampler2DArray depthColor; 3810uniform float depthWidth; 3811uniform float depthHeight; 3812 3813void main() { 3814 3815 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 3816 3817 if ( coord.x >= 1.0 ) { 3818 3819 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 3820 3821 } else { 3822 3823 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 3824 3825 } 3826 3827}`;class aU{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(this.texture===null){const i=new Ur,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!==r.depthNear||t.depthFar!==r.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,r=new yo({vertexShader:iU,fragmentShader:sU,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ci(new $f(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class oU extends xA{constructor(e,t){super();const r=this;let i=null,s=1,a=null,o="local-floor",A=1,l=null,c=null,u=null,h=null,f=null,d=null;const g=new aU,m=t.getContextAttributes();let p=null,w=null;const C=[],b=[],U=new Kt;let F=null;const D=new oi;D.viewport=new Tn;const O=new oi;O.viewport=new Tn;const I=[D,O],R=new yI;let V=null,re=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Be){let De=C[Be];return De===void 0&&(De=new $d,C[Be]=De),De.getTargetRaySpace()},this.getControllerGrip=function(Be){let De=C[Be];return De===void 0&&(De=new $d,C[Be]=De),De.getGripSpace()},this.getHand=function(Be){let De=C[Be];return De===void 0&&(De=new $d,C[Be]=De),De.getHandSpace()};function Y(Be){const De=b.indexOf(Be.inputSource);if(De===-1)return;const je=C[De];je!==void 0&&(je.update(Be.inputSource,Be.frame,l||a),je.dispatchEvent({type:Be.type,data:Be.inputSource}))}function se(){i.removeEventListener("select",Y),i.removeEventListener("selectstart",Y),i.removeEventListener("selectend",Y),i.removeEventListener("squeeze",Y),i.removeEventListener("squeezestart",Y),i.removeEventListener("squeezeend",Y),i.removeEventListener("end",se),i.removeEventListener("inputsourceschange",ge);for(let Be=0;Be<C.length;Be++){const De=b[Be];De!==null&&(b[Be]=null,C[Be].disconnect(De))}V=null,re=null,g.reset(),e.setRenderTarget(p),f=null,h=null,u=null,i=null,w=null,Dt.stop(),r.isPresenting=!1,e.setPixelRatio(F),e.setSize(U.width,U.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Be){s=Be,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Be){o=Be,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(Be){l=Be},this.getBaseLayer=function(){return h!==null?h:f},this.getBinding=function(){return u},this.getFrame=function(){return d},this.getSession=function(){return i},this.setSession=async function(Be){if(i=Be,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",Y),i.addEventListener("selectstart",Y),i.addEventListener("selectend",Y),i.addEventListener("squeeze",Y),i.addEventListener("squeezestart",Y),i.addEventListener("squeezeend",Y),i.addEventListener("end",se),i.addEventListener("inputsourceschange",ge),m.xrCompatible!==!0&&await t.makeXRCompatible(),F=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let je=null,Ke=null,xt=null;m.depth&&(xt=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,je=m.stencil?Vc:Hc,Ke=m.stencil?Qc:oA);const It={colorFormat:t.RGBA8,depthFormat:xt,scaleFactor:s};u=new XRWebGLBinding(i,t),h=u.createProjectionLayer(It),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),w=new AA(h.textureWidth,h.textureHeight,{format:Zi,type:Ks,depthTexture:new Ky(h.textureWidth,h.textureHeight,Ke,void 0,void 0,void 0,void 0,void 0,void 0,je),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1})}else{const je={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,t,je),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),w=new AA(f.framebufferWidth,f.framebufferHeight,{format:Zi,type:Ks,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}w.isXRRenderTarget=!0,this.setFoveation(A),l=null,a=await i.requestReferenceSpace(o),Dt.setContext(i),Dt.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function ge(Be){for(let De=0;De<Be.removed.length;De++){const je=Be.removed[De],Ke=b.indexOf(je);Ke>=0&&(b[Ke]=null,C[Ke].disconnect(je))}for(let De=0;De<Be.added.length;De++){const je=Be.added[De];let Ke=b.indexOf(je);if(Ke===-1){for(let It=0;It<C.length;It++)if(It>=b.length){b.push(je),Ke=It;break}else if(b[It]===null){b[It]=je,Ke=It;break}if(Ke===-1)break}const xt=C[Ke];xt&&xt.connect(je)}}const ue=new Ae,Ce=new Ae;function ae(Be,De,je){ue.setFromMatrixPosition(De.matrixWorld),Ce.setFromMatrixPosition(je.matrixWorld);const Ke=ue.distanceTo(Ce),xt=De.projectionMatrix.elements,It=je.projectionMatrix.elements,ht=xt[14]/(xt[10]-1),pt=xt[14]/(xt[10]+1),Pt=(xt[9]+1)/xt[5],bt=(xt[9]-1)/xt[5],Z=(xt[8]-1)/xt[0],cn=(It[8]+1)/It[0],Rt=ht*Z,kt=ht*cn,st=Ke/(-Z+cn),Tt=st*-Z;if(De.matrixWorld.decompose(Be.position,Be.quaternion,Be.scale),Be.translateX(Tt),Be.translateZ(st),Be.matrixWorld.compose(Be.position,Be.quaternion,Be.scale),Be.matrixWorldInverse.copy(Be.matrixWorld).invert(),xt[10]===-1)Be.projectionMatrix.copy(De.projectionMatrix),Be.projectionMatrixInverse.copy(De.projectionMatrixInverse);else{const lt=ht+st,G=pt+st,L=Rt-Tt,he=kt+(Ke-Tt),Te=Pt*pt/G*lt,Ne=bt*pt/G*lt;Be.projectionMatrix.makePerspective(L,he,Te,Ne,lt,G),Be.projectionMatrixInverse.copy(Be.projectionMatrix).invert()}}function we(Be,De){De===null?Be.matrixWorld.copy(Be.matrix):Be.matrixWorld.multiplyMatrices(De.matrixWorld,Be.matrix),Be.matrixWorldInverse.copy(Be.matrixWorld).invert()}this.updateCamera=function(Be){if(i===null)return;let De=Be.near,je=Be.far;g.texture!==null&&(g.depthNear>0&&(De=g.depthNear),g.depthFar>0&&(je=g.depthFar)),R.near=O.near=D.near=De,R.far=O.far=D.far=je,(V!==R.near||re!==R.far)&&(i.updateRenderState({depthNear:R.near,depthFar:R.far}),V=R.near,re=R.far),D.layers.mask=Be.layers.mask|2,O.layers.mask=Be.layers.mask|4,R.layers.mask=D.layers.mask|O.layers.mask;const Ke=Be.parent,xt=R.cameras;we(R,Ke);for(let It=0;It<xt.length;It++)we(xt[It],Ke);xt.length===2?ae(R,D,O):R.projectionMatrix.copy(D.projectionMatrix),Pe(Be,R,Ke)};function Pe(Be,De,je){je===null?Be.matrix.copy(De.matrixWorld):(Be.matrix.copy(je.matrixWorld),Be.matrix.invert(),Be.matrix.multiply(De.matrixWorld)),Be.matrix.decompose(Be.position,Be.quaternion,Be.scale),Be.updateMatrixWorld(!0),Be.projectionMatrix.copy(De.projectionMatrix),Be.projectionMatrixInverse.copy(De.projectionMatrixInverse),Be.isPerspectiveCamera&&(Be.fov=bl*2*Math.atan(1/Be.projectionMatrix.elements[5]),Be.zoom=1)}this.getCamera=function(){return R},this.getFoveation=function(){if(!(h===null&&f===null))return A},this.setFoveation=function(Be){A=Be,h!==null&&(h.fixedFoveation=Be),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Be)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(R)};let $e=null;function yt(Be,De){if(c=De.getViewerPose(l||a),d=De,c!==null){const je=c.views;f!==null&&(e.setRenderTargetFramebuffer(w,f.framebuffer),e.setRenderTarget(w));let Ke=!1;je.length!==R.cameras.length&&(R.cameras.length=0,Ke=!0);for(let ht=0;ht<je.length;ht++){const pt=je[ht];let Pt=null;if(f!==null)Pt=f.getViewport(pt);else{const Z=u.getViewSubImage(h,pt);Pt=Z.viewport,ht===0&&(e.setRenderTargetTextures(w,Z.colorTexture,Z.depthStencilTexture),e.setRenderTarget(w))}let bt=I[ht];bt===void 0&&(bt=new oi,bt.layers.enable(ht),bt.viewport=new Tn,I[ht]=bt),bt.matrix.fromArray(pt.transform.matrix),bt.matrix.decompose(bt.position,bt.quaternion,bt.scale),bt.projectionMatrix.fromArray(pt.projectionMatrix),bt.projectionMatrixInverse.copy(bt.projectionMatrix).invert(),bt.viewport.set(Pt.x,Pt.y,Pt.width,Pt.height),ht===0&&(R.matrix.copy(bt.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),Ke===!0&&R.cameras.push(bt)}const xt=i.enabledFeatures;if(xt&&xt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const ht=u.getDepthInformation(je[0]);ht&&ht.isValid&&ht.texture&&g.init(e,ht,i.renderState)}}for(let je=0;je<C.length;je++){const Ke=b[je],xt=C[je];Ke!==null&&xt!==void 0&&xt.update(Ke,De,l||a)}$e&&$e(Be,De),De.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:De}),d=null}const Dt=new qy;Dt.setAnimationLoop(yt),this.setAnimationLoop=function(Be){$e=Be},this.dispose=function(){}}}const Lo=new js,AU=new an;function lU(n,e){function t(m,p){m.matrixAutoUpdate===!0&&m.updateMatrix(),p.value.copy(m.matrix)}function r(m,p){p.color.getRGB(m.fogColor.value,$y(n)),p.isFog?(m.fogNear.value=p.near,m.fogFar.value=p.far):p.isFogExp2&&(m.fogDensity.value=p.density)}function i(m,p,w,C,b){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(m,p):p.isMeshToonMaterial?(s(m,p),u(m,p)):p.isMeshPhongMaterial?(s(m,p),c(m,p)):p.isMeshStandardMaterial?(s(m,p),h(m,p),p.isMeshPhysicalMaterial&&f(m,p,b)):p.isMeshMat
vendor: 12,688 bytes, line 3827
3827capMaterial?(s(m,p),d(m,p)):p.isMeshDepthMaterial?s(m,p):p.isMeshDistanceMaterial?(s(m,p),g(m,p)):p.isMeshNormalMaterial?s(m,p):p.isLineBasicMaterial?(a(m,p),p.isLineDashedMaterial&&o(m,p)):p.isPointsMaterial?A(m,p,w,C):p.isSpriteMaterial?l(m,p):p.isShadowMaterial?(m.color.value.copy(p.color),m.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(m,p){m.opacity.value=p.opacity,p.color&&m.diffuse.value.copy(p.color),p.emissive&&m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.bumpMap&&(m.bumpMap.value=p.bumpMap,t(p.bumpMap,m.bumpMapTransform),m.bumpScale.value=p.bumpScale,p.side===Bi&&(m.bumpScale.value*=-1)),p.normalMap&&(m.normalMap.value=p.normalMap,t(p.normalMap,m.normalMapTransform),m.normalScale.value.copy(p.normalScale),p.side===Bi&&m.normalScale.value.negate()),p.displacementMap&&(m.displacementMap.value=p.displacementMap,t(p.displacementMap,m.displacementMapTransform),m.displacementScale.value=p.displacementScale,m.displacementBias.value=p.displacementBias),p.emissiveMap&&(m.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,m.emissiveMapTransform)),p.specularMap&&(m.specularMap.value=p.specularMap,t(p.specularMap,m.specularMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest);const w=e.get(p),C=w.envMap,b=w.envMapRotation;C&&(m.envMap.value=C,Lo.copy(b),Lo.x*=-1,Lo.y*=-1,Lo.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Lo.y*=-1,Lo.z*=-1),m.envMapRotation.value.setFromMatrix4(AU.makeRotationFromEuler(Lo)),m.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,m.aoMapTransform))}function a(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform))}function o(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function A(m,p,w,C){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*w,m.scale.value=C*.5,p.map&&(m.map.value=p.map,t(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function l(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function u(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function h(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function f(m,p,w){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Bi&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,p){p.matcap&&(m.matcap.value=p.matcap)}function g(m,p){const w=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function cU(n,e,t,r){let i={},s={},a=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function A(w,C){const b=C.program;r.uniformBlockBinding(w,b)}function l(w,C){let b=i[w.id];b===void 0&&(d(w),b=c(w),i[w.id]=b,w.addEventListener("dispose",m));const U=C.program;r.updateUBOMapping(w,U);const F=e.render.frame;s[w.id]!==F&&(h(w),s[w.id]=F)}function c(w){const C=u();w.__bindingPointIndex=C;const b=n.createBuffer(),U=w.__size,F=w.usage;return n.bindBuffer(n.UNIFORM_BUFFER,b),n.bufferData(n.UNIFORM_BUFFER,U,F),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,b),b}function u(){for(let w=0;w<o;w++)if(a.indexOf(w)===-1)return a.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function h(w){const C=i[w.id],b=w.uniforms,U=w.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let F=0,D=b.length;F<D;F++){const O=Array.isArray(b[F])?b[F]:[b[F]];for(let I=0,R=O.length;I<R;I++){const V=O[I];if(f(V,F,I,U)===!0){const re=V.__offset,Y=Array.isArray(V.value)?V.value:[V.value];let se=0;for(let ge=0;ge<Y.length;ge++){const ue=Y[ge],Ce=g(ue);typeof ue=="number"||typeof ue=="boolean"?(V.__data[0]=ue,n.bufferSubData(n.UNIFORM_BUFFER,re+se,V.__data)):ue.isMatrix3?(V.__data[0]=ue.elements[0],V.__data[1]=ue.elements[1],V.__data[2]=ue.elements[2],V.__data[3]=0,V.__data[4]=ue.elements[3],V.__data[5]=ue.elements[4],V.__data[6]=ue.elements[5],V.__data[7]=0,V.__data[8]=ue.elements[6],V.__data[9]=ue.elements[7],V.__data[10]=ue.elements[8],V.__data[11]=0):(ue.toArray(V.__data,se),se+=Ce.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,re,V.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function f(w,C,b,U){const F=w.value,D=C+"_"+b;if(U[D]===void 0)return typeof F=="number"||typeof F=="boolean"?U[D]=F:U[D]=F.clone(),!0;{const O=U[D];if(typeof F=="number"||typeof F=="boolean"){if(O!==F)return U[D]=F,!0}else if(O.equals(F)===!1)return O.copy(F),!0}return!1}function d(w){const C=w.uniforms;let b=0;const U=16;for(let D=0,O=C.length;D<O;D++){const I=Array.isArray(C[D])?C[D]:[C[D]];for(let R=0,V=I.length;R<V;R++){const re=I[R],Y=Array.isArray(re.value)?re.value:[re.value];for(let se=0,ge=Y.length;se<ge;se++){const ue=Y[se],Ce=g(ue),ae=b%U,we=ae%Ce.boundary,Pe=ae+we;b+=we,Pe!==0&&U-Pe<Ce.storage&&(b+=U-Pe),re.__data=new Float32Array(Ce.storage/Float32Array.BYTES_PER_ELEMENT),re.__offset=b,b+=Ce.storage}}}const F=b%U;return F>0&&(b+=U-F),w.__size=b,w.__cache={},this}function g(w){const C={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(C.boundary=4,C.storage=4):w.isVector2?(C.boundary=8,C.storage=8):w.isVector3||w.isColor?(C.boundary=16,C.storage=12):w.isVector4?(C.boundary=16,C.storage=16):w.isMatrix3?(C.boundary=48,C.storage=48):w.isMatrix4?(C.boundary=64,C.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),C}function m(w){const C=w.target;C.removeEventListener("dispose",m);const b=a.indexOf(C.__bindingPointIndex);a.splice(b,1),n.deleteBuffer(i[C.id]),delete i[C.id],delete s[C.id]}function p(){for(const w in i)n.deleteBuffer(i[w]);a=[],i={},s={}}return{bind:A,update:l,dispose:p}}class uU{constructor(e={}){const{canvas:t=cT(),context:r=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:A=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let f;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=r.getContextAttributes().alpha}else f=a;const d=new Uint32Array(4),g=new Int32Array(4);let m=null,p=null;const w=[],C=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=co,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let U=!1;this._outputColorSpace=kr;let F=0,D=0,O=null,I=-1,R=null;const V=new Tn,re=new Tn;let Y=null;const se=new Yt(0);let ge=0,ue=t.width,Ce=t.height,ae=1,we=null,Pe=null;const $e=new Tn(0,0,ue,Ce),yt=new Tn(0,0,ue,Ce);let Dt=!1;const Be=new hg;let De=!1,je=!1;const Ke=new an,xt=new an,It=new Ae,ht=new Tn,pt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Pt=!1;function bt(){return O===null?ae:1}let Z=r;function cn(Q,oe){return t.getContext(Q,oe)}try{const Q={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:A,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${eg}`),t.addEventListener("webglcontextlost",Ee,!1),t.addEventListener("webglcontextrestored",Le,!1),t.addEventListener("webglcontextcreationerror",Ue,!1),Z===null){const oe="webgl2";if(Z=cn(oe,Q),Z===null)throw cn(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(Q){throw console.error("THREE.WebGLRenderer: "+Q.message),Q}let Rt,kt,st,Tt,lt,G,L,he,Te,Ne,xe,qe,Ve,vt,Mt,Oe,ut,Nt,ft,Ge,_t,Bt,un,te;function Je(){Rt=new x5(Z),Rt.init(),Bt=new rU(Z,Rt),kt=new d5(Z,Rt,e,Bt),st=new tU(Z,Rt),kt.reverseDepthBuffer&&h&&st.buffers.depth.setReversed(!0),Tt=new _5(Z),lt=new HR,G=new nU(Z,Rt,st,lt,kt,Bt,Tt),L=new m5(b),he=new w5(b),Te=new FI(Z),un=new h5(Z,Te),Ne=new b5(Z,Te,Tt,un),xe=new E5(Z,Ne,Te,Tt),ft=new B5(Z,kt,G),Oe=new p5(lt),qe=new QR(b,L,he,Rt,kt,un,Oe),Ve=new lU(b,lt),vt=new GR,Mt=new YR(Rt),Nt=new u5(b,L,he,st,xe,f,A),ut=new ZR(b,xe,kt),te=new cU(Z,Tt,kt,st),Ge=new f5(Z,Rt,Tt),_t=new C5(Z,Rt,Tt),Tt.programs=qe.programs,b.capabilities=kt,b.extensions=Rt,b.properties=lt,b.renderLists=vt,b.shadowMap=ut,b.state=st,b.info=Tt}Je();const be=new oU(b,Z);this.xr=be,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){const Q=Rt.get("WEBGL_lose_context");Q&&Q.loseContext()},this.forceContextRestore=function(){const Q=Rt.get("WEBGL_lose_context");Q&&Q.restoreContext()},this.getPixelRatio=function(){return ae},this.setPixelRatio=function(Q){Q!==void 0&&(ae=Q,this.setSize(ue,Ce,!1))},this.getSize=function(Q){return Q.set(ue,Ce)},this.setSize=function(Q,oe,ye=!0){if(be.isPresenting){console.warn("THREE.WebGLRenderer: Can't
3827change size while VR device is presenting.");return}ue=Q,Ce=oe,t.width=Math.floor(Q*ae),t.height=Math.floor(oe*ae),ye===!0&&(t.style.width=Q+"px",t.style.height=oe+"px"),this.setViewport(0,0,Q,oe)},this.getDrawingBufferSize=function(Q){return Q.set(ue*ae,Ce*ae).floor()},this.setDrawingBufferSize=function(Q,oe,ye){ue=Q,Ce=oe,ae=ye,t.width=Math.floor(Q*ye),t.height=Math.floor(oe*ye),this.setViewport(0,0,Q,oe)},this.getCurrentViewport=function(Q){return Q.copy(V)},this.getViewport=function(Q){return Q.copy($e)},this.setViewport=function(Q,oe,ye,ve){Q.isVector4?$e.set(Q.x,Q.y,Q.z,Q.w):$e.set(Q,oe,ye,ve),st.viewport(V.copy($e).multiplyScalar(ae).round())},this.getScissor=function(Q){return Q.copy(yt)},this.setScissor=function(Q,oe,ye,ve){Q.isVector4?yt.set(Q.x,Q.y,Q.z,Q.w):yt.set(Q,oe,ye,ve),st.scissor(re.copy(yt).multiplyScalar(ae).round())},this.getScissorTest=function(){return Dt},this.setScissorTest=function(Q){st.setScissorTest(Dt=Q)},this.setOpaqueSort=function(Q){we=Q},this.setTransparentSort=function(Q){Pe=Q},this.getClearColor=function(Q){return Q.copy(Nt.getClearColor())},this.setClearColor=function(){Nt.setClearColor(...arguments)},this.getClearAlpha=function(){return Nt.getClearAlpha()},this.setClearAlpha=function(){Nt.setClearAlpha(...arguments)},this.clear=function(Q=!0,oe=!0,ye=!0){let ve=0;if(Q){let le=!1;if(O!==null){const ke=O.texture.format;le=ke===og||ke===ag||ke===sg}if(le){const ke=O.texture.type,Ze=ke===Ks||ke===oA||ke===$c||ke===Qc||ke===ng||ke===rg,it=Nt.getClearColor(),tt=Nt.getClearAlpha(),Ot=it.r,Lt=it.g,Et=it.b;Ze?(d[0]=Ot,d[1]=Lt,d[2]=Et,d[3]=tt,Z.clearBufferuiv(Z.COLOR,0,d)):(g[0]=Ot,g[1]=Lt,g[2]=Et,g[3]=tt,Z.clearBufferiv(Z.COLOR,0,g))}else ve|=Z.COLOR_BUFFER_BIT}oe&&(ve|=Z.DEPTH_BUFFER_BIT),ye&&(ve|=Z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Z.clear(ve)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ee,!1),t.removeEventListener("webglcontextrestored",Le,!1),t.removeEventListener("webglcontextcreationerror",Ue,!1),Nt.dispose(),vt.dispose(),Mt.dispose(),lt.dispose(),L.dispose(),he.dispose(),xe.dispose(),un.dispose(),te.dispose(),qe.dispose(),be.dispose(),be.removeEventListener("sessionstart",mr),be.removeEventListener("sessionend",Gr),ei.stop()};function Ee(Q){Q.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Le(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const Q=Tt.autoReset,oe=ut.enabled,ye=ut.autoUpdate,ve=ut.needsUpdate,le=ut.type;Je(),Tt.autoReset=Q,ut.enabled=oe,ut.autoUpdate=ye,ut.needsUpdate=ve,ut.type=le}function Ue(Q){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Q.statusMessage)}function Ft(Q){const oe=Q.target;oe.removeEventListener("dispose",Ft),wn(oe)}function wn(Q){Pn(Q),lt.remove(Q)}function Pn(Q){const oe=lt.get(Q).programs;oe!==void 0&&(oe.forEach(function(ye){qe.releaseProgram(ye)}),Q.isShaderMaterial&&qe.releaseShaderCache(Q))}this.renderBufferDirect=function(Q,oe,ye,ve,le,ke){oe===null&&(oe=pt);const Ze=le.isMesh&&le.matrixWorld.determinant()<0,it=ra(Q,oe,ye,ve,le);st.setMaterial(ve,Ze);let tt=ye.index,Ot=1;if(ve.wireframe===!0){if(tt=Ne.getWireframeAttribute(ye),tt===void 0)return;Ot=2}const Lt=ye.drawRange,Et=ye.attributes.position;let Zt=Lt.start*Ot,Ht=(Lt.start+Lt.count)*Ot;ke!==null&&(Zt=Math.max(Zt,ke.start*Ot),Ht=Math.min(Ht,(ke.start+ke.count)*Ot)),tt!==null?(Zt=Math.max(Zt,0),Ht=Math.min(Ht,tt.count)):Et!=null&&(Zt=Math.max(Zt,0),Ht=Math.min(Ht,Et.count));const Nn=Ht-Zt;if(Nn<0||Nn===1/0)return;un.setup(le,ve,it,ye,tt);let mn,An=Ge;if(tt!==null&&(mn=Te.get(tt),An=_t,An.setIndex(mn)),le.isMesh)ve.wireframe===!0?(st.setLineWidth(ve.wireframeLinewidth*bt()),An.setMode(Z.LINES)):An.setMode(Z.TRIANGLES);else if(le.isLine){let Ct=ve.linewidth;Ct===void 0&&(Ct=1),st.setLineWidth(Ct*bt()),le.isLineSegments?An.setMode(Z.LINES):le.isLineLoop?An.setMode(Z.LINE_LOOP):An.setMode(Z.LINE_STRIP)}else le.isPoints?An.setMode(Z.POINTS):le.isSprite&&An.setMode(Z.TRIANGLES);if(le.isBatchedMesh)if(le._multiDrawInstances!==null)Gh("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),An.renderMultiDrawInstances(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount,le._multiDrawInstances);else if(Rt.get("WEBGL_multi_draw"))An.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else{const Ct=le._multiDrawStarts,kn=le._multiDrawCounts,zt=le._multiDrawCount,lr=tt?Te.get(tt).bytesPerElement:1,Ii=lt.get(ve).currentProgram.getUniforms();for(let cr=0;cr<zt;cr++)Ii.setValue(Z,"_gl_DrawID",cr),An.render(Ct[cr]/lr,kn[cr])}
vendor: 4,435 bytes, line 3827
3827else if(le.isInstancedMesh)An.renderInstances(Zt,Nn,le.count);else if(ye.isInstancedBufferGeometry){const Ct=ye._maxInstanceCount!==void 0?ye._maxInstanceCount:1/0,kn=Math.min(ye.instanceCount,Ct);An.renderInstances(Zt,Nn,kn)}else An.render(Zt,Nn)};function on(Q,oe,ye){Q.transparent===!0&&Q.side===$s&&Q.forceSinglePass===!1?(Q.side=Bi,Q.needsUpdate=!0,Vi(Q,oe,ye),Q.side=_a,Q.needsUpdate=!0,Vi(Q,oe,ye),Q.side=$s):Vi(Q,oe,ye)}this.compile=function(Q,oe,ye=null){ye===null&&(ye=Q),p=Mt.get(ye),p.init(oe),C.push(p),ye.traverseVisible(function(le){le.isLight&&le.layers.test(oe.layers)&&(p.pushLight(le),le.castShadow&&p.pushShadow(le))}),Q!==ye&&Q.traverseVisible(function(le){le.isLight&&le.layers.test(oe.layers)&&(p.pushLight(le),le.castShadow&&p.pushShadow(le))}),p.setupLights();const ve=new Set;return Q.traverse(function(le){if(!(le.isMesh||le.isPoints||le.isLine||le.isSprite))return;const ke=le.material;if(ke)if(Array.isArray(ke))for(let Ze=0;Ze<ke.length;Ze++){const it=ke[Ze];on(it,ye,le),ve.add(it)}else on(ke,ye,le),ve.add(ke)}),p=C.pop(),ve},this.compileAsync=function(Q,oe,ye=null){const ve=this.compile(Q,oe,ye);return new Promise(le=>{function ke(){if(ve.forEach(function(Ze){lt.get(Ze).currentProgram.isReady()&&ve.delete(Ze)}),ve.size===0){le(Q);return}setTimeout(ke,10)}Rt.get("KHR_parallel_shader_compile")!==null?ke():setTimeout(ke,10)})};let Xn=null;function Er(Q){Xn&&Xn(Q)}function mr(){ei.stop()}function Gr(){ei.start()}const ei=new qy;ei.setAnimationLoop(Er),typeof self<"u"&&ei.setContext(self),this.setAnimationLoop=function(Q){Xn=Q,be.setAnimationLoop(Q),Q===null?ei.stop():ei.start()},be.addEventListener("sessionstart",mr),be.addEventListener("sessionend",Gr),this.render=function(Q,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(Q.matrixWorldAutoUpdate===!0&&Q.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),be.enabled===!0&&be.isPresenting===!0&&(be.cameraAutoUpdate===!0&&be.updateCamera(oe),oe=be.getCamera()),Q.isScene===!0&&Q.onBeforeRender(b,Q,oe,O),p=Mt.get(Q,C.length),p.init(oe),C.push(p),xt.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),Be.setFromProjectionMatrix(xt),je=this.localClippingEnabled,De=Oe.init(this.clippingPlanes,je),m=vt.get(Q,w.length),m.init(),w.push(m),be.enabled===!0&&be.isPresenting===!0){const ke=b.xr.getDepthSensingMesh();ke!==null&&na(ke,oe,-1/0,b.sortObjects)}na(Q,oe,0,b.sortObjects),m.finish(),b.sortObjects===!0&&m.sort(we,Pe),Pt=be.enabled===!1||be.isPresenting===!1||be.hasDepthSensing()===!1,Pt&&Nt.addToRenderList(m,Q),this.info.render.frame++,De===!0&&Oe.beginShadows();const ye=p.state.shadowsArray;ut.render(ye,Q,oe),De===!0&&Oe.endShadows(),this.info.autoReset===!0&&this.info.reset();const ve=m.opaque,le=m.transmissive;if(p.setupLights(),oe.isArrayCamera){const ke=oe.cameras;if(le.length>0)for(let Ze=0,it=ke.length;Ze<it;Ze++){const tt=ke[Ze];Sr(ve,le,Q,tt)}Pt&&Nt.render(Q);for(let Ze=0,it=ke.length;Ze<it;Ze++){const tt=ke[Ze];sr(m,Q,tt,tt.viewport)}}else le.length>0&&Sr(ve,le,Q,oe),Pt&&Nt.render(Q),sr(m,Q,oe);O!==null&&D===0&&(G.updateMultisampleRenderTarget(O),G.updateRenderTargetMipmap(O)),Q.isScene===!0&&Q.onAfterRender(b,Q,oe),un.resetDefaultState(),I=-1,R=null,C.pop(),C.length>0?(p=C[C.length-1],De===!0&&Oe.setGlobalState(b.clippingPlanes,p.state.camera)):p=null,w.pop(),w.length>0?m=w[w.length-1]:m=null};function na(Q,oe,ye,ve){if(Q.visible===!1)return;if(Q.layers.test(oe.layers)){if(Q.isGroup)ye=Q.renderOrder;else if(Q.isLOD)Q.autoUpdate===!0&&Q.update(oe);else if(Q.isLight)p.pushLight(Q),Q.castShadow&&p.pushShadow(Q);else if(Q.isSprite){if(!Q.frustumCulled||Be.intersectsSprite(Q)){ve&&ht.setFromMatrixPosition(Q.matrixWorld).applyMatrix4(xt);const Ze=xe.update(Q),it=Q.material;it.visible&&m.push(Q,Ze,it,ye,ht.z,null)}}else if((Q.isMesh||Q.isLine||Q.isPoints)&&(!Q.frustumCulled||Be.intersectsObject(Q))){const Ze=xe.update(Q),it=Q.material;if(ve&&(Q.boundingSphere!==void 0?(Q.boundingSphere===null&&Q.computeBoundingSphere(),ht.copy(Q.boundingSphere.center)):(Ze.boundingSphere===null&&Ze.computeBoundingSphere(),ht.copy(Ze.boundingSphere.center)),ht.applyMatrix4(Q.matrixWorld).applyMatrix4(xt)),Array.isArray(it)){const tt=Ze.groups;for(let Ot=0,Lt=tt.length;Ot<Lt;Ot++){const Et=tt[Ot],Zt=it[Et.materialIndex];Zt&&Zt.visible&&m.push(Q,Ze,Zt,ye,ht.z,Et)}
vendor: 20,007 bytes, line 3827
3827}else it.visible&&m.push(Q,Ze,it,ye,ht.z,null)}}const ke=Q.children;for(let Ze=0,it=ke.length;Ze<it;Ze++)na(ke[Ze],oe,ye,ve)}function sr(Q,oe,ye,ve){const le=Q.opaque,ke=Q.transmissive,Ze=Q.transparent;p.setupLightsView(ye),De===!0&&Oe.setGlobalState(b.clippingPlanes,ye),ve&&st.viewport(V.copy(ve)),le.length>0&&Hi(le,oe,ye),ke.length>0&&Hi(ke,oe,ye),Ze.length>0&&Hi(Ze,oe,ye),st.buffers.depth.setTest(!0),st.buffers.depth.setMask(!0),st.buffers.color.setMask(!0),st.setPolygonOffset(!1)}function Sr(Q,oe,ye,ve){if((ye.isScene===!0?ye.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[ve.id]===void 0&&(p.state.transmissionRenderTarget[ve.id]=new AA(1,1,{generateMipmaps:!0,type:Rt.has("EXT_color_buffer_half_float")||Rt.has("EXT_color_buffer_float")?cu:Ks,minFilter:ya,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xn.workingColorSpace}));const ke=p.state.transmissionRenderTarget[ve.id],Ze=ve.viewport||V;ke.setSize(Ze.z*b.transmissionResolutionScale,Ze.w*b.transmissionResolutionScale);const it=b.getRenderTarget();b.setRenderTarget(ke),b.getClearColor(se),ge=b.getClearAlpha(),ge<1&&b.setClearColor(16777215,.5),b.clear(),Pt&&Nt.render(ye);const tt=b.toneMapping;b.toneMapping=co;const Ot=ve.viewport;if(ve.viewport!==void 0&&(ve.viewport=void 0),p.setupLightsView(ve),De===!0&&Oe.setGlobalState(b.clippingPlanes,ve),Hi(Q,ye,ve),G.updateMultisampleRenderTarget(ke),G.updateRenderTargetMipmap(ke),Rt.has("WEBGL_multisampled_render_to_texture")===!1){let Lt=!1;for(let Et=0,Zt=oe.length;Et<Zt;Et++){const Ht=oe[Et],Nn=Ht.object,mn=Ht.geometry,An=Ht.material,Ct=Ht.group;if(An.side===$s&&Nn.layers.test(ve.layers)){const kn=An.side;An.side=Bi,An.needsUpdate=!0,di(Nn,ye,ve,mn,An,Ct),An.side=kn,An.needsUpdate=!0,Lt=!0}}Lt===!0&&(G.updateMultisampleRenderTarget(ke),G.updateRenderTargetMipmap(ke))}b.setRenderTarget(it),b.setClearColor(se,ge),Ot!==void 0&&(ve.viewport=Ot),b.toneMapping=tt}function Hi(Q,oe,ye){const ve=oe.isScene===!0?oe.overrideMaterial:null;for(let le=0,ke=Q.length;le<ke;le++){const Ze=Q[le],it=Ze.object,tt=Ze.geometry,Ot=Ze.group;let Lt=Ze.material;Lt.allowOverride===!0&&ve!==null&&(Lt=ve),it.layers.test(ye.layers)&&di(it,oe,ye,tt,Lt,Ot)}}function di(Q,oe,ye,ve,le,ke){Q.onBeforeRender(b,oe,ye,ve,le,ke),Q.modelViewMatrix.multiplyMatrices(ye.matrixWorldInverse,Q.matrixWorld),Q.normalMatrix.getNormalMatrix(Q.modelViewMatrix),le.onBeforeRender(b,oe,ye,ve,Q,ke),le.transparent===!0&&le.side===$s&&le.forceSinglePass===!1?(le.side=Bi,le.needsUpdate=!0,b.renderBufferDirect(ye,oe,ve,le,Q,ke),le.side=_a,le.needsUpdate=!0,b.renderBufferDirect(ye,oe,ve,le,Q,ke),le.side=$s):b.renderBufferDirect(ye,oe,ve,le,Q,ke),Q.onAfterRender(b,oe,ye,ve,le,ke)}function Vi(Q,oe,ye){oe.isScene!==!0&&(oe=pt);const ve=lt.get(Q),le=p.state.lights,ke=p.state.shadowsArray,Ze=le.state.version,it=qe.getParameters(Q,le.state,ke,oe,ye),tt=qe.getProgramCacheKey(it);let Ot=ve.programs;ve.environment=Q.isMeshStandardMaterial?oe.environment:null,ve.fog=oe.fog,ve.envMap=(Q.isMeshStandardMaterial?he:L).get(Q.envMap||ve.environment),ve.envMapRotation=ve.environment!==null&&Q.envMap===null?oe.environmentRotation:Q.envMapRotation,Ot===void 0&&(Q.addEventListener("dispose",Ft),Ot=new Map,ve.programs=Ot);let Lt=Ot.get(tt);if(Lt!==void 0){if(ve.currentProgram===Lt&&ve.lightsStateVersion===Ze)return us(Q,it),Lt}else it.uniforms=qe.getUniforms(Q),Q.onBeforeCompile(it,b),Lt=qe.acquireProgram(it,tt),Ot.set(tt,Lt),ve.uniforms=it.uniforms;const Et=ve.uniforms;return(!Q.isShaderMaterial&&!Q.isRawShaderMaterial||Q.clipping===!0)&&(Et.clippingPlanes=Oe.uniform),us(Q,it),ve.needsLights=La(Q),ve.lightsStateVersion=Ze,ve.needsLights&&(Et.ambientLightColor.value=le.state.ambient,Et.lightProbe.value=le.state.probe,Et.directionalLights.value=le.state.directional,Et.directionalLightShadows.value=le.state.directionalShadow,Et.spotLights.value=le.state.spot,Et.spotLightShadows.value=le.state.spotShadow,Et.rectAreaLights.value=le.state.rectArea,Et.ltc_1.value=le.state.rectAreaLTC1,Et.ltc_2.value=le.state.rectAreaLTC2,Et.pointLights.value=le.state.point,Et.pointLightShadows.value=le.state.pointShadow,Et.hemisphereLights.value=le.state.hemi,Et.directionalShadowMap.value=le.state.directionalShadowMap,Et.directionalShadowMatrix.value=le.state.directionalShadowMatrix,Et.spotShadowMap.value=le.state.spotShadowMap,Et.spotLightMatrix.value=le.state.spotLightMatrix,Et.spotLightMap.value=le.state.spotLightMap,Et.pointShadowMap.value=le.state.pointShadowMap,Et.pointShadowMatrix.value=le.state.pointShadowMatrix),ve.currentProgram=Lt,ve.uniformsList=null,Lt}function pi(Q){if(Q.uniformsList===null){const oe=Q.currentProgram.getUniforms();Q.uniformsList=zh.seqWithValue(oe.seq,Q.uniforms)}return Q.uniformsList}function us(Q,oe){const ye=lt.get(Q);ye.outputColorSpace=oe.outputColorSpace,ye.batching=oe.batching,ye.batchingColor=oe.batchingColor,ye.instancing=oe.instancing,ye.instancingColor=oe.instancingColor,ye.instancingMorph=oe.instancingMorph,ye.skinning=oe.skinning,ye.morphTargets=oe.morphTargets,ye.morphNormals=oe.morphNormals,ye.morphColors=oe.morphColors,ye.morphTargetsCount=oe.morphTargetsCount,ye.numClippingPlanes=oe.numClippingPlanes,ye.numIntersection=oe.numClipIntersection,ye.vertexAlphas=oe.vertexAlphas,ye.vertexTangents=oe.vertexTangents,ye.toneMapping=oe.toneMapping}function ra(Q,oe,ye,ve,le){oe.isScene!==!0&&(oe=pt),G.resetTextureUnits();const ke=oe.fog,Ze=ve.isMeshStandardMaterial?oe.environment:null,it=O===null?b.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:ui,tt=(ve.isMeshStandardMaterial?he:L).get(ve.envMap||Ze),Ot=ve.vertexColors===!0&&!!ye.attributes.color&&ye.attributes.color.itemSize===4,Lt=!!ye.attributes.tangent&&(!!ve.normalMap||ve.anisotropy>0),Et=!!ye.morphAttributes.position,Zt=!!ye.morphAttributes.normal,Ht=!!ye.morphAttributes.color;let Nn=co;ve.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(Nn=b.toneMapping);const mn=ye.morphAttributes.position||ye.morphAttributes.normal||ye.morphAttributes.color,An=mn!==void 0?mn.length:0,Ct=lt.get(ve),kn=p.state.lights;if(De===!0&&(je===!0||Q!==R)){const qn=Q===R&&ve.id===I;Oe.setState(ve,Q,qn)}let zt=!1;ve.version===Ct.__version?(Ct.needsLights&&Ct.lightsStateVersion!==kn.state.version||Ct.outputColorSpace!==it||le.isBatchedMesh&&Ct.batching===!1||!le.isBatchedMesh&&Ct.batching===!0||le.isBatchedMesh&&Ct.batchingColor===!0&&le.colorTexture===null||le.isBatchedMesh&&Ct.batchingColor===!1&&le.colorTexture!==null||le.isInstancedMesh&&Ct.instancing===!1||!le.isInstancedMesh&&Ct.instancing===!0||le.isSkinnedMesh&&Ct.skinning===!1||!le.isSkinnedMesh&&Ct.skinning===!0||le.isInstancedMesh&&Ct.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&Ct.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&Ct.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&Ct.instancingMorph===!1&&le.morphTexture!==null||Ct.envMap!==tt||ve.fog===!0&&Ct.fog!==ke||Ct.numClippingPlanes!==void 0&&(Ct.numClippingPlanes!==Oe.numPlanes||Ct.numIntersection!==Oe.numIntersection)||Ct.vertexAlphas!==Ot||Ct.vertexTangents!==Lt||Ct.morphTargets!==Et||Ct.morphNormals!==Zt||Ct.morphColors!==Ht||Ct.toneMapping!==Nn||Ct.morphTargetsCount!==An)&&(zt=!0):(zt=!0,Ct.__version=ve.version);let lr=Ct.currentProgram;zt===!0&&(lr=Vi(ve,oe,le));let Ii=!1,cr=!1,Gi=!1;const en=lr.getUniforms(),ur=Ct.uniforms;if(st.useProgram(lr.program)&&(Ii=!0,cr=!0,Gi=!0),ve.id!==I&&(I=ve.id,cr=!0),Ii||R!==Q){st.buffers.depth.getReversed()?(Ke.copy(Q.projectionMatrix),hT(Ke),fT(Ke),en.setValue(Z,"projectionMatrix",Ke)):en.setValue(Z,"projectionMatrix",Q.projectionMatrix),en.setValue(Z,"viewMatrix",Q.matrixWorldInverse);const Jn=en.map.cameraPosition;Jn!==void 0&&Jn.setValue(Z,It.setFromMatrixPosition(Q.matrixWorld)),kt.logarithmicDepthBuffer&&en.setValue(Z,"logDepthBufFC",2/(Math.log(Q.far+1)/Math.LN2)),(ve.isMeshPhongMaterial||ve.isMeshToonMaterial||ve.isMeshLambertMaterial||ve.isMeshBasicMaterial||ve.isMeshStandardMaterial||ve.isShaderMaterial)&&en.setValue(Z,"isOrthographic",Q.isOrthographicCamera===!0),R!==Q&&(R=Q,cr=!0,Gi=!0)}if(le.isSkinnedMesh){en.setOptional(Z,le,"bindMatrix"),en.setOptional(Z,le,"bindMatrixInverse");const qn=le.skeleton;qn&&(qn.boneTexture===null&&qn.computeBoneTexture(),en.setValue(Z,"boneTexture",qn.boneTexture,G))}le.isBatchedMesh&&(en.setOptional(Z,le,"batchingTexture"),en.setValue(Z,"batchingTexture",le._matricesTexture,G),en.setOptional(Z,le,"batchingIdTexture"),en.setValue(Z,"batchingIdTexture",le._indirectTexture,G),en.setOptional(Z,le,"batchingColorTexture"),le._colorsTexture!==null&&en.setValue(Z,"batchingColorTexture",le._colorsTexture,G));const Yn=ye.morphAttributes;if((Yn.position!==void 0||Yn.normal!==void 0||Yn.color!==void 0)&&ft.update(le,ye,lr),(cr||Ct.receiveShadow!==le.receiveShadow)&&(Ct.receiveShadow=le.receiveShadow,en.setValue(Z,"receiveShadow",le.receiveShadow)),ve.isMeshGouraudMaterial&&ve.envMap!==null&&(ur.envMap.value=tt,ur.flipEnvMap.value=tt.isCubeTexture&&tt.isRenderTargetTexture===!1?-1:1),ve.isMeshStandardMaterial&&ve.envMap===null&&oe.environment!==null&&(ur.envMapIntensity.value=oe.environmentIntensity),cr&&(en.setValue(Z,"toneMappingExposure",b.toneMappingExposure),Ct.needsLights&&ia(ur,Gi),ke&&ve.fog===!0&&Ve.refreshFogUniforms(ur,ke),Ve.refreshMaterialUniforms(ur,ve,ae,Ce,p.state.transmissionRenderTarget[Q.id]),zh.upload(Z,pi(Ct),ur,G)),ve.isShaderMaterial&&ve.uniformsNeedUpdate===!0&&(zh.upload(Z,pi(Ct),ur,G),ve.uniformsNeedUpdate=!1),ve.isSpriteMaterial&&en.setValue(Z,"center",le.center),en.setValue(Z,"modelViewMatrix",le.modelViewMatrix),en.setValue(Z,"normalMatrix",le.normalMatrix),en.setValue(Z,"modelMatrix",le.matrixWorld),ve.isShaderMaterial||ve.isRawShaderMaterial){const qn=ve.uniformsGroups;for(let Jn=0,hs=qn.length;Jn<hs;Jn++){const ti=qn[Jn];te.update(ti,lr),te.bind(ti,lr)}}return lr}function ia(Q,oe){Q.ambientLightColor.needsUpdate=oe,Q.lightProbe.needsUpdate=oe,Q.directionalLights.needsUpdate=oe,Q.directionalLightShadows.needsUpdate=oe,Q.pointLights.needsUpdate=oe,Q.pointLightShadows.needsUpdate=oe,Q.spotLights.needsUpdate=oe,Q.spotLightShadows.needsUpdate=oe,Q.rectAreaLights.needsUpdate=oe,Q.hemisphereLights.needsUpdate=oe}function La(Q){return Q.isMeshLambertMaterial||Q.isMeshToonMaterial||Q.isMeshPhongMaterial||Q.isMeshStandardMaterial||Q.isShadowMaterial||Q.isShaderMaterial&&Q.lights===!0}this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return O},this.setRenderTargetTextures=function(Q,oe,ye){const ve=lt.get(Q);ve.__autoAllocateDepthBuffer=Q.resolveDepthBuffer===!1,ve.__autoAllocateDepthBuffer===!1&&(ve.__useRenderToTexture=!1),lt.get(Q.texture).__webglTexture=oe,lt.get(Q.depthTexture).__webglTexture=ve.__autoAllocateDepthBuffer?void 0:ye,ve.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(Q,oe){const ye=lt.get(Q);ye.__webglFramebuffer=oe,ye.__useDefaultFramebuffer=oe===void 0};const Ds=Z.createFramebuffer();this.setRenderTarget=function(Q,oe=0,ye=0){O=Q,F=oe,D=ye;let ve=!0,le=null,ke=!1,Ze=!1;if(Q){const tt=lt.get(Q);if(tt.__useDefaultFramebuffer!==void 0)st.bindFramebuffer(Z.FRAMEBUFFER,null),ve=!1;else if(tt.__webglFramebuffer===void 0)G.setupRenderTarget(Q);else if(tt.__hasExternalTextures)G.rebindTextures(Q,lt.get(Q.texture).__webglTexture,lt.get(Q.depthTexture).__webglTexture);else if(Q.depthBuffer){const Et=Q.depthTexture;if(tt.__boundDepthTexture!==Et){if(Et!==null&<.has(Et)&&(Q.width!==Et.image.width||Q.height!==Et.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");G.setupDepthRenderbuffer(Q)}}const Ot=Q.texture;(Ot.isData3DTexture||Ot.isDataArrayTexture||Ot.isCompressedArrayTexture)&&(Ze=!0);const Lt=lt.get(Q).__webglFramebuffer;Q.isWebGLCubeRenderTarget?(Array.isArray(Lt[oe])?le=Lt[oe][ye]:le=Lt[oe],ke=!0):Q.samples>0&&G.useMultisampledRTT(Q)===!1?le=lt.get(Q).__webglMultisampledFramebuffer:Array.isArray(Lt)?le=Lt[ye]:le=Lt,V.copy(Q.viewport),re.copy(Q.scissor),Y=Q.scissorTest}else V.copy($e).multiplyScalar(ae).floor(),re.copy(yt).multiplyScalar(ae).floor(),Y=Dt;if(ye!==0&&(le=Ds),st.bindFramebuffer(Z.FRAMEBUFFER,le)&&ve&&st.drawBuffers(Q,le),st.viewport(V),st.scissor(re),st.setScissorTest(Y),ke){const tt=lt.get(Q.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+oe,tt.__webglTexture,ye)}else if(Ze){const tt=lt.get(Q.texture),Ot=oe;Z.framebufferTextureLayer(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,tt.__webglTexture,ye,Ot)}else if(Q!==null&&ye!==0){const tt=lt.get(Q.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_2D,tt.__webglTexture,ye)}I=-1},this.readRenderTargetPixels=function(Q,oe,ye,ve,le,ke,Ze){if(!(Q&&Q.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=lt.get(Q).__webglFramebuffer;if(Q.isWebGLCubeRenderTarget&&Ze!==void 0&&(it=it[Ze]),it){st.bindFramebuffer(Z.FRAMEBUFFER,it);try{const tt=Q.texture,Ot=tt.format,Lt=tt.type;if(!kt.textureFormatReadable(Ot)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!kt.textureTypeReadable(Lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=Q.width-ve&&ye>=0&&ye<=Q.height-le&&Z.readPixels(oe,ye,ve,le,Bt.convert(Ot),Bt.convert(Lt),ke)}finally{const tt=O!==null?lt.get(O).__webglFramebuffer:null;st.bindFramebuffer(Z.FRAMEBUFFER,tt)}}},this.readRenderTargetPixelsAsync=async function(Q,oe,ye,ve,le,ke,Ze){if(!(Q&&Q.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let it=lt.get(Q).__webglFramebuffer;if(Q.isWebGLCubeRenderTarget&&Ze!==void 0&&(it=it[Ze]),it)if(oe>=0&&oe<=Q.width-ve&&ye>=0&&ye<=Q.height-le){st.bindFramebuffer(Z.FRAMEBUFFER,it);const tt=Q.texture,Ot=tt.format,Lt=tt.type;if(!kt.textureFormatReadable(Ot))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!kt.textureTypeReadable(Lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Et=Z.createBuffer();Z.bindBuffer(Z.PIXEL_PACK_BUFFER,Et),Z.bufferData(Z.PIXEL_PACK_BUFFER,ke.byteLength,Z.STREAM_READ),Z.readPixels(oe,ye,ve,le,Bt.convert(Ot),Bt.convert(Lt),0);const Zt=O!==null?lt.get(O).__webglFramebuffer:null;st.bindFramebuffer(Z.FRAMEBUFFER,Zt);const Ht=Z.fenceSync(Z.SYNC_GPU_COMMANDS_COMPLETE,0);return Z.flush(),await uT(Z,Ht,4),Z.bindBuffer(Z.PIXEL_PACK_BUFFER,Et),Z.getBufferSubData(Z.PIXEL_PACK_BUFFER,0,ke),Z.deleteBuffer(Et),Z.deleteSync(Ht),ke}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(Q,oe=null,ye=0){const ve=Math.pow(2,-ye),le=Math.floor(Q.image.width*ve),ke=Math.floor(Q.image.height*ve),Ze=oe!==null?oe.x:0,it=oe!==null?oe.y:0;G.setTexture2D(Q,0),Z.copyTexSubImage2D(Z.TEXTURE_2D,ye,0,0,Ze,it,le,ke),st.unbindTexture()};const mi=Z.createFramebuffer(),Ls=Z.createFramebuffer();this.copyTextureToTexture=function(Q,oe,ye=null,ve=null,le=0,ke=null){ke===null&&(le!==0?(Gh("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ke=le,le=0):ke=0);let Ze,it,tt,Ot,Lt,Et,Zt,Ht,Nn;const mn=Q.isCompressedTexture?Q.mipmaps[ke]:Q.image;if(ye!==null)Ze=ye.max.x-ye.min.x,it=ye.max.y-ye.min.y,tt=ye.isBox3?ye.max.z-ye.min.z:1,Ot=ye.min.x,Lt=ye.min.y,Et=ye.isBox3?ye.min.z:0;else{const Yn=Math.pow(2,-le);Ze=Math.floor(mn.width*Yn),it=Math.floor(mn.height*Yn),Q.isDataArrayTexture?tt=mn.depth:Q.isData3DTexture?tt=Math.floor(mn.depth*Yn):tt=1,Ot=0,Lt=0,Et=0}ve!==null?(Zt=ve.x,Ht=ve.y,Nn=ve.z):(Zt=0,Ht=0,Nn=0);const An=Bt.convert(oe.format),Ct=Bt.convert(oe.type);let kn;oe.isData3DTexture?(G.setTexture3D(oe,0),kn=Z.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(G.setTexture2DArray(oe,0),kn=Z.TEXTURE_2D_ARRAY):(G.setTexture2D(oe,0),kn=Z.TEXTURE_2D),Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,oe.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,oe.unpackAlignment);const zt=Z.getParameter(Z.UNPACK_ROW_LENGTH),lr=Z.getParameter(Z.UNPACK_IMAGE_HEIGHT),Ii=Z.getParameter(Z.UNPACK_SKIP_PIXELS),cr=Z.getParameter(Z.UNPACK_SKIP_ROWS),Gi=Z.getParameter(Z.UNPACK_SKIP_IMAGES);Z.pixelStorei(Z.UNPACK_ROW_LENGTH,mn.width),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,mn.height),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,Ot),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,Lt),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,Et);const en=Q.isDataArrayTexture||Q.isData3DTexture,ur=oe.isDataArrayTexture||oe.isData3DTexture;if(Q.isDepthTexture){const Yn=lt.get(Q),qn=lt.get(oe),Jn=lt.get(Yn.__renderTarget),hs=lt.get(qn.__renderTarget);st.bindFramebuffer(Z.READ_FRAMEBUFFER,Jn.__webglFramebuffer),st.bindFramebuffer(Z.DRAW_FRAMEBUFFER,hs.__webglFramebuffer);for(let ti=0;ti<tt;ti++)en&&(Z.framebufferTextureLayer(Z.READ_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,lt.get(Q).__webglTexture,le,Et+ti),Z.framebufferTextureLayer(Z.DRAW_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,lt.get(oe).__webglTexture,ke,Nn+ti)),Z.blitFramebuffer(Ot,Lt,Ze,it,Zt,Ht,Ze,it,Z.DEPTH_BUFFER_BIT,Z.NEAREST);st.bindFramebuffer(Z.READ_FRAMEBUFFER,null),st.bindFramebuffer(Z.DRAW_FRAMEBUFFER,null)}else if(le!==0||Q.isRenderTargetTexture||lt.has(Q)){const Yn=lt.get(Q),qn=lt.get(oe);st.bindFramebuffer(Z.READ_FRAMEBUFFER,mi),st.bindFramebuffer(Z.DRAW_FRAMEBUFFER,Ls);for(let Jn=0;Jn<tt;Jn++)en?Z.framebufferTextureLayer(Z.READ_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Yn.__webglTexture,le,Et+Jn):Z.framebufferTexture2D(Z.READ_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_2D,Yn.__webglTexture,le),ur?Z.framebufferTextureLayer(Z.DRAW_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,qn.__webglTexture,ke,Nn+Jn):Z.framebufferTexture2D(Z.DRAW_FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_2D,qn.__webglTexture,ke),le!==0?Z.blitFramebuffer(Ot,Lt,Ze,it,Zt,Ht,Ze,it,Z.COLOR_BUFFER_BIT,Z.NEAREST):ur?Z.copyTexSubImage3D(kn,ke,Zt,Ht,Nn+Jn,Ot,Lt,Ze,it):Z.copyTexSubImage2D(kn,ke,Zt,Ht,Ot,Lt,Ze,it);st.bindFramebuffer(Z.READ_FRAMEBUFFER,null),st.bindFramebuffer(Z.DRAW_FRAMEBUFFER,null)}else ur?Q.isDataTexture||Q.isData3DTexture?Z.texSubImage3D(kn,ke,Zt,Ht,Nn,Ze,it,tt,An,Ct,mn.data):oe.isCompressedArrayTexture?Z.compressedTexSubImage3D(kn,ke,Zt,Ht,Nn,Ze,it,tt,An,mn.data):Z.texSubImage3D(kn,ke,Zt,Ht,Nn,Ze,it,tt,An,Ct,mn):Q.isDataTexture?Z.texSubImage2D(Z.TEXTURE_2D,ke,Zt,Ht,Ze,it,An,Ct,mn.data):Q.isCompressedTexture?Z.compressedTexSubImage2D(Z.TEXTURE_2D,ke,Zt,Ht,mn.width,mn.height,An,mn.data):Z.texSubImage2D(Z.TEXTURE_2D,ke,Zt,Ht,Ze,it,An,Ct,mn);Z.pixelStorei(Z.UNPACK_ROW_LENGTH,zt),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,lr),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,Ii),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,cr),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,Gi),ke===0&&oe.generateMipmaps&&Z.generateMipmap(kn),st.unbindTexture()},this.copyTextureToTexture3D=function(Q,oe,ye=null,ve=null,le=0){return Gh('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(Q,oe,ye,ve,le)},this.initRenderTarget=function(Q){lt.get(Q).__webglFramebuffer===void 0&&G.setupRenderTarget(Q)},this.initTexture=function(Q){Q.isCubeTexture?G.setTextureCube(Q,0):Q.isData3DTexture?G.setTexture3D(Q,0):Q.isDataArrayTexture||Q.isCompressedArrayTexture?G.setTexture2DArray(Q,0):G.setTexture2D(Q,0),st.unbindTexture()},this.resetState=function(){F=0,D=0,O=null,st.reset(),un.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return va}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();
vendor: 39,170 bytes, line 3827
3827t.drawingBufferColorSpace=xn._getDrawingBufferColorSpace(e),t.unpackColorSpace=xn._getUnpackColorSpace()}}const O0={type:"change"},wg={type:"start"},nv={type:"end"},th=new uu,P0=new qa,hU=Math.cos(70*My.DEG2RAD),yr=new Ae,yi=2*Math.PI,Ln={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Zd=1e-6;class fU extends TI{constructor(e,t=null){super(e,t),this.state=Ln.NONE,this.target=new Ae,this.cursor=new Ae,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:ll.ROTATE,MIDDLE:ll.DOLLY,RIGHT:ll.PAN},this.touches={ONE:sl.ROTATE,TWO:sl.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new Ae,this._lastQuaternion=new Xs,this._lastTargetPosition=new Ae,this._quat=new Xs().setFromUnitVectors(e.up,new Ae(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new u0,this._sphericalDelta=new u0,this._scale=1,this._panOffset=new Ae,this._rotateStart=new Kt,this._rotateEnd=new Kt,this._rotateDelta=new Kt,this._panStart=new Kt,this._panEnd=new Kt,this._panDelta=new Kt,this._dollyStart=new Kt,this._dollyEnd=new Kt,this._dollyDelta=new Kt,this._dollyDirection=new Ae,this._mouse=new Kt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=pU.bind(this),this._onPointerDown=dU.bind(this),this._onPointerUp=mU.bind(this),this._onContextMenu=CU.bind(this),this._onMouseWheel=vU.bind(this),this._onKeyDown=wU.bind(this),this._onTouchStart=xU.bind(this),this._onTouchMove=bU.bind(this),this._onMouseDown=gU.bind(this),this._onMouseMove=yU.bind(this),this._interceptControlDown=_U.bind(this),this._interceptControlUp=BU.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(O0),this.update(),this.state=Ln.NONE}update(e=null){const t=this.object.position;yr.copy(t).sub(this.target),yr.applyQuaternion(this._quat),this._spherical.setFromVector3(yr),this.autoRotate&&this.state===Ln.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let r=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(r)&&isFinite(i)&&(r<-Math.PI?r+=yi:r>Math.PI&&(r-=yi),i<-Math.PI?i+=yi:i>Math.PI&&(i-=yi),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=a!=this._spherical.radius}if(yr.setFromSpherical(this._spherical),yr.applyQuaternion(this._quatInverse),t.copy(this.target).add(yr),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=yr.length();a=this._clampDistance(o*this._scale);const A=o-a;this.object.position.addScaledVector(this._dollyDirection,A),this.object.updateMatrixWorld(),s=!!A}else if(this.object.isOrthographicCamera){const o=new Ae(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const A=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=A!==this.object.zoom;const l=new Ae(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=yr.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(th.origin.copy(this.object.position),th.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(th.direction))<hU?this.object.lookAt(this.target):(P0.setFromNormalAndCoplanarPoint(this.object.up,this.target),th.intersectPlane(P0,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>Zd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Zd||this._lastTargetPosition.distanceToSquared(this.target)>Zd?(this.dispatchEvent(O0),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?yi/60*this.autoRotateSpeed*e:yi/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){yr.setFromMatrixColumn(t,0),yr.multiplyScalar(-e),this._panOffset.add(yr)}_panUp(e,t){this.screenSpacePanning===!0?yr.setFromMatrixColumn(t,1):(yr.setFromMatrixColumn(t,0),yr.crossVectors(this.object.up,yr)),yr.multiplyScalar(e),this._panOffset.add(yr)}_pan(e,t){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;yr.copy(i).sub(this.target);let s=yr.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/r.clientHeight,this.object.matrix),this._panUp(2*t*s/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,s=t-r.top,a=r.width,o=r.height;this._mouse.x=i/a*2-1,this._mouse.y=-(s/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(yi*this._rotateDelta.x/t.clientHeight),this._rotateUp(yi*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(yi*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-yi*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(yi*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-yi*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),s=.5*(e.pageY+r.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(yi*this._rotateDelta.x/t.clientHeight),this._rotateUp(yi*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Kt,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,r={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:r.deltaY*=16;break;case 2:r.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(r.deltaY*=10),r}}function dU(n){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(n.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(n)&&(this._addPointer(n),n.pointerType==="touch"?this._onTouchStart(n):this._onMouseDown(n)))}function pU(n){this.enabled!==!1&&(n.pointerType==="touch"?this._onTouchMove(n):this._onMouseMove(n))}function mU(n){switch(this._removePointer(n),this._pointers.length){case 0:this.domElement.releasePointerCapture(n.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(nv),this.state=Ln.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function gU(n){let e;switch(n.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case ll.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(n),this.state=Ln.DOLLY;break;case ll.ROTATE:if(n.ctrlKey||n.metaKey||n.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(n),this.state=Ln.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(n),this.state=Ln.ROTATE}break;case ll.PAN:if(n.ctrlKey||n.metaKey||n.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(n),this.state=Ln.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(n),this.state=Ln.PAN}break;default:this.state=Ln.NONE}this.state!==Ln.NONE&&this.dispatchEvent(wg)}function yU(n){switch(this.state){case Ln.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(n);break;case Ln.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(n);break;case Ln.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(n);break}}function vU(n){this.enabled===!1||this.enableZoom===!1||this.state!==Ln.NONE||(n.preventDefault(),this.dispatchEvent(wg),this._handleMouseWheel(this._customWheelEvent(n)),this.dispatchEvent(nv))}function wU(n){this.enabled!==!1&&this._handleKeyDown(n)}function xU(n){switch(this._trackPointer(n),this._pointers.length){case 1:switch(this.touches.ONE){case sl.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(n),this.state=Ln.TOUCH_ROTATE;break;case sl.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(n),this.state=Ln.TOUCH_PAN;break;default:this.state=Ln.NONE}break;case 2:switch(this.touches.TWO){case sl.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(n),this.state=Ln.TOUCH_DOLLY_PAN;break;case sl.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(n),this.state=Ln.TOUCH_DOLLY_ROTATE;break;default:this.state=Ln.NONE}break;default:this.state=Ln.NONE}this.state!==Ln.NONE&&this.dispatchEvent(wg)}function bU(n){switch(this._trackPointer(n),this.state){case Ln.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(n),this.update();break;case Ln.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(n),this.update();break;case Ln.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(n),this.update();break;case Ln.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(n),this.update();break;default:this.state=Ln.NONE}}function CU(n){this.enabled!==!1&&n.preventDefault()}function _U(n){n.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function BU(n){n.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function k0(n,e){if(e===OS)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Um||e===Fy){let t=n.getIndex();if(t===null){const a=[],o=n.getAttribute("position");if(o!==void 0){for(let A=0;A<o.count;A++)a.push(A);n.setIndex(a),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const r=t.count-2,i=[];if(e===Um)for(let a=1;a<=r;a++)i.push(t.getX(0)),i.push(t.getX(a)),i.push(t.getX(a+1));else for(let a=0;a<r;a++)a%2===0?(i.push(t.getX(a)),i.push(t.getX(a+1)),i.push(t.getX(a+2))):(i.push(t.getX(a+2)),i.push(t.getX(a+1)),i.push(t.getX(a)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}class EU extends kl{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new RU(t)}),this.register(function(t){return new UU(t)}),this.register(function(t){return new QU(t)}),this.register(function(t){return new HU(t)}),this.register(function(t){return new VU(t)}),this.register(function(t){return new NU(t)}),this.register(function(t){return new DU(t)}),this.register(function(t){return new LU(t)}),this.register(function(t){return new OU(t)}),this.register(function(t){return new FU(t)}),this.register(function(t){return new PU(t)}),this.register(function(t){return new MU(t)}),this.register(function(t){return new $U(t)}),this.register(function(t){return new kU(t)}),this.register(function(t){return new TU(t)}),this.register(function(t){return new GU(t)}),this.register(function(t){return new zU(t)})}load(e,t,r,i){const s=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const l=Uc.extractUrlBase(e);a=Uc.resolveURL(l,this.path)}else a=Uc.extractUrlBase(e);this.manager.itemStart(e);const o=function(l){i?i(l):console.error(l),s.manager.itemError(e),s.manager.itemEnd(e)},A=new Yy(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(l){try{s.parse(l,a,function(c){t(c),s.manager.itemEnd(e)},o)}catch(c){o(c)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,i){let s;const a={},o={},A=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===rv){try{a[pn.KHR_BINARY_GLTF]=new WU(e)}catch(u){i&&i(u);return}s=JSON.parse(a[pn.KHR_BINARY_GLTF].content)}else s=JSON.parse(A.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new sM(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){const u=this.pluginCallbacks[c](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[u.name]=u,a[u.name]=!0}if(s.extensionsUsed)for(let c=0;c<s.extensionsUsed.length;++c){const u=s.extensionsUsed[c],h=s.extensionsRequired||[];switch(u){case pn.KHR_MATERIALS_UNLIT:a[u]=new IU;break;case pn.KHR_DRACO_MESH_COMPRESSION:a[u]=new KU(s,this.dracoLoader);break;case pn.KHR_TEXTURE_TRANSFORM:a[u]=new XU;break;case pn.KHR_MESH_QUANTIZATION:a[u]=new jU;break;default:h.indexOf(u)>=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(r,i)}parseAsync(e,t){const r=this;return new Promise(function(i,s){r.parse(e,t,i,s)})}}function SU(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const pn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class TU{constructor(e){this.parser=e,this.name=pn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r<i;r++){const s=t[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let i=t.cache.get(r);if(i)return i;const s=t.json,A=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let l;const c=new Yt(16777215);A.color!==void 0&&c.setRGB(A.color[0],A.color[1],A.color[2],ui);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":l=new Lm(c),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new pI(c),l.distance=u;break;case"spot":l=new fI(c),l.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,l.angle=A.spot.outerConeAngle,l.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return l.position.set(0,0,0),da(l,A),A.intensity!==void 0&&(l.intensity=A.intensity),l.name=t.createUniqueName(A.name||"light_"+e),i=Promise.resolve(l),t.cache.add(r,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,s=r.json.nodes[e],o=(s.extensions&&s.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(A){return r._getNodeRef(t.cache,o,A)})}}class IU{constructor(){this.name=pn.KHR_MATERIALS_UNLIT}getMaterialType(){return no}extendParams(e,t,r){const i=[];e.color=new Yt(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const a=s.baseColorFactor;e.color.setRGB(a[0],a[1],a[2],ui),e.opacity=a[3]}s.baseColorTexture!==void 0&&i.push(r.assignTexture(e,"map",s.baseColorTexture,kr))}return Promise.all(i)}}class FU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class RU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];if(a.clearcoatFactor!==void 0&&(t.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){const o=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Kt(o,o)}return Promise.all(s)}}class UU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class MU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return a.iridescenceFactor!==void 0&&(t.iridescence=a.iridescenceFactor),a.iridescenceTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),a.iridescenceIor!==void 0&&(t.iridescenceIOR=a.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),a.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),a.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(s)}}class NU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Yt(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=i.extensions[this.name];if(a.sheenColorFactor!==void 0){const o=a.sheenColorFactor;t.sheenColor.setRGB(o[0],o[1],o[2],ui)}return a.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=a.sheenRoughnessFactor),a.sheenColorTexture!==void 0&&s.push(r.assignTexture(t,"sheenColorMap",a.sheenColorTexture,kr)),a.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(s)}}class DU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return a.transmissionFactor!==void 0&&(t.transmission=a.transmissionFactor),a.transmissionTexture!==void 0&&s.push(r.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(s)}}class LU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];t.thickness=a.thicknessFactor!==void 0?a.thicknessFactor:0,a.thicknessTexture!==void 0&&s.push(r.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;const o=a.attenuationColor||[1,1,1];return t.attenuationColor=new Yt().setRGB(o[0],o[1],o[2],ui),Promise.all(s)}}class OU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class PU{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];t.specularIntensity=a.specularFactor!==void 0?a.specularFactor:1,a.specularTexture!==void 0&&s.push(r.assignTexture(t,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return t.specularColor=new Yt().setRGB(o[0],o[1],o[2],ui),a.specularColorTexture!==void 0&&s.push(r.assignTexture(t,"specularColorMap",a.specularColorTexture,kr)),Promise.all(s)}}class kU{constructor(e){this.parser=e,this.name=pn.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return t.bumpScale=a.bumpFactor!==void 0?a.bumpFactor:1,a.bumpTexture!==void 0&&s.push(r.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(s)}}class $U{constructor(e){this.parser=e,this.name=pn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Js}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return a.anisotropyStrength!==void 0&&(t.anisotropy=a.anisotropyStrength),a.anisotropyRotation!==void 0&&(t.anisotropyRotation=a.anisotropyRotation),a.anisotropyTexture!==void 0&&s.push(r.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(s)}}class QU{constructor(e){this.parser=e,this.name=pn.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,i=r.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,a)}}class HU{constructor(e){this.parser=e,this.name=pn.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const a=s.extensions[t],o=i.images[a.source];let A=r.textureLoader;if(o.uri){const l=r.options.manager.getHandler(o.uri);l!==null&&(A=l)}return r.loadTextureImage(e,a.source,A)}}class VU{constructor(e){this.parser=e,this.name=pn.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const a=s.extensions[t],o=i.images[a.source];let A=r.textureLoader;if(o.uri){const l=r.options.manager.getHandler(o.uri);l!==null&&(A=l)}return r.loadTextureImage(e,a.source,A)}}class GU{constructor(e){this.name=pn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(o){const A=i.byteOffset||0,l=i.byteLength||0,c=i.count,u=i.byteStride,h=new Uint8Array(o,A,l);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,u,h,i.mode,i.filter).then(function(f){return f.buffer}):a.ready.then(function(){const f=new ArrayBuffer(c*u);return a.decodeGltfBuffer(new Uint8Array(f),c,u,h,i.mode,i.filter),f})})}else return null}}class zU{constructor(e){this.name=pn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=t.meshes[r.mesh];for(const l of i.primitives)if(l.mode!==Xi.TRIANGLES&&l.mode!==Xi.TRIANGLE_STRIP&&l.mode!==Xi.TRIANGLE_FAN&&l.mode!==void 0)return null;const a=r.extensions[this.name].attributes,o=[],A={};for(const l in a)o.push(this.parser.getDependency("accessor",a[l]).then(c=>(A[l]=c,A[l])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(l=>{const c=l.pop(),u=c.isGroup?c.children:[c],h=l[0].count,f=[];for(const d of u){const g=new an,m=new Ae,p=new Xs,w=new Ae(1,1,1),C=new GT(d.geometry,d.material,h);for(let b=0;b<h;b++)A.TRANSLATION&&m.fromBufferAttribute(A.TRANSLATION,b),A.ROTATION&&p.fromBufferAttribute(A.ROTATION,b),A.SCALE&&w.fromBufferAttribute(A.SCALE,b),C.setMatrixAt(b,g.compose(m,p,w));for(const b in A)if(b==="_COLOR_0"){const U=A[b];C.instanceColor=new Nm(U.array,U.itemSize,U.normalized)}else b!=="TRANSLATION"&&b!=="ROTATION"&&b!=="SCALE"&&d.geometry.setAttribute(b,A[b]);or.prototype.copy.call(C,d),this.parser.assignFinalMaterial(C),f.push(C)}return c.isGroup?(c.clear(),c.add(...f),c):f[0]}))}}const rv="glTF",lc=12,$0={JSON:1313821514,BIN:5130562};class WU{constructor(e){this.name=pn.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,lc),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==rv)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-lc,s=new DataView(e,lc);let a=0;for(;a<i;){const o=s.getUint32(a,!0);a+=4;const A=s.getUint32(a,!0);if(a+=4,A===$0.JSON){const l=new Uint8Array(e,lc+a,o);this.content=r.decode(l)}else if(A===$0.BIN){const l=lc+a;this.body=e.slice(l,l+o)}a+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class KU{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=pn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},A={},l={};for(const c in a){const u=Pm[c]||c.toLowerCase();o[u]=a[c]}for(const c in e.attributes){const u=Pm[c]||c.toLowerCase();if(a[c]!==void 0){const h=r.accessors[e.attributes[c]],f=hl[h.componentType];l[u]=f.name,A[u]=h.normalized===!0}}return t.getDependency("bufferView",s).then(function(c){return new Promise(function(u,h){i.decodeDracoFile(c,function(f){for(const d in f.attributes){const g=f.attributes[d],m=A[d];m!==void 0&&(g.normalized=m)}u(f)},o,l,ui,h)})})}}class XU{constructor(){this.name=pn.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}
vendor: 5,634 bytes, line 3827
3827class jU{constructor(){this.name=pn.KHR_MESH_QUANTIZATION}}class iv extends fu{constructor(e,t,r,i){super(e,t,r,i)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let a=0;a!==i;a++)t[a]=r[s+a];return t}interpolate_(e,t,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,A=o*2,l=o*3,c=i-t,u=(r-t)/c,h=u*u,f=h*u,d=e*l,g=d-l,m=-2*f+3*h,p=f-h,w=1-m,C=p-h+u;for(let b=0;b!==o;b++){const U=a[g+b+o],F=a[g+b+A]*c,D=a[d+b+o],O=a[d+b]*c;s[b]=w*U+C*F+m*D+p*O}return s}}const YU=new Xs;class qU extends iv{interpolate_(e,t,r,i){const s=super.interpolate_(e,t,r,i);return YU.fromArray(s).normalize().toArray(s),s}}const Xi={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},hl={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Q0={9728:li,9729:Ni,9984:by,9985:Ph,9986:gc,9987:ya},H0={33071:to,33648:nf,10497:xl},ep={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Pm={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},za={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},JU={CUBICSPLINE:void 0,LINEAR:zc,STEP:Gc},tp={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ZU(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new dg({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:_a})),n.DefaultMaterial}function Oo(n,e,t){for(const r in t.extensions)n[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function da(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function eM(n,e,t){let r=!1,i=!1,s=!1;for(let l=0,c=e.length;l<c;l++){const u=e[l];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(i=!0),u.COLOR_0!==void 0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return Promise.resolve(n);const a=[],o=[],A=[];for(let l=0,c=e.length;l<c;l++){const u=e[l];if(r){const h=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):n.attributes.position;a.push(h)}if(i){const h=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):n.attributes.normal;o.push(h)}if(s){const h=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):n.attributes.color;A.push(h)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(A)]).then(function(l){const c=l[0],u=l[1],h=l[2];return r&&(n.morphAttributes.position=c),i&&(n.morphAttributes.normal=u),s&&(n.morphAttributes.color=h),n.morphTargetsRelative=!0,n})}function tM(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,r=e.weights.length;t<r;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let r=0,i=t.length;r<i;r++)n.morphTargetDictionary[t[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function nM(n){let e;const t=n.extensions&&n.extensions[pn.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+np(t.attributes):e=n.indices+":"+np(n.attributes)+":"+n.mode,n.targets!==void 0)for(let r=0,i=n.targets.length;r<i;r++)e+=":"+np(n.targets[r]);return e}function np(n){let e="";const t=Object.keys(n).sort();for(let r=0,i=t.length;r<i;r++)e+=t[r]+":"+n[t[r]]+";";return e}function km(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function rM(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const iM=new an;class sM{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new SU,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,s=!1,a=-1;if(typeof navigator<"u"){const o=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(o)===!0;const A=o.match(/Version\/(\d+)/);i=r&&A?parseInt(A[1],10):-1,s=o.indexOf("Firefox")>-1,a=s?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||s&&a<98?this.textureLoader=new uI(this.options.manager):this.textureLoader=new gI(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Yy(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()}
vendor: 4,109 bytes, line 3827
3827)).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const o={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Oo(s,o,i),da(o,i),Promise.all(r._invokeAll(function(A){return A.afterRoot&&A.afterRoot(o)})).then(function(){for(const A of o.scenes)A.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const a=t[i].joints;for(let o=0,A=a.length;o<A;o++)e[a[o]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const a=e[i];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(r[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const i=r.clone(),s=(a,o)=>{const A=this.associations.get(a);A!=null&&this.associations.set(o,A);for(const[l,c]of a.children.entries())s(c,o.children[l])};return s(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const i=e(t[r]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&r.push(s)}return r}getDependency(e,t){const r=e+":"+t;let i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(r,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,a){return r.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[pn.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,a){r.load(Uc.resolveURL(t.uri,i.path),s,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(r){const i=t.byteLength||0,s=t.byteOffset||0;return r.slice(s,s+i)})}loadAccessor(e){const t=this,r=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const a=ep[i.type],o=hl[i.componentType],A=i.normalized===!0,l=new o(i.count*a);return Promise.resolve(new ci(l,a,A))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(a){const o=a[0],A=ep[i.type],l=hl[i.componentType],c=l.BYTES_PER_ELEMENT,u=c*A,h=i.byteOffset||0,f=i.bufferView!==void 0?r.bufferViews[i.bufferView].byteStride:void 0,d=i.normalized===!0;let g,m;if(f&&f!==u){const p=Math.floor(h/f),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+p+":"+i.count;let C=t.cache.get(w);
vendor: 8,354 bytes, line 3827
3827C||(g=new l(o,p*f,i.count*f/c),C=new kT(g,f/c),t.cache.add(w,C)),m=new cg(C,A,h%f/c,d)}else o===null?g=new l(i.count*A):g=new l(o,h,i.count*A),m=new ci(g,A,d);if(i.sparse!==void 0){const p=ep.SCALAR,w=hl[i.sparse.indices.componentType],C=i.sparse.indices.byteOffset||0,b=i.sparse.values.byteOffset||0,U=new w(a[1],C,i.sparse.count*p),F=new l(a[2],b,i.sparse.count*A);o!==null&&(m=new ci(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let D=0,O=U.length;D<O;D++){const I=U[D];if(m.setX(I,F[D*A]),A>=2&&m.setY(I,F[D*A+1]),A>=3&&m.setZ(I,F[D*A+2]),A>=4&&m.setW(I,F[D*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=d}return m})}loadTexture(e){const t=this.json,r=this.options,s=t.textures[e].source,a=t.images[s];let o=this.textureLoader;if(a.uri){const A=r.manager.getHandler(a.uri);A!==null&&(o=A)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,r){const i=this,s=this.json,a=s.textures[e],o=s.images[t],A=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];const l=this.loadImageSource(t,r).then(function(c){c.flipY=!1,c.name=a.name||o.name||"",c.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(c.name=o.uri);const h=(s.samplers||{})[a.sampler]||{};return c.magFilter=Q0[h.magFilter]||Ni,c.minFilter=Q0[h.minFilter]||ya,c.wrapS=H0[h.wrapS]||xl,c.wrapT=H0[h.wrapT]||xl,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==li&&c.minFilter!==Ni,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){const r=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const a=i.images[e],o=self.URL||self.webkitURL;let A=a.uri||"",l=!1;if(a.bufferView!==void 0)A=r.getDependency("bufferView",a.bufferView).then(function(u){l=!0;const h=new Blob([u],{type:a.mimeType});return A=o.createObjectURL(h),A});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(A).then(function(u){return new Promise(function(h,f){let d=h;t.isImageBitmapLoader===!0&&(d=function(g){const m=new Ur(g);m.needsUpdate=!0,h(m)}),t.load(Uc.resolveURL(u,s.path),d,void 0,f)})}).then(function(u){return l===!0&&o.revokeObjectURL(A),da(u,a),u.userData.mimeType=a.mimeType||rM(a.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=c,c}assignTexture(e,t,r,i){const s=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),s.extensions[pn.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[pn.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const A=s.associations.get(a);a=s.extensions[pn.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),s.associations.set(a,A)}}return i!==void 0&&(a.colorSpace=i),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let A=this.cache.get(o);A||(A=new Wy,Vs.prototype.copy.call(A,r),A.color.copy(r.color),A.map=r.map,A.sizeAttenuation=!1,this.cache.add(o,A)),r=A}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let A=this.cache.get(o);A||(A=new zy,Vs.prototype.copy.call(A,r),A.color.copy(r.color),A.map=r.map,this.cache.add(o,A)),r=A}if(i||s||a){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),s&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let A=this.cache.get(o);A||(A=r.clone(),s&&(A.vertexColors=!0),a&&(A.flatShading=!0),i&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(o,A),this.associations.set(A,this.associations.get(r))),r=A}e.material=r}getMaterialType(){return dg}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let a;const o={},A=s.extensions||{},l=[];if(A[pn.KHR_MATERIALS_UNLIT]){const u=i[pn.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),l.push(u.extendParams(o,s,t))}else{const u=s.pbrMetallicRoughness||{};if(o.color=new Yt(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const h=u.baseColorFactor;o.color.setRGB(h[0],h[1],h[2],ui),o.opacity=h[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(o,"map",u.baseColorTexture,kr)),o.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,o.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),a=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,o)})))}s.doubleSided===!0&&(o.side=$s);const c=s.alphaMode||tp.OPAQUE;if(c===tp.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===tp.MASK&&(o.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&a!==no&&(l.push(t.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new Kt(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;o.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&a!==no&&(l.push(t.assignTexture(o,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&a!==no){const u=s.emissiveFactor;o.emissive=new Yt().setRGB(u[0],u[1],u[2],ui)}return s.emissiveTexture!==void 0&&a!==no&&l.push(t.assignTexture(o,"emissiveMap",s.emissiveTexture,kr)),Promise.all(l).then(function(){const u=new a(o);return s.name&&(u.name=s.name),da(u,s),t.associations.set(u,{materials:e}),s.extensions&&Oo(i,u,s),u})}createUniqueName(e){const t=Rn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(o){return r[pn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(A){return V0(A,o,t)})}const a=[];for(let o=0,A=e.length;o<A;o++){const l=e[o],c=nM(l),u=i[c];if(u)a.push(u.promise);else{let h;l.extensions&&l.extensions[pn.KHR_DRACO_MESH_COMPRESSION]?h=s(l):h=V0(new Is,l,t),i[c]={primitive:l,promise:h},a.push(h)}}return Promise.all(a)}loadMesh(e){const t=this,r=this.json,i=this.extensions,s=r.meshes[e],a=s.primitives,o=[];for(let A=0,l=a.length;A<l;A++){const c=a[A].material===void 0?ZU(this.cache):this.getDependency("material",a[A].material);o.push(c)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(A){const l=A.slice(0,A.length-1),c=A[A.length-1],u=[];for(let f=0,d=c.length;f<d;f++){const g=c[f],m=a[f];let p;const w=l[f];if(m.mode===Xi.TRIANGLES||m.mode===Xi.TRIANGLE_STRIP||m.mode===Xi.TRIANGLE_FAN||m.mode===void 0)p=s.isSkinnedMesh===!0?new QT(g,w):new Ci(g,w),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),m.mode===Xi.TRIANGLE_STRIP?p.geometry=k0(p.geometry,Fy):m.mode===Xi.TRIANGLE_FAN&&(p.geometry=k0(p.geometry,Um));else if(m.mode===Xi.LINES)p=new KT(g,w);else if(m.mode===Xi.LINE_STRIP)p=new fg(g,w);else if(m.mode===Xi.LINE_LOOP)p=new XT(g,w);else if(m.mode===Xi.POINTS)p=new jT(g,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(p.geometry.morphAttributes).length>0&&tM(p,s),p.name=t.createUniqueName(s.name||"mesh_"+e),da(p,s),m.extensions&&Oo(i,p,m),t.assignFinalMaterial(p),u.push(p)}for(let f=0,d=u.length;f<d;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return s.extensions&&Oo(i,u[0],s),u[0];const h=new qo;s.extensions&&Oo(i,h,s),t.associations.set(h,{meshes:e});for(let f=0,d=u.length;f<d;f++)h.add(u[f]);return h})}loadCamera(e){let t;const r=this.json.cameras[e],i=r[r.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?t=new oi(My.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):r.type==="orthographic"&&(t=new Qf(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),da(t,r),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],r=[];for(let i=0,s=t.joints.length;i<s;i++)r.push(this._loadNodeShallow(t.joints[i]));
vendor: 4,296 bytes, line 3827
3827return t.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(i){const s=i.pop(),a=i,o=[],A=[];for(let l=0,c=a.length;l<c;l++){const u=a[l];if(u){o.push(u);const h=new an;s!==null&&h.fromArray(s.array,l*16),A.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new ug(o,A)})}loadAnimation(e){const t=this.json,r=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,a=[],o=[],A=[],l=[],c=[];for(let u=0,h=i.channels.length;u<h;u++){const f=i.channels[u],d=i.samplers[f.sampler],g=f.target,m=g.node,p=i.parameters!==void 0?i.parameters[d.input]:d.input,w=i.parameters!==void 0?i.parameters[d.output]:d.output;g.node!==void 0&&(a.push(this.getDependency("node",m)),o.push(this.getDependency("accessor",p)),A.push(this.getDependency("accessor",w)),l.push(d),c.push(g))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(A),Promise.all(l),Promise.all(c)]).then(function(u){const h=u[0],f=u[1],d=u[2],g=u[3],m=u[4],p=[];for(let w=0,C=h.length;w<C;w++){const b=h[w],U=f[w],F=d[w],D=g[w],O=m[w];if(b===void 0)continue;b.updateMatrix&&b.updateMatrix();const I=r._createAnimationTracks(b,U,F,D,O);if(I)for(let R=0;R<I.length;R++)p.push(I[R])}return new iI(s,void 0,p)})}createNodeMesh(e){const t=this.json,r=this,i=t.nodes[e];return i.mesh===void 0?null:r.getDependency("mesh",i.mesh).then(function(s){const a=r._getNodeRef(r.meshCache,i.mesh,s);return i.weights!==void 0&&a.traverse(function(o){if(!!o.isMesh)for(let A=0,l=i.weights.length;A<l;A++)o.morphTargetInfluences[A]=i.weights[A]}),a})}loadNode(e){const t=this.json,r=this,i=t.nodes[e],s=r._loadNodeShallow(e),a=[],o=i.children||[];for(let l=0,c=o.length;l<c;l++)a.push(r.getDependency("node",o[l]));const A=i.skin===void 0?Promise.resolve(null):r.getDependency("skin",i.skin);return Promise.all([s,Promise.all(a),A]).then(function(l){const c=l[0],u=l[1],h=l[2];h!==null&&c.traverse(function(f){!f.isSkinnedMesh||f.bind(h,iM)});for(let f=0,d=u.length;f<d;f++)c.add(u[f]);return c})}_loadNodeShallow(e){const t=this.json,r=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],a=s.name?i.createUniqueName(s.name):"",o=[],A=i._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return A&&o.push(A),s.camera!==void 0&&o.push(i.getDependency("camera",s.camera).then(function(l){return i._getNodeRef(i.cameraCache,s.camera,l)})),i._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){o.push(l)}),this.nodeCache[e]=Promise.all(o).then(function(l){let c;if(s.isBone===!0?c=new Vy:l.length>1?c=new qo:l.length===1?c=l[0]:c=new or,c!==l[0])for(let u=0,h=l.length;u<h;u++)c.add(l[u]);if(s.name&&(c.userData.name=s.name,c.name=a),da(c,s),s.extensions&&Oo(r,c,s),s.matrix!==void 0){const u=new an;u.fromArray(s.matrix),c.applyMatrix4(u)}else s.translation!==void 0&&c.position.fromArray(s.translation),s.rotation!==void 0&&c.quaternion.fromArray(s.rotation),s.scale!==void 0&&c.scale.fromArray(s.scale);return i.associations.has(c)||i.associations.set(c,{}),i.associations.get(c).nodes=e,c}),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],i=this,s=new qo;r.name&&(s.name=i.createUniqueName(r.name)),da(s,r),r.extensions&&Oo(t,s,r);const a=r.nodes||[],o=[];for(let A=0,l=a.length;A<l;A++)o.push(i.getDependency("node",a[A]));return Promise.all(o).then(function(A){for(let c=0,u=A.length;c<u;c++)s.add(A[c]);const l=c=>{const u=new Map;for(const[h,f]of i.associations)(h instanceof Vs||h instanceof Ur)&&u.set(h,f);return c.traverse(h=>{const f=i.associations.get(h);f!=null&&u.set(h,f)}),u};return i.associations=l(s),s})}_createAnimationTracks(e,t,r,i,s){const a=[],o=e.name?e.name:e.uuid,A=[];za[s.path]===za.weights?e.traverse(function(h){h.morphTargetInfluences&&A.push(h.name?h.name:h.uuid)}):A.push(o);let l;switch(za[s.path]){case za.weights:l=_l;break;case za.rotation:l=Bl;break;case za.translation:case za.scale:l=El;break;default:switch(r.itemSize){case 1:l=_l;break;case 2:case 3:default:l=El;break}break}const c=i.interpolation!==void 0?JU[i.interpolation]:zc,u=this._getArrayFromAccessor(r);for(let h=0,f=A.length;h<f;h++){const d=new l(A[h]+"."+za[s.path],t.array,u,c);
3827i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(d),a.push(d)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const r=km(t.constructor),i=new Float32Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=t[s]*r;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const i=this instanceof Bl?qU:iv;return new i(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function aM(n,e,t){const r=e.attributes,i=new Ua;if(r.POSITION!==void 0){const o=t.json.accessors[r.POSITION],A=o.min,l=o.max;if(A!==void 0&&l!==void 0){if(i.set(new Ae(A[0],A[1],A[2]),new Ae(l[0],l[1],l[2])),o.normalized){const c=km(hl[o.componentType]);i.min.multiplyScalar(c),i.max.multiplyScalar(c)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const o=new Ae,A=new Ae;for(let l=0,c=s.length;l<c;l++){const u=s[l];if(u.POSITION!==void 0){const h=t.json.accessors[u.POSITION],f=h.min,d=h.max;if(f!==void 0&&d!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(d[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(d[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(d[2]))),h.normalized){const g=km(hl[h.componentType]);A.multiplyScalar(g)}o.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(o)}n.boundingBox=i;const a=new qs;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,n.boundingSphere=a}function V0(n,e,t){const r=e.attributes,i=[];function s(a,o){return t.getDependency("accessor",a).then(function(A){n.setAttribute(o,A)})}for(const a in r){const o=Pm[a]||a.toLowerCase();o in n.attributes||i.push(s(r[a],o))}if(e.indices!==void 0&&!n.index){const a=t.getDependency("accessor",e.indices).then(function(o){n.setIndex(o)});i.push(a)}return xn.workingColorSpace!==ui&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${xn.workingColorSpace}" not supported.`),da(n,e),aM(n,e,t),Promise.all(i).then(function(){return e.targets!==void 0?eM(n,e.targets,t):n})}(function(){var n;function e(x){var E=0;return function(){return E<x.length?{done:!1,value:x[E++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(x,E,T){return x==Array.prototype||x==Object.prototype||(x[E]=T.value),x};function r(x){x=[typeof globalThis=="object"&&globalThis,x,typeof window=="object"&&window,typeof self=="object"&&self,typeof Li=="object"&&Li];for(var E=0;E<x.length;++E){var T=x[E];if(T&&T.Math==Math)return T}throw Error("Cannot find global object")}var i=r(this);function s(x,E){if(E)e:{var T=i;x=x.split(".");for(var X=0;X<x.length-1;X++){var ce=x[X];if(!(ce in T))break e;T=T[ce]}x=x[x.length-1],X=T[x],E=E(X),E!=X&&E!=null&&t(T,x,{configurable:!0,writable:!0,value:E})}}s("Symbol",function(x){function E(Se){if(this instanceof E)throw new TypeError("Symbol is not a constructor");return new T(X+(Se||"")+"_"+ce++,Se)}function T(Se,fe){this.g=Se,t(this,"description",{configurable:!0,writable:!0,value:fe})}if(x)return x;T.prototype.toString=function(){return this.g};var X="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",ce=0;return E}),s("Symbol.iterator",function(x){if(x)return x;x=Symbol("Symbol.iterator");for(var E="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),T=0;T<E.length;T++){var X=i[E[T]];typeof X=="function"&&typeof X.prototype[x]!="function"&&t(X.prototype,x,{configurable:!0,writable:!0,value:function(){return a(e(this))}})}return x});function a(x){return x={next:x},x[Symbol.iterator]=function(){return this},x}function o(x){var E=typeof Symbol<"u"&&Symbol.iterator&&x[Symbol.iterator];return E?E.call(x):{next:e(x)}}function A(x){if(!(x instanceof Array)){x=o(x);for(var E,T=[];!(E=x.next()).done;)T.push(E.value);x=T}return x}var l=typeof Object.create=="function"?Object.create:function(x){function E(){}return E.prototype=x,new E},c;
vendor: 39,016 bytes, lines 3827-3844
3827if(typeof Object.setPrototypeOf=="function")c=Object.setPrototypeOf;else{var u;e:{var h={a:!0},f={};try{f.__proto__=h,u=f.a;break e}catch{}u=!1}c=u?function(x,E){if(x.__proto__=E,x.__proto__!==E)throw new TypeError(x+" is not extensible");return x}:null}var d=c;function g(x,E){if(x.prototype=l(E.prototype),x.prototype.constructor=x,d)d(x,E);else for(var T in E)if(T!="prototype")if(Object.defineProperties){var X=Object.getOwnPropertyDescriptor(E,T);X&&Object.defineProperty(x,T,X)}else x[T]=E[T];x.ea=E.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function p(x){if(x.l)throw new TypeError("Generator is already running");x.l=!0}m.prototype.o=function(x){this.h=x};function w(x,E){x.j={U:E,V:!0},x.g=x.m||x.s}m.prototype.return=function(x){this.j={return:x},this.g=this.s};function C(x,E,T){return x.g=T,{value:E}}function b(x){this.g=new m,this.h=x}function U(x,E){p(x.g);var T=x.g.i;return T?F(x,"return"in T?T.return:function(X){return{value:X,done:!0}},E,x.g.return):(x.g.return(E),D(x))}function F(x,E,T,X){try{var ce=E.call(x.g.i,T);if(!(ce instanceof Object))throw new TypeError("Iterator result "+ce+" is not an object");if(!ce.done)return x.g.l=!1,ce;var Se=ce.value}catch(fe){return x.g.i=null,w(x.g,fe),D(x)}return x.g.i=null,X.call(x.g,Se),D(x)}function D(x){for(;x.g.g;)try{var E=x.h(x.g);if(E)return x.g.l=!1,{value:E.value,done:!1}}catch(T){x.g.h=void 0,w(x.g,T)}if(x.g.l=!1,x.g.j){if(E=x.g.j,x.g.j=null,E.V)throw E.U;return{value:E.return,done:!0}}return{value:void 0,done:!0}}function O(x){this.next=function(E){return p(x.g),x.g.i?E=F(x,x.g.i.next,E,x.g.o):(x.g.o(E),E=D(x)),E},this.throw=function(E){return p(x.g),x.g.i?E=F(x,x.g.i.throw,E,x.g.o):(w(x.g,E),E=D(x)),E},this.return=function(E){return U(x,E)},this[Symbol.iterator]=function(){return this}}function I(x,E){return E=new O(new b(E)),d&&x.prototype&&d(E,x.prototype),E}function R(x,E){x instanceof String&&(x+="");var T=0,X=!1,ce={next:function(){if(!X&&T<x.length){var Se=T++;return{value:E(Se,x[Se]),done:!1}}return X=!0,{done:!0,value:void 0}}};return ce[Symbol.iterator]=function(){return ce},ce}var V=typeof Object.assign=="function"?Object.assign:function(x,E){for(var T=1;T<arguments.length;T++){var X=arguments[T];if(X)for(var ce in X)Object.prototype.hasOwnProperty.call(X,ce)&&(x[ce]=X[ce])}return x};s("Object.assign",function(x){return x||V}),s("Promise",function(x){function E(fe){this.h=0,this.i=void 0,this.g=[],this.o=!1;var Fe=this.j();try{fe(Fe.resolve,Fe.reject)}catch(Qe){Fe.reject(Qe)}}function T(){this.g=null}function X(fe){return fe instanceof E?fe:new E(function(Fe){Fe(fe)})}if(x)return x;T.prototype.h=function(fe){if(this.g==null){this.g=[];var Fe=this;this.i(function(){Fe.l()})}this.g.push(fe)};var ce=i.setTimeout;T.prototype.i=function(fe){ce(fe,0)},T.prototype.l=function(){for(;this.g&&this.g.length;){var fe=this.g;this.g=[];for(var Fe=0;Fe<fe.length;++Fe){var Qe=fe[Fe];fe[Fe]=null;try{Qe()}catch(ot){this.j(ot)}}}this.g=null},T.prototype.j=function(fe){this.i(function(){throw fe})},E.prototype.j=function(){function fe(ot){return function(Qt){Qe||(Qe=!0,ot.call(Fe,Qt))}}var Fe=this,Qe=!1;return{resolve:fe(this.C),reject:fe(this.l)}},E.prototype.C=function(fe){if(fe===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(fe instanceof E)this.F(fe);else{e:switch(typeof fe){case"object":var Fe=fe!=null;break e;case"function":Fe=!0;break e;default:Fe=!1}Fe?this.u(fe):this.m(fe)}},E.prototype.u=function(fe){var Fe=void 0;try{Fe=fe.then}catch(Qe){this.l(Qe);return}typeof Fe=="function"?this.G(Fe,fe):this.m(fe)},E.prototype.l=function(fe){this.s(2,fe)},E.prototype.m=function(fe){this.s(1,fe)},E.prototype.s=function(fe,Fe){if(this.h!=0)throw Error("Cannot settle("+fe+", "+Fe+"): Promise already settled in state"+this.h);this.h=fe,this.i=Fe,this.h===2&&this.D(),this.A()},E.prototype.D=function(){var fe=this;ce(function(){if(fe.B()){var Fe=i.console;typeof Fe<"u"&&Fe.error(fe.i)}},1)},E.prototype.B=function(){if(this.o)return!1;var fe=i.CustomEvent,Fe=i.Event,Qe=i.dispatchEvent;return typeof Qe>"u"?!0:(typeof fe=="function"?fe=new fe("unhandledrejection",{cancelable:!0}):typeof Fe=="function"?fe=new Fe("unhandledrejection",{cancelable:!0}):(fe=i.document.createEvent("CustomEvent"),fe.initCustomEvent("unhandledrejection",!1,!0,fe)),fe.promise=this,fe.reason=this.i,Qe(fe))},E.prototype.A=function(){if(this.g!=null){for(var fe=0;fe<this.g.length;++fe)Se.h(this.g[fe]);this.g=null}};var Se=new T;return E.prototype.F=function(fe){var Fe=this.j();fe.J(Fe.resolve,Fe.reject)},E.prototype.G=function(fe,Fe){var Qe=this.j();try{fe.call(Fe,Qe.resolve,Qe.reject)}catch(ot){Qe.reject(ot)}},E.prototype.then=function(fe,Fe){function Qe(qt,Gt){return typeof qt=="function"?function(gt){try{ot(qt(gt))}catch(v){Qt(v)}}:Gt}var ot,Qt,fn=new E(function(qt,Gt){ot=qt,Qt=Gt});return this.J(Qe(fe,ot),Qe(Fe,Qt)),fn},E.prototype.catch=function(fe){return this.then(void 0,fe)},E.prototype.J=function(fe,Fe){function Qe(){switch(ot.h){case 1:fe(ot.i);break;case 2:Fe(ot.i);break;default:throw Error("Unexpected state: "+ot.h)}}var ot=this;this.g==null?Se.h(Qe):this.g.push(Qe),this.o=!0},E.resolve=X,E.reject=function(fe){return new E(function(Fe,Qe){Qe(fe)})},E.race=function(fe){return new E(function(Fe,Qe){for(var ot=o(fe),Qt=ot.next();!Qt.done;Qt=ot.next())X(Qt.value).J(Fe,Qe)})},E.all=function(fe){var Fe=o(fe),Qe=Fe.next();return Qe.done?X([]):new E(function(ot,Qt){function fn(gt){return function(v){qt[gt]=v,Gt--,Gt==0&&ot(qt)}}var qt=[],Gt=0;do qt.push(void 0),Gt++,X(Qe.value).J(fn(qt.length-1),Qt),Qe=Fe.next();while(!Qe.done)})},E}),s("Object.is",function(x){return x||function(E,T){return E===T?E!==0||1/E===1/T:E!==E&&T!==T}}),s("Array.prototype.includes",function(x){return x||function(E,T){var X=this;X instanceof String&&(X=String(X));var ce=X.length;for(T=T||0,0>T&&(T=Math.max(T+ce,0));T<ce;T++){var Se=X[T];if(Se===E||Object.is(Se,E))return!0}return!1}}),s("String.prototype.includes",function(x){return x||function(E,T){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(E instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(E,T||0)!==-1}}),s("Array.prototype.keys",function(x){return x||function(){return R(this,function(E){return E})}});var re=this||self;function Y(x,E){x=x.split(".");var T=re;x[0]in T||typeof T.execScript>"u"||T.execScript("var "+x[0]);for(var X;x.length&&(X=x.shift());)x.length||E===void 0?T[X]&&T[X]!==Object.prototype[X]?T=T[X]:T=T[X]={}:T[X]=E}function se(x,E){return E=String.fromCharCode.apply(null,E),x==null?E:x+E}var ge,ue=typeof TextDecoder<"u",Ce,ae=typeof TextEncoder<"u";function we(x){if(ae)x=(Ce||(Ce=new TextEncoder)).encode(x);else{var E=void 0;E=E===void 0?!1:E;for(var T=0,X=new Uint8Array(3*x.length),ce=0;ce<x.length;ce++){var Se=x.charCodeAt(ce);if(128>Se)X[T++]=Se;else{if(2048>Se)X[T++]=Se>>6|192;else{if(55296<=Se&&57343>=Se){if(56319>=Se&&ce<x.length){var fe=x.charCodeAt(++ce);if(56320<=fe&&57343>=fe){Se=1024*(Se-55296)+fe-56320+65536,X[T++]=Se>>18|240,X[T++]=Se>>12&63|128,X[T++]=Se>>6&63|128,X[T++]=Se&63|128;continue}else ce--}if(E)throw Error("Found an unpaired surrogate");Se=65533}X[T++]=Se>>12|224,X[T++]=Se>>6&63|128}X[T++]=Se&63|128}}x=X.subarray(0,T)}return x}var Pe={},$e=null;function yt(x,E){E===void 0&&(E=0),De(),E=Pe[E];for(var T=Array(Math.floor(x.length/3)),X=E[64]||"",ce=0,Se=0;ce<x.length-2;ce+=3){var fe=x[ce],Fe=x[ce+1],Qe=x[ce+2],ot=E[fe>>2];fe=E[(fe&3)<<4|Fe>>4],Fe=E[(Fe&15)<<2|Qe>>6],Qe=E[Qe&63],T[Se++]=ot+fe+Fe+Qe}switch(ot=0,Qe=X,x.length-ce){case 2:ot=x[ce+1],Qe=E[(ot&15)<<2]||X;case 1:x=x[ce],T[Se]=E[x>>2]+E[(x&3)<<4|ot>>4]+Qe+X}return T.join("")}function Dt(x){var E=x.length,T=3*E/4;T%3?T=Math.floor(T):"=.".indexOf(x[E-1])!=-1&&(T="=.".indexOf(x[E-2])!=-1?T-2:T-1);var X=new Uint8Array(T),ce=0;return Be(x,function(Se){X[ce++]=Se}),X.subarray(0,ce)}function Be(x,E){function T(Qe){for(;X<x.length;){var ot=x.charAt(X++),Qt=$e[ot];if(Qt!=null)return Qt;if(!/^[\s\xa0]*$/.test(ot))throw Error("Unknown base64 encoding at char: "+ot)}return Qe}De();for(var X=0;;){var ce=T(-1),Se=T(0),fe=T(64),Fe=T(64);if(Fe===64&&ce===-1)break;E(ce<<2|Se>>4),fe!=64&&(E(Se<<4&240|fe>>2),Fe!=64&&E(fe<<6&192|Fe))}}function De(){if(!$e){$e={};for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),E=["+/=","+/","-_=","-_.","-_"],T=0;5>T;T++){var X=x.concat(E[T].split(""));Pe[T]=X;for(var ce=0;ce<X.length;ce++){var Se=X[ce];$e[Se]===void 0&&($e[Se]=ce)}}}}var je=typeof Uint8Array.prototype.slice=="function",Ke;function xt(x,E,T){return E===T?Ke||(Ke=new Uint8Array(0)):je?x.slice(E,T):new Uint8Array(x.subarray(E,T))}var It=0,ht=0;function pt(x,E){E=E===void 0?{}:E,E=E.v===void 0?!1:E.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=E,x&&Pt(this,x)}function Pt(x,E){E=E.constructor===Uint8Array?E:E.constructor===ArrayBuffer?new Uint8Array(E):E.constructor===Array?new Uint8Array(E):E.constructor===String?Dt(E):E instanceof Uint8Array?new Uint8Array(E.buffer,E.byteOffset,E.byteLength):new Uint8Array(0),x.h=E,x.l=0,x.j=x.h.length,x.g=x.l}pt.prototype.reset=function(){this.g=this.l};function bt(x){for(var E=128,T=0,X=0,ce=0;4>ce&&128<=E;ce++)E=x.h[x.g++],T|=(E&127)<<7*ce;if(128<=E&&(E=x.h[x.g++],T|=(E&127)<<28,X|=(E&127)>>4),128<=E)for(ce=0;5>ce&&128<=E;ce++)E=x.h[x.g++],X|=(E&127)<<7*ce+3;if(128>E)return x=T>>>0,E=X>>>0,(X=E&2147483648)&&(x=~x+1>>>0,E=~E>>>0,x==0&&(E=E+1>>>0)),x=4294967296*E+(x>>>0),X?-x:x;x.m=!0}pt.prototype.i=function(){var x=this.h,E=x[this.g],T=E&127;return 128>E?(this.g+=1,T):(E=x[this.g+1],T|=(E&127)<<7,128>E?(this.g+=2,T):(E=x[this.g+2],T|=(E&127)<<14,128>E?(this.g+=3,T):(E=x[this.g+3],T|=(E&127)<<21,128>E?(this.g+=4,T):(E=x[this.g+4],T|=(E&15)<<28,128>E?(this.g+=5,T>>>0):(this.g+=5,128<=x[this.g++]&&128<=x[this.g++]&&128<=x[this.g++]&&128<=x[this.g++]&&this.g++,T)))))},pt.prototype.o=function(){var x=this.h[this.g],E=this.h[this.g+1],T=this.h[this.g+2],X=this.h[this.g+3];return this.g+=4,T=(x<<0|E<<8|T<<16|X<<24)>>>0,x=2*(T>>31)+1,E=T>>>23&255,T&=8388607,E==255?T?NaN:1/0*x:E==0?x*Math.pow(2,-149)*T:x*Math.pow(2,E-150)*(T+Math.pow(2,23))};var Z=[];function cn(){this.g=new Uint8Array(64),this.h=0}cn.prototype.push=function(x){if(!(this.h+1<this.g.length)){var E=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(E)}this.g[this.h++]=x},cn.prototype.length=function(){return this.h},cn.prototype.end=function(){var x=this.g,E=this.h;return this.h=0,xt(x,0,E)};function Rt(x,E){for(;127<E;)x.push(E&127|128),E>>>=7;x.push(E)}function kt(x){var E={},T=E.N===void 0?!1:E.N;this.o={v:E.v===void 0?!1:E.v},this.N=T,E=this.o,Z.length?(T=Z.pop(),E&&(T.v=E.v),x&&Pt(T,x),x=T):x=new pt(x,E),this.g=x,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}kt.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};function st(x){var E=x.g;if((E=E.g==E.j)||(E=x.j)||(E=x.g,E=E.m||0>E.g||E.g>E.j),E)return!1;x.m=x.g.g,E=x.g.i();var T=E&7;return T!=0&&T!=5&&T!=1&&T!=2&&T!=3&&T!=4?(x.j=!0,!1):(x.i=E,x.l=E>>>3,x.h=T,!0)}function Tt(x){switch(x.h){case 0:if(x.h!=0)Tt(x);else{for(x=x.g;x.h[x.g]&128;)x.g++;x.g++}break;case 1:x.h!=1?Tt(x):(x=x.g,x.g+=8);break;case 2:if(x.h!=2)Tt(x);else{var E=x.g.i();x=x.g,x.g+=E}break;case 5:x.h!=5?Tt(x):(x=x.g,x.g+=4);break;case 3:E=x.l;do{if(!st(x)){x.j=!0;break}if(x.h==4){x.l!=E&&(x.j=!0);break}Tt(x)}while(1);break;default:x.j=!0}}function lt(x,E,T){var X=x.g.j,ce=x.g.i(),Se=x.g.g+ce;if(x.g.j=Se,T(E,x),T=Se-x.g.g,T!==0)throw Error("Message parsing ended unexpectedly. Expected to read "+ce+" bytes, instead read "+(ce-T)+" bytes, either the data ended unexpectedly or the message misreported its own length");return x.g.g=Se,x.g.j=X,E}function G(x){return x.g.o()}function L(x){var E=x.g.i();x=x.g;var T=x.g;x.g+=E,x=x.h;var X;if(ue)(X=ge)||(X=ge=new TextDecoder("utf-8",{fatal:!1})),X=X.decode(x.subarray(T,T+E));else{E=T+E;for(var ce=[],Se=null,fe,Fe,Qe;T<E;)fe=x[T++],128>fe?ce.push(fe):224>fe?T>=E?ce.push(65533):(Fe=x[T++],194>fe||(Fe&192)!==128?(T--,ce.push(65533)):ce.push((fe&31)<<6|Fe&63)):240>fe?T>=E-1?ce.push(65533):(Fe=x[T++],(Fe&192)!==128||fe===224&&160>Fe||fe===237&&160<=Fe||((X=x[T++])&192)!==128?(T--,ce.push(65533)):ce.push((fe&15)<<12|(Fe&63)<<6|X&63)):244>=fe?T>=E-2?ce.push(65533):(Fe=x[T++],(Fe&192)!==128||(fe<<28)+(Fe-144)>>30!==0||((X=x[T++])&192)!==128||((Qe=x[T++])&192)!==128?(T--,ce.push(65533)):(fe=(fe&7)<<18|(Fe&63)<<12|(X&63)<<6|Qe&63,fe-=65536,ce.push((fe>>10&1023)+55296,(fe&1023)+56320))):ce.push(65533),8192<=ce.length&&(Se=se(Se,ce),ce.length=0);X=se(Se,ce)}return X}function he(x,E,T){var X=x.g.i();for(X=x.g.g+X;x.g.g<X;)T.push(E.call(x.g))}function Te(x,E){x.h==2?he(x,pt.prototype.o,E):E.push(G(x))}function Ne(){this.h=[],this.i=0,this.g=new cn}function xe(x,E){E.length!==0&&(x.h.push(E),x.i+=E.length)}function qe(x){var E=x.i+x.g.length();if(E===0)return new Uint8Array(0);E=new Uint8Array(E);for(var T=x.h,X=T.length,ce=0,Se=0;Se<X;Se++){var fe=T[Se];fe.length!==0&&(E.set(fe,ce),ce+=fe.length)}return T=x.g,X=T.h,X!==0&&(E.set(T.g.subarray(0,X),ce),T.h=0),x.h=[E],E}function Ve(x,E,T){if(T!=null){Rt(x.g,8*E+5),x=x.g;var X=T;X=(T=0>X?1:0)?-X:X,X===0?0<1/X?It=ht=0:(ht=0,It=2147483648):isNaN(X)?(ht=0,It=2147483647):34028234663852886e22<X?(ht=0,It=(T<<31|2139095040)>>>0):11754943508222875e-54>X?(X=Math.round(X/Math.pow(2,-149)),ht=0,It=(T<<31|X)>>>0):(E=Math.floor(Math.log(X)/Math.LN2),X*=Math.pow(2,-E),X=Math.round(8388608*X),16777216<=X&&++E,ht=0,It=(T<<31|E+127<<23|X&8388607)>>>0),T=It,x.push(T>>>0&255),x.push(T>>>8&255),x.push(T>>>16&255),x.push(T>>>24&255)}}var vt=typeof Uint8Array=="function";function Mt(x,E,T){if(x!=null)return typeof x=="object"?vt&&x instanceof Uint8Array?T(x):Oe(x,E,T):E(x)}function Oe(x,E,T){if(Array.isArray(x)){for(var X=Array(x.length),ce=0;ce<x.length;ce++)X[ce]=Mt(x[ce],E,T);return Array.isArray(x)&&x.W&&ft(X),X}X={};for(ce in x)X[ce]=Mt(x[ce],E,T);return X}function ut(x){return typeof x=="number"?isFinite(x)?x:String(x):x}var Nt={W:{value:!0,configurable:!0}};function ft(x){return Array.isArray(x)&&!Object.isFrozen(x)&&Object.defineProperties(x,Nt),x}var Ge;function _t(x,E,T){var X=Ge;Ge=null,x||(x=X),X=this.constructor.ca,x||(x=X?[X]:[]),this.j=X?0:-1,this.m=this.g=null,this.h=x;e:{if(X=this.h.length,x=X-1,X&&(X=this.h[x],!(X===null||typeof X!="object"||Array.isArray(X)||vt&&X instanceof Uint8Array))){this.l=x-this.j,this.i=X;break e}E!==void 0&&-1<E?(this.l=Math.max(E,x+1-this.j),this.i=null):this.l=Number.MAX_VALUE}if(T)for(E=0;E<T.length;E++)x=T[E],x<this.l?(x+=this.j,(X=this.h[x])?ft(X):this.h[x]=Bt):(un(this),(X=this.i[x])?ft(X):this.i[x]=Bt)}var Bt=Object.freeze(ft([]));function un(x){var E=x.l+x.j;x.h[E]||(x.i=x.h[E]={})}function te(x,E,T){return E===-1?null:(T===void 0?0:T)||E>=x.l?x.i?x.i[E]:void 0:x.h[E+x.j]}function Je(x,E){var T=T===void 0?!1:T,X=te(x,E,T);return X==null&&(X=Bt),X===Bt&&(X=ft([]),Ue(x,E,X,T)),X}function be(x){var E=Je(x,3);if(x.m||(x.m={}),!x.m[3]){for(var T=0;T<E.length;T++)E[T]=+E[T];x.m[3]=!0}return E}function Ee(x,E,T){return x=te(x,E),x==null?T:x}function Le(x,E,T){return x=te(x,E),x=x==null?x:+x,x==null?T===void 0?0:T:x}function Ue(x,E,T,X){(X===void 0?0:X)||E>=x.l?(un(x),x.i[E]=T):x.h[E+x.j]=T}function Ft(x,E,T){if(T===-1)return null;if(x.g||(x.g={}),!x.g[T]){var X=te(x,T,!1);X&&(x.g[T]=new E(X))}return x.g[T]}function wn(x,E){x.g||(x.g={});var T=x.g[1];if(!T){var X=Je(x,1);T=[];for(var ce=0;ce<X.length;ce++)T[ce]=new E(X[ce]);x.g[1]=T}return T}function Pn(x,E,T){var X=X===void 0?!1:X;x.g||(x.g={});var ce=T&&Xn(T);x.g[E]=T,Ue(x,E,ce,X)}function on(x,E,T,X){var ce=wn(x,T);E=E||new T,x=Je(x,1),X!=null?(ce.splice(X,0,E),x.splice(X,0,Xn(E))):(ce.push(E),x.push(Xn(E)))}_t.prototype.toJSON=function(){var x=Xn(this);return Oe(x,ut,yt)};function Xn(x,E){if(x.g)for(var T in x.g){var X=x.g[T];if(Array.isArray(X))for(var ce=0;ce<X.length;ce++)X[ce]&&Xn(X[ce]);else X&&Xn(X)}return x.h}_t.prototype.toString=function(){return Xn(this).toString()};function Er(x,E){if(x=x.o){xe(E,E.g.end());for(var T=0;T<x.length;T++)xe(E,x[T])}}function mr(x,E){if(E.h==4)return!1;var T=E.m;return Tt(E),E.N||(E=xt(E.g.h,T,E.g.g),(T=x.o)?T.push(E):x.o=[E]),!0}function Gr(x){_t.call(this,x,-1,na)}g(Gr,_t),Gr.prototype.getRows=function(){return te(this,1)},Gr.prototype.getCols=function(){return te(this,2)},Gr.prototype.getPackedDataList=function(){return be(this)},Gr.prototype.getLayout=function(){return Ee(this,4,0)};function ei(x,E){for(;st(E);)switch(E.i){case 8:var T=E.g.i();Ue(x,1,T);break;case 16:T=E.g.i(),Ue(x,2,T);break;case 29:case 26:Te(E,x.getPackedDataList());break;case 32:T=bt(E.g),Ue(x,4,T);break;default:if(!mr(x,E))return x}return x}var na=[3];function sr(x,E){var T=void 0;return new(T||(T=Promise))(function(X,ce){function Se(Qe){try{Fe(E.next(Qe))}catch(ot){ce(ot)}}function fe(Qe){try{Fe(E.throw(Qe))}catch(ot){ce(ot)}}function Fe(Qe){Qe.done?X(Qe.value):new T(function(ot){ot(Qe.value)}).then(Se,fe)}Fe((E=E.apply(x,void 0)).next())})}function Sr(x){_t.call(this,x)}g(Sr,_t);function Hi(x,E){for(;st(E);)switch(E.i){case 8:var T=E.g.i();Ue(x,1,T);break;case 21:T=G(E),Ue(x,2,T);break;case 26:T=L(E),Ue(x,3,T);break;case 34:T=L(E),Ue(x,4,T);break;default:if(!mr(x,E))return x}return x}function di(x){_t.call(this,x,-1,Vi)}g(di,_t),di.prototype.addClassification=function(x,E){return on(this,x,Sr,E),this};var Vi=[1];function pi(x){_t.call(this,x)}g(pi,_t);function us(x,E){for(;st(E);)switch(E.i){case 13:var T=G(E);Ue(x,1,T);break;case 21:T=G(E),Ue(x,2,T);break;case 29:T=G(E),Ue(x,3,T);break;case 37:T=G(E),Ue(x,4,T);break;case 45:T=G(E),Ue(x,5,T);break;default:if(!mr(x,E))return x}return x}function ra(x){_t.call(this,x,-1,La)}g(ra,_t);function ia(x){e:{var E=new ra;for(x=new kt(x);st(x);)switch(x.i){case 10:var T=lt(x,new pi,us);on(E,T,pi,void 0);break;default:if(!mr(E,x))break e}}return E}var La=[1];function Ds(x){_t.call(this,x)}g(Ds,_t);function mi(x){_t.call(this,x,-1,Q)}g(mi,_t),mi.prototype.getVertexType=function(){return Ee(this,1,0)},mi.prototype.getPrimitiveType=function(){return Ee(this,2,0)},mi.prototype.getVertexBufferList=function(){return be(this)},mi.prototype.getIndexBufferList=function(){return Je(this,4)};function Ls(x,E){for(;st(E);)switch(E.i){case 8:var T=bt(E.g);Ue(x,1,T);break;case 16:T=bt(E.g),Ue(x,2,T);break;case 29:case 26:Te(E,x.getVertexBufferList());break;case 32:case 34:T=E;var X=x.getIndexBufferList();T.h==2?he(T,pt.prototype.i,X):X.push(T.g.i());break;default:if(!mr(x,E))return x}return x}var Q=[3,4];function oe(x){_t.call(this,x)}g(oe,_t),oe.prototype.getMesh=function(){return Ft(this,mi,1)},oe.prototype.getPoseTransformMatrix=function(){return Ft(this,Gr,2)};function ye(x){e:{var E=new oe;for(x=new kt(x);st(x);)switch(x.i){case 10:var T=lt(x,new mi,Ls);Pn(E,1,T);break;case 18:T=lt(x,new Gr,ei),Pn(E,2,T);break;default:if(!mr(E,x))break e}}return E}function ve(x,E,T){if(T=x.createShader(T===0?x.VERTEX_SHADER:x.FRAGMENT_SHADER),x.shaderSource(T,E),x.compileShader(T),!x.getShaderParameter(T,x.COMPILE_STATUS))throw Error(`Could not compile WebGL shader. 3828 3829`+x.getShaderInfoLog(T));return T}function le(x){return wn(x,Sr).map(function(E){return{index:Ee(E,1,0),Y:Le(E,2),label:te(E,3)!=null?Ee(E,3,""):void 0,displayName:te(E,4)!=null?Ee(E,4,""):void 0}})}function ke(x){return{x:Le(x,1),y:Le(x,2),z:Le(x,3),visibility:te(x,4)!=null?Le(x,4):void 0}}function Ze(x,E){this.h=x,this.g=E,this.l=0}function it(x,E,T){return tt(x,E),typeof x.g.canvas.transferToImageBitmap=="function"?Promise.resolve(x.g.canvas.transferToImageBitmap()):T?Promise.resolve(x.g.canvas):typeof createImageBitmap=="function"?createImageBitmap(x.g.canvas):(x.i===void 0&&(x.i=document.createElement("canvas")),new Promise(function(X){x.i.height=x.g.canvas.height,x.i.width=x.g.canvas.width,x.i.getContext("2d",{}).drawImage(x.g.canvas,0,0,x.g.canvas.width,x.g.canvas.height),X(x.i)}))}function tt(x,E){var T=x.g;if(x.m===void 0){var X=ve(T,` 3830 attribute vec2 aVertex; 3831 attribute vec2 aTex; 3832 varying vec2 vTex; 3833 void main(void) { 3834 gl_Position = vec4(aVertex, 0.0, 1.0); 3835 vTex = aTex; 3836 }`,0),ce=ve(T,` 3837 precision mediump float; 3838 varying vec2 vTex; 3839 uniform sampler2D sampler0; 3840 void main(){ 3841 gl_FragColor = texture2D(sampler0, vTex); 3842 }`,1),Se=T.createProgram();if(T.attachShader(Se,X),T.attachShader(Se,ce),T.linkProgram(Se),!T.getProgramParameter(Se,T.LINK_STATUS))throw Error(`Could not compile WebGL program. 3843 3844`+T.getProgramInfoLog(Se));X=x.m=Se,T.useProgram(X),ce=T.getUniformLocation(X,"sampler0"),x.j={I:T.getAttribLocation(X,"aVertex"),H:T.getAttribLocation(X,"aTex"),da:ce},x.s=T.createBuffer(),T.bindBuffer(T.ARRAY_BUFFER,x.s),T.enableVertexAttribArray(x.j.I),T.vertexAttribPointer(x.j.I,2,T.FLOAT,!1,0,0),T.bufferData(T.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),T.STATIC_DRAW),T.bindBuffer(T.ARRAY_BUFFER,null),x.o=T.createBuffer(),T.bindBuffer(T.ARRAY_BUFFER,x.o),T.enableVertexAttribArray(x.j.H),T.vertexAttribPointer(x.j.H,2,T.FLOAT,!1,0,0),T.bufferData(T.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),T.STATIC_DRAW),T.bindBuffer(T.ARRAY_BUFFER,null),T.uniform1i(ce,0)}X=x.j,T.useProgram(x.m),T.canvas.width=E.width,T.canvas.height=E.height,T.viewport(0,0,E.width,E.height),T.activeTexture(T.TEXTURE0),x.h.bindTexture2d(E.glName),T.enableVertexAttribArray(X.I),T.bindBuffer(T.ARRAY_BUFFER,x.s),T.vertexAttribPointer(X.I,2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(X.H),T.bindBuffer(T.ARRAY_BUFFER,x.o),T.vertexAttribPointer(X.H,2,T.FLOAT,!1,0,0),T.bindFramebuffer(T.DRAW_FRAMEBUFFER?T.DRAW_FRAMEBUFFER:T.FRAMEBUFFER,null),T.clearColor(0,0,0,0),T.clear(T.COLOR_BUFFER_BIT),T.colorMask(!0,!0,!0,!0),T.drawArrays(T.TRIANGLE_FAN,0,4),T.disableVertexAttribArray(X.I),T.disableVertexAttribArray(X.H),T.bindBuffer(T.ARRAY_BUFFER,null),x.h.bindTexture2d(0)}function Ot(x){this.g=x}var Lt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Et(x,E){return E+x}function Zt(x,E){window[x]=E}function Ht(x){var E=document.createElement("script");return E.setAttribute("src",x),E.setAttribute("crossorigin","anonymous"),new Promise(function(T){E.addEventListener("load",function(){T()},!1),E.addEventListener("error",function(){T()},!1),document.body.appendChild(E)})}function Nn(){return sr(this,function x(){return I(x,function(E){switch(E.g){case 1:return E.m=2,C(E,WebAssembly.instantiate(Lt),4);case 4:E.g=3,E.m=0;break;case 2:return E.m=0,E.j=null,E.return(!1);case 3:return E.return(!0)}})})}function mn(x){if(this.g=x,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=x&&x.locateFile||Et,typeof window=="object")var E=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if(typeof location<"u")E=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.S=E,x.options){E=o(Object.keys(x.options));for(var T=E.next();!T.done;T=E.next()){T=T.value;var X=x.options[T].default;X!==void 0&&(this.j[T]=typeof X=="function"?X():X)}}}n=mn.prototype,n.close=function(){return this.i&&this.i.delete(),Promise.resolve()};function An(x,E){return x.g.files===void 0?[]:typeof x.g.files=="function"?x.g.files(E):x.g.files}function Ct(x){return sr(x,function E(){var T=this,X,ce,Se,fe,Fe,Qe,ot,Qt,fn,qt,Gt;return I(E,function(gt){switch(gt.g){case 1:return X=T,T.R?(ce=An(T,T.j),C(gt,Nn(),2)):gt.return();case 2:if(Se=gt.h,typeof window=="object")return Zt("createMediapipeSolutionsWasm",{locateFile:T.locateFile}),Zt("createMediapipeSolutionsPackedAssets",{locateFile:T.locateFile}),Qe=ce.filter(function(v){return v.data!==void 0}),ot=ce.filter(function(v){return v.data===void 0}),Qt=Promise.all(Qe.map(function(v){var S=lr(X,v.url);if(v.path!==void 0){var N=v.path;S=S.then(function(k){return X.overrideFile(N,k),Promise.resolve(k)})}return S})),fn=Promise.all(ot.map(function(v){return v.simd===void 0||v.simd&&Se||!v.simd&&!Se?Ht(X.locateFile(v.url,X.S)):Promise.resolve()})).then(function(){return sr(X,function v(){var S,N,k=this;return I(v,function(W){if(W.g==1)return S=window.createMediapipeSolutionsWasm,N=window.createMediapipeSolutionsPackedAssets,C(W,S(N),2);k.h=W.h,W.g=0})})}),qt=function(){return sr(X,function v(){var S=this;return I(v,function(N){return S.g.graph&&S.g.graph.url?N=C(N,lr(S,S.g.graph.url),0):(N.g=0,N=void 0),N})})}(),C(gt,Promise.all([fn,Qt,qt]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return fe=ce.filter(function(v){return v.simd===void 0||v.simd&&Se||!v.simd&&!Se}).map(function(v){return X.locateFile(v.url,X.S)}),importScripts.apply(null,A(fe)),C(gt,createMediapipeSolutionsWasm(Module),6);case 6:T.h=gt.h,T.l=new OffscreenCanvas(1,1),T.h.canvas=T.l,Fe=T.h.GL.createContext(T.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),T.h.GL.makeContextCurrent(Fe),gt.g=4;break;case 7:if(T.l=document.createElement("canvas"),Gt=T.l.getContext("webgl2",{}),!Gt&&(Gt=T.l.getContext("webgl",{}),!Gt))return alert("Failed to create WebGL canvas context when passing video frame."),gt.return();T.D=Gt,T.h.canvas=T.l,T.h.createContext(T.l,!0,!0,{});case 4:T.i=new T.h.SolutionWasm,T.R=!1,gt.g=0}})})}function kn(x){return sr(x,function E(){var T=this,X,ce,Se,fe,Fe,Qe,ot,Qt;return I(E,function(fn){if(fn.g==1){if(T.g.graph&&T.g.graph.url&&T.P===T.g.graph.url)return fn.return();if(T.o=!0,!T.g.graph||!T.g.graph.url){fn.g=2;return}return T.P=T.g.graph.url,C(fn,lr(T,T.g.graph.url),3)}for(fn.g!=2&&(X=fn.h,T.i.loadGraph(X)),ce=o(Object.keys(T.B)),Se=ce.next();!Se.done;Se=ce.next())fe=Se.value,T.i.overrideFile(fe,T.B[fe]);if(T.B={},T.g.listeners)for(Fe=o(T.g.listeners),Qe=Fe.next();!Qe.done;Qe=Fe.next())ot=Qe.value,Gi(T,ot);Qt=T.j,T.j={},T.setOptions(Qt),fn.g=0})})}n.reset=function(){return sr(this,function x(){var E=this;return I(x,function(T){E.i&&(E.i.reset(),E.m={},E.s={}),T.g=0})})},n.setOptions=function(x,E){var T=this;if(E=E||this.g.options){for(var X=[],ce=[],Se={},fe=o(Object.keys(x)),Fe=fe.next();!Fe.done;Se={K:Se.K,L:Se.L},Fe=fe.next()){var Qe=Fe.value;Qe in this.j&&this.j[Qe]===x[Qe]||(this.j[Qe]=x[Qe],Fe=E[Qe],Fe!==void 0&&(Fe.onChange&&(Se.K=Fe.onChange,Se.L=x[Qe],X.push(function(ot){return function(){return sr(T,function Qt(){var fn,qt=this;return I(Qt,function(Gt){if(Gt.g==1)return C(Gt,ot.K(ot.L),2);fn=Gt.h,fn===!0&&(qt.o=!0),Gt.g=0})})}}(Se))),Fe.graphOptionXref&&(Qe={valueNumber:Fe.type===1?x[Qe]:0,valueBoolean:Fe.type===0?x[Qe]:!1,valueString:Fe.type===2?x[Qe]:""},Fe=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),Fe.graphOptionXref),Qe),ce.push(Fe))))}(X.length!==0||ce.length!==0)&&(this.o=!0,this.A=(this.A===void 0?[]:this.A).concat(ce),this.u=(this.u===void 0?[]:this.u).concat(X))}};function zt(x){return sr(x,function E(){var T=this,X,ce,Se,fe,Fe,Qe,ot;return I(E,function(Qt){switch(Qt.g){case 1:if(!T.o)return Qt.return();if(!T.u){Qt.g=2;break}X=o(T.u),ce=X.next();case 3:if(ce.done){Qt.g=5;break}return Se=ce.value,C(Qt,Se(),4);case 4:ce=X.next(),Qt.g=3;break;case 5:T.u=void 0;case 2:if(T.A){for(fe=new T.h.GraphOptionChangeRequestList,Fe=o(T.A),Qe=Fe.next();!Qe.done;Qe=Fe.next())ot=Qe.value,fe.push_back(ot);T.i.changeOptions(fe),fe.delete(),T.A=void 0}T.o=!1,Qt.g=0}})})}n.initialize=function(){return sr(this,function x(){var E=this;return I(x,function(T){return T.g==1?C(T,Ct(E),2):T.g!=3?C(T,kn(E),3):C(T,zt(E),0)})})};function lr(x,E){return sr(x,function T(){var X=this,ce,Se;return I(T,function(fe){return E in X.F?fe.return(X.F[E]):(ce=X.locateFile(E,""),Se=fetch(ce).then(function(Fe){return Fe.arrayBuffer()}),X.F[E]=Se,fe.return(Se))})})}n.overrideFile=function(x,E){this.i?this.i.overrideFile(x,E):this.B[x]=E},n.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},n.send=function(x,E){return sr(this,function T(){var X=this,ce,Se,fe,Fe,Qe,ot,Qt,fn,qt;return I(T,function(Gt){switch(Gt.g){case 1:return X.g.inputs?(ce=1e3*(E==null?performance.now():E),C(Gt,X.C,2)):Gt.return();case 2:return C(Gt,X.initialize(),3);case 3:for(Se=new X.h.PacketDataList,fe=o(Object.keys(x)),Fe=fe.next();!Fe.done;Fe=fe.next())if(Qe=Fe.value,ot=X.g.inputs[Qe]){e:{var gt=X,v=x[Qe];switch(ot.type){case"video":var S=gt.m[ot.stream];if(S||(S=new Ze(gt.h,gt.D),gt.m[ot.stream]=S),gt=S,gt.l===0&&(gt.l=gt.h.createTexture()),typeof HTMLVideoElement<"u"&&v instanceof HTMLVideoElement){var N=v.videoWidth;S=v.videoHeight}else typeof HTMLImageElement<"u"&&v instanceof HTMLImageElement?(N=v.naturalWidth,S=v.naturalHeight):(N=v.width,S=v.height);S={glName:gt.l,width:N,height:S},N=gt.g,N.canvas.width=S.width,N.canvas.height=S.height,N.activeTexture(N.TEXTURE0),gt.h.bindTexture2d(gt.l),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,N.RGBA,N.UNSIGNED_BYTE,v),gt.h.bindTexture2d(0),gt=S;break e;case"detections":for(S=gt.m[ot.stream],S||(S=new Ot(gt.h),gt.m[ot.stream]=S),gt=S,gt.data||(gt.data=new gt.g.DetectionListData),gt.data.reset(v.length),S=0;S<v.length;++S){N=v[S];var k=gt.data,W=k.setBoundingBox,z=S,j=N.T,ee=new Ds;Ue(ee,1,j.Z),Ue(ee,2,j.$),Ue(ee,3,j.height),Ue(ee,4,j.width),Ue(ee,5,j.rotation),Ue(ee,6,j.X);var de=j=new Ne;Ve(de,1,te(ee,1)),Ve(de,2,te(ee,2)),Ve(de,3,te(ee,3)),Ve(de,4,te(ee,4)),Ve(de,5,te(ee,5));var Ie=te(ee,6);if(Ie!=null&&Ie!=null){Rt(de.g,48);var Me=de.g,We=Ie;Ie=0>We,We=Math.abs(We);var Xe=We>>>0;for(We=Math.floor((We-Xe)/4294967296),We>>>=0,Ie&&(We=~We>>>0,Xe=(~Xe>>>0)+1,4294967295<Xe&&(Xe=0,We++,4294967295<We&&(We=0))),It=Xe,ht=We,Ie=It,Xe=ht;0<Xe||127<Ie;)Me.push(Ie&127|128),Ie=(Ie>>>7|Xe<<25)>>>0,Xe>>>=7;Me.push(Ie)}if(Er(ee,de),j=qe(j),W.call(k,z,j),N.O)for(k=0;k<N.O.length;++k)ee=N.O[k],de=!!ee.visibility,W=gt.data,z=W.addNormalizedLandmark,j=S,ee=Object.assign(Object.assign({},ee),{visibility:de?ee.visibility:0}),de=new pi,Ue(de,1,ee.x),Ue(de,2,ee.y),Ue(de,3,ee.z),ee.visibility&&Ue(de,4,ee.visibility),Me=ee=new Ne,Ve(Me,1,te(de,1)),Ve(Me,2,te(de,2)),Ve(Me,3,te(de,3)),Ve(Me,4,te(de,4)),Ve(Me,5,te(de,5)),Er(de,Me),ee=qe(ee),z.call(W,j,ee);if(N.M)for(k=0;k<N.M.length;++k){if(W=gt.data,z=W.addClassification,j=S,ee=N.M[k],de=new Sr,Ue(de,2,ee.Y),ee.index&&Ue(de,1,ee.index),ee.label&&Ue(de,3,ee.label),ee.displayName&&Ue(de,4,ee.displayName),Me=ee=new Ne,Xe=te(de,1),Xe!=null&&Xe!=null)if(Rt(Me.g,8),Ie=Me.g,0<=Xe)Rt(Ie,Xe);else{for(We=0;9>We;We++)Ie.push(Xe&127|128),Xe>>=7;Ie.push(1)}Ve(Me,2,te(de,2)),Ie=te(de,3),Ie!=null&&(Ie=we(Ie),Rt(Me.g,26),Rt(Me.g,Ie.length),xe(Me,Me.g.end()),xe(Me,Ie)),Ie=te(de,4),Ie!=null&&(Ie=we(Ie),Rt(Me.g,34),Rt(Me.g,Ie.length),xe(Me,Me.g.end()),xe(Me,Ie)),Er(de,Me),ee=qe(ee),z.call(W,j,ee)}}gt=gt.data;break e;default:gt={}}}switch(Qt=gt,fn=ot.stream,ot.type){case"video":Se.pushTexture2d(Object.assign(Object.assign({},Qt),{stream:fn,timestamp:ce}));break;case"detections":qt=Qt,qt.stream=fn,qt.timestamp=ce,Se.pushDetectionList(qt);break;default:throw Error("Unknown input config type: '"+ot.type+"'")}}return X.i.send(Se),C(Gt,X.C,4);case 4:Se.delete(),Gt.g=0}})})};function Ii(x,E,T){return sr(x,function X(){var ce,Se,fe,Fe,Qe,ot,Qt=this,fn,qt,Gt,gt,v,S,N,k;return I(X,function(W){switch(W.g){case 1:if(!T)return W.return(E);for(ce={},Se=0,fe=o(Object.keys(T)),Fe=fe.next();!Fe.done;Fe=fe.next())Qe=Fe.value,ot=T[Qe],typeof ot!="string"&&ot.type==="texture"&&E[ot.stream]!==void 0&&++Se;1<Se&&(Qt.G=!1),fn=o(Object.keys(T)),Fe=fn.next();case 2:if(Fe.done){W.g=4;break}if(qt=Fe.value,Gt=T[qt],typeof Gt=="string")return N=ce,k=qt,C(W,cr(Qt,qt,E[Gt]),14);if(gt=E[Gt.stream],Gt.type==="detection_list"){if(gt){for(var z=gt.getRectList(),j=gt.getLandmarksList(),ee=gt.getClassificationsList(),de=[],Ie=0;Ie<z.size();++Ie){var Me=z.get(Ie);e:{var We=new Ds;for(Me=new kt(Me);st(Me);)switch(Me.i){case 13:var Xe=G(Me);Ue(We,1,Xe);break;case 21:Xe=G(Me),Ue(We,2,Xe);break;case 29:Xe=G(Me),Ue(We,3,Xe);break;case 37:Xe=G(Me),Ue(We,4,Xe);break;case 45:Xe=G(Me),Ue(We,5,Xe);break;case 48:Xe=bt(Me.g),Ue(We,6,Xe);break;default:if(!mr(We,Me))break e}}We={Z:Le(We,1),$:Le(We,2),height:Le(We,3),width:Le(We,4),rotation:Le(We,5,0),X:Ee(We,6,0)},Me=wn(ia(j.get(Ie)),pi).map(ke);var rt=ee.get(Ie);e:for(Xe=new di,rt=new kt(rt);st(rt);)switch(rt.i){case 10:Xe.addClassification(lt(rt,new Sr,Hi));break;default:if(!mr(Xe,rt))break e}We={T:We,O:Me,M:le(Xe)},de.push(We)}z=de}else z=[];ce[qt]=z,W.g=7;break}if(Gt.type==="proto_list"){if(gt){for(z=Array(gt.size()),j=0;j<gt.size();j++)z[j]=gt.get(j);gt.delete()}else z=[];ce[qt]=z,W.g=7;break}if(gt===void 0){W.g=3;break}if(Gt.type==="float_list"){ce[qt]=gt,W.g=7;break}if(Gt.type==="proto"){ce[qt]=gt,W.g=7;break}if(Gt.type!=="texture")throw Error("Unknown output config type: '"+Gt.type+"'");return v=Qt.s[qt],v||(v=new Ze(Qt.h,Qt.D),Qt.s[qt]=v),C(W,it(v,gt,Qt.G),13);case 13:S=W.h,ce[qt]=S;case 7:Gt.transform&&ce[qt]&&(ce[qt]=Gt.transform(ce[qt])),W.g=3;break;case 14:N[k]=W.h;case 3:Fe=fn.next(),W.g=2;break;case 4:return W.return(ce)}})})}function cr(x,E,T){return sr(x,function X(){var ce=this,Se;return I(X,function(fe){return typeof T=="number"||T instanceof Uint8Array||T instanceof ce.h.Uint8BlobList?fe.return(T):T instanceof ce.h.Texture2dDataOut?(Se=ce.s[E],Se||(Se=new Ze(ce.h,ce.D),ce.s[E]=Se),fe.return(it(Se,T,ce.G))):fe.return(void 0)})})}function Gi(x,E){for(var T=E.name||"$",X=[].concat(A(E.wants)),ce=new x.h.StringList,Se=o(E.wants),fe=Se.next();!fe.done;fe=Se.next())ce.push_back(fe.value);Se=x.h.PacketListener.implement({onResults:function(Fe){for(var Qe={},ot=0;ot<E.wants.length;++ot)Qe[X[ot]]=Fe.get(ot);var Qt=x.listeners[T];Qt&&(x.C=Ii(x,Qe,E.outs).then(function(fn){fn=Qt(fn);for(var qt=0;qt<E.wants.length;++qt){var Gt=Qe[X[qt]];typeof Gt=="object"&&Gt.hasOwnProperty&&Gt.hasOwnProperty("delete")&&Gt.delete()}fn&&(x.C=fn)}))}}),x.i.attachMultiListener(ce,Se),ce.delete()}n.onResults=function(x,E){this.listeners[E||"$"]=x},Y("Solution",mn),Y("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});function en(x){x=ye(x);var E=x.getMesh();if(!E)return x;var T=new Float32Array(E.getVertexBufferList());E.getVertexBufferList=function(){return T};var X=new Uint32Array(E.getIndexBufferList());return E.getIndexBufferList=function(){return X},x}var ur={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(x){return x.map(en)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(x){return x.map(function(E){return wn(ia(E),pi).map(ke)})}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},Yn=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],qn=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Jn=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],hs=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],ti=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Os=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Io=[].concat(A(Yn),A(qn),A(Jn),A(hs),A(ti),A(Os));function Fo(x){x=x||{},x=Object.assign(Object.assign({},ur),x),this.g=new mn(x)}n=Fo.prototype,n.close=function(){return this.g.close(),Promise.resolve()},n.onResults=function(x){this.g.onResults(x)},n.initialize=function(){return sr(this,function x(){var E=this;return I(x,function(T){return C(T,E.g.initialize(),0)})})},n.reset=function(){this.g.reset()},n.send=function(x){return sr(this,function E(){var T=this;return I(E,function(X){return C(X,T.g.send(x),0)})})},n.setOptions=function(x){this.g.setOptions(x)},Y("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),Y("FaceMesh",Fo),Y("FACEMESH_LIPS",Yn),Y("FACEMESH_LEFT_EYE",qn),Y("FACEMESH_LEFT_EYEBROW",Jn),Y("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),Y("FACEMESH_RIGHT_EYE",hs),Y("FACEMESH_RIGHT_EYEBROW",ti),Y("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),Y("FACEMESH_FACE_OVAL",Os),Y("FACEMESH_CONTOURS",Io),Y("FACEMESH_TESSELATION"
vendor: 8,530 bytes, line 3844
3844,[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400
vendor: 15,813 bytes, line 3844
3844],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
3844]),Y("matrixDataToMatrix",function(x){for(var E=x.getCols(),T=x.getRows(),X=x.getPackedDataList(),ce=[],Se=0;Se<T;Se++)ce.push(Array(E));for(Se=0;Se<T;Se++)for(var fe=0;fe<E;fe++){var Fe=x.getLayout()===1?Se*E+fe:fe*T+Se;ce[Se][fe]=X[Fe]}return ce}),Y("VERSION","0.4.1633559619")}).call(Li);var oM=FaceMesh;/** 3845 * @license 3846 * Copyright 2020 Google LLC. All Rights Reserved. 3847 * Licensed under the Apache License, Version 2.0 (the "License"); 3848 * you may not use this file except in compliance with the License. 3849 * You may obtain a copy of the License at 3850 * 3851 * http://www.apache.org/licenses/LICENSE-2.0 3852 * 3853 * Unless required by applicable law or agreed to in writing, software 3854 * distributed under the License is distributed on an "AS IS" BASIS, 3855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3856 * See the License for the specific language governing permissions and 3857 * limitations under the License. 3858 * ============================================================================= 3859 */const AM=1e-7,lM=1e-4;class cM{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class sv{refCount(e){return vi("refCount")}incRef(e){return vi("incRef")}timerAvailable(){return!0}time(e){return vi("time")}read(e){return vi("read")}readSync(e){return vi("readSync")}readToGPU(e,t){return vi("readToGPU")}numDataIds(){return vi("numDataIds")}disposeData(e,t){return vi("disposeData")}write(e,t,r){return vi("write")}move(e,t,r,i,s){return vi("move")}createTensorFromGPUData(e,t,r){return vi("createTensorFromGPUData")}memory(){return vi("memory")}floatPrecision(){return vi("floatPrecision")}epsilon(){return this.floatPrecision()===32?AM:lM}dispose(){return vi("dispose")}}function vi(n){throw new Error(`'${n}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}/** 3860 * @license 3861 * Copyright 2020 Google LLC. All Rights Reserved. 3862 * Licensed under the Apache License, Version 2.0 (the "License"); 3863 * you may not use this file except in compliance with the License. 3864 * You may obtain a copy of the License at 3865 * 3866 * http://www.apache.org/licenses/LICENSE-2.0 3867 * 3868 * Unless required by applicable law or agreed to in writing, software 3869 * distributed under the License is distributed on an "AS IS" BASIS, 3870 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3871 * See the License for the specific language governing permissions and 3872 * limitations under the License. 3873 * ============================================================================= 3874 */function Af(n,e,t){return Math.max(n,Math.min(e,t))}function xg(n){return n%2===0?n:n+1}function cc(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function uM(n){let e=0;for(let t=0;t<n.length;t++)e+=n[t];return e}function H(n,e){if(!n)throw new Error(typeof e=="string"?e:e())}function Pi(n,e,t=""){H(rr(n,e),()=>t+` Shapes ${n} and ${e} must match`)}function Ql(n){H(n!=null,()=>"The input to the tensor constructor must be a non-null value.")}function ze(n){if(n.length===0)return 1;let e=n[0];for(let t=1;t<n.length;t++)e*=n[t];return e}function hM(n,e){if(n===e)return!0;
vendor: 13,425 bytes, lines 3874-3937
3874if(n==null||e==null||n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==null&&e[t]!==null&&n[t]!==e[t])return!1;return!0}function rr(n,e){if(n===e)return!0;if(n==null||e==null||n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Sl(n){return n%1===0}function $m(n){const e=Math.ceil(Math.sqrt(n));return[e,Math.ceil(n/e)]}function fl(n,e){return e<=n.length?n:n+" ".repeat(e-n.length)}function G0(n,e=i=>0,t,r){return new Promise((i,s)=>{let a=0;const o=()=>{if(n()){i();return}a++;const A=e(a);if(t!=null&&a>=t){s();return}r!=null?r(o,A):setTimeout(o,A)};o()})}function fM(n,e){let t=1,r=-1;for(let s=0;s<n.length;++s)if(n[s]>=0)t*=n[s];else if(n[s]===-1){if(r!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${s}`);r=s}else if(n[s]<0)throw Error(`Shapes can not be < 0. Found ${n[s]} at dim ${s}`);if(r===-1){if(e>0&&e!==t)throw Error(`Size(${e}) must match the product of shape ${n}`);return n}if(t===0)throw Error(`Cannot infer the missing size in [${n}] when there are 0 elements`);if(e%t!==0)throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${t}`);const i=n.slice();return i[r]=e/t,i}function Br(n,e){const t=e.length;return n=n==null?e.map((r,i)=>i):[].concat(n),H(n.every(r=>r>=-t&&r<t),()=>`All values in axis param must be in range [-${t}, ${t}) but got axis ${n}`),H(n.every(r=>Sl(r)),()=>`All values in axis param must be integers but got axis ${n}`),n.map(r=>r<0?t+r:r)}function Bo(n,e){const t=[],r=[],i=e!=null&&Array.isArray(e)&&e.length===0,s=e==null||i?null:Br(e,n).sort();let a=0;for(let o=0;o<n.length;++o){if(s!=null){if(s[a]===o&&n[o]!==1)throw new Error(`Can't squeeze axis ${o} since its dim '${n[o]}' is not 1`);(s[a]==null||s[a]>o)&&n[o]===1&&(t.push(n[o]),r.push(o)),s[a]<=o&&a++}n[o]!==1&&(t.push(n[o]),r.push(o))}return{newShape:t,keptDims:r}}function vo(n,e){return br(n,e)}function br(n,e){let t=null;if(n==null||n==="float32")t=new Float32Array(e);else if(n==="int32")t=new Int32Array(e);else if(n==="bool")t=new Uint8Array(e);else if(n==="string")t=new Array(e);else throw new Error(`Unknown data type ${n}`);return t}function dM(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(isNaN(r)||!isFinite(r))throw Error(`A tensor of type ${e} being uploaded contains ${r}.`)}}function pM(n){return n==="bool"||n==="complex64"||n==="float32"||n==="int32"||n==="string"}function mM(n,e){return!(e==="complex64"||e==="float32"&&n!=="complex64"||e==="int32"&&n!=="float32"&&n!=="complex64"||e==="bool"&&n==="bool")}function lf(n){if(n==="float32"||n==="int32")return 4;if(n==="complex64")return 8;if(n==="bool")return 1;throw new Error(`Unknown dtype ${n}`)}function gM(n){if(n==null)return 0;let e=0;return n.forEach(t=>e+=t.length),e}function Vf(n){return typeof n=="string"||n instanceof String}function yM(n){return typeof n=="boolean"}function vM(n){return typeof n=="number"}function du(n){return Array.isArray(n)?du(n[0]):n instanceof Float32Array?"float32":n instanceof Int32Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray?"int32":vM(n)?"float32":Vf(n)?"string":yM(n)?"bool":"float32"}function Qm(n){return!!(n&&n.constructor&&n.call&&n.apply)}function Hm(n,e){for(let t=e;t<n;++t)if(n%t===0)return t;return n}function Mr(n){const e=n.length;if(e<2)return[];const t=new Array(e-1);t[e-2]=n[e-1];for(let r=e-3;r>=0;--r)t[r]=t[r+1]*n[r+1];return t}function av(n,e,t,r=!1){const i=new Array;if(e.length===1){const s=e[0]*(r?2:1);for(let a=0;a<s;a++)i[a]=t[n+a]}else{const s=e[0],a=e.slice(1),o=a.reduce((A,l)=>A*l)*(r?2:1);for(let A=0;A<s;A++)i[A]=av(n+A*o,a,t,r)}return i}function Vm(n,e,t=!1){if(n.length===0)return e[0];const r=n.reduce((i,s)=>i*s)*(t?2:1);if(r===0)return[];if(r!==e.length)throw new Error(`[${n}] does not match the input size ${e.length}${t?" for a complex tensor":""}.`);return av(0,n,e,t)}function ov(n,e){const t=wo(n,e);for(let r=0;r<t.length;r++)t[r]=1;return t}function wo(n,e){if(e==null||e==="float32"||e==="complex64")return new Float32Array(n);if(e==="int32")return new Int32Array(n);if(e==="bool")return new Uint8Array(n);throw new Error(`Unknown data type ${e}`)}function ki(n){n.forEach(e=>{H(Number.isInteger(e)&&e>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${n}].`)})}function Gm(n,e,t){if(e===0)return 0;if(e===1)return n[0];let r=n[n.length-1];for(let i=0;i<n.length-1;++i)r+=t[i]*n[i];return r}function bg(n,e,t){if(e===0)return[];if(e===1)return[n];const r=new Array(e);for(let i=0;i<r.length-1;++i)r[i]=Math.floor(n/t[i]),n-=r[i]*t[i];return r[r.length-1]=n,r}function lA(n){return n&&n.then&&typeof n.then=="function"}/** 3875 * @license 3876 * Copyright 2017 Google LLC. All Rights Reserved. 3877 * Licensed under the Apache License, Version 2.0 (the "License"); 3878 * you may not use this file except in compliance with the License. 3879 * You may obtain a copy of the License at 3880 * 3881 * http://www.apache.org/licenses/LICENSE-2.0 3882 * 3883 * Unless required by applicable law or agreed to in writing, software 3884 * distributed under the License is distributed on an "AS IS" BASIS, 3885 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3886 * See the License for the specific language governing permissions and 3887 * limitations under the License. 3888 * ============================================================================= 3889 */const z0="tfjsflags";class wM{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=xM,this.populateURLFlags()}setPlatform(e,t){this.platform!=null&&(pe().getBool("IS_TEST")||pe().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)),this.platformName=e,this.platform=t}registerFlag(e,t,r){if(this.flagRegistry[e]={evaluationFn:t,setHook:r},this.urlFlags[e]!=null){const i=this.urlFlags[e];pe().getBool("IS_TEST")||pe().getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${i}.`),this.set(e,i)}}async getAsync(e){return e in this.flags?this.flags[e]:(this.flags[e]=await this.evaluateFlag(e),this.flags[e])}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if(lA(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getString(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(this.flagRegistry[e]==null)throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,this.flagRegistry[e].setHook!=null&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(this.flagRegistry[e]==null)throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(typeof this.global>"u"||typeof this.global.location>"u"||typeof this.global.location.search>"u")return;const e=this.getQueryParams(this.global.location.search);z0 in e&&e[z0].split(",").forEach(r=>{const[i,s]=r.split(":");this.urlFlags[i]=CM(i,s)})}}function xM(n){const e={};return n.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(t,...r)=>(bM(e,r[0],r[1]),r.join("="))),e}function bM(n,e,t){n[decodeURIComponent(e)]=decodeURIComponent(t||"")}function CM(n,e){const t=e.toLowerCase();return t==="true"||t==="false"?t==="true":`${+t}`===t?+t:e}function pe(){return Av}let Av=null;function _M(n){Av=n}/** 3890 * @license 3891 * Copyright 2020 Google LLC. All Rights Reserved. 3892 * Licensed under the Apache License, Version 2.0 (the "License"); 3893 * you may not use this file except in compliance with the License. 3894 * You may obtain a copy of the License at 3895 * 3896 * http://www.apache.org/licenses/LICENSE-2.0 3897 * 3898 * Unless required by applicable law or agreed to in writing, software 3899 * distributed under the License is distributed on an "AS IS" BASIS, 3900 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3901 * See the License for the specific language governing permissions and 3902 * limitations under the License. 3903 * ============================================================================= 3904 */let rp;function lv(){if(rp==null){let n;if(typeof window<"u")n=window;else if(typeof global<"u")n=global;else if(typeof process<"u")n=process;else if(typeof self<"u")n=self;else throw new Error("Could not find a global object");rp=n}return rp}function BM(){const n=lv();return n._tfGlobals==null&&(n._tfGlobals=new Map),n._tfGlobals}function Cg(n,e){const t=BM();if(t.has(n))return t.get(n);{const r=e();return t.set(n,r),t.get(n)}}const cv="Abs",uv="Acos",hv="Acosh",_g="Add",fv="AddN",dv="All",pv="Any",mv="ArgMax",gv="ArgMin",yv="Asin",vv="Asinh",wv="Atan",xv="Atanh",bv="Atan2",Cv="AvgPool",EM="AvgPoolGrad",_v="AvgPool3D",SM="AvgPool3DGrad",Bv="BatchMatMul",Ev="BatchToSpaceND",Sv="Bincount",Tv="BitwiseAnd",Iv="BroadcastArgs",Bg="Cast",Fv="Ceil",Rv="ClipByValue",Uv="Complex",Mv="ComplexAbs",Nv="Concat",Dv="Conv2D",Lv="Conv2DBackpropFilter",Ov="Conv2DBackpropInput",Pv="Conv3D",TM="Conv3DBackpropFilterV2",kv="Conv3DBackpropInputV2",$v="Cos",Qv="Cosh",Hv="Cumprod",Vv="Cumsum",Gv="CropAndResize",zv="DenseBincount",Wv="DepthToSpace",Kv="DepthwiseConv2dNative",Xv="DepthwiseConv2dNativeBackpropFilter",jv="DepthwiseConv2dNativeBackpropInput",Yv="Diag",qv="Dilation2D",IM="Draw",Jv="RealDiv",Zv="Einsum",ew="Elu",FM="EluGrad",tw="Erf",nw="Equal",rw="Exp",iw="ExpandDims",sw="Expm1",aw="FFT",ow="Fill",Aw="FlipLeftRight",lw="Floor",cw="FloorDiv",uw="FusedBatchNorm",hw="GatherV2",fw="GatherNd",dw="Greater",pw="GreaterEqual",Eg="Identity",mw="IFFT",gw="Imag",yw="IsFinite",vw="IsInf",ww="IsNan",xw="LeakyRelu",bw="Less",Cw="LessEqual",_w="LinSpace",Bw="Log",Ew="Log1p",Sw="LogicalAnd",Tw="LogicalNot",Iw="LogicalOr",Fw="LRN",RM="LRNGrad",Rw="Max",Uw="Maximum",Mw="MaxPool",UM="MaxPoolGrad",Nw="MaxPool3D",MM="MaxPool3DGrad",Dw="MaxPoolWithArgmax",Lw="Mean",Ow="Min",Pw="Minimum",kw="MirrorPad",$w="Mod",Qw="Multinomial",Hw="Multiply",Vw="Neg",Gw="NotEqual",zw="NonMaxSuppressionV3",Ww="NonMaxSuppressionV4",Kw="NonMaxSuppressionV5",Xw="OnesLike",jw="OneHot",Yw="Pack",qw="PadV2",Jw="Pow",Zw="Prelu",ex="Prod",tx="RaggedGather",nx="RaggedRange",rx="RaggedTensorToTensor",ix="Range",sx="Real",ax="Reciprocal",ox="Relu",Ax="Reshape",lx="ResizeNearestNeighbor",NM="ResizeNearestNeighborGrad",cx="ResizeBilinear",DM="ResizeBilinearGrad",ux="Relu6",hx="Reverse",fx="Round",dx="Rsqrt",px="ScatterNd",mx="TensorScatterUpdate",gx="SearchSorted",yx="Select",vx="Selu",wx="Slice",xx="Sin",bx="Sinh",Cx="Sign",_x="Sigmoid",Bx="Softplus",Ex="Sqrt",Sx="Sum",Tx="SpaceToBatchND",Ix="SplitV",Fx="Softmax",Rx="SparseFillEmptyRows",Ux="SparseReshape",Mx="SparseSegmentMean",Nx="SparseSegmentSum",Dx="SparseToDense",Lx="SquaredDifference",LM="Square",Ox="StaticRegexReplace",Px="StridedSlice",kx="StringNGrams",$x="StringSplit",Qx="StringToHashBucketFast",Hx="Sub",Vx="Tan",Gx="Tanh",Sg="Tile",zx="TopK",Wx="Transform",Wh="Transpose",Kx="Unique",Xx="Unpack",jx="UnsortedSegmentSum",Yx="ZerosLike",qx="Step",zm="FromPixels",Jx="RotateWithOffset",Wm="_FusedMatMul",Km="FusedConv2D",Xm="FusedDepthwiseConv2D";/** 3905 * @license 3906 * Copyright 2018 Google LLC. All Rights Reserved. 3907 * Licensed under the Apache License, Version 2.0 (the "License"); 3908 * you may not use this file except in compliance with the License. 3909 * You may obtain a copy of the License at 3910 * 3911 * http://www.apache.org/licenses/LICENSE-2.0 3912 * 3913 * Unless required by applicable law or agreed to in writing, software 3914 * distributed under the License is distributed on an "AS IS" BASIS, 3915 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3916 * See the License for the specific language governing permissions and 3917 * limitations under the License. 3918 * ============================================================================= 3919 */function Cs(...n){pe().getBool("IS_TEST")||pe().getBool("PROD")||console.warn(...n)}function OM(...n){pe().getBool("IS_TEST")||pe().getBool("PROD")||console.log(...n)}/** 3920 * @license 3921 * Copyright 2019 Google LLC. All Rights Reserved. 3922 * Licensed under the Apache License, Version 2.0 (the "License"); 3923 * you may not use this file except in compliance with the License. 3924 * You may obtain a copy of the License at 3925 * 3926 * http://www.apache.org/licenses/LICENSE-2.0 3927 * 3928 * Unless required by applicable law or agreed to in writing, software 3929 * distributed under the License is distributed on an "AS IS" BASIS, 3930 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3931 * See the License for the specific language governing permissions and 3932 * limitations under the License. 3933 * ============================================================================= 3934 */const cf=Cg("kernelRegistry",()=>new Map),PM=Cg("gradRegistry",()=>new Map);function uf(n,e){const t=Zx(n,e);return cf.get(t)}function W0(n){return PM.get(n)}function K0(n){const e=cf.entries(),t=[];for(;;){const{done:r,value:i}=e.next();if(r)break;const[s,a]=i,[o]=s.split("_");o===n&&t.push(a)}return t}function kM(n){const{kernelName:e,backendName:t}=n,r=Zx(e,t);cf.has(r)&&Cs(`The kernel '${e}' for backend '${t}' is already registered`),cf.set(r,n)}function Zx(n,e){return`${e}_${n}`}/** 3935 * @license 3936 * Copyright 2023 Google LLC. 3937 * Licensed under the Apache License, Version 2.0 (the "License");
vendor: 4,987 bytes, lines 3938-3949
3938 * you may not use this file except in compliance with the License. 3939 * You may obtain a copy of the License at 3940 * 3941 * http://www.apache.org/licenses/LICENSE-2.0 3942 * 3943 * Unless required by applicable law or agreed to in writing, software 3944 * distributed under the License is distributed on an "AS IS" BASIS, 3945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3946 * See the License for the specific language governing permissions and 3947 * limitations under the License. 3948 * ============================================================================= 3949 */function eb(n){return n instanceof Float32Array||n instanceof Int32Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray}var jm=zn,es=null;try{es=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function zn(n,e,t){this.low=n|0,this.high=e|0,this.unsigned=!!t}zn.prototype.__isLong__;Object.defineProperty(zn.prototype,"__isLong__",{value:!0});function Si(n){return(n&&n.__isLong__)===!0}zn.isLong=Si;var X0={},j0={};function bA(n,e){var t,r,i;return e?(n>>>=0,(i=0<=n&&n<256)&&(r=j0[n],r)?r:(t=Wn(n,(n|0)<0?-1:0,!0),i&&(j0[n]=t),t)):(n|=0,(i=-128<=n&&n<128)&&(r=X0[n],r)?r:(t=Wn(n,n<0?-1:0,!1),i&&(X0[n]=t),t))}zn.fromInt=bA;function ts(n,e){if(isNaN(n))return e?Jo:ns;if(e){if(n<0)return Jo;if(n>=tb)return ib}else{if(n<=-q0)return _i;if(n+1>=q0)return rb}return n<0?ts(-n,e).neg():Wn(n%Tl|0,n/Tl|0,e)}zn.fromNumber=ts;function Wn(n,e,t){return new zn(n,e,t)}zn.fromBits=Wn;var hf=Math.pow;function Tg(n,e,t){if(n.length===0)throw Error("empty string");if(n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return ns;if(typeof e=="number"?(t=e,e=!1):e=!!e,t=t||10,t<2||36<t)throw RangeError("radix");var r;if((r=n.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return Tg(n.substring(1),e,t).neg();for(var i=ts(hf(t,8)),s=ns,a=0;a<n.length;a+=8){var o=Math.min(8,n.length-a),A=parseInt(n.substring(a,a+o),t);if(o<8){var l=ts(hf(t,o));s=s.mul(l).add(ts(A))}else s=s.mul(i),s=s.add(ts(A))}return s.unsigned=e,s}zn.fromString=Tg;function Rs(n,e){return typeof n=="number"?ts(n,e):typeof n=="string"?Tg(n,e):Wn(n.low,n.high,typeof e=="boolean"?e:n.unsigned)}zn.fromValue=Rs;var Y0=1<<16,$M=1<<24,Tl=Y0*Y0,tb=Tl*Tl,q0=tb/2,J0=bA($M),ns=bA(0);zn.ZERO=ns;var Jo=bA(0,!0);zn.UZERO=Jo;var ol=bA(1);zn.ONE=ol;var nb=bA(1,!0);zn.UONE=nb;var Ym=bA(-1);zn.NEG_ONE=Ym;var rb=Wn(-1,2147483647,!1);zn.MAX_VALUE=rb;var ib=Wn(-1,-1,!0);zn.MAX_UNSIGNED_VALUE=ib;var _i=Wn(0,-2147483648,!1);zn.MIN_VALUE=_i;var nt=zn.prototype;nt.toInt=function(){return this.unsigned?this.low>>>0:this.low};nt.toNumber=function(){return this.unsigned?(this.high>>>0)*Tl+(this.low>>>0):this.high*Tl+(this.low>>>0)};nt.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(_i)){var t=ts(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=ts(hf(e,6),this.unsigned),a=this,o="";;){var A=a.div(s),l=a.sub(A.mul(s)).toInt()>>>0,c=l.toString(e);if(a=A,a.isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}};nt.getHighBits=function(){return this.high};nt.getHighBitsUnsigned=function(){return this.high>>>0};nt.getLowBits=function(){return this.low};nt.getLowBitsUnsigned=function(){return this.low>>>0};nt.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_i)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&(e&1<<t)==0;t--);return this.high!=0?t+33:t+1};nt.isZero=function(){return this.high===0&&this.low===0};nt.eqz=nt.isZero;nt.isNegative=function(){return!this.unsigned&&this.high<0};nt.isPositive=function(){return this.unsigned||this.high>=0};nt.isOdd=function(){return(this.low&1)===1};nt.isEven=function(){return(this.low&1)===0};nt.equals=function(e){return Si(e)||(e=Rs(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};nt.eq=nt.equals;nt.notEquals=function(e){return!this.eq(e)};nt.neq=nt.notEquals;nt.ne=nt.notEquals;nt.lessThan=function(e){return this.comp(e)<0}
vendor: 4,659 bytes, line 3949
3949;nt.lt=nt.lessThan;nt.lessThanOrEqual=function(e){return this.comp(e)<=0};nt.lte=nt.lessThanOrEqual;nt.le=nt.lessThanOrEqual;nt.greaterThan=function(e){return this.comp(e)>0};nt.gt=nt.greaterThan;nt.greaterThanOrEqual=function(e){return this.comp(e)>=0};nt.gte=nt.greaterThanOrEqual;nt.ge=nt.greaterThanOrEqual;nt.compare=function(e){if(Si(e)||(e=Rs(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};nt.comp=nt.compare;nt.negate=function(){return!this.unsigned&&this.eq(_i)?_i:this.not().add(ol)};nt.neg=nt.negate;nt.add=function(e){Si(e)||(e=Rs(e));var t=this.high>>>16,r=this.high&65535,i=this.low>>>16,s=this.low&65535,a=e.high>>>16,o=e.high&65535,A=e.low>>>16,l=e.low&65535,c=0,u=0,h=0,f=0;return f+=s+l,h+=f>>>16,f&=65535,h+=i+A,u+=h>>>16,h&=65535,u+=r+o,c+=u>>>16,u&=65535,c+=t+a,c&=65535,Wn(h<<16|f,c<<16|u,this.unsigned)};nt.subtract=function(e){return Si(e)||(e=Rs(e)),this.add(e.neg())};nt.sub=nt.subtract;nt.multiply=function(e){if(this.isZero())return ns;if(Si(e)||(e=Rs(e)),es){var t=es.mul(this.low,this.high,e.low,e.high);return Wn(t,es.get_high(),this.unsigned)}if(e.isZero())return ns;if(this.eq(_i))return e.isOdd()?_i:ns;if(e.eq(_i))return this.isOdd()?_i:ns;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(J0)&&e.lt(J0))return ts(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,s=this.low>>>16,a=this.low&65535,o=e.high>>>16,A=e.high&65535,l=e.low>>>16,c=e.low&65535,u=0,h=0,f=0,d=0;return d+=a*c,f+=d>>>16,d&=65535,f+=s*c,h+=f>>>16,f&=65535,f+=a*l,h+=f>>>16,f&=65535,h+=i*c,u+=h>>>16,h&=65535,h+=s*l,u+=h>>>16,h&=65535,h+=a*A,u+=h>>>16,h&=65535,u+=r*c+i*l+s*A+a*o,u&=65535,Wn(f<<16|d,u<<16|h,this.unsigned)};nt.mul=nt.multiply;nt.divide=function(e){if(Si(e)||(e=Rs(e)),e.isZero())throw Error("division by zero");if(es){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?es.div_u:es.div_s)(this.low,this.high,e.low,e.high);return Wn(t,es.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Jo:ns;var r,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Jo;if(e.gt(this.shru(1)))return nb;s=Jo}else{if(this.eq(_i)){if(e.eq(ol)||e.eq(Ym))return _i;if(e.eq(_i))return ol;var a=this.shr(1);return r=a.div(e).shl(1),r.eq(ns)?e.isNegative()?ol:Ym:(i=this.sub(e.mul(r)),s=r.add(i.div(e)),s)}else if(e.eq(_i))return this.unsigned?Jo:ns;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=ns}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),A=o<=48?1:hf(2,o-48),l=ts(r),c=l.mul(e);c.isNegative()||c.gt(i);)r-=A,l=ts(r,this.unsigned),c=l.mul(e);l.isZero()&&(l=ol),s=s.add(l),i=i.sub(c)}return s};nt.div=nt.divide;nt.modulo=function(e){if(Si(e)||(e=Rs(e)),es){var t=(this.unsigned?es.rem_u:es.rem_s)(this.low,this.high,e.low,e.high);return Wn(t,es.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};nt.mod=nt.modulo;nt.rem=nt.modulo;nt.not=function(){return Wn(~this.low,~this.high,this.unsigned)};nt.and=function(e){return Si(e)||(e=Rs(e)),Wn(this.low&e.low,this.high&e.high,this.unsigned)};nt.or=function(e){return Si(e)||(e=Rs(e)),Wn(this.low|e.low,this.high|e.high,this.unsigned)};nt.xor=function(e){return Si(e)||(e=Rs(e)),Wn(this.low^e.low,this.high^e.high,this.unsigned)};nt.shiftLeft=function(e){return Si(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Wn(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Wn(0,this.low<<e-32,this.unsigned)};nt.shl=nt.shiftLeft;nt.shiftRight=function(e){return Si(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Wn(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Wn(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};nt.shr=nt.shiftRight;nt.shiftRightUnsigned=function(e){if(Si(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var r=this.low;return Wn(r>>>e|t<<32-e,t>>>e,this.unsigned)}else return e===32?Wn(t,0,this.unsigned):Wn(t>>>e-32,0,this.unsigned)};nt.shru=nt.shiftRightUnsigned;nt.shr_u=nt.shiftRightUnsigned;nt.toSigned=function(){return this.unsigned?Wn(this.low,this.high,!1):this};nt.toUnsigned=function(){return this.unsigned?this:Wn(this.low,this.high,!0)};nt.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};nt.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>
3949>8&255,e>>>16&255,e>>>24]};nt.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};zn.fromBytes=function(e,t,r){return r?zn.fromBytesLE(e,t):zn.fromBytesBE(e,t)};zn.fromBytesLE=function(e,t){return new zn(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)};zn.fromBytesBE=function(e,t){return new zn(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};const QM=iS({__proto__:null,default:jm},[jm]);/** 3950 * @license 3951 * Copyright 2021 Google LLC. All Rights Reserved. 3952 * Licensed under the Apache License, Version 2.0 (the "License"); 3953 * you may not use this file except in compliance with the License. 3954 * You may obtain a copy of the License at 3955 * 3956 * http://www.apache.org/licenses/LICENSE-2.0 3957 * 3958 * Unless required by applicable law or agreed to in writing, software 3959 * distributed under the License is distributed on an "AS IS" BASIS, 3960 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3961 * See the License for the specific language governing permissions and 3962 * limitations under the License. 3963 * ============================================================================= 3964 */const Wo=jm||QM;function Gf(n){return Wo.fromString(n,!0,16)}const sb=Gf("c3a5c85c97cb3127"),Vo=Gf("b492b66fbe98f273"),Yr=Gf("9ae16a3b2f90404f");function qm(n){return n.xor(n.shru(47))}function ab(n,e,t){const r=n.slice(e,e+t);return Wo.fromBytes(Array.from(r),!0,!0)}function $n(n,e){return ab(n,e,8)}function Z0(n,e){return ab(n,e,4)}function wr(n,e){return e===0?n:n.shru(e).or(n.shl(64-e))}function uo(n,e,t=Gf("9ddfea08eb382d69")){let r=n.xor(e).mul(t);r=r.xor(r.shru(47));let i=e.xor(r).mul(t);return i=i.xor(i.shru(47)),i=i.mul(t),i}
vendor: 4,235 bytes, lines 3964-3982
3964function HM(n,e,t,r,i,s){i=i.add(n),s=wr(s.add(i).add(r),21);const a=i;return i=i.add(e),i=i.add(t),s=s.add(wr(i,44)),[i.add(r),s.add(a)]}function nh(n,e,t,r){return HM($n(n,e),$n(n,e+8),$n(n,e+16),$n(n,e+24),t,r)}function VM(n,e=n.length){if(e>=8){const t=Yr.add(e*2),r=$n(n,0).add(Yr),i=$n(n,e-8),s=wr(i,37).mul(t).add(r),a=wr(r,25).add(i).mul(t);return uo(s,a,t)}if(e>=4){const t=Yr.add(e*2),r=Z0(n,0);return uo(r.shl(3).add(e),Z0(n,e-4),t)}if(e>0){const t=n[0],r=n[e>>1],i=n[e-1],s=t+(r<<8),a=e+(i<<2);return qm(Yr.mul(s).xor(sb.mul(a))).mul(Yr)}return Yr}function GM(n,e=n.length){const t=Yr.add(e*2),r=$n(n,0).mul(Vo),i=$n(n,8),s=$n(n,e-8).mul(t),a=$n(n,e-16).mul(Yr);return uo(wr(r.add(i),43).add(wr(s,30)).add(a),r.add(wr(i.add(Yr),18)).add(s),t)}function zM(n,e=n.length){const t=Yr.add(e*2),r=$n(n,0).mul(Yr),i=$n(n,8),s=$n(n,e-8).mul(t),a=$n(n,e-16).mul(Yr),o=wr(r.add(i),43).add(wr(s,30)).add(a),A=uo(o,r.add(wr(i.add(Yr),18)).add(s),t),l=$n(n,16).mul(t),c=$n(n,24),u=o.add($n(n,e-32)).mul(t),h=A.add($n(n,e-24)).mul(t);return uo(wr(l.add(c),43).add(wr(u,30)).add(h),l.add(wr(c.add(r),18)).add(u),t)}function WM(n,e=n.length){const t=Wo.fromNumber(81,!0);if(e<=32)return e<=16?VM(n,e):GM(n,e);if(e<=64)return zM(n,e);let r=t,i=t.mul(Vo).add(113),s=qm(i.mul(Yr).add(113)).mul(Yr),a=[Wo.UZERO,Wo.UZERO],o=[Wo.UZERO,Wo.UZERO];r=r.mul(Yr).add($n(n,0));let A=0;const l=(e-1>>6)*64,c=l+(e-1&63)-63;do r=wr(r.add(i).add(a[0]).add($n(n,A+8)),37).mul(Vo),i=wr(i.add(a[1]).add($n(n,A+48)),42).mul(Vo),r=r.xor(o[1]),i=i.add(a[0]).add($n(n,A+40)),s=wr(s.add(o[0]),33).mul(Vo),a=nh(n,A,a[1].mul(Vo),r.add(o[0])),o=nh(n,A+32,s.add(o[1]),i.add($n(n,A+16))),[s,r]=[r,s],A+=64;while(A!==l);const u=Vo.add(s.and(255).shl(1));return A=c,o[0]=o[0].add(e-1&63),a[0]=a[0].add(o[0]),o[0]=o[0].add(a[0]),r=wr(r.add(i).add(a[0]).add($n(n,A+8)),37).mul(u),i=wr(i.add(a[1]).add($n(n,A+48)),42).mul(u),r=r.xor(o[1].mul(9)),i=i.add(a[0].mul(9).add($n(n,A+40))),s=wr(s.add(o[0]),33).mul(u),a=nh(n,A,a[1].mul(u),r.add(o[0])),o=nh(n,A+32,s.add(o[1]),i.add($n(n,A+16))),[s,r]=[r,s],uo(uo(a[0],o[0],u).add(qm(i).mul(sb)).add(s),uo(a[1],o[1],u).add(r),u)}/** 3965 * @license 3966 * Copyright 2017 Google LLC. All Rights Reserved. 3967 * Licensed under the Apache License, Version 2.0 (the "License"); 3968 * you may not use this file except in compliance with the License. 3969 * You may obtain a copy of the License at 3970 * 3971 * http://www.apache.org/licenses/LICENSE-2.0 3972 * 3973 * Unless required by applicable law or agreed to in writing, software 3974 * distributed under the License is distributed on an "AS IS" BASIS, 3975 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3976 * See the License for the specific language governing permissions and 3977 * limitations under the License. 3978 * ============================================================================= 3979 */function Hl(n,e){return e==="string"?nA(n):zf([n],e)}function KM(n,e){return n instanceof Float32Array&&e==="float32"||n instanceof Int32Array&&e==="int32"||n instanceof Uint8Array&&e==="bool"}function zf(n,e){if(e==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(n)&&(n=cA(n)),pe().getBool("DEBUG")&&dM(n,e),KM(n,e))return n;if(e==null||e==="float32"||e==="complex64")return new Float32Array(n);if(e==="int32")return new Int32Array(n);if(e==="bool"){const t=new Uint8Array(n.length);for(let r=0;r<t.length;++r)Math.round(n[r])!==0&&(t[r]=1);return t}else throw new Error(`Unknown data type ${e}`)}function gs(){return pe().platform.now()}function nA(n,e="utf-8"){return e=e||"utf-8",pe().platform.encode(n,e)}function Il(n,e="utf-8"){return e=e||"utf-8",pe().platform.decode(n,e)}function as(n){return pe().platform.isTypedArray!=null?pe().platform.isTypedArray(n):eb(n)}function cA(n,e=[],t=!1){if(e==null&&(e=[]),typeof n=="boolean"||typeof n=="number"||typeof n=="string"||lA(n)||n==null||as(n)&&t)e.push(n);else if(Array.isArray(n)||as(n))for(let r=0;r<n.length;++r)cA(n[r],e,t);else{let r=-1;for(const i of Object.keys(n))/^([1-9]+[0-9]*|0)$/.test(i)&&(r=Math.max(r,Number(i)));for(let i=0;i<=r;i++)cA(n[i],e,t)}return e}/** 3980 * @license 3981 * Copyright 2018 Google LLC. All Rights Reserved. 3982 * Licensed under the Apache License, Version 2.0 (the "License");
3983 * you may not use this file except in compliance with the License. 3984 * You may obtain a copy of the License at 3985 * 3986 * http://www.apache.org/licenses/LICENSE-2.0 3987 * 3988 * Unless required by applicable law or agreed to in writing, software 3989 * distributed under the License is distributed on an "AS IS" BASIS, 3990 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3991 * See the License for the specific language governing permissions and 3992 * limitations under the License. 3993 * ============================================================================= 3994 */class XM{constructor(e,t){this.backendTimer=e,this.logger=t,t==null&&(this.logger=new YM)}profileKernel(e,t,r){let i;const s=()=>{i=r()};let a;const o=gs();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(s);else{s();for(const l of i)l.dataSync();a=Promise.resolve({kernelMs:gs()-o})}if(pe().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let l=0;l<i.length;l++){const c=i[l];c.data().then(u=>{jM(u,c.dtype,e)})}return{kernelName:e,outputs:i,inputs:t,timeMs:a.then(l=>l.kernelMs),extraInfo:a.then(l=>l.getExtraProfileInfo!=null?l.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:t,outputs:r,timeMs:i,inputs:s,extraInfo:a}=e;r.forEach(o=>{Promise.all([o.data(),i,a]).then(A=>{this.logger.logKernelProfile(t,o,A[0],A[1],s,A[2])})})}}function jM(n,e,t){if(e!=="float32")return!1;for(let r=0;r<n.length;r++){const i=n[r];if(isNaN(i)||!isFinite(i))return console.warn(`Found ${i} in the result of '${t}'`),!0}return!1}class YM{logKernelProfile(e,t,r,i,s,a){const o=typeof i=="number"?fl(`${i}ms`,9):i.error,A=fl(e,25),l=t.rank,c=t.size,u=fl(t.shape.toString(),14);let h="";for(const f in s){const d=s[f];if(d!=null){const g=d.shape||t.shape,m=g.length;h+=`${f}: ${m}D ${m>0?g:""} `}}console.log(`%c${A} %c${o} %c${l}D ${u} %c${c} %c${h} %c${a}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}/** 3995 * @license 3996 * Copyright 2017 Google LLC. All Rights Reserved. 3997 * Licensed under the Apache License, Version 2.0 (the "License"); 3998 * you may not use this file except in compliance with the License. 3999 * You may obtain a copy of the License at 4000 * 4001 * http://www.apache.org/licenses/LICENSE-2.0 4002 * 4003 * Unless required by applicable law or agreed to in writing, software 4004 * distributed under the License is distributed on an "AS IS" BASIS, 4005 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4006 * See the License for the specific language governing permissions and 4007 * limitations under the License. 4008 * ============================================================================= 4009 */function qM(n,e,t){const r={},i={};for(let A=0;A<e.length;A++)r[e[A].id]=!0;for(let A=0;A<n.length;A++){const l=n[A],c=l.inputs;for(const u in c){const h=c[u];let f=!1;for(let d=0;d<e.length;d++)if(r[h.id]){l.outputs.forEach(g=>r[g.id]=!0),f=!0,i[l.id]=!0;break}if(f)break}}const s={};s[t.id]=!0;const a={};for(let A=n.length-1;A>=0;A--){const l=n[A],c=l.inputs;for(let u=0;u<l.outputs.length;u++)if(s[l.outputs[u].id]){for(const h in c)s[c[h].id]=!0,a[l.id]=!0;break}}const o=[];for(let A=0;A<n.length;A++){const l=n[A];if(i[l.id]&&a[l.id]){const c={};for(const h in l.inputs){const f=l.inputs[h];r[f.id]&&(c[h]=f)}const u=Object.assign({},l);u.inputs=c,u.outputs=l.outputs,o.push(u)}}return o}function JM(n,e,t,r){for(let i=e.length-1;i>=0;i--){const s=e[i],a=[];if(s.outputs.forEach(A=>{const l=n[A.id];l!=null?a.push(l):a.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);const o=s.gradient(a);for(const A in s.inputs){if(!(A in o))throw new Error(`Cannot backprop through input ${A}. Available gradients found: ${Object.keys(o)}.`);const l=t(()=>o[A]());if(l.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${A} must have 'float32' dtype, but has '${l.dtype}'`);const c=s.inputs[A];if(!rr(l.shape,c.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${A}' has shape '${l.shape}', which does not match the shape of the input '${c.shape}'`);if(n[c.id]==null)n[c.id]=l;else{const u=n[c.id];n[c.id]=r(u,l),u.dispose()}}}}/** 4010 * @license 4011 * Copyright 2018 Google LLC. All Rights Reserved. 4012 * Licensed under the Apache License, Version 2.0 (the "License");
vendor: 26,606 bytes, lines 4013-4091
4013 * you may not use this file except in compliance with the License. 4014 * You may obtain a copy of the License at 4015 * 4016 * http://www.apache.org/licenses/LICENSE-2.0 4017 * 4018 * Unless required by applicable law or agreed to in writing, software 4019 * distributed under the License is distributed on an "AS IS" BASIS, 4020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4021 * See the License for the specific language governing permissions and 4022 * limitations under the License. 4023 * ============================================================================= 4024 */const e3=20,uc=3,ip=7;function ZM(n,e,t,r){const i=Mr(e),s=eN(n,e,t,i),a=e.length,o=Kh(n,e,t,i,s),A=["Tensor"];return r&&(A.push(` dtype: ${t}`),A.push(` rank: ${a}`),A.push(` shape: [${e}]`),A.push(" values:")),A.push(o.map(l=>" "+l).join(` 4025`)),A.join(` 4026`)}function eN(n,e,t,r){const i=ze(e),s=r[r.length-1],a=new Array(s).fill(0),o=e.length,A=t==="complex64"?wc(n):n;if(o>1)for(let l=0;l<i/s;l++){const c=l*s;for(let u=0;u<s;u++)a[u]=Math.max(a[u],vc(A[c+u],0,t).length)}return a}function vc(n,e,t){let r;return Array.isArray(n)?r=`${parseFloat(n[0].toFixed(ip))} + ${parseFloat(n[1].toFixed(ip))}j`:Vf(n)?r=`'${n}'`:t==="bool"?r=ob(n):r=parseFloat(n.toFixed(ip)).toString(),fl(r,e)}function ob(n){return n===0?"false":"true"}function Kh(n,e,t,r,i,s=!0){const a=t==="complex64"?2:1,o=e[0],A=e.length;if(A===0){if(t==="complex64"){const g=wc(n);return[vc(g[0],0,t)]}return t==="bool"?[ob(n[0])]:[n[0].toString()]}if(A===1){if(o>e3){const m=uc*a;let p=Array.from(n.slice(0,m)),w=Array.from(n.slice((o-uc)*a,o*a));return t==="complex64"&&(p=wc(p),w=wc(w)),["["+p.map((C,b)=>vc(C,i[b],t)).join(", ")+", ..., "+w.map((C,b)=>vc(C,i[o-uc+b],t)).join(", ")+"]"]}return["["+(t==="complex64"?wc(n):Array.from(n)).map((m,p)=>vc(m,i[p],t)).join(", ")+"]"]}const l=e.slice(1),c=r.slice(1),u=r[0]*a,h=[];if(o>e3){for(let g=0;g<uc;g++){const m=g*u,p=m+u;h.push(...Kh(n.slice(m,p),l,t,c,i,!1))}h.push("...");for(let g=o-uc;g<o;g++){const m=g*u,p=m+u;h.push(...Kh(n.slice(m,p),l,t,c,i,g===o-1))}}else for(let g=0;g<o;g++){const m=g*u,p=m+u;h.push(...Kh(n.slice(m,p),l,t,c,i,g===o-1))}const f=A===2?",":"";h[0]="["+(o>0?h[0]+f:"");for(let g=1;g<h.length-1;g++)h[g]=" "+h[g]+f;let d=`, 4027`;for(let g=2;g<A;g++)d+=` 4028`;return h[h.length-1]=" "+h[h.length-1]+"]"+(s?"":d),h}function wc(n){const e=[];for(let t=0;t<n.length;t+=2)e.push([n[t],n[t+1]]);return e}/** 4029 * @license 4030 * Copyright 2017 Google LLC. All Rights Reserved. 4031 * Licensed under the Apache License, Version 2.0 (the "License"); 4032 * you may not use this file except in compliance with the License. 4033 * You may obtain a copy of the License at 4034 * 4035 * http://www.apache.org/licenses/LICENSE-2.0 4036 * 4037 * Unless required by applicable law or agreed to in writing, software 4038 * distributed under the License is distributed on an "AS IS" BASIS, 4039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4040 * See the License for the specific language governing permissions and 4041 * limitations under the License. 4042 * ============================================================================= 4043 */class Fl{constructor(e,t,r){if(this.dtype=t,this.shape=e.slice(),this.size=ze(e),r!=null){const i=r.length;H(i===this.size,()=>`Length of values '${i}' does not match the size inferred by the shape '${this.size}'.`)}if(t==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=r||br(t,this.size),this.strides=Mr(e)}set(e,...t){t.length===0&&(t=[0]),H(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);const r=this.locToIndex(t);this.values[r]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(const i of e){if(i<0||i>=this.shape[t]){const s=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(s)}t++}let r=e[e.length-1];for(let i=0;i<e.length-1;++i)r+=this.strides[i]*e[i];return this.values[r]}locToIndex(e){if(this.rank===0)return 0;if(this.rank===1)return e[0];let t=e[e.length-1];for(let r=0;r<e.length-1;++r)t+=this.strides[r]*e[r];return t}indexToLoc(e){if(this.rank===0)return[];if(this.rank===1)return[e];const t=new Array(this.shape.length);for(let r=0;r<t.length-1;++r)t[r]=Math.floor(e/this.strides[r]),e-=t[r]*this.strides[r];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return ys().makeTensor(this.values,this.shape,this.dtype)}}let ys=null,ZA=null;function tN(n){ys=n}function nN(n){ZA=n}class ar{constructor(e,t,r,i){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=ze(e),this.strides=Mr(e),this.dataId=r,this.id=i,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return ZA.buffer(this.shape,this.dtype,e)}bufferSync(){return ZA.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return Vm(this.shape,e,this.dtype==="complex64")}arraySync(){return Vm(this.shape,this.dataSync(),this.dtype==="complex64")}async data(){this.throwIfDisposed();const e=ys().read(this.dataId);if(this.dtype==="string"){const t=await e;try{return t.map(r=>Il(r))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),ys().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=ys().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>Il(t))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await ys().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),ys().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return ZA.print(this,e)}clone(){return this.throwIfDisposed(),ZA.clone(this)}toString(e=!1){const t=this.dataSync();return ZM(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),ZA.cast(this,e)}variable(e=!0,t,r){return this.throwIfDisposed(),ys().makeVariable(this,e,t,r)}}Object.defineProperty(ar,Symbol.hasInstance,{value:n=>!!n&&n.data!=null&&n.dataSync!=null&&n.throwIfDisposed!=null});function Ab(){return Cg("Tensor",()=>ar)}Ab();class ff extends ar{constructor(e,t,r,i){super(e.shape,e.dtype,e.dataId,i),this.trainable=t,this.name=r}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!rr(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);ys().disposeTensor(this),this.dataId=e.dataId,ys().incRef(this,null)}dispose(){ys().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(ff,Symbol.hasInstance,{value:n=>n instanceof ar&&n.assign!=null&&n.assign instanceof Function});/** 4044 * @license 4045 * Copyright 2017 Google LLC. All Rights Reserved. 4046 * Licensed under the Apache License, Version 2.0 (the "License"); 4047 * you may not use this file except in compliance with the License. 4048 * You may obtain a copy of the License at 4049 * 4050 * http://www.apache.org/licenses/LICENSE-2.0 4051 * 4052 * Unless required by applicable law or agreed to in writing, software 4053 * distributed under the License is distributed on an "AS IS" BASIS, 4054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4055 * See the License for the specific language governing permissions and 4056 * limitations under the License. 4057 * ============================================================================= 4058 */var t3;(function(n){n.R0="R0",n.R1="R1",n.R2="R2",n.R3="R3",n.R4="R4",n.R5="R5",n.R6="R6"})(t3||(t3={}));var Jm;(function(n){n.float32="float32",n.int32="int32",n.bool="int32",n.complex64="complex64"})(Jm||(Jm={}));var Zm;(function(n){n.float32="float32",n.int32="int32",n.bool="bool",n.complex64="complex64"})(Zm||(Zm={}));var e1;(function(n){n.float32="float32",n.int32="float32",n.bool="float32",n.complex64="complex64"})(e1||(e1={}));var t1;(function(n){n.float32="complex64",n.int32="complex64",n.bool="complex64",n.complex64="complex64"})(t1||(t1={}));const rN={float32:e1,int32:Jm,bool:Zm,complex64:t1};function Ys(n,e){if(n==="string"||e==="string"){if(n==="string"&&e==="string")return"string";throw new Error(`Can not upcast ${n} with ${e}`)}return rN[n][e]}function Ig(n){return Ys(n,"int32")}function lb(n){return n!=null&&typeof n=="object"&&"texture"in n&&n.texture instanceof WebGLTexture}function cb(n){return typeof GPUBuffer<"u"&&n!=null&&typeof n=="object"&&"buffer"in n&&n.buffer instanceof GPUBuffer}/** 4059 * @license 4060 * Copyright 2018 Google LLC. All Rights Reserved. 4061 * Licensed under the Apache License, Version 2.0 (the "License"); 4062 * you may not use this file except in compliance with the License. 4063 * You may obtain a copy of the License at 4064 * 4065 * http://www.apache.org/licenses/LICENSE-2.0 4066 * 4067 * Unless required by applicable law or agreed to in writing, software 4068 * distributed under the License is distributed on an "AS IS" BASIS, 4069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4070 * See the License for the specific language governing permissions and 4071 * limitations under the License. 4072 * ============================================================================= 4073 */function Ar(n,e){if(n.dtype===e.dtype)return[n,e];const t=Ys(n.dtype,e.dtype);return[n.cast(t),e.cast(t)]}function iN(n,e){H(n.dtype===e.dtype,()=>`The dtypes of the first(${n.dtype}) and second(${e.dtype}) input must match`)}function ub(n){const e=[];return hb(n,e,new Set),e}function hb(n,e,t){if(n==null)return;if(n instanceof ar){e.push(n);return}if(!sN(n))return;const r=n;for(const i in r){const s=r[i];t.has(s)||(t.add(s),hb(s,e,t))}}function sN(n){return Array.isArray(n)||typeof n=="object"}/** 4074 * @license 4075 * Copyright 2018 Google LLC. All Rights Reserved. 4076 * Licensed under the Apache License, Version 2.0 (the "License"); 4077 * you may not use this file except in compliance with the License. 4078 * You may obtain a copy of the License at 4079 * 4080 * http://www.apache.org/licenses/LICENSE-2.0 4081 * 4082 * Unless required by applicable law or agreed to in writing, software 4083 * distributed under the License is distributed on an "AS IS" BASIS, 4084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4085 * See the License for the specific language governing permissions and 4086 * limitations under the License. 4087 * ============================================================================= 4088 */function sp(n){return n.kernelName!=null}class n3{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Rl{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new n3}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const r=e[t];if(await this.initializeBackend(r).success){await this.setBackend(r);return}}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(this.pendingBackendInit!=null)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(this.backendInstance==null){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry))if(e in this.registryFactory){const{asyncInit:t}=this.initializeBackend(e);if(t)return null}else return null;return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,r=1){return e in this.registryFactory?(Cs(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:r},!0)}async setBackend(e){if(this.registryFactory[e]==null)throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,this.registry[e]==null){this.backendInstance=null;const{success:t,asyncInit:r}=this.initializeBackend(e);if(!(r?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new XM(this.backendInstance),!0}setupRegisteredKernels(){K0(this.backendName).forEach(t=>{t.setupFunc!=null&&t.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){K0(e).forEach(r=>{r.disposeFunc!=null&&r.disposeFunc(this.registry[e])})}initializeBackend(e){const t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const r=t.factory();if(r&&!(r instanceof sv)&&typeof r.then=="function"){const i=++this.pendingBackendInitId,s=r.then(a=>i<this.pendingBackendInitId?!1:(this.registry[e]=a,this.pendingBackendInit=null,!0)).catch(a=>(i<this.pendingBackendInitId||(this.pendingBackendInit=null,Cs(`Initialization of backend ${e} failed`),Cs(a.stack||a.message)),!1));return this.pendingBackendInit=s,{success:s,asyncInit:!0}}else return this.registry[e]=r,{success:!0,asyncInit:!1}}catch(r){return Cs(`Initialization of backend ${e} failed`),Cs(r.stack||r.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&this.pendingBackendInit!=null&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(Object.keys(this.registryFactory).length===0)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const r=e[t],{success:i,asyncInit:s}=this.initializeBackend(r);if(s||i)return{name:r,asyncInit:s}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const r=this.state.tensorInfo.get(t),i=r.backend,s=this.readSync(t),a=i.refCount(t);i.disposeData(t,!0),r.backend=e,e.move(t,s,r.shape,r.dtype,a),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let r=null;if(t==null){if(typeof e!="function")throw new Error("Please provide a function to tidy()");t=e}else{if(typeof e!="string"&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if(typeof t!="function")throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");r=e}let i;return this.scopedRun(()=>this.startScope(r),()=>this.endScope(i),()=>(i=t(),i instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),i))}scopedRun(e,t,r){e();try{const i=r();return t(),i}catch(i){throw t(),i}}nextTensorId(){return Rl.nextTensorId++}nextVariableId(){return Rl.nextVariableId++}clone(e){const t=ne.runKernel(Eg,{x:e}),r={x:e},i=a=>({x:()=>{const o="float32",A={x:a},l={dtype:o};return ne.runKernel(Bg,A,l)}}),s=[];return this.addTapeNode(this.state.activeScope.name,r,[t],i,s,{}),t}runKernel(e,t,r){if(this.backendName==null&&this.backend,!(uf(e,this.backendName)!=null))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:r})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,r){const i=this.backend.numDataIds();let s=0;r.forEach(A=>{s+=A.dtype==="complex64"?3:1});const a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=i-t-s-a;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,r=[];const i=this.isTapeOn(),s=this.state.numBytes,a=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let o;this.backendName==null&&this.backend;let A;const l=sp(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(sp(e)){const{kernelName:d,inputs:g,attrs:m}=e;this.backendName==null&&this.backend;const p=uf(d,this.backendName);H(p!=null,()=>`Cannot find registered kernel '${d}' for backend '${this.backendName}'`),o=()=>{const w=this.backend.numDataIds();A=p.kernelFunc({inputs:g,attrs:m,backend:this.backend});const C=Array.isArray(A)?A:[A];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(d,w,C);const b=C.map(U=>U.rank!=null?U:this.makeTensorFromTensorInfo(U));if(i){const U=this.getTensorsForGradient(d,g,b);r=this.saveTensorsForBackwardMode(U)}return b}}else{const{forwardFunc:d}=e,g=m=>{!i||(r=m.map(p=>this.keep(this.clone(p))))};o=()=>{const m=this.backend.numDataIds();A=this.tidy(()=>d(this.backend,g));const p=Array.isArray(A)?A:[A];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,m,p),p}}const{inputs:c,attrs:u}=e,h=sp(e)?null:e.backwardsFunc;let f;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=o():(f=this.profiler.profileKernel(l,c,()=>o()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(f),t=f.outputs)}),i&&this.addTapeNode(l,c,t,h,r,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(d=>c[d]!=null?c[d].shape:null),outputShapes:t.map(d=>d.shape),kernelTimeMs:f.timeMs,extraInfo:f.extraInfo}),Array.isArray(A)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(r=>this.keep(this.clone(r)))}getTensorsForGradient(e,t,r){const i=W0(e);if(i!=null){const s=i.inputsToSave||[],a=i.outputsToSave||[];let o;i.saveAllInputs?(H(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),o=Object.keys(t).map(l=>t[l])):o=s.map(l=>t[l]);const A=r.filter((l,c)=>a[c]);return o.concat(A)}return[]}makeTensor(e,t,r,i){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");r=r||"float32",i=i||this.backend;let s=e;r==="string"&&Vf(e[0])&&(s=e.map(A=>nA(A)));const a=i.write(s,t,r),o=new ar(t,r,a,this.nextTensorId());if(this.trackTensor(o,i),r==="string"){const A=this.state.tensorInfo.get(a),l=gM(s);this.state.numBytes+=l-A.bytes,A.bytes=l}return o}makeTensorFromDataId(e,t,r,i){r=r||"float32";const s={dataId:e,shape:t,dtype:r};return this.makeTensorFromTensorInfo(s,i)}makeTensorFromTensorInfo(e,t){const{dataId:r,shape:i,dtype:s}=e,a=new ar(i,s,r,this.nextTensorId());return this.trackTensor(a,t),a}makeVariable(e,t=!0,r,i){r=r||this.nextVariableId().toString(),i!=null&&i!==e.dtype&&(e=e.cast(i));const s=new ff(e,t,r,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let r=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(r=e.size*lf(e.dtype)),this.state.numBytes+=r,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:r})),e instanceof ff||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){const r=e.size*lf(e.dtype);this.state.numBytes-=r}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,r=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(i=>i.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-r;for(const i of this.state.activeProfile.kernels)i.kernelTimeMs=await i.kernelTimeMs,i.extraInfo=await i.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,r,i,s,a){const o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:r,saved:s},A=W0(e);A!=null&&(i=A.gradFunc),i!=null&&(o.gradient=l=>(l=l.map((c,u)=>{if(c==null){const h=r[u],f=wo(h.size,h.dtype);return this.makeTensor(f,h.shape,h.dtype)}return c}),i(l.length>1?l:l[0],s,a))),this.state.activeTape.push(o)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=ub(e),r=new Set(t.map(s=>s.id));for(let s=0;s<this.state.activeScope.track.length;s++){const a=this.state.activeScope.track[s];!a.kept&&!r.has(a.id)&&a.dispose()}const i=this.state.scopeStack.pop();this.state.activeScope=this.state.scopeStack.length===0?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach(s=>{!s.kept&&s.scopeId===i.id&&this.track(s)})}gradients(e,t,r,i=!1){if(H(t.length>0,()=>"gradients() received an empty list of xs."),r!=null&&r.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${r.dtype}'`);const s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));H(s instanceof ar,()=>"The result y returned by f() must be a tensor.");const a=qM(this.state.activeTape,t,s);if(!i&&a.length===0&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const o={};o[s.id]=r==null?aN(s.shape):r,JM(o,a,l=>this.tidy(l),oN);const A=t.map(l=>o[l.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(l=>{for(const c of l.saved)c.dispose()}),this.state.activeTape=null),{value:s,grads:A}})}customGrad(e){return H(Qm(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{H(t.every(o=>o instanceof ar),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let r;const i={};t.forEach((o,A)=>{i[A]=o});const s=(o,A)=>(r=e(...t,A),H(r.value instanceof ar,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),H(Qm(r.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),r.value),a=(o,A)=>{const l=r.gradFunc(o,A),c=Array.isArray(l)?l:[l];H(c.length===t.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),H(c.every(h=>h instanceof ar),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const u={};return c.forEach((h,f)=>{u[f]=()=>h}),u};return this.runKernelFunc({forwardFunc:s,backwardsFunc:a,inputs:i})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=gs(),r=await this.backend.time(e);return r.wallMs=gs()-t,r}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new n3;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Rl.nextTensorId=0;Rl.nextVariableId=0;function aN(n){const e=ov(ze(n),"float32");return ne.makeTensor(e,n,"float32")}function fb(){const n=lv();if(n._tfengine==null){const e=new wM(n);n._tfengine=new Rl(e)}return _M(n._tfengine.ENV),tN(()=>n._tfengine),n._tfengine}const ne=fb();function oN(n,e){const t={a:n,b:e};return ne.runKernel(_g,t)}/** 4089 * @license 4090 * Copyright 2017 Google LLC. All Rights Reserved. 4091 * Licensed under the Apache License, Version 2.0 (the "License");
4092 * you may not use this file except in compliance with the License. 4093 * You may obtain a copy of the License at 4094 * 4095 * http://www.apache.org/licenses/LICENSE-2.0 4096 * 4097 * Unless required by applicable law or agreed to in writing, software 4098 * distributed under the License is distributed on an "AS IS" BASIS, 4099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4100 * See the License for the specific language governing permissions and 4101 * limitations under the License. 4102 * ============================================================================= 4103 */function AN(){return typeof navigator<"u"&&navigator!=null}function db(n){if(n||AN()){if(n||(n=navigator),n.product==="ReactNative")return!0;const e=n.userAgent||n.vendor||(typeof window<"u"?window.opera:"");if(!e){const t=n;return t.userAgentData&&t.userAgentData.mobile}return/(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(e)||/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(e.substr(0,4))}return!1}function pb(){return typeof window<"u"&&window.document!=null||typeof WorkerGlobalScope<"u"}/** 4104 * @license 4105 * Copyright 2019 Google LLC. All Rights Reserved. 4106 * Licensed under the Apache License, Version 2.0 (the "License"); 4107 * you may not use this file except in compliance with the License. 4108 * You may obtain a copy of the License at 4109 * 4110 * http://www.apache.org/licenses/LICENSE-2.0 4111 * 4112 * Unless required by applicable law or agreed to in writing, software 4113 * distributed under the License is distributed on an "AS IS" BASIS, 4114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4115 * See the License for the specific language governing permissions and 4116 * limitations under the License. 4117 * ============================================================================= 4118 */const hi=pe();hi.registerFlag("DEBUG",()=>!1,n=>{n&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")});hi.registerFlag("IS_BROWSER",()=>pb());hi.registerFlag("IS_NODE",()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u");hi.registerFlag("IS_CHROME",()=>typeof navigator<"u"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));hi.registerFlag("IS_SAFARI",()=>typeof navigator<"u"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));hi.registerFlag("PROD",()=>!1);hi.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>hi.getBool("DEBUG"));hi.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);hi.registerFlag("IS_TEST",()=>!1);hi.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>hi.getBool("DEBUG"));hi.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);hi.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1);hi.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);/** 4119 * @license 4120 * Copyright 2018 Google LLC. All Rights Reserved. 4121 * Licensed under the Apache License, Version 2.0 (the "License");
4122 * you may not use this file except in compliance with the License. 4123 * You may obtain a copy of the License at 4124 * 4125 * http://www.apache.org/licenses/LICENSE-2.0 4126 * 4127 * Unless required by applicable law or agreed to in writing, software 4128 * distributed under the License is distributed on an "AS IS" BASIS, 4129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4130 * See the License for the specific language governing permissions and 4131 * limitations under the License. 4132 * ============================================================================= 4133 */function Eo(n,e){let t=n;if(as(n))return e==="string"?[]:[n.length];if(lb(n)){const i=n.channels||"RGBA";return[n.height,n.width*i.length]}else if(cb(n))return[n.buffer.size/(e==null?4:lf(e))];if(!Array.isArray(n))return[];const r=[];for(;Array.isArray(t)||as(t)&&e!=="string";)r.push(t.length),t=t[0];return Array.isArray(n)&&pe().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&mb(n,r,[]),r}function mb(n,e,t){if(t=t||[],!Array.isArray(n)&&!as(n)){H(e.length===0,()=>`Element arr[${t.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);return}H(e.length>0,()=>`Element arr[${t.join("][")}] should be a primitive, but is an array of ${n.length} elements`),H(n.length===e[0],()=>`Element arr[${t.join("][")}] should have ${e[0]} elements, but has ${n.length} elements`);const r=e.slice(1);for(let i=0;i<n.length;++i)mb(n[i],r,t.concat(i))}function r3(n,e,t,r){if(n!=="string_or_numeric"){if(n==null)throw new Error("Expected dtype cannot be null.");if(n!=="numeric"&&n!==e||n==="numeric"&&e==="string")throw new Error(`Argument '${t}' passed to '${r}' must be ${n} tensor, but got ${e} tensor`)}}function $(n,e,t,r="numeric"){if(n instanceof Ab())return r3(r,n.dtype,e,t),n;let i=du(n);if(i!=="string"&&["bool","int32","float32"].indexOf(r)>=0&&(i=r),r3(r,i,e,t),n==null||!as(n)&&!Array.isArray(n)&&typeof n!="number"&&typeof n!="boolean"&&typeof n!="string"){const A=n==null?"null":n.constructor.name;throw new Error(`Argument '${e}' passed to '${t}' must be a Tensor or TensorLike, but got '${A}'`)}const s=Eo(n,i);!as(n)&&!Array.isArray(n)&&(n=[n]);const o=i!=="string"?zf(n,i):cA(n,[],!0);return ne.makeTensor(o,s,i)}function df(n,e,t,r="numeric"){if(!Array.isArray(n))throw new Error(`Argument ${e} passed to ${t} must be a \`Tensor[]\` or \`TensorLike[]\``);return n.map((s,a)=>$(s,`${e}[${a}]`,t,r))}/** 4134 * @license 4135 * Copyright 2018 Google LLC. All Rights Reserved. 4136 * Licensed under the Apache License, Version 2.0 (the "License"); 4137 * you may not use this file except in compliance with the License. 4138 * You may obtain a copy of the License at 4139 * 4140 * http://www.apache.org/licenses/LICENSE-2.0 4141 * 4142 * Unless required by applicable law or agreed to in writing, software 4143 * distributed under the License is distributed on an "AS IS" BASIS, 4144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4145 * See the License for the specific language governing permissions and 4146 * limitations under the License. 4147 * ============================================================================= 4148 */const gb="__op";function q(n){const e=Object.keys(n);if(e.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let t=e[0];const r=n[t];t.endsWith("_")&&(t=t.substring(0,t.length-1)),t=t+gb;const i=(...s)=>{ne.startScope(t);try{const a=r(...s);return lA(a)&&console.error("Cannot return a Promise inside of tidy."),ne.endScope(a),a}catch(a){throw ne.endScope(null),a}};return Object.defineProperty(i,"name",{value:t,configurable:!0}),i}/** 4149 * @license 4150 * Copyright 2020 Google LLC. All Rights Reserved. 4151 * Licensed under the Apache License, Version 2.0 (the "License"); 4152 * you may not use this file except in compliance with the License. 4153 * You may obtain a copy of the License at 4154 * 4155 * http://www.apache.org/licenses/LICENSE-2.0 4156 * 4157 * Unless required by applicable law or agreed to in writing, software 4158 * distributed under the License is distributed on an "AS IS" BASIS, 4159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4160 * See the License for the specific language governing permissions and 4161 * limitations under the License. 4162 * ============================================================================= 4163 */function lN(n,e){const t=$(n,"real","complex"),r=$(e,"imag","complex");Pi(t.shape,r.shape,`real and imag shapes, ${t.shape} and ${r.shape}, must match in call to tf.complex().`);const i={real:t,imag:r};return ne.runKernel(Uv,i)}const xo=q({complex_:lN});/** 4164 * @license 4165 * Copyright 2018 Google LLC. All Rights Reserved. 4166 * Licensed under the Apache License, Version 2.0 (the "License");
4167 * you may not use this file except in compliance with the License. 4168 * You may obtain a copy of the License at 4169 * 4170 * http://www.apache.org/licenses/LICENSE-2.0 4171 * 4172 * Unless required by applicable law or agreed to in writing, software 4173 * distributed under the License is distributed on an "AS IS" BASIS, 4174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4175 * See the License for the specific language governing permissions and 4176 * limitations under the License. 4177 * ============================================================================= 4178 */function So(n,e,t,r){if(r==null)r=du(n);else if(r==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(cb(n)||lb(n)){if(r!=="float32"&&r!=="int32")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${r}.`);return ne.backend.createTensorFromGPUData(n,e||t,r)}if(!as(n)&&!Array.isArray(n)&&typeof n!="number"&&typeof n!="boolean"&&typeof n!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(e!=null){ki(e);const i=ze(e),s=ze(t);H(i===s,()=>`Based on the provided shape, [${e}], the tensor should have ${i} values but has ${s}`);for(let a=0;a<t.length;++a){const o=t[a],A=a===t.length-1?o!==ze(e.slice(a)):!0;H(t[a]===e[a]||!A,()=>`Error creating a new Tensor. Inferred shape (${t}) does not match the provided shape (${e}). `)}}return!as(n)&&!Array.isArray(n)&&(n=[n]),e=e||t,n=r!=="string"?zf(n,r):cA(n,[],!0),ne.makeTensor(n,e,r)}/** 4179 * @license 4180 * Copyright 2018 Google LLC. All Rights Reserved. 4181 * Licensed under the Apache License, Version 2.0 (the "License"); 4182 * you may not use this file except in compliance with the License. 4183 * You may obtain a copy of the License at 4184 * 4185 * http://www.apache.org/licenses/LICENSE-2.0 4186 * 4187 * Unless required by applicable law or agreed to in writing, software 4188 * distributed under the License is distributed on an "AS IS" BASIS, 4189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4190 * See the License for the specific language governing permissions and 4191 * limitations under the License. 4192 * ============================================================================= 4193 */function zs(n,e,t){const r=Eo(n,t);return So(n,e,r,t)}/** 4194 * @license 4195 * Copyright 2018 Google LLC. All Rights Reserved. 4196 * Licensed under the Apache License, Version 2.0 (the "License"); 4197 * you may not use this file except in compliance with the License. 4198 * You may obtain a copy of the License at 4199 * 4200 * http://www.apache.org/licenses/LICENSE-2.0 4201 * 4202 * Unless required by applicable law or agreed to in writing, software 4203 * distributed under the License is distributed on an "AS IS" BASIS, 4204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4205 * See the License for the specific language governing permissions and 4206 * limitations under the License. 4207 * ============================================================================= 4208 */const uA={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class Us{static join(e){return new Us(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,e==null||(e instanceof Array||(e=[e]),e=e.map(r=>as(r)?r.buffer:r),e.length===0))return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let r=0;r<e.length;r++){const i=e[r];r!==e.length-1&&i.byteLength!==this.bufferUniformSize&&(this.bufferUniformSize=void 0);const s=t+i.byteLength;this.shards.push({buffer:i,start:t,end:s}),t=s}this.shards.length===0&&(this.byteLength=0),this.byteLength=this.shards[this.shards.length-1].end}slice(e=0,t=this.byteLength){if(this.shards.length===0)return new ArrayBuffer(0);if(e=isNaN(Number(e))?0:e,t=isNaN(Number(t))?0:t,e=Math.max(0,e),t=Math.min(this.byteLength,t),t<=e)return new ArrayBuffer(0);const r=this.findShardForByte(e);if(r===-1)throw new Error(`Could not find start shard for byte ${e}`);const i=t-e,s=new ArrayBuffer(i),a=new Uint8Array(s);let o=0;for(let A=r;A<this.shards.length;A++){const l=this.shards[A],u=e+o-l.start,h=o,d=Math.min(t,l.end
4208)-l.start,g=new Uint8Array(l.buffer,u,d-u);if(a.set(g,h),o+=g.length,t<l.end)break}return s}findShardForByte(e){if(this.shards.length===0||e<0||e>=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(i){return e<i.start?-1:e>=i.end?1:0}if(t(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;const r=cN(this.shards,t);return r===-1?-1:(this.previousShardIndex=r,this.previousShardIndex)}}function cN(n,e){let t=0,r=n.length;for(;t<=r;){const i=Math.floor((r-t)/2)+t,s=e(n[i]);if(s===0)return i;s<0?r=i:t=i+1}return-1}/** 4209 * @license 4210 * Copyright 2018 Google LLC. All Rights Reserved. 4211 * Licensed under the Apache License, Version 2.0 (the "License"); 4212 * you may not use this file except in compliance with the License. 4213 * You may obtain a copy of the License at 4214 * 4215 * http://www.apache.org/licenses/LICENSE-2.0 4216 * 4217 * Unless required by applicable law or agreed to in writing, software 4218 * distributed under the License is distributed on an "AS IS" BASIS, 4219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4220 * See the License for the specific language governing permissions and 4221 * limitations under the License. 4222 * ============================================================================= 4223 */function Wa(){return ne}function Jt(n,e){return ne.tidy(n,e)}function nr(n){ub(n).forEach(t=>t.dispose())}function Qs(n){return ne.keep(n)}function uN(){return ne.backendName}function hN(n,e,t=1){return ne.registerBackend(n,e,t)}function fN(){return ne.backend}/** 4224 * @license 4225 * Copyright 2018 Google LLC. All Rights Reserved. 4226 * Licensed under the Apache License, Version 2.0 (the "License"); 4227 * you may not use this file except in compliance with the License. 4228 * You may obtain a copy of the License at 4229 * 4230 * http://www.apache.org/licenses/LICENSE-2.0 4231 * 4232 * Unless required by applicable law or agreed to in writing, software 4233 * distributed under the License is distributed on an "AS IS" BASIS, 4234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4235 * See the License for the specific language governing permissions and 4236 * limitations under the License. 4237 * ============================================================================= 4238 */const bo=4;async function dN(n,e){const t=[],r=[],i=Array.isArray(n)?n.map(a=>a.name):Object.keys(n);for(let a=0;a<i.length;++a){const o=i[a],A=Array.isArray(n)?n[a].tensor:n[o];if(A.dtype!=="float32"&&A.dtype!=="int32"&&A.dtype!=="bool"&&A.dtype!=="string"&&A.dtype!=="complex64")throw new Error(`Unsupported dtype in weight '${o}': ${A.dtype}`);const l={name:o,shape:A.shape,dtype:A.dtype};if(A.dtype==="string"){const c=new Promise(async u=>{const h=await A.bytes(),f=h.reduce((m,p)=>m+p.length,0)+bo*h.length,d=new Uint8Array(f);let g=0;for(let m=0;m<h.length;m++){const p=h[m],w=new Uint8Array(new Uint32Array([p.length]).buffer);d.set(w,g),g+=bo,d.set(p,g),g+=p.length}u(d)});r.push(c)}else r.push(A.data());e!=null&&(l.group=e),t.push(l)}const s=await Promise.all(r);return{data:gN(s),specs:t}}function yb(n,e){const t=new Us(n),r={};let i=0;for(const s of e){const a=pN(s,(o,A)=>t.slice(i+o,i+A));r[s.name]=vb(s,t.slice(i,i+a)),i+=a}return r}function pN(n,e){const t=ze(n.shape);let r;if("quantization"in n){const i=n.quantization;r=uA[i.dtype]}else if(n.dtype==="string"){let i=0;for(let s=0;s<t;s++)i+=bo+new Uint32Array(e(i,i+bo))[0];return i}else r=uA[n.dtype];return t*r}async function mN(n,e){const t=ze(n.shape);let r;if("quantization"in n){const i=n.quantization;r=uA[i.dtype]}else if(n.dtype==="string"){let i=0;for(let s=0;s<t;s++)i+=bo+new Uint32Array(await e(i,i+bo))[0];return i}else r=uA[n.dtype];return t*r}function vb(n,e){const t=n.name,r=n.dtype,i=n.shape,s=ze(i);let a,o=0;if("quantization"in n){const A=n.quantization;if(A.dtype==="uint8"||A.dtype==="uint16"){if(!("min"in A&&"scale"in A))throw new Error(`Weight ${n.name} with quantization ${A.dtype} doesn't have corresponding metadata min and scale.`)}else if(A.dtype==="float16"){if(r!=="float32")throw new Error(`Weight ${n.name} is quantized with ${A.dtype} which only supports weights of type float32 not ${r}.`)}else throw new Error(`Weight ${n.name} has unknown quantization dtype ${A.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);const l=uA[A.dtype],c=A.dtype==="uint8"?new Uint8Array(e):new Uint16Array(e);if(r==="float32")if(A.dtype==="uint8"||A.dtype==="uint16"){a=new Float32Array(c.length);for(let u=0;u<c.length;u++){const h=c[u];a[u]=h*A.scale+A.min}}else if(A.dtype==="float16")a=_N()(c);else throw new Error(`Unsupported quantization type ${A.dtype} for weight type float32.`);else if(r==="int32"){if(A.dtype!=="uint8"&&A.dtype!=="uint16")throw new Error(`Unsupported quantization type ${A.dtype} for weight type int32.`);a=new Int32Array(c.length);for(let u=0;u<c.length;u++){const h=c[u];a[u]=Math.round(h*A.scale+A.min)}}else throw new Error(`Unsupported dtype in weight '${t}': ${r}`);o+=s*l}else if(r==="string"){const A=ze(n.shape);a=[];for(let l=0;l<A;l++){const c=new Uint32Array(e.slice(o,o+bo))[0];o+=bo;const u=new Uint8Array(e.slice(o,o+c));a.push(u),o+=c}}else{const A=uA[r];if(r==="float32")a=new Float32Array(e);else if(r==="int32")a=new Int32Array(e);else if(r==="bool")a=new Uint8Array(e);else if(r==="complex64"){a=new Float32Array(e);const l=new Float32Array(a.length/2),c=new Float32Array(a.length/2);for(let d=0;d<l.length;d++)l[d]=a[d*2],c[d]=a[d*2+1];const u=zs(l,i,"float32"),h=zs(c,i,"float32"),f=xo(u,h);return u.dispose(),h.dispose(),f}else throw new Error(`Unsupported dtype in weight '${t}': ${r}`);o+=s*A}return zs(a,i,r)}async function i3(n,e,t){let r=new Uint8Array(e);for(;r.byteLength<t;){const{done:i,value:s}=await n.read();if(i&&s==null){const o=t-r.byteLength;throw new Error(`Reader is done but ${o} bytes are still expected`)}const a=new Uint8Array(r.length+s.byteLength);a.set(r,0),a.set(new Uint8Array(s),r.length),r=a}return r.buffer}async function wb(n,e){const t={},r=n.getReader();let i=new ArrayBuffer(0);for(const s of e){const a=await mN(s,async(l,c)=>(i=await i3(r,i,c),i.slice(l,c)));i=await i3(r,i,a);const o=i.slice(0,a);i=i.slice(a);const A=vb(s,o);if(t[s.name]=A,uN()==="webgpu"){const l=fN();"uploadToGPU"in l&&ze(A.shape)>=pe().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&l.uploadToGPU(A.dataId)}}return t}function gN(n){if(n===null)throw new Error(`Invalid input value: ${JSON.stringify(n)}`);let e=0;const t=[];
4238n.forEach(s=>{if(e+=s.byteLength,t.push(s.byteLength===s.buffer.byteLength?s:new s.constructor(s)),!(s instanceof Float32Array||s instanceof Int32Array||s instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${s.constructor.name}`)});const r=new Uint8Array(e);let i=0;return t.forEach(s=>{r.set(new Uint8Array(s.buffer),i),i+=s.byteLength}),r.buffer}const Fg=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function s3(n){return Fg?Buffer.byteLength(n,"utf8"):new Blob([n]).size}function yN(n){if(Fg)return Buffer.from(n).toString("base64");const e=new Uint8Array(n);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function vN(n){if(Fg){const r=Buffer.from(n,"base64");return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}const e=atob(n),t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t.set([e.charCodeAt(r)],r);return t.buffer}function wN(n){return Us.join(n)}function a3(n){const e="/";for(n=n.trim();n.endsWith(e);)n=n.slice(0,n.length-1);const t=n.split(e);return t[t.length-1]}function xb(n,e){const t={modelTopology:n.modelTopology,format:n.format,generatedBy:n.generatedBy,convertedBy:n.convertedBy,weightsManifest:e};return n.signature!=null&&(t.signature=n.signature),n.userDefinedMetadata!=null&&(t.userDefinedMetadata=n.userDefinedMetadata),n.modelInitializer!=null&&(t.modelInitializer=n.modelInitializer),n.initializerSignature!=null&&(t.initializerSignature=n.initializerSignature),n.trainingConfig!=null&&(t.trainingConfig=n.trainingConfig),t}function bb(n,e,t){const r={modelTopology:n.modelTopology,format:n.format,generatedBy:n.generatedBy,convertedBy:n.convertedBy};if(n.trainingConfig!=null&&(r.trainingConfig=n.trainingConfig),n.weightsManifest!=null){if(!e)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!t)throw new Error("modelJSON has weightsManifest but weightData is null");r.weightSpecs=e,r.weightData=t}return n.signature!=null&&(r.signature=n.signature),n.userDefinedMetadata!=null&&(r.userDefinedMetadata=n.userDefinedMetadata),n.modelInitializer!=null&&(r.modelInitializer=n.modelInitializer),n.initializerSignature!=null&&(r.initializerSignature=n.initializerSignature),r}async function Rg(n,e){let t,r;return n.weightsManifest!=null&&([t,r]=await e(n.weightsManifest)),bb(n,t,r)}function pu(n){if(n.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:n.modelTopology==null?0:s3(JSON.stringify(n.modelTopology)),weightSpecsBytes:n.weightSpecs==null?0:s3(JSON.stringify(n.weightSpecs)),weightDataBytes:n.weightData==null?0:new Us(n.weightData).byteLength}}function n1(n){const e=[];for(const t of n)e.push(...t.weights);return e}function xN(){const n=t=>{let r=t<<13,i=0;for(;(r&8388608)===0;)i-=8388608,r<<=1;return r&=-8388609,i+=947912704,r|i},e=new Uint32Array(2048);e[0]=0;for(let t=1;t<1024;t++)e[t]=n(t);for(let t=1024;t<2048;t++)e[t]=939524096+(t-1024<<13);return e}function bN(){const n=new Uint32Array(64);n[0]=0,n[31]=1199570944,n[32]=2147483648,n[63]=3347054592;for(let e=1;e<31;e++)n[e]=e<<23;for(let e=33;e<63;e++)n[e]=2147483648+(e-32<<23);return n}function CN(){const n=new Uint32Array(64);for(let e=0;e<64;e++)n[e]=1024;return n[0]=n[32]=0,n}function _N(){const n=xN(),e=bN(),t=CN();return r=>{const i=new ArrayBuffer(4*r.length),s=new Uint32Array(i);for(let a=0;a<r.length;a++){const o=r[a],A=n[t[o>>10]+(o&1023)]+e[o>>10];s[a]=A}return new Float32Array(i)}}/** 4239 * @license 4240 * Copyright 2018 Google LLC. All Rights Reserved. 4241 * Licensed under the Apache License, Version 2.0 (the "License"); 4242 * you may not use this file except in compliance with the License. 4243 * You may obtain a copy of the License at 4244 * 4245 * http://www.apache.org/licenses/LICENSE-2.0 4246 * 4247 * Unless required by applicable law or agreed to in writing, software 4248 * distributed under the License is distributed on an "AS IS" BASIS, 4249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4250 * See the License for the specific language governing permissions and 4251 * limitations under the License. 4252 * ============================================================================= 4253 */class er{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return er.instance==null&&(er.instance=new er),er.instance}static registerSaveRouter(e){er.getInstance().saveRouters.push(e)}static registerLoadRouter(e){er.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return er.getHandlers(e,"save")}static getLoadHandlers(e,t){return er.getHandlers(e,"load",t)}static getHandlers(e,t,r){const i=[];return(t==="load"?er.getInstance().loadRouters:er.getInstance().saveRouters).forEac
vendor: 4,587 bytes, lines 4253-4271
4253h(a=>{const o=a(e,r);o!==null&&i.push(o)}),i}}const BN=n=>er.registerSaveRouter(n),EN=n=>er.registerLoadRouter(n),SN=n=>er.getSaveHandlers(n),TN=(n,e)=>er.getLoadHandlers(n,e);/** 4254 * @license 4255 * Copyright 2018 Google LLC. All Rights Reserved. 4256 * Licensed under the Apache License, Version 2.0 (the "License"); 4257 * you may not use this file except in compliance with the License. 4258 * You may obtain a copy of the License at 4259 * 4260 * http://www.apache.org/licenses/LICENSE-2.0 4261 * 4262 * Unless required by applicable law or agreed to in writing, software 4263 * distributed under the License is distributed on an "AS IS" BASIS, 4264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4265 * See the License for the specific language governing permissions and 4266 * limitations under the License. 4267 * ============================================================================= 4268 */const r1="tensorflowjs",i1=1,Zo="models_store",io="model_info_store";function Cb(){if(!pe().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const n=typeof window>"u"?self:window,e=n.indexedDB||n.mozIndexedDB||n.webkitIndexedDB||n.msIndexedDB||n.shimIndexedDB;if(e==null)throw new Error("The current browser does not appear to support IndexedDB.");return e}function s1(n){const e=n.result;e.createObjectStore(Zo,{keyPath:"modelPath"}),e.createObjectStore(io,{keyPath:"modelPath"})}class hA{constructor(e){if(this.indexedDB=Cb(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise((r,i)=>{const s=this.indexedDB.open(r1,i1);s.onupgradeneeded=()=>s1(s),s.onsuccess=()=>{const a=s.result;if(t==null){const o=a.transaction(Zo,"readonly"),l=o.objectStore(Zo).get(this.modelPath);l.onsuccess=()=>{if(l.result==null)return a.close(),i(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));r(l.result.modelArtifacts)},l.onerror=c=>(a.close(),i(l.error)),o.oncomplete=()=>a.close()}else{t.weightData=Us.join(t.weightData);const o=pu(t),A=a.transaction(io,"readwrite");let l=A.objectStore(io),c;try{c=l.put({modelPath:this.modelPath,modelArtifactsInfo:o})}catch(h){return i(h)}let u;c.onsuccess=()=>{u=a.transaction(Zo,"readwrite");const h=u.objectStore(Zo);let f;try{f=h.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:o})}catch(d){return i(d)}f.onsuccess=()=>r({modelArtifactsInfo:o}),f.onerror=d=>{l=A.objectStore(io);const g=l.delete(this.modelPath);g.onsuccess=()=>(a.close(),i(f.error)),g.onerror=m=>(a.close(),i(f.error))}},c.onerror=h=>(a.close(),i(c.error)),A.oncomplete=()=>{u==null?a.close():u.oncomplete=()=>a.close()}}},s.onerror=a=>i(s.error)})}}hA.URL_SCHEME="indexeddb://";const _b=n=>pe().getBool("IS_BROWSER")&&!Array.isArray(n)&&n.startsWith(hA.URL_SCHEME)?IN(n.slice(hA.URL_SCHEME.length)):null;er.registerSaveRouter(_b);er.registerLoadRouter(_b);function IN(n){return new hA(n)}function FN(n){return n.startsWith(hA.URL_SCHEME)?n.slice(hA.URL_SCHEME.length):n}class RN{constructor(){this.indexedDB=Cb()}async listModels(){return new Promise((e,t)=>{const r=this.indexedDB.open(r1,i1);r.onupgradeneeded=()=>s1(r),r.onsuccess=()=>{const i=r.result,s=i.transaction(io,"readonly"),o=s.objectStore(io).getAll();o.onsuccess=()=>{const A={};for(const l of o.result)A[l.modelPath]=l.modelArtifactsInfo;e(A)},o.onerror=A=>(i.close(),t(o.error)),s.oncomplete=()=>i.close()},r.onerror=i=>t(r.error)})}async removeModel(e){return e=FN(e),new Promise((t,r)=>{const i=this.indexedDB.open(r1,i1);i.onupgradeneeded=()=>s1(i),i.onsuccess=()=>{const s=i.result,a=s.transaction(io,"readwrite"),o=a.objectStore(io),A=o.get(e);let l;A.onsuccess=()=>{if(A.result==null)return s.close(),r(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const c=o.delete(e),u=()=>{l=s.transaction(Zo,"readwrite");const f=l.objectStore(Zo).delete(e);f.onsuccess=()=>t(A.result.modelArtifactsInfo),f.onerror=d=>r(A.error)};c.onsuccess=u,c.onerror=h=>(u(),s.close(),r(A.error))}},A.onerror=c=>(s.close(),r(A.error)),a.oncomplete=()=>{l==null?s.close():l.oncomplete=()=>s.close()}},i.onerror=s=>r(i.error)})}}/** 4269 * @license 4270 * Copyright 2018 Google LLC. All Rights Reserved. 4271 * Licensed under the Apache License, Version 2.0 (the "License");
4272 * you may not use this file except in compliance with the License. 4273 * You may obtain a copy of the License at 4274 * 4275 * http://www.apache.org/licenses/LICENSE-2.0 4276 * 4277 * Unless required by applicable law or agreed to in writing, software 4278 * distributed under the License is distributed on an "AS IS" BASIS, 4279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4280 * See the License for the specific language governing permissions and 4281 * limitations under the License. 4282 * ============================================================================= 4283 */const ga="/",el="tensorflowjs_models",Bb="info",UN="model_topology",MN="weight_specs",NN="weight_data",DN="model_metadata";function Eb(n){return{info:[el,n,Bb].join(ga),topology:[el,n,UN].join(ga),weightSpecs:[el,n,MN].join(ga),weightData:[el,n,NN].join(ga),modelMetadata:[el,n,DN].join(ga)}}function Sb(n){for(const e of Object.values(n))window.localStorage.removeItem(e)}function LN(n){const e=n.split(ga);if(e.length<3)throw new Error(`Invalid key format: ${n}`);return e.slice(1,e.length-1).join(ga)}function ON(n){return n.startsWith(fA.URL_SCHEME)?n.slice(fA.URL_SCHEME.length):n}class fA{constructor(e){if(!pe().getBool("IS_BROWSER")||typeof window>"u"||typeof window.localStorage>"u")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Eb(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),r=JSON.stringify(e.weightSpecs),i=pu(e),s=Us.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(i)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,yN(s));const a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,initializerSignature:e.initializerSignature!=null?e.initializerSignature:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:i}}catch{throw Sb(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${i.modelTopologyBytes}, weightSpecsBytes=${i.weightSpecsBytes}, weightDataBytes=${i.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},r=JSON.parse(this.LS.getItem(this.keys.topology));if(r==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=r;const i=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(i==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=i;const s=this.LS.getItem(this.keys.modelMetadata);if(s!=null){const o=JSON.parse(s);t.format=o.format,t.generatedBy=o.generatedBy,t.convertedBy=o.convertedBy,o.signature!=null&&(t.signature=o.signature),o.userDefinedMetadata!=null&&(t.userDefinedMetadata=o.userDefinedMetadata),o.modelInitializer!=null&&(t.modelInitializer=o.modelInitializer),o.initializerSignature!=null&&(t.initializerSignature=o.initializerSignature),o.trainingConfig!=null&&(t.trainingConfig=o.trainingConfig)}const a=this.LS.getItem(this.keys.weightData);if(a==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=vN(a),t}}fA.URL_SCHEME="localstorage://";const Tb=n=>
4283pe().getBool("IS_BROWSER")&&!Array.isArray(n)&&n.startsWith(fA.URL_SCHEME)?PN(n.slice(fA.URL_SCHEME.length)):null;er.registerSaveRouter(Tb);er.registerLoadRouter(Tb);function PN(n){return new fA(n)}class kN{constructor(){H(pe().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),H(typeof window>"u"||typeof window.localStorage<"u",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},t=el+ga,r=ga+Bb;for(let i=0;i<this.LS.length;++i){const s=this.LS.key(i);if(s.startsWith(t)&&s.endsWith(r)){const a=LN(s);e[a]=JSON.parse(this.LS.getItem(s))}}return e}async removeModel(e){e=ON(e);const t=Eb(e);if(this.LS.getItem(t.info)==null)throw new Error(`Cannot find model at path '${e}'`);const r=JSON.parse(this.LS.getItem(t.info));return Sb(t),r}}/** 4284 * @license 4285 * Copyright 2018 Google LLC. All Rights Reserved. 4286 * Licensed under the Apache License, Version 2.0 (the "License"); 4287 * you may not use this file except in compliance with the License. 4288 * You may obtain a copy of the License at 4289 * 4290 * http://www.apache.org/licenses/LICENSE-2.0 4291 * 4292 * Unless required by applicable law or agreed to in writing, software 4293 * distributed under the License is distributed on an "AS IS" BASIS, 4294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4295 * See the License for the specific language governing permissions and 4296 * limitations under the License. 4297 * ============================================================================= 4298 */const dl="://";class Xr{constructor(){this.managers={}}static getInstance(){return Xr.instance==null&&(Xr.instance=new Xr),Xr.instance}static registerManager(e,t){H(e!=null,()=>"scheme must not be undefined or null."),e.endsWith(dl)&&(e=e.slice(0,e.indexOf(dl))),H(e.length>0,()=>"scheme must not be an empty string.");const r=Xr.getInstance();H(r.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),r.managers[e]=t}static getManager(e){const t=Xr.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(Xr.getInstance().managers)}}function Xh(n){if(n.indexOf(dl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Xr.getSchemes().join(",")}`);return{scheme:n.split(dl)[0],path:n.split(dl)[1]}}async function Ib(n,e,t=!1){H(n!==e,()=>`Old path and new path are the same: '${n}'`);const r=er.getLoadHandlers(n);H(r.length>0,()=>`Copying failed because no load handler is found for source URL ${n}.`),H(r.length<2,()=>`Copying failed because more than one (${r.length}) load handlers for source URL ${n}.`);const i=r[0],s=er.getSaveHandlers(e);H(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${e}.`),H(s.length<2,()=>`Copying failed because more than one (${r.length}) save handlers for destination URL ${e}.`);const a=s[0],o=Xh(n).scheme,A=Xh(n).path,l=o===Xh(n).scheme,c=await i.load();t&&l&&await Xr.getManager(o).removeModel(A);const u=await a.save(c);return t&&!l&&await Xr.getManager(o).removeModel(A),u.modelArtifactsInfo}async function $N(){const n=Xr.getSchemes(),e={};for(const t of n){const r=await Xr.getManager(t).listModels();for(const i in r){const s=t+dl+i;e[s]=r[i]}}return e}async function QN(n){const e=Xh(n);return Xr.getManager(e.scheme).removeModel(e.path)}async function HN(n,e){return Ib(n,e,!1)}async function VN(n,e){return Ib(n,e,!0)}/** 4299 * @license 4300 * Copyright 2019 Google LLC. All Rights Reserved. 4301 * Licensed under the Apache License, Version 2.0 (the "License"); 4302 * you may not use this file except in compliance with the License. 4303 * You may obtain a copy of the License at 4304 * 4305 * http://www.apache.org/licenses/LICENSE-2.0 4306 * 4307 * Unless required by applicable law or agreed to in writing, software 4308 * distributed under the License is distributed on an "AS IS" BASIS, 4309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4310 * See the License for the specific language governing permissions and 4311 * limitations under the License. 4312 * ============================================================================= 4313 */class GN{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){if(typeof window>"u"||!pe().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,t);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",r=>{if(r.source===window&&r.data.name===this.messageName){r.stopPropagation();const i=this.functionRefs[r.data.index];i(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(e){return eb(e)}}
vendor: 4,380 bytes, lines 4313-4376
4313if(pe().get("IS_BROWSER")){pe().setPlatform("browser",new GN);try{Xr.registerManager(fA.URL_SCHEME,new kN)}catch{}try{Xr.registerManager(hA.URL_SCHEME,new RN)}catch{}}/** 4314 * @license 4315 * Copyright 2019 Google LLC. All Rights Reserved. 4316 * Licensed under the Apache License, Version 2.0 (the "License"); 4317 * you may not use this file except in compliance with the License. 4318 * You may obtain a copy of the License at 4319 * 4320 * http://www.apache.org/licenses/LICENSE-2.0 4321 * 4322 * Unless required by applicable law or agreed to in writing, software 4323 * distributed under the License is distributed on an "AS IS" BASIS, 4324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4325 * See the License for the specific language governing permissions and 4326 * limitations under the License. 4327 * ============================================================================= 4328 */const zN={importFetch:()=>require("node-fetch")};let ap;class WN{constructor(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return pe().global.fetch!=null?pe().global.fetch(e,t):(ap==null&&(ap=zN.importFetch()),ap(e,t))}now(){const e=process.hrtime();return e[0]*1e3+e[1]/1e6}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return e.length===0?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}pe().get("IS_NODE")&&!pe().get("IS_BROWSER")&&pe().setPlatform("node",new WN);/** 4329 * @license 4330 * Copyright 2020 Google Inc. All Rights Reserved. 4331 * Licensed under the Apache License, Version 2.0 (the "License"); 4332 * you may not use this file except in compliance with the License. 4333 * You may obtain a copy of the License at 4334 * 4335 * http://www.apache.org/licenses/LICENSE-2.0 4336 * 4337 * Unless required by applicable law or agreed to in writing, software 4338 * distributed under the License is distributed on an "AS IS" BASIS, 4339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4340 * See the License for the specific language governing permissions and 4341 * limitations under the License. 4342 * ============================================================================= 4343 */function ir(n,e="float32",t){return e=e||"float32",ki(n),new Fl(n,e,t)}/** 4344 * @license 4345 * Copyright 2020 Google Inc. All Rights Reserved. 4346 * Licensed under the Apache License, Version 2.0 (the "License"); 4347 * you may not use this file except in compliance with the License. 4348 * You may obtain a copy of the License at 4349 * 4350 * http://www.apache.org/licenses/LICENSE-2.0 4351 * 4352 * Unless required by applicable law or agreed to in writing, software 4353 * distributed under the License is distributed on an "AS IS" BASIS, 4354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4355 * See the License for the specific language governing permissions and 4356 * limitations under the License. 4357 * ============================================================================= 4358 */function KN(n,e){const t=$(n,"x","cast");if(!pM(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if(e==="string"&&t.dtype!=="string"||e!=="string"&&t.dtype==="string")throw new Error("Only strings can be casted to strings");const r={x:t},i={dtype:e};return ne.runKernel(Bg,r,i)}const Kn=q({cast_:KN});/** 4359 * @license 4360 * Copyright 2020 Google LLC. All Rights Reserved. 4361 * Licensed under the Apache License, Version 2.0 (the "License"); 4362 * you may not use this file except in compliance with the License. 4363 * You may obtain a copy of the License at 4364 * 4365 * http://www.apache.org/licenses/LICENSE-2.0 4366 * 4367 * Unless required by applicable law or agreed to in writing, software 4368 * distributed under the License is distributed on an "AS IS" BASIS, 4369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4370 * See the License for the specific language governing permissions and 4371 * limitations under the License. 4372 * ============================================================================= 4373 */function XN(n){const t={x:$(n,"x","clone","string_or_numeric")};return ne.runKernel(Eg,t)}const ho=q({clone_:XN});/** 4374 * @license 4375 * Copyright 2020 Google Inc. All Rights Reserved. 4376 * Licensed under the Apache License, Version 2.0 (the "License");
4377 * you may not use this file except in compliance with the License. 4378 * You may obtain a copy of the License at 4379 * 4380 * http://www.apache.org/licenses/LICENSE-2.0 4381 * 4382 * Unless required by applicable law or agreed to in writing, software 4383 * distributed under the License is distributed on an "AS IS" BASIS, 4384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4385 * See the License for the specific language governing permissions and 4386 * limitations under the License. 4387 * ============================================================================= 4388 */function Fb(n,e=!1){console.log(n.toString(e))}/** 4389 * @license 4390 * Copyright 2020 Google Inc. All Rights Reserved. 4391 * Licensed under the Apache License, Version 2.0 (the "License"); 4392 * you may not use this file except in compliance with the License. 4393 * You may obtain a copy of the License at 4394 * 4395 * http://www.apache.org/licenses/LICENSE-2.0 4396 * 4397 * Unless required by applicable law or agreed to in writing, software 4398 * distributed under the License is distributed on an "AS IS" BASIS, 4399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4400 * See the License for the specific language governing permissions and 4401 * limitations under the License. 4402 * ============================================================================= 4403 */fb();const jN={buffer:ir,cast:Kn,clone:ho,print:Fb};nN(jN);/** 4404 * @license 4405 * Copyright 2020 Google LLC. All Rights Reserved. 4406 * Licensed under the Apache License, Version 2.0 (the "License"); 4407 * you may not use this file except in compliance with the License. 4408 * You may obtain a copy of the License at 4409 * 4410 * http://www.apache.org/licenses/LICENSE-2.0 4411 * 4412 * Unless required by applicable law or agreed to in writing, software 4413 * distributed under the License is distributed on an "AS IS" BASIS, 4414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4415 * See the License for the specific language governing permissions and 4416 * limitations under the License. 4417 * ============================================================================= 4418 */function YN(n,e){let t=$(n,"a","add"),r=$(e,"b","add");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel(_g,i)}const Ut=q({add_:YN});/** 4419 * @license 4420 * Copyright 2020 Google LLC. All Rights Reserved. 4421 * Licensed under the Apache License, Version 2.0 (the "License"); 4422 * you may not use this file except in compliance with the License. 4423 * You may obtain a copy of the License at 4424 * 4425 * http://www.apache.org/licenses/LICENSE-2.0 4426 * 4427 * Unless required by applicable law or agreed to in writing, software 4428 * distributed under the License is distributed on an "AS IS" BASIS, 4429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4430 * See the License for the specific language governing permissions and 4431 * limitations under the License. 4432 * ============================================================================= 4433 */function qN(n,e){let t=$(n,"a","floorDiv"),r=$(e,"b","floorDiv");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel(cw,i)}const Rb=q({floorDiv_:qN});/** 4434 * @license 4435 * Copyright 2020 Google LLC. All Rights Reserved. 4436 * Licensed under the Apache License, Version 2.0 (the "License"); 4437 * you may not use this file except in compliance with the License. 4438 * You may obtain a copy of the License at 4439 * 4440 * http://www.apache.org/licenses/LICENSE-2.0 4441 * 4442 * Unless required by applicable law or agreed to in writing, software 4443 * distributed under the License is distributed on an "AS IS" BASIS, 4444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4445 * See the License for the specific language governing permissions and 4446 * limitations under the License. 4447 * ============================================================================= 4448 */function JN(n,e){let t=$(n,"a","div"),r=$(e,"b","div");if([t,r]=Ar(t,r),t.dtype==="int32"&&r.dtype==="int32")return Rb(t,r);const i={a:t,b:r},s={};return ne.runKernel(Jv,i,s)}const dn=q({div_:JN});/** 4449 * @license 4450 * Copyright 2020 Google LLC. All Rights Reserved. 4451 * Licensed under the Apache License, Version 2.0 (the "License");
4452 * you may not use this file except in compliance with the License. 4453 * You may obtain a copy of the License at 4454 * 4455 * http://www.apache.org/licenses/LICENSE-2.0 4456 * 4457 * Unless required by applicable law or agreed to in writing, software 4458 * distributed under the License is distributed on an "AS IS" BASIS, 4459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4460 * See the License for the specific language governing permissions and 4461 * limitations under the License. 4462 * ============================================================================= 4463 */function ZN(n,e){let t=$(n,"a","mul"),r=$(e,"b","mul");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel(Hw,i)}const Ye=q({mul_:ZN});/** 4464 * @license 4465 * Copyright 2018 Google LLC. All Rights Reserved. 4466 * Licensed under the Apache License, Version 2.0 (the "License"); 4467 * you may not use this file except in compliance with the License. 4468 * You may obtain a copy of the License at 4469 * 4470 * http://www.apache.org/licenses/LICENSE-2.0 4471 * 4472 * Unless required by applicable law or agreed to in writing, software 4473 * distributed under the License is distributed on an "AS IS" BASIS, 4474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4475 * See the License for the specific language governing permissions and 4476 * limitations under the License. 4477 * ============================================================================= 4478 */function e8(n){const e=$(n,"x","abs");if(e.dtype==="complex64"){const t={x:e};return ne.runKernel(Mv,t)}else{const t={x:e};return ne.runKernel(cv,t)}}const Mi=q({abs_:e8});/** 4479 * @license 4480 * Copyright 2018 Google LLC. All Rights Reserved. 4481 * Licensed under the Apache License, Version 2.0 (the "License"); 4482 * you may not use this file except in compliance with the License. 4483 * You may obtain a copy of the License at 4484 * 4485 * http://www.apache.org/licenses/LICENSE-2.0 4486 * 4487 * Unless required by applicable law or agreed to in writing, software 4488 * distributed under the License is distributed on an "AS IS" BASIS, 4489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4490 * See the License for the specific language governing permissions and 4491 * limitations under the License. 4492 * ============================================================================= 4493 */function t8(n){const t={x:$(n,"x","acos")};return ne.runKernel(uv,t)}const n8=q({acos_:t8});/** 4494 * @license 4495 * Copyright 2018 Google LLC. All Rights Reserved. 4496 * Licensed under the Apache License, Version 2.0 (the "License"); 4497 * you may not use this file except in compliance with the License. 4498 * You may obtain a copy of the License at 4499 * 4500 * http://www.apache.org/licenses/LICENSE-2.0 4501 * 4502 * Unless required by applicable law or agreed to in writing, software 4503 * distributed under the License is distributed on an "AS IS" BASIS, 4504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4505 * See the License for the specific language governing permissions and 4506 * limitations under the License. 4507 * ============================================================================= 4508 */function r8(n){const t={x:$(n,"x","acosh")};return ne.runKernel(hv,t)}const i8=q({acosh_:r8});/** 4509 * @license 4510 * Copyright 2020 Google LLC. All Rights Reserved. 4511 * Licensed under the Apache License, Version 2.0 (the "License"); 4512 * you may not use this file except in compliance with the License. 4513 * You may obtain a copy of the License at 4514 * 4515 * http://www.apache.org/licenses/LICENSE-2.0 4516 * 4517 * Unless required by applicable law or agreed to in writing, software 4518 * distributed under the License is distributed on an "AS IS" BASIS, 4519 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4520 * See the License for the specific language governing permissions and 4521 * limitations under the License. 4522 * ============================================================================= 4523 */function s8(n){H(Array.isArray(n),()=>"The argument passed to tf.addN() must be a list of tensors"),H(n.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${n.length}`);const e=n.map((i,s)=>$(i,`tensors${s}`,"addN")),t=e[0];e.forEach(i=>
4523{if(i.dtype!==t.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(i=>{if(!rr(i.shape,t.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const r=e;return ne.runKernel(fv,r)}const a8=q({addN_:s8});/** 4524 * @license 4525 * Copyright 2020 Google LLC. All Rights Reserved. 4526 * Licensed under the Apache License, Version 2.0 (the "License"); 4527 * you may not use this file except in compliance with the License. 4528 * You may obtain a copy of the License at 4529 * 4530 * http://www.apache.org/licenses/LICENSE-2.0 4531 * 4532 * Unless required by applicable law or agreed to in writing, software 4533 * distributed under the License is distributed on an "AS IS" BASIS, 4534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4535 * See the License for the specific language governing permissions and 4536 * limitations under the License. 4537 * ============================================================================= 4538 */function o8(n,e=null,t=!1){const i={x:$(n,"x","all","bool")},s={axis:e,keepDims:t};return ne.runKernel(dv,i,s)}const A8=q({all_:o8});/** 4539 * @license 4540 * Copyright 2020 Google LLC. All Rights Reserved. 4541 * Licensed under the Apache License, Version 2.0 (the "License"); 4542 * you may not use this file except in compliance with the License. 4543 * You may obtain a copy of the License at 4544 * 4545 * http://www.apache.org/licenses/LICENSE-2.0 4546 * 4547 * Unless required by applicable law or agreed to in writing, software 4548 * distributed under the License is distributed on an "AS IS" BASIS, 4549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4550 * See the License for the specific language governing permissions and 4551 * limitations under the License. 4552 * ============================================================================= 4553 */function l8(n,e=null,t=!1){const i={x:$(n,"x","any","bool")},s={axis:e,keepDims:t};return ne.runKernel(pv,i,s)}const c8=q({any_:l8});/** 4554 * @license 4555 * Copyright 2020 Google Inc. All Rights Reserved. 4556 * Licensed under the Apache License, Version 2.0 (the "License"); 4557 * you may not use this file except in compliance with the License. 4558 * You may obtain a copy of the License at 4559 * 4560 * http://www.apache.org/licenses/LICENSE-2.0 4561 * 4562 * Unless required by applicable law or agreed to in writing, software 4563 * distributed under the License is distributed on an "AS IS" BASIS, 4564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4565 * See the License for the specific language governing permissions and 4566 * limitations under the License. 4567 * ============================================================================= 4568 */function u8(n,e=0){const r={x:$(n,"x","argMax")},i={axis:e};return ne.runKernel(mv,r,i)}const h8=q({argMax_:u8});/** 4569 * @license 4570 * Copyright 2020 Google Inc. All Rights Reserved. 4571 * Licensed under the Apache License, Version 2.0 (the "License"); 4572 * you may not use this file except in compliance with the License. 4573 * You may obtain a copy of the License at 4574 * 4575 * http://www.apache.org/licenses/LICENSE-2.0 4576 * 4577 * Unless required by applicable law or agreed to in writing, software 4578 * distributed under the License is distributed on an "AS IS" BASIS, 4579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4580 * See the License for the specific language governing permissions and 4581 * limitations under the License. 4582 * ============================================================================= 4583 */function f8(n,e=0){const r={x:$(n,"x","argMin")},i={axis:e};return ne.runKernel(gv,r,i)}const d8=q({argMin_:f8});/** 4584 * @license 4585 * Copyright 2018 Google LLC. All Rights Reserved. 4586 * Licensed under the Apache License, Version 2.0 (the "License"); 4587 * you may not use this file except in compliance with the License. 4588 * You may obtain a copy of the License at 4589 * 4590 * http://www.apache.org/licenses/LICENSE-2.0 4591 * 4592 * Unless required by applicable law or agreed to in writing, software 4593 * distributed under the License is distributed on an "AS IS" BASIS, 4594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4595 * See the License for the specific language governing permissions and 4596 * limitations under the License. 4597 * ============================================================================= 4598 */function p8(n){const t={x:$(n,"x","asin")};return ne.runKernel(yv,t)}const m8=q({asin_:p8});/** 4599 * @license 4600 * Copyright 2018 Google LLC. All Rights Reserved. 4601 * Licensed under the Apache License, Version 2.0 (the "License");
4602 * you may not use this file except in compliance with the License. 4603 * You may obtain a copy of the License at 4604 * 4605 * http://www.apache.org/licenses/LICENSE-2.0 4606 * 4607 * Unless required by applicable law or agreed to in writing, software 4608 * distributed under the License is distributed on an "AS IS" BASIS, 4609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4610 * See the License for the specific language governing permissions and 4611 * limitations under the License. 4612 * ============================================================================= 4613 */function g8(n){const t={x:$(n,"x","asinh")};return ne.runKernel(vv,t)}const y8=q({asinh_:g8});/** 4614 * @license 4615 * Copyright 2018 Google LLC. All Rights Reserved. 4616 * Licensed under the Apache License, Version 2.0 (the "License"); 4617 * you may not use this file except in compliance with the License. 4618 * You may obtain a copy of the License at 4619 * 4620 * http://www.apache.org/licenses/LICENSE-2.0 4621 * 4622 * Unless required by applicable law or agreed to in writing, software 4623 * distributed under the License is distributed on an "AS IS" BASIS, 4624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4625 * See the License for the specific language governing permissions and 4626 * limitations under the License. 4627 * ============================================================================= 4628 */function v8(n){const t={x:$(n,"x","atan")};return ne.runKernel(wv,t)}const w8=q({atan_:v8});/** 4629 * @license 4630 * Copyright 2020 Google LLC. All Rights Reserved. 4631 * Licensed under the Apache License, Version 2.0 (the "License"); 4632 * you may not use this file except in compliance with the License. 4633 * You may obtain a copy of the License at 4634 * 4635 * http://www.apache.org/licenses/LICENSE-2.0 4636 * 4637 * Unless required by applicable law or agreed to in writing, software 4638 * distributed under the License is distributed on an "AS IS" BASIS, 4639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4640 * See the License for the specific language governing permissions and 4641 * limitations under the License. 4642 * ============================================================================= 4643 */function x8(n,e){let t=$(n,"a","atan2"),r=$(e,"b","atan2");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel(bv,i)}const b8=q({atan2_:x8});/** 4644 * @license 4645 * Copyright 2018 Google LLC. All Rights Reserved. 4646 * Licensed under the Apache License, Version 2.0 (the "License"); 4647 * you may not use this file except in compliance with the License. 4648 * You may obtain a copy of the License at 4649 * 4650 * http://www.apache.org/licenses/LICENSE-2.0 4651 * 4652 * Unless required by applicable law or agreed to in writing, software 4653 * distributed under the License is distributed on an "AS IS" BASIS, 4654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4655 * See the License for the specific language governing permissions and 4656 * limitations under the License. 4657 * ============================================================================= 4658 */function C8(n){const t={x:$(n,"x","atanh")};return ne.runKernel(xv,t)}const _8=q({atanh_:C8});/** 4659 * @license 4660 * Copyright 2020 Google LLC. All Rights Reserved. 4661 * Licensed under the Apache License, Version 2.0 (the "License"); 4662 * you may not use this file except in compliance with the License. 4663 * You may obtain a copy of the License at 4664 * 4665 * http://www.apache.org/licenses/LICENSE-2.0 4666 * 4667 * Unless required by applicable law or agreed to in writing, software 4668 * distributed under the License is distributed on an "AS IS" BASIS, 4669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4670 * See the License for the specific language governing permissions and 4671 * limitations under the License. 4672 * ============================================================================= 4673 */function Ub(n,e,t,r,i="NHWC",s){const a=n[3],o=[...e,a],A=Vl(i);return $i(n,o,t,s,r,null,null,A)}function CA(n,e,t,r,i,s,a="channelsLast"){const[o,A]=Kc(e);let l;if(a==="channelsLast")l=[o,A,n[3],n[3]];else if(a==="channelsFirst")l=[o,A,n[1],n[1]];else throw new Error(`Unknown dataFormat ${a}`);return $i(n,l,t,r,i,s,!1,a)}function mu(n,e,t,r,i,s,a="NDHWC"){const[o,A,l]=a1(e);let c,u;if(a==="NDHWC")u="channelsLast",c=[o,A,l,n[4],n[4]];else if(a==="NCDHW")u="channelsFirst",c=[o,A,l,n[1],n[1]];else throw new Error(`Unknown dataFormat ${a}`);return gu(n,c,t,r,i,!1,u,s)}function $i(n,e,t,r,i,s,a=!1,o="channelsLast"){let[A,l,c,u]=[-1,-1,-1,-1];if(o==="channelsLast")[A,l,c,u]=n;else if(o==="channelsFirst")[A,u,l,c]=n;else throw new Error(`Unknown dataFormat ${o}`);const[h,f,,d]=e,[g,m]=Kc(t),[p,w]=Kc(r),C=pl(h,p),b=pl(f,w),{padInfo:U,outHeight:F,outWidth:D}=S8(i,l,c,g,m,C,b,s,o),O=a?d*u:d;let I;return o==="channelsFirst"?I=[A,O,F,D]:o==="channelsLast"&&(I=[A,F,D,O]),{batchSize:A,dataFormat:o,inHeight:l,inWidth:c,inChannels:u,outHeight:F,outWidth:D,outChannels:O,padInfo:U,strideHeight:g,strideWidth:m,filterHeight:h,filterWidth:f,effectiveFilterHeight:C,effectiveFilterWidth:b,dilationHeight:p,dilationWidth:w,inShape:n,outShape:I,filterShape:e}}function gu(n,e,t,r,i,s=!1,a="channelsLast",o){let[A,l,c,u,h]=[-1,-1,-1,-1,-1];if(a==="channelsLast")[A,l,c,u,h]=n;else if(a==="channelsFirst")[A,h,l,c,u]=n;else throw new Error(`Unknown dataFormat ${a}`);const[f,d,g,,m]=e,[p,w,C]=a1(t),[b,U,F]=a1(r),D=pl(f,b),O=pl(d,U),I=pl(g,F),{padInfo:R,outDepth:V,outHeight:re,outWidth:Y}=T8(i,l,c,u,p,w,C,D,O,I,o),se=s?m*h:m;let ge;return a==="channelsFirst"?ge=[A,se,V,re,Y]:a==="channelsLast"&&(ge=[A,V,re,Y,se]),{batchSize:A,dataFormat:a,inDepth:l,inHeight:c,inWidth:u,inChannels:h,outDepth:V,outHeight:re,outWidth:Y,outChannels:se,padInfo:R,strideDepth:p,strideHeight:w,strideWidth:C,filterDepth:f,filterHeight:d,filterWidth:g,effectiveFilterDepth:D,effectiveFilterHeight:O,effectiveFilterWidth:I,dilationDepth:b,dilationHeight:U,dilationWidth:F,inShape:n,outShape:ge,filterShape:e}}function B8(n,e,t,r,i){r==null&&(r=Ug(n,e,t));const s=n[0],a=n[1],o=Xc((s-e+2*r)/t+1,i),A=Xc((a-e+2*r)/t+1,i);return[o,A]}function E8(n,e,t,r,i,s){i==null&&(i=Ug(n,e[0],r[0]));const a=[0,0,0,t];for(let o=0;o<3;o++)n[o]+2*i>=e[o]&&(a[o]=Xc((n[o]-e[o]+2*i)/r[o]+1,s));return a}function Ug(n,e,t,r=1){const i=pl(e,r);return Math.floor((n[0]*(t-1)-t+i)/2)}function Kc(n){return typeof n=="number"?[n,n,n]:n.length===2?[n[0],n[1],1]:n}function a1(n){return typeof n=="number"?[n,n,n]:n}function pl(n,e){return e<=1?n:n+(n-1)*(e-1)}function S8(n,e,t,r,i,s,a,o,A){let l,c,u;
vendor: 4,628 bytes, lines 4673-4706
4673if(typeof n=="number"){l={top:n,bottom:n,left:n,right:n,type:n===0?"VALID":"NUMBER"};const f=B8([e,t],s,r,n,o);c=f[0],u=f[1]}else if(n==="same"){c=Math.ceil(e/r),u=Math.ceil(t/i);const h=Math.max(0,(c-1)*r+s-e),f=Math.max(0,(u-1)*i+a-t),d=Math.floor(h/2),g=h-d,m=Math.floor(f/2),p=f-m;l={top:d,bottom:g,left:m,right:p,type:"SAME"}}else if(n==="valid")l={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((e-s+1)/r),u=Math.ceil((t-a+1)/i);else if(typeof n=="object"){const h=A==="channelsLast"?n[1][0]:n[2][0],f=A==="channelsLast"?n[1][1]:n[2][1],d=A==="channelsLast"?n[2][0]:n[3][0],g=A==="channelsLast"?n[2][1]:n[3][1];l={top:h,bottom:f,left:d,right:g,type:h===0&&f===0&&d===0&&g===0?"VALID":"EXPLICIT"},c=Xc((e-s+h+f)/r+1,o),u=Xc((t-a+d+g)/i+1,o)}else throw Error(`Unknown padding parameter: ${n}`);return{padInfo:l,outHeight:c,outWidth:u}}function T8(n,e,t,r,i,s,a,o,A,l,c){let u,h,f,d;if(n==="valid"&&(n=0),typeof n=="number"){u={top:n,bottom:n,left:n,right:n,front:n,back:n,type:n===0?"VALID":"NUMBER"};const m=E8([e,t,r,1],[o,A,l],1,[i,s,a],n,c);h=m[0],f=m[1],d=m[2]}else if(n==="same"){h=Math.ceil(e/i),f=Math.ceil(t/s),d=Math.ceil(r/a);const g=(h-1)*i+o-e,m=(f-1)*s+A-t,p=(d-1)*a+l-r,w=Math.floor(g/2),C=g-w,b=Math.floor(m/2),U=m-b,F=Math.floor(p/2),D=p-F;u={top:b,bottom:U,left:F,right:D,front:w,back:C,type:"SAME"}}else throw Error(`Unknown padding parameter: ${n}`);return{padInfo:u,outDepth:h,outHeight:f,outWidth:d}}function Xc(n,e){if(!e)return Math.trunc(n);switch(e){case"round":return Math.round(n);case"ceil":return Math.ceil(n);case"floor":return Math.floor(n);default:throw new Error(`Unknown roundingMode ${e}`)}}function jc(n){const[e,t,r]=Kc(n);return e===1&&t===1&&r===1}function Ti(n,e){return jc(n)||jc(e)}function dA(n){return Kc(n).every(e=>e>0)}function Vl(n){if(n==="NHWC")return"channelsLast";if(n==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${n}`)}function os(n,e,t){if(t!=null){if(typeof e=="string")throw Error(`Error in ${n}: pad must be an integer when using dimRoundingMode ${t} but got pad ${e}.`);if(typeof e=="number")H(Sl(e),()=>`Error in ${n}: pad must be an integer when using dimRoundingMode ${t} but got pad ${e}.`);else if(typeof e=="object")e.forEach(r=>{r.forEach(i=>{H(Sl(i),()=>`Error in ${n}: pad must be an integer when using dimRoundingMode ${t} but got pad ${i}.`)})});else throw Error(`Error in ${n}: Unknown padding parameter: ${e}`)}}/** 4674 * @license 4675 * Copyright 2020 Google LLC. All Rights Reserved. 4676 * Licensed under the Apache License, Version 2.0 (the "License"); 4677 * you may not use this file except in compliance with the License. 4678 * You may obtain a copy of the License at 4679 * 4680 * http://www.apache.org/licenses/LICENSE-2.0 4681 * 4682 * Unless required by applicable law or agreed to in writing, software 4683 * distributed under the License is distributed on an "AS IS" BASIS, 4684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4685 * See the License for the specific language governing permissions and 4686 * limitations under the License. 4687 * ============================================================================= 4688 */function I8(n,e){const r={x:$(n,"x","reshape","string_or_numeric")},i={shape:e};return ne.runKernel(Ax,r,i)}const Re=q({reshape_:I8});/** 4689 * @license 4690 * Copyright 2020 Google LLC. All Rights Reserved. 4691 * Licensed under the Apache License, Version 2.0 (the "License"); 4692 * you may not use this file except in compliance with the License. 4693 * You may obtain a copy of the License at 4694 * 4695 * http://www.apache.org/licenses/LICENSE-2.0 4696 * 4697 * Unless required by applicable law or agreed to in writing, software 4698 * distributed under the License is distributed on an "AS IS" BASIS, 4699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4700 * See the License for the specific language governing permissions and 4701 * limitations under the License. 4702 * ============================================================================= 4703 */function F8(n,e,t,r,i){const s=$(n,"x","avgPool","float32"),a=1;H(Ti(t,a),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${a}'`);let o=s,A=!1;s.rank===3&&(A=!0,o=Re(s,[1,s.shape[0],s.shape[1],s.shape[2]])),H(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),os("avgPool",r,i);const l={x:o},c={filterSize:e,strides:t,pad:r,dimRoundingMode:i};let u=ne.runKernel(Cv,l,c);return u=Kn(u,s.dtype),A?Re(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const Mb=q({avgPool_:F8});/** 4704 * @license 4705 * Copyright 2020 Google LLC. All Rights Reserved. 4706 * Licensed under the Apache License, Version 2.0 (the "License");
4707 * you may not use this file except in compliance with the License. 4708 * You may obtain a copy of the License at 4709 * 4710 * http://www.apache.org/licenses/LICENSE-2.0 4711 * 4712 * Unless required by applicable law or agreed to in writing, software 4713 * distributed under the License is distributed on an "AS IS" BASIS, 4714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4715 * See the License for the specific language governing permissions and 4716 * limitations under the License. 4717 * ============================================================================= 4718 */function R8(n,e,t,r,i,s="NDHWC"){const a=$(n,"x","avgPool3d","float32");let o=a,A=!1;a.rank===4&&(A=!0,o=Re(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),H(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),H(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),H(typeof t=="number"&&t>0||Array.isArray(t)&&t[0]>0&&t[1]>0&&t[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${t}'`),os("avgPool3d",r,i);const l={x:o},c={filterSize:e,strides:t,pad:r,dimRoundingMode:i,dataFormat:s};let u=ne.runKernel(_v,l,c);return u=Kn(u,o.dtype),A?Re(u,[u.shape[1],u.shape[2],u.shape[3],u.shape[4]]):u}const U8=q({avgPool3d_:R8});/** 4719 * @license 4720 * Copyright 2020 Google LLC. All Rights Reserved. 4721 * Licensed under the Apache License, Version 2.0 (the "License"); 4722 * you may not use this file except in compliance with the License. 4723 * You may obtain a copy of the License at 4724 * 4725 * http://www.apache.org/licenses/LICENSE-2.0 4726 * 4727 * Unless required by applicable law or agreed to in writing, software 4728 * distributed under the License is distributed on an "AS IS" BASIS, 4729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4730 * See the License for the specific language governing permissions and 4731 * limitations under the License. 4732 * ============================================================================= 4733 */function M8(n,e=0){H(n.length>=1,()=>"Pass at least one tensor to concat");const t=df(n,"tensors","concat","string_or_numeric");if(t[0].dtype==="complex64"&&t.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor 4734 with dtype ${s.dtype}. `)}),t.length===1)return ho(t[0]);const r=t,i={axis:e};return ne.runKernel(Nv,r,i)}const Nr=q({concat_:M8});/** 4735 * @license 4736 * Copyright 2020 Google LLC. All Rights Reserved. 4737 * Licensed under the Apache License, Version 2.0 (the "License"); 4738 * you may not use this file except in compliance with the License. 4739 * You may obtain a copy of the License at 4740 * 4741 * http://www.apache.org/licenses/LICENSE-2.0 4742 * 4743 * Unless required by applicable law or agreed to in writing, software 4744 * distributed under the License is distributed on an "AS IS" BASIS, 4745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4746 * See the License for the specific language governing permissions and 4747 * limitations under the License. 4748 * ============================================================================= 4749 */function N8(n,e,t=!1,r=!1){let i=$(n,"a","matMul"),s=$(e,"b","matMul");[i,s]=Ar(i,s);const a={a:i,b:s},o={transposeA:t,transposeB:r};return ne.runKernel(Bv,a,o)}const Un=q({matMul_:N8});/** 4750 * @license 4751 * Copyright 2018 Google LLC. All Rights Reserved. 4752 * Licensed under the Apache License, Version 2.0 (the "License"); 4753 * you may not use this file except in compliance with the License. 4754 * You may obtain a copy of the License at 4755 * 4756 * http://www.apache.org/licenses/LICENSE-2.0 4757 * 4758 * Unless required by applicable law or agreed to in writing, software 4759 * distributed under the License is distributed on an "AS IS" BASIS, 4760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4761 * See the License for the specific language governing permissions and 4762 * limitations under the License. 4763 * ============================================================================= 4764 */function D8(n){const t={x:$(n,"x","sigmoid","float32")};return ne.runKernel(_x,t)}const rA=q({sigmoid_:D8});/** 4765 * @license 4766 * Copyright 2018 Google LLC. All Rights Reserved. 4767 * Licensed under the Apache License, Version 2.0 (the "License");
4768 * you may not use this file except in compliance with the License. 4769 * You may obtain a copy of the License at 4770 * 4771 * http://www.apache.org/licenses/LICENSE-2.0 4772 * 4773 * Unless required by applicable law or agreed to in writing, software 4774 * distributed under the License is distributed on an "AS IS" BASIS, 4775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4776 * See the License for the specific language governing permissions and 4777 * limitations under the License. 4778 * ============================================================================= 4779 */function L8(n,e,t){const r=$(n,"x","slice","string_or_numeric");if(r.rank===0)throw new Error("Slicing scalar is not possible");const i={x:r},s={begin:e,size:t};return ne.runKernel(wx,i,s)}const rn=q({slice_:L8});/** 4780 * @license 4781 * Copyright 2018 Google LLC. All Rights Reserved. 4782 * Licensed under the Apache License, Version 2.0 (the "License"); 4783 * you may not use this file except in compliance with the License. 4784 * You may obtain a copy of the License at 4785 * 4786 * http://www.apache.org/licenses/LICENSE-2.0 4787 * 4788 * Unless required by applicable law or agreed to in writing, software 4789 * distributed under the License is distributed on an "AS IS" BASIS, 4790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4791 * See the License for the specific language governing permissions and 4792 * limitations under the License. 4793 * ============================================================================= 4794 */function O8(n){const t={x:$(n,"x","tanh","float32")};return ne.runKernel(Gx,t)}const o1=q({tanh_:O8});/** 4795 * @license 4796 * Copyright 2020 Google LLC. All Rights Reserved. 4797 * Licensed under the Apache License, Version 2.0 (the "License"); 4798 * you may not use this file except in compliance with the License. 4799 * You may obtain a copy of the License at 4800 * 4801 * http://www.apache.org/licenses/LICENSE-2.0 4802 * 4803 * Unless required by applicable law or agreed to in writing, software 4804 * distributed under the License is distributed on an "AS IS" BASIS, 4805 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4806 * See the License for the specific language governing permissions and 4807 * limitations under the License. 4808 * ============================================================================= 4809 */function P8(n,e,t,r,i,s){const a=$(n,"forgetBias","basicLSTMCell"),o=$(e,"lstmKernel","basicLSTMCell"),A=$(t,"lstmBias","basicLSTMCell"),l=$(r,"data","basicLSTMCell"),c=$(i,"c","basicLSTMCell"),u=$(s,"h","basicLSTMCell"),h=Nr([l,u],1),f=Un(h,o),d=Ut(f,A),g=d.shape[0],m=d.shape[1]/4,p=[g,m],w=rn(d,[0,0],p),C=rn(d,[0,m],p),b=rn(d,[0,m*2],p),U=rn(d,[0,m*3],p),F=Ut(Ye(rA(w),o1(C)),Ye(c,rA(Ut(a,b)))),D=Ye(o1(F),rA(U));return[F,D]}const k8=q({basicLSTMCell_:P8});/** 4810 * @license 4811 * Copyright 2020 Google LLC. All Rights Reserved. 4812 * Licensed under the Apache License, Version 2.0 (the "License"); 4813 * you may not use this file except in compliance with the License. 4814 * You may obtain a copy of the License at 4815 * 4816 * http://www.apache.org/licenses/LICENSE-2.0 4817 * 4818 * Unless required by applicable law or agreed to in writing, software 4819 * distributed under the License is distributed on an "AS IS" BASIS, 4820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4821 * See the License for the specific language governing permissions and 4822 * limitations under the License. 4823 * ============================================================================= 4824 */function $8(n,e,t){const r=$(n,"x","batchToSpaceND"),i=e.reduce((o,A)=>o*A);H(r.rank>=1+e.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${e.length}`),H(t.length===e.length,()=>`crops.length is ${t.length} but should be equal to blockShape.length ${e.length}`),H(r.shape[0]%i===0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${i}`);const s={x:r},a={blockShape:e,crops:t};return ne.runKernel(Ev,s,a)}const Nb=q({batchToSpaceND_:$8});function Q8(n){let e;return n.rank===0||n.rank===1?e=Re(n,[1,1,1,n.size]):n.rank===2?e=Re(n,[1,1,n.shape[0],n.shape[1]]):n.rank===3?e=Re(n,[1,n.shape[0],n.shape[1],n.shape[2]]):e=n,e}/** 4825 * @license 4826 * Copyright 2020 Google LLC. All Rights Reserved. 4827 * Licensed under the Apache License, Version 2.0 (the "License");
4828 * you may not use this file except in compliance with the License. 4829 * You may obtain a copy of the License at 4830 * 4831 * http://www.apache.org/licenses/LICENSE-2.0 4832 * 4833 * Unless required by applicable law or agreed to in writing, software 4834 * distributed under the License is distributed on an "AS IS" BASIS, 4835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4836 * See the License for the specific language governing permissions and 4837 * limitations under the License. 4838 * ============================================================================= 4839 */function H8(n,e,t,r,i,s){s==null&&(s=.001);const a=$(n,"x","batchNorm"),o=$(e,"mean","batchNorm"),A=$(t,"variance","batchNorm");let l;i!=null&&(l=$(i,"scale","batchNorm"));let c;r!=null&&(c=$(r,"offset","batchNorm")),H(o.rank===A.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),H(c==null||o.rank===c.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),H(l==null||o.rank===l.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const h={x:Q8(a),scale:l,offset:c,mean:o,variance:A},f={varianceEpsilon:s},d=ne.runKernel(uw,h,f);return Re(d,a.shape)}const Wf=q({batchNorm_:H8});function V8(n,e,t,r,i,s){const a=$(n,"x","batchNorm"),o=$(e,"mean","batchNorm"),A=$(t,"variance","batchNorm");let l;i!=null&&(l=$(i,"scale","batchNorm"));let c;return r!=null&&(c=$(r,"offset","batchNorm")),H(a.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`),H(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),H(A.rank===2||A.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${A.rank}.`),l!=null&&H(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${l.rank}.`),c!=null&&H(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`),Wf(a,o,A,c,l,s)}const G8=q({batchNorm2d_:V8});function z8(n,e,t,r,i,s){const a=$(n,"x","batchNorm"),o=$(e,"mean","batchNorm"),A=$(t,"variance","batchNorm");let l;i!=null&&(l=$(i,"scale","batchNorm"));let c;return r!=null&&(c=$(r,"offset","batchNorm")),H(a.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`),H(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),H(A.rank===3||A.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${A.rank}.`),l!=null&&H(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${l.rank}.`),c!=null&&H(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`),Wf(a,o,A,c,l,s)}const W8=q({batchNorm3d_:z8});function K8(n,e,t,r,i,s){const a=$(n,"x","batchNorm"),o=$(e,"mean","batchNorm"),A=$(t,"variance","batchNorm");let l;i!=null&&(l=$(i,"scale","batchNorm"));let c;return r!=null&&(c=$(r,"offset","batchNorm")),H(a.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`),H(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),H(A.rank===4||A.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${A.rank}.`),l!=null&&H(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${l.rank}.`),c!=null&&H(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`),Wf(a,o,A,c,l,s)}const X8=q({batchNorm4d_:K8});/** 4840 * @license 4841 * Copyright 2020 Google LLC. All Rights Reserved. 4842 * Licensed under the Apache License, Version 2.0 (the "License"); 4843 * you may not use this file except in compliance with the License. 4844 * You may obtain a copy of the License at 4845 * 4846 * http://www.apache.org/licenses/LICENSE-2.0 4847 * 4848 * Unless required by applicable law or agreed to in writing, software 4849 * distributed under the License is distributed on an "AS IS" BASIS, 4850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4851 * See the License for the specific language governing permissions and 4852 * limitations under the License. 4853 * ============================================================================= 4854 */function j8(n,e,t){const r=$(n,"x","bincount"),i=$(e,"weights","bincount");H(r.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),H(t>=0,()=>`size must be non-negative, but got ${t}.`),H(i.size===r.size||i.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${i.shape}.`);const s={x:r,weights:i},a={size:t};return ne.runKernel(Sv,s,a)}const Db=q({bincount_:j8});/** 4855 * @license 4856 * Copyright 2023 Google LLC. 4857 * Licensed under the Apache License, Version 2.0 (the "License");
4858 * you may not use this file except in compliance with the License. 4859 * You may obtain a copy of the License at 4860 * 4861 * http://www.apache.org/licenses/LICENSE-2.0 4862 * 4863 * Unless required by applicable law or agreed to in writing, software 4864 * distributed under the License is distributed on an "AS IS" BASIS, 4865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4866 * See the License for the specific language governing permissions and 4867 * limitations under the License. 4868 * ============================================================================= 4869 */function Y8(n,e){const t=$(n,"x","bitwiseAnd"),r=$(e,"y","bitwiseAnd");if(!rr(t.shape,r.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${t.shape}, y: ${r.shape}`);if(t.dtype!=="int32"||r.dtype!=="int32")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${t.dtype} and type of y: ${r.dtype}`);const i={a:t,b:r};return ne.runKernel(Tv,i)}const q8=q({bitwiseAnd_:Y8});/** 4870 * @license 4871 * Copyright 2021 Google LLC. All Rights Reserved. 4872 * Licensed under the Apache License, Version 2.0 (the "License"); 4873 * you may not use this file except in compliance with the License. 4874 * You may obtain a copy of the License at 4875 * 4876 * http://www.apache.org/licenses/LICENSE-2.0 4877 * 4878 * Unless required by applicable law or agreed to in writing, software 4879 * distributed under the License is distributed on an "AS IS" BASIS, 4880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4881 * See the License for the specific language governing permissions and 4882 * limitations under the License. 4883 * ============================================================================= 4884 */function J8(n,e){const t=$(n,"s0","broadcastArgs","int32"),r=$(e,"s1","broadcastArgs","int32");if(t.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${t.rank}`);if(r.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const i={s0:t,s1:r};return ne.runKernel(Iv,i)}const Z8=q({broadcastArgs_:J8});/** 4885 * @license 4886 * Copyright 2020 Google LLC. All Rights Reserved. 4887 * Licensed under the Apache License, Version 2.0 (the "License"); 4888 * you may not use this file except in compliance with the License. 4889 * You may obtain a copy of the License at 4890 * 4891 * http://www.apache.org/licenses/LICENSE-2.0 4892 * 4893 * Unless required by applicable law or agreed to in writing, software 4894 * distributed under the License is distributed on an "AS IS" BASIS, 4895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4896 * See the License for the specific language governing permissions and 4897 * limitations under the License. 4898 * ============================================================================= 4899 */function e7(n,e){let t=$(n,"broadcastTo","x");const r=t.shape;if(ki(e),e.length<t.rank)throw new Error(`broadcastTo(): shape.length=${e.length} < input.rank=${t.rank}.`);if(e.length>t.rank){const l=t.shape.slice();for(;l.length<e.length;)l.unshift(1);t=Re(t,l)}const i=t.shape,s=Array.from(e);for(let l=e.length-1;l>=0;l--)if(i[l]===e[l])s[l]=1;else if(t.shape[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${e}].`);if(s.map((l,c)=>l>1?c:-1).filter(l=>l>=0).length===0)return ho(t);const o={x:t},A={reps:s};return ne.runKernel(Sg,o,A)}const Mc=q({broadcastTo_:e7});/** 4900 * @license 4901 * Copyright 2018 Google LLC. All Rights Reserved. 4902 * Licensed under the Apache License, Version 2.0 (the "License"); 4903 * you may not use this file except in compliance with the License. 4904 * You may obtain a copy of the License at 4905 * 4906 * http://www.apache.org/licenses/LICENSE-2.0 4907 * 4908 * Unless required by applicable law or agreed to in writing, software 4909 * distributed under the License is distributed on an "AS IS" BASIS, 4910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4911 * See the License for the specific language governing permissions and 4912 * limitations under the License. 4913 * ============================================================================= 4914 */function t7(n){const t={x:$(n,"x","ceil","float32")};return ne.runKernel(Fv,t)}const n7=q({ceil_:t7});/** 4915 * @license 4916 * Copyright 2020 Google LLC. All Rights Reserved. 4917 * Licensed under the Apache License, Version 2.0 (the "License");
4918 * you may not use this file except in compliance with the License. 4919 * You may obtain a copy of the License at 4920 * 4921 * http://www.apache.org/licenses/LICENSE-2.0 4922 * 4923 * Unless required by applicable law or agreed to in writing, software 4924 * distributed under the License is distributed on an "AS IS" BASIS, 4925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4926 * See the License for the specific language governing permissions and 4927 * limitations under the License. 4928 * ============================================================================= 4929 */function yu(n,e,t){ki(n),t=t||du(e);const r={shape:n,value:e,dtype:t};return ne.runKernel(ow,{},r)}/** 4930 * @license 4931 * Copyright 2018 Google LLC. All Rights Reserved. 4932 * Licensed under the Apache License, Version 2.0 (the "License"); 4933 * you may not use this file except in compliance with the License. 4934 * You may obtain a copy of the License at 4935 * 4936 * http://www.apache.org/licenses/LICENSE-2.0 4937 * 4938 * Unless required by applicable law or agreed to in writing, software 4939 * distributed under the License is distributed on an "AS IS" BASIS, 4940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4941 * See the License for the specific language governing permissions and 4942 * limitations under the License. 4943 * ============================================================================= 4944 */function r7(n,e,t){const r=$(n,"x","clipByValue");if(H(e<=t,()=>`Error in clip: min (${e}) must be less than or equal to max (${t}).`),e===t)return yu(r.shape,e,r.dtype);const i={x:r},s={clipValueMin:e,clipValueMax:t};return ne.runKernel(Rv,i,s)}const Lb=q({clipByValue_:r7});function i7(n){return Nr(n,0)}const s7=q({concat1d_:i7});function a7(n,e){return Nr(n,e)}const o7=q({concat2d_:a7});function A7(n,e){return Nr(n,e)}const l7=q({concat3d_:A7});function c7(n,e){return Nr(n,e)}const u7=q({concat4d_:c7});/** 4945 * @license 4946 * Copyright 2020 Google LLC. All Rights Reserved. 4947 * Licensed under the Apache License, Version 2.0 (the "License"); 4948 * you may not use this file except in compliance with the License. 4949 * You may obtain a copy of the License at 4950 * 4951 * http://www.apache.org/licenses/LICENSE-2.0 4952 * 4953 * Unless required by applicable law or agreed to in writing, software 4954 * distributed under the License is distributed on an "AS IS" BASIS, 4955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4956 * See the License for the specific language governing permissions and 4957 * limitations under the License. 4958 * ============================================================================= 4959 */function h7(n,e,t,r,i="NHWC",s=[1,1],a){const o=$(n,"x","conv2d","float32"),A=$(e,"filter","conv2d","float32");let l=o,c=!1;o.rank===3&&(c=!0,l=Re(o,[1,o.shape[0],o.shape[1],o.shape[2]])),H(l.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${l.rank}.`),H(A.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${A.rank}.`),os("conv2d",r,a);const u=i==="NHWC"?l.shape[3]:l.shape[1];H(u===A.shape[2],()=>`Error in conv2d: depth of input (${u}) must match input depth for filter ${A.shape[2]}.`),H(Ti(t,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),H(dA(s),()=>"Error in conv2D: Dilated rates should be larger than 0."),H(dA(t),()=>"Error in conv2D: Strides should be larger than 0.");const h={x:l,filter:A},f={strides:t,pad:r,dataFormat:i,dilations:s,dimRoundingMode:a},d=ne.runKernel(Dv,h,f);return c?Re(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const Kf=q({conv2d_:h7});function f7(n,e,t,r,i="NWC",s=1,a){const o=$(n,"x","conv1d"),A=$(e,"filter","conv1d");let l=o,c=!1;o.rank===2&&(c=!0,l=Re(o,[1,o.shape[0],o.shape[1]])),H(l.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${l.rank}.`),H(A.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${A.rank}.`),os("conv1d",r,a),H(l.shape[2]===A.shape[1],()=>`Error in conv1d: depth of input (${l.shape[2]}) must match input depth for filter ${A.shape[1]}.`),H(Ti(t,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${t} and dilation '${s}'`),H(dA(s),()=>"Error in conv1D: Dilated rates should be larger than 0."),H(dA(t),()=>"Error in conv1D: Stride should be larger than 0."),H(i==="NWC",()=>`Error in conv1d: got dataFormat of ${i} but only NWC is currently supported.`);const u=Re(A,[1,A.shape[0],A.shape[1],A.shape[2]]),h=Re(l,[l.shape[0],1,l.shape[1],l.shape[2]]),m=Kf(h,u,[1,t],r,"NHWC",[1,s],a);return c?Re(m,[m.shape[2],m.shape[3]]):Re(m,[m.shape[0],m.shape[2],m.shape[3]])}const d7=q({conv1d_:f7});/** 4960 * @license 4961 * Copyright 2020 Google LLC. All Rights Reserved. 4962 * Licensed under the Apache License, Version 2.0 (the "License");
4963 * you may not use this file except in compliance with the License. 4964 * You may obtain a copy of the License at 4965 * 4966 * http://www.apache.org/licenses/LICENSE-2.0 4967 * 4968 * Unless required by applicable law or agreed to in writing, software 4969 * distributed under the License is distributed on an "AS IS" BASIS, 4970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4971 * See the License for the specific language governing permissions and 4972 * limitations under the License. 4973 * ============================================================================= 4974 */function p7(n,e,t,r,i,s="NHWC",a){H(n.length===e.rank,()=>`Length of inShape (${n.length}) and rank of dy (${e.rank}) must match`);let o=n,A=e,l=!1;e.rank===3&&(l=!0,A=Re(e,[1,e.shape[0],e.shape[1],e.shape[2]]),o=[1,n[0],n[1],n[2]]),H(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),H(A.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${A.rank}`),H(t.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${t.rank}`);const c=s==="NHWC"?o[3]:o[1],u=s==="NHWC"?A.shape[3]:A.shape[1];H(c===t.shape[2],()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${t.shape[2]}.`),H(u===t.shape[3],()=>`Error in conv2dDerInput: depth of output (${u}) must match output depth for filter ${t.shape[3]}.`),os("conv2dDerInput",i,a);const h={dy:A,filter:t},f={strides:r,pad:i,dataFormat:s,dimRoundingMode:a,inputShape:o},d=ne.runKernel(Ov,h,f);return l?Re(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const Ob=q({conv2DBackpropInput_:p7});function m7(n,e,t,r,i,s){const a=$(n,"x","conv2dTranspose"),o=$(e,"filter","conv2dTranspose");return Ob(t,a,o,r,i,"NHWC",s)}const g7=q({conv2dTranspose_:m7});/** 4975 * @license 4976 * Copyright 2020 Google LLC. All Rights Reserved. 4977 * Licensed under the Apache License, Version 2.0 (the "License"); 4978 * you may not use this file except in compliance with the License. 4979 * You may obtain a copy of the License at 4980 * 4981 * http://www.apache.org/licenses/LICENSE-2.0 4982 * 4983 * Unless required by applicable law or agreed to in writing, software 4984 * distributed under the License is distributed on an "AS IS" BASIS, 4985 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4986 * See the License for the specific language governing permissions and 4987 * limitations under the License. 4988 * ============================================================================= 4989 */function y7(n,e,t,r,i="NDHWC",s=[1,1,1]){const a=$(n,"x","conv3d"),o=$(e,"filter","conv3d");let A=a,l=!1;a.rank===4&&(l=!0,A=Re(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),H(A.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${A.rank}.`),H(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),H(A.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${A.shape[4]}) must match input depth for filter ${o.shape[3]}.`),H(Ti(t,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),H(i==="NDHWC",()=>`Error in conv3d: got dataFormat of ${i} but only NDHWC is currently supported.`),H(dA(s),()=>"Error in conv3D: Dilated rates should be larger than 0."),H(dA(t),()=>"Error in conv3D: Strides should be larger than 0.");const c={x:A,filter:o},u={strides:t,pad:r,dataFormat:i,dilations:s},h=ne.runKernel(Pv,c,u);return l?Re(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}const v7=q({conv3d_:y7});/** 4990 * @license 4991 * Copyright 2020 Google LLC. All Rights Reserved. 4992 * Licensed under the Apache License, Version 2.0 (the "License"); 4993 * you may not use this file except in compliance with the License. 4994 * You may obtain a copy of the License at 4995 * 4996 * http://www.apache.org/licenses/LICENSE-2.0 4997 * 4998 * Unless required by applicable law or agreed to in writing, software 4999 * distributed under the License is distributed on an "AS IS" BASIS, 5000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5001 * See the License for the specific language governing permissions and 5002 * limitations under the License. 5003 * ============================================================================= 5004 */function w7(n,e,t,r,i){H(n.length===e.rank,()=>`Length of inShape (${n.length}) and rank of dy (${e.rank}) must match`);let s=n,a=e,o=!1;e.rank===4&&(o=!0,a=Re(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),s=[1,n[0],n[1],n[2],n[3]]);const A=s[4],l=a.shape[4];H(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),H(a.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`),H(t.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${t.rank}`),H(A===t.shape[3],()=>`Error in conv3dDerInput: depth of input (${A}) must match input depth for filter ${t.shape[3]}.`),H(l===t.shape[4],()=>`Error in conv3dDerInput: depth of output (${l}) must match output depth for filter ${t.shape[4]}.`);const c={dy:a,filter:t},u={pad:i,strides:r,inputShape:s},h=ne.runKernel(kv,c,u);return o?Re(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}const x7=q({conv3DBackpropInput_:w7});function b7(n,e,t,r,i){const s=$(n,"x","conv3dTranspose"),a=$(e,"filter","conv3dTranspose");return x7(t,s,a,r,i)}const C7=q({conv3dTranspose_:b7});/** 5005 * @license 5006 * Copyright 2018 Google LLC. All Rights Reserved. 5007 * Licensed under the Apache License, Version 2.0 (the "License");
5008 * you may not use this file except in compliance with the License. 5009 * You may obtain a copy of the License at 5010 * 5011 * http://www.apache.org/licenses/LICENSE-2.0 5012 * 5013 * Unless required by applicable law or agreed to in writing, software 5014 * distributed under the License is distributed on an "AS IS" BASIS, 5015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5016 * See the License for the specific language governing permissions and 5017 * limitations under the License. 5018 * ============================================================================= 5019 */function _7(n){const t={x:$(n,"x","cos","float32")};return ne.runKernel($v,t)}const B7=q({cos_:_7});/** 5020 * @license 5021 * Copyright 2018 Google LLC. All Rights Reserved. 5022 * Licensed under the Apache License, Version 2.0 (the "License"); 5023 * you may not use this file except in compliance with the License. 5024 * You may obtain a copy of the License at 5025 * 5026 * http://www.apache.org/licenses/LICENSE-2.0 5027 * 5028 * Unless required by applicable law or agreed to in writing, software 5029 * distributed under the License is distributed on an "AS IS" BASIS, 5030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5031 * See the License for the specific language governing permissions and 5032 * limitations under the License. 5033 * ============================================================================= 5034 */function E7(n){const t={x:$(n,"x","cosh","float32")};return ne.runKernel(Qv,t)}const S7=q({cosh_:E7});/** 5035 * @license 5036 * Copyright 2022 Google LLC. All Rights Reserved. 5037 * Licensed under the Apache License, Version 2.0 (the 'License'); 5038 * you may not use this file except in compliance with the License. 5039 * You may obtain a copy of the License at 5040 * 5041 * http://www.apache.org/licenses/LICENSE-2.0 5042 * 5043 * Unless required by applicable law or agreed to in writing, software 5044 * distributed under the License is distributed on an 'AS IS' BASIS, 5045 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5046 * See the License for the specific language governing permissions and 5047 * limitations under the License. 5048 * ============================================================================= 5049 */function T7(n,e=0,t=!1,r=!1){const s={x:$(n,"x","cumprod")},a={axis:e,exclusive:t,reverse:r};return ne.runKernel(Hv,s,a)}const I7=q({cumprod_:T7});/** 5050 * @license 5051 * Copyright 2018 Google LLC. All Rights Reserved. 5052 * Licensed under the Apache License, Version 2.0 (the "License"); 5053 * you may not use this file except in compliance with the License. 5054 * You may obtain a copy of the License at 5055 * 5056 * http://www.apache.org/licenses/LICENSE-2.0 5057 * 5058 * Unless required by applicable law or agreed to in writing, software 5059 * distributed under the License is distributed on an "AS IS" BASIS, 5060 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5061 * See the License for the specific language governing permissions and 5062 * limitations under the License. 5063 * ============================================================================= 5064 */function F7(n,e=0,t=!1,r=!1){const s={x:$(n,"x","cumsum")},a={axis:e,exclusive:t,reverse:r};return ne.runKernel(Vv,s,a)}const R7=q({cumsum_:F7});/** 5065 * @license 5066 * Copyright 2020 Google LLC. All Rights Reserved. 5067 * Licensed under the Apache License, Version 2.0 (the "License"); 5068 * you may not use this file except in compliance with the License. 5069 * You may obtain a copy of the License at 5070 * 5071 * http://www.apache.org/licenses/LICENSE-2.0 5072 * 5073 * Unless required by applicable law or agreed to in writing, software 5074 * distributed under the License is distributed on an "AS IS" BASIS, 5075 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5076 * See the License for the specific language governing permissions and 5077 * limitations under the License. 5078 * ============================================================================= 5079 */function U7(n,e,t,r=!1){const i=$(n,"x","denseBincount"),s=$(e,"weights","denseBincount");H(i.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${i.dtype}`),H(i.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${i.rank}
5079.`),H(t>=0,()=>`size must be non-negative, but got ${t}.`),H(s.size===i.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${i.shape}, weights shape: ${s.shape}.`);const a={x:i,weights:s},o={size:t,binaryOutput:r};return ne.runKernel(zv,a,o)}const M7=q({denseBincount_:U7});/** 5080 * @license 5081 * Copyright 2020 Google LLC. All Rights Reserved. 5082 * Licensed under the Apache License, Version 2.0 (the "License"); 5083 * you may not use this file except in compliance with the License. 5084 * You may obtain a copy of the License at 5085 * 5086 * http://www.apache.org/licenses/LICENSE-2.0 5087 * 5088 * Unless required by applicable law or agreed to in writing, software 5089 * distributed under the License is distributed on an "AS IS" BASIS, 5090 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5091 * See the License for the specific language governing permissions and 5092 * limitations under the License. 5093 * ============================================================================= 5094 */function N7(n,e,t="NHWC"){const r=$(n,"x","depthToSpace","float32"),i=t==="NHWC"?r.shape[1]:r.shape[2],s=t==="NHWC"?r.shape[2]:r.shape[3],a=t==="NHWC"?r.shape[3]:r.shape[1];H(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),H(i*e>=0,()=>`Negative dimension size caused by overflow when multiplying 5095 ${i} and ${e} for depthToSpace with input shape 5096 ${r.shape}`),H(s*e>=0,()=>`Negative dimension size caused by overflow when multiplying 5097 ${s} and ${e} for depthToSpace with input shape 5098 ${r.shape}`),H(a%(e*e)===0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${a} for depthToSpace with input shape ${r.shape}`);const o={x:r},A={blockSize:e,dataFormat:t};return ne.runKernel(Wv,o,A)}const D7=q({depthToSpace_:N7});/** 5099 * @license 5100 * Copyright 2020 Google LLC. All Rights Reserved. 5101 * Licensed under the Apache License, Version 2.0 (the "License"); 5102 * you may not use this file except in compliance with the License. 5103 * You may obtain a copy of the License at 5104 * 5105 * http://www.apache.org/licenses/LICENSE-2.0 5106 * 5107 * Unless required by applicable law or agreed to in writing, software 5108 * distributed under the License is distributed on an "AS IS" BASIS, 5109 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5110 * See the License for the specific language governing permissions and 5111 * limitations under the License. 5112 * ============================================================================= 5113 */function L7(n,e,t,r,i="NHWC",s=[1,1],a){const o=$(n,"x","depthwiseConv2d","float32"),A=$(e,"filter","depthwiseConv2d","float32");let l=o,c=!1;o.rank===3&&(c=!0,l=Re(o,[1,o.shape[0],o.shape[1],o.shape[2]])),H(l.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${l.rank}.`),H(A.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${A.rank}.`);const u=i==="NHWC"?l.shape[3]:l.shape[1];H(u===A.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${u}) must match the inChannels dimension in filter ${A.shape[2]}.`),os("depthwiseConv2d",r,a);const h={x:l,filter:A},f={strides:t,pad:r,dataFormat:i,dilations:s,dimRoundingMode:a},d=ne.runKernel(Kv,h,f);return c?Re(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const Mg=q({depthwiseConv2d_:L7});/** 5114 * @license 5115 * Copyright 2020 Google LLC. All Rights Reserved. 5116 * Licensed under the Apache License, Version 2.0 (the "License"); 5117 * you may not use this file except in compliance with the License. 5118 * You may obtain a copy of the License at 5119 * 5120 * http://www.apache.org/licenses/LICENSE-2.0 5121 * 5122 * Unless required by applicable law or agreed to in writing, software 5123 * distributed under the License is distributed on an "AS IS" BASIS, 5124 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5125 * See the License for the specific language governing permissions and 5126 * limitations under the License. 5127 * ============================================================================= 5128 */function O7(n){const t={x:$(n,"x","diag")};return ne.runKernel(Yv,t)}const P7=q({diag_:O7});/** 5129 * @license 5130 * Copyright 2020 Google LLC. All Rights Reserved. 5131 * Licensed under the Apache License, Version 2.0 (the "License");
5132 * you may not use this file except in compliance with the License. 5133 * You may obtain a copy of the License at 5134 * 5135 * http://www.apache.org/licenses/LICENSE-2.0 5136 * 5137 * Unless required by applicable law or agreed to in writing, software 5138 * distributed under the License is distributed on an "AS IS" BASIS, 5139 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5140 * See the License for the specific language governing permissions and 5141 * limitations under the License. 5142 * ============================================================================= 5143 */function k7(n,e,t,r,i=[1,1],s="NHWC"){const a=$(n,"x","dilation2d"),o=$(e,"filter","dilation2d");H(a.rank===3||a.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),H(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),H(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let A=a,l=!1;a.rank===3&&(A=Re(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=!0),H(A.shape[3]===o.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${A.shape[3]} vs ${o.shape[2]}`);const c={x:A,filter:o},u={strides:t,pad:r,dilations:i},h=ne.runKernel(qv,c,u);return l?Re(h,[h.shape[1],h.shape[2],h.shape[3]]):h}const $7=q({dilation2d_:k7});/** 5144 * @license 5145 * Copyright 2017 Google LLC. All Rights Reserved. 5146 * Licensed under the Apache License, Version 2.0 (the "License"); 5147 * you may not use this file except in compliance with the License. 5148 * You may obtain a copy of the License at 5149 * 5150 * http://www.apache.org/licenses/LICENSE-2.0 5151 * 5152 * Unless required by applicable law or agreed to in writing, software 5153 * distributed under the License is distributed on an "AS IS" BASIS, 5154 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5155 * See the License for the specific language governing permissions and 5156 * limitations under the License. 5157 * ============================================================================= 5158 */function pf(n,e){const t=n.length,r=[];for(let i=0;i<t;i++){const s=t-1-i,a=n[s]||1;(e[e.length-1-i]||1)>1&&a===1&&r.unshift(s)}return r}function Pb(n,e){const t=[];for(let r=0;r<e.length;r++){const i=n[n.length-r-1],s=e.length-r-1,a=e[s];(i==null||i===1&&a>1)&&t.unshift(s)}return t}function Cn(n,e){const t=Math.max(n.length,e.length),r=new Array(t);for(let i=0;i<t;i++){let s=n[n.length-i-1];s==null&&(s=1);let a=e[e.length-i-1];if(a==null&&(a=1),s===1)r[t-i-1]=a;else if(a===1)r[t-i-1]=s;else if(s!==a){const o=`Operands could not be broadcast together with shapes ${n} and ${e}.`;throw Error(o)}else r[t-i-1]=s}return r}/** 5159 * @license 5160 * Copyright 2020 Google LLC. All Rights Reserved. 5161 * Licensed under the Apache License, Version 2.0 (the "License"); 5162 * you may not use this file except in compliance with the License. 5163 * You may obtain a copy of the License at 5164 * 5165 * http://www.apache.org/licenses/LICENSE-2.0 5166 * 5167 * Unless required by applicable law or agreed to in writing, software 5168 * distributed under the License is distributed on an "AS IS" BASIS, 5169 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5170 * See the License for the specific language governing permissions and 5171 * limitations under the License. 5172 * ============================================================================= 5173 */function Q7(n,e){let t=$(n,"a","equal","string_or_numeric"),r=$(e,"b","equal","string_or_numeric");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(nw,i)}const kb=q({equal_:Q7});/** 5174 * @license 5175 * Copyright 2020 Google LLC. All Rights Reserved. 5176 * Licensed under the Apache License, Version 2.0 (the "License"); 5177 * you may not use this file except in compliance with the License. 5178 * You may obtain a copy of the License at 5179 * 5180 * http://www.apache.org/licenses/LICENSE-2.0 5181 * 5182 * Unless required by applicable law or agreed to in writing, software 5183 * distributed under the License is distributed on an "AS IS" BASIS, 5184 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5185 * See the License for the specific language governing permissions and 5186 * limitations under the License. 5187 * ============================================================================= 5188 */function H7(n,e,t){const r=$(e,"a","where"),i=$(t,"b","where"),s=$(n,"condition","where","bool"),a=Cn(Cn(s.shape,r.shape),i.shape),o=Mc(s,a),A=Mc(r,a),l=Mc(i,a),c={condition:o,t:A,e:l};return ne.runKernel(yx,c)}const fo=q({where_:H7});/** 5189 * @license 5190 * Copyright 2018 Google LLC. All Rights Reserved. 5191 * Licensed under the Apache License, Version 2.0 (the "License");
5192 * you may not use this file except in compliance with the License. 5193 * You may obtain a copy of the License at 5194 * 5195 * http://www.apache.org/licenses/LICENSE-2.0 5196 * 5197 * Unless required by applicable law or agreed to in writing, software 5198 * distributed under the License is distributed on an "AS IS" BASIS, 5199 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5200 * See the License for the specific language governing permissions and 5201 * limitations under the License. 5202 * ============================================================================= 5203 */function V7(n){const t={x:$(n,"x","zerosLike")};return ne.runKernel(Yx,t)}const Oi=q({zerosLike_:V7});/** 5204 * @license 5205 * Copyright 2020 Google LLC. All Rights Reserved. 5206 * Licensed under the Apache License, Version 2.0 (the "License"); 5207 * you may not use this file except in compliance with the License. 5208 * You may obtain a copy of the License at 5209 * 5210 * http://www.apache.org/licenses/LICENSE-2.0 5211 * 5212 * Unless required by applicable law or agreed to in writing, software 5213 * distributed under the License is distributed on an "AS IS" BASIS, 5214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5215 * See the License for the specific language governing permissions and 5216 * limitations under the License. 5217 * ============================================================================= 5218 */function G7(n,e){let t=$(n,"a","div"),r=$(e,"b","div");[t,r]=Ar(t,r);const i=dn(t,r),s=Oi(i),a=kb(r,s);return fo(a,s,i)}const z7=q({divNoNan_:G7});/** 5219 * @license 5220 * Copyright 2020 Google LLC. All Rights Reserved. 5221 * Licensed under the Apache License, Version 2.0 (the "License"); 5222 * you may not use this file except in compliance with the License. 5223 * You may obtain a copy of the License at 5224 * 5225 * http://www.apache.org/licenses/LICENSE-2.0 5226 * 5227 * Unless required by applicable law or agreed to in writing, software 5228 * distributed under the License is distributed on an "AS IS" BASIS, 5229 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5230 * See the License for the specific language governing permissions and 5231 * limitations under the License. 5232 * ============================================================================= 5233 */function W7(n,e){const t=$(n,"t1","dot"),r=$(e,"t2","dot");H((t.rank===1||t.rank===2)&&(r.rank===1||r.rank===2),()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${t.rank} and ${r.rank}.`);const i=t.rank===1?t.size:t.shape[1],s=r.rank===1?r.size:r.shape[0];if(H(i===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${i} and ${s}.`),t.rank===1&&r.rank===1){const a=Re(t,[1,-1]),o=Re(r,[-1,1]),A=Un(a,o);return Re(A,[])}else if(t.rank===1&&r.rank===2){const a=Re(t,[1,-1]),o=Re(r,[r.shape[0],r.shape[1]]),A=Un(a,o);return Re(A,[A.size])}else if(t.rank===2&&r.rank===1){const a=Re(r,[-1,1]),o=Un(t,a);return Re(o,[o.size])}else{const a=Re(r,[r.shape[0],r.shape[1]]);return Un(t,a)}}const K7=q({dot_:W7});/** 5234 * @license 5235 * Copyright 2021 Google LLC. All Rights Reserved. 5236 * Licensed under the Apache License, Version 2.0 (the "License"); 5237 * you may not use this file except in compliance with the License. 5238 * You may obtain a copy of the License at 5239 * 5240 * http://www.apache.org/licenses/LICENSE-2.0 5241 * 5242 * Unless required by applicable law or agreed to in writing, software 5243 * distributed under the License is distributed on an "AS IS" BASIS, 5244 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5245 * See the License for the specific language governing permissions and 5246 * limitations under the License. 5247 * ============================================================================= 5248 */function X7(n,...e){const t=e.map((i,s)=>$(i,`tensors${s}`,"einsum")),r={equation:n};return ne.runKernel(Zv,t,r)}const tl=q({einsum_:X7});/** 5249 * @license 5250 * Copyright 2020 Google LLC. All Rights Reserved. 5251 * Licensed under the Apache License, Version 2.0 (the "License"); 5252 * you may not use this file except in compliance with the License. 5253 * You may obtain a copy of the License at 5254 * 5255 * http://www.apache.org/licenses/LICENSE-2.0 5256 * 5257 * Unless required by applicable law or agreed to in writing, softw
5257are 5258 * distributed under the License is distributed on an "AS IS" BASIS, 5259 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5260 * See the License for the specific language governing permissions and 5261 * limitations under the License. 5262 * ============================================================================= 5263 */function j7(n){const t={x:$(n,"x","elu","float32")};return ne.runKernel(ew,t)}const $b=q({elu_:j7});/** 5264 * @license 5265 * Copyright 2023 Google LLC. 5266 * Licensed under the Apache License, Version 2.0 (the "License"); 5267 * you may not use this file except in compliance with the License. 5268 * You may obtain a copy of the License at 5269 * 5270 * http://www.apache.org/licenses/LICENSE-2.0 5271 * 5272 * Unless required by applicable law or agreed to in writing, software 5273 * distributed under the License is distributed on an "AS IS" BASIS, 5274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5275 * See the License for the specific language governing permissions and 5276 * limitations under the License. 5277 * ============================================================================= 5278 */function Y7(n,e){const t=$(n,"x","ensureShape","string_or_numeric");if(!hM(t.shape,e))throw new Error(`EnsureShape: Shape of tensor ${t.shape} is not compatible with expected shape ${e}`);return n}const q7=q({ensureShape_:Y7});/** 5279 * @license 5280 * Copyright 2018 Google LLC. All Rights Reserved. 5281 * Licensed under the Apache License, Version 2.0 (the "License"); 5282 * you may not use this file except in compliance with the License. 5283 * You may obtain a copy of the License at 5284 * 5285 * http://www.apache.org/licenses/LICENSE-2.0 5286 * 5287 * Unless required by applicable law or agreed to in writing, software 5288 * distributed under the License is distributed on an "AS IS" BASIS, 5289 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5290 * See the License for the specific language governing permissions and 5291 * limitations under the License. 5292 * ============================================================================= 5293 */function J7(n){let e=$(n,"x","erf");H(e.dtype==="int32"||e.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),e.dtype==="int32"&&(e=Kn(e,"float32"));const t={x:e};return ne.runKernel(tw,t)}const Z7=q({erf_:J7});/** 5294 * @license 5295 * Copyright 2017 Google LLC. All Rights Reserved. 5296 * Licensed under the Apache License, Version 2.0 (the "License"); 5297 * you may not use this file except in compliance with the License. 5298 * You may obtain a copy of the License at 5299 * 5300 * http://www.apache.org/licenses/LICENSE-2.0 5301 * 5302 * Unless required by applicable law or agreed to in writing, software 5303 * distributed under the License is distributed on an "AS IS" BASIS, 5304 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5305 * See the License for the specific language governing permissions and 5306 * limitations under the License. 5307 * ============================================================================= 5308 */function Ng(n,e){for(let t=0;t<n.length;++t)if(n[n.length-t-1]!==e-1-t)return!1;return!0}function Qb(n,e,t){const r=n.length+e.length,i=[];let s=0,a=0;for(let o=0;o<r;o++)t.indexOf(o)===-1?i.push(n[s++]):i.push(e[a++]);return i}function Zs(n,e){const t=[],r=n.length;for(let s=0;s<r;s++)e.indexOf(s)===-1&&t.push(n[s]);const i=e.map(s=>n[s]);return[t,i]}function Qi(n,e){const t=e.map(r=>1);return Qb(n,t,e)}function Ms(n,e,t){H(Ng(e,t),()=>`${n} supports only inner-most axes for now. Got axes ${e} and rank-${t} input.`)}function As(n,e){if(Ng(n,e))return null;const t=[];for(let r=0;r<e;++r)n.indexOf(r)===-1&&t.push(r);return n.forEach(r=>t.push(r)),t}function Dg(n){return n.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function ls(n,e){const t=[];for(let r=e-n;r<e;++r)t.push(r);return t}/** 5309 * @license 5310 * Copyright 2020 Google LLC. All Rights Reserved. 5311 * Licensed under the Apache License, Version 2.0 (the "License"); 5312 * you may not use this file except in compliance with the License. 5313 * You may obtain a copy of the License at 5314 * 5315 * http://www.apache.org/licenses/LICENSE-2.0 5316 * 5317 * Unless required by applicable law or agreed to in writing, softw
5317are 5318 * distributed under the License is distributed on an "AS IS" BASIS, 5319 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5320 * See the License for the specific language governing permissions and 5321 * limitations under the License. 5322 * ============================================================================= 5323 */function eD(n,e=null,t=!1){const i={x:$(n,"x","max")},s={reductionIndices:e,keepDims:t};return ne.runKernel(Rw,i,s)}const ml=q({max_:eD});/** 5324 * @license 5325 * Copyright 2020 Google Inc. All Rights Reserved. 5326 * Licensed under the Apache License, Version 2.0 (the "License"); 5327 * you may not use this file except in compliance with the License. 5328 * You may obtain a copy of the License at 5329 * 5330 * http://www.apache.org/licenses/LICENSE-2.0 5331 * 5332 * Unless required by applicable law or agreed to in writing, software 5333 * distributed under the License is distributed on an "AS IS" BASIS, 5334 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5335 * See the License for the specific language governing permissions and 5336 * limitations under the License. 5337 * ============================================================================= 5338 */function tD(n,e=null,t=!1){const i={x:$(n,"x","min")},s={axis:e,keepDims:t};return ne.runKernel(Ow,i,s)}const A1=q({min_:tD});/** 5339 * @license 5340 * Copyright 2020 Google LLC. All Rights Reserved. 5341 * Licensed under the Apache License, Version 2.0 (the "License"); 5342 * you may not use this file except in compliance with the License. 5343 * You may obtain a copy of the License at 5344 * 5345 * http://www.apache.org/licenses/LICENSE-2.0 5346 * 5347 * Unless required by applicable law or agreed to in writing, software 5348 * distributed under the License is distributed on an "AS IS" BASIS, 5349 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5350 * See the License for the specific language governing permissions and 5351 * limitations under the License. 5352 * ============================================================================= 5353 */function nD(n,e){let t=$(n,"base","pow"),r=$(e,"exp","pow");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel(Jw,i)}const Yc=q({pow_:nD});/** 5354 * @license 5355 * Copyright 2018 Google LLC. All Rights Reserved. 5356 * Licensed under the Apache License, Version 2.0 (the "License"); 5357 * you may not use this file except in compliance with the License. 5358 * You may obtain a copy of the License at 5359 * 5360 * http://www.apache.org/licenses/LICENSE-2.0 5361 * 5362 * Unless required by applicable law or agreed to in writing, software 5363 * distributed under the License is distributed on an "AS IS" BASIS, 5364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5365 * See the License for the specific language governing permissions and 5366 * limitations under the License. 5367 * ============================================================================= 5368 */function yn(n,e){if((as(n)&&e!=="string"||Array.isArray(n))&&e!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(e==="string"&&as(n)&&!(n instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return So(n,[],[],e)}/** 5369 * @license 5370 * Copyright 2018 Google LLC. All Rights Reserved. 5371 * Licensed under the Apache License, Version 2.0 (the "License"); 5372 * you may not use this file except in compliance with the License. 5373 * You may obtain a copy of the License at 5374 * 5375 * http://www.apache.org/licenses/LICENSE-2.0 5376 * 5377 * Unless required by applicable law or agreed to in writing, software 5378 * distributed under the License is distributed on an "AS IS" BASIS, 5379 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5380 * See the License for the specific language governing permissions and 5381 * limitations under the License. 5382 * ============================================================================= 5383 */function rD(n){const t={x:$(n,"x","sqrt","float32")};return ne.runKernel(Ex,t)}const Ba=q({sqrt_:rD});/** 5384 * @license 5385 * Copyright 2019 Google LLC. All Rights Reserved. 5386 * Licensed under the Apache License, Version 2.0 (the "License");
5387 * you may not use this file except in compliance with the License. 5388 * You may obtain a copy of the License at 5389 * 5390 * http://www.apache.org/licenses/LICENSE-2.0 5391 * 5392 * Unless required by applicable law or agreed to in writing, software 5393 * distributed under the License is distributed on an "AS IS" BASIS, 5394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5395 * See the License for the specific language governing permissions and 5396 * limitations under the License. 5397 * ============================================================================= 5398 */function iD(n){const e=$(n,"x","square"),t={};return ne.runKernel("Square",{x:e},t)}const Es=q({square_:iD});/** 5399 * @license 5400 * Copyright 2018 Google LLC. All Rights Reserved. 5401 * Licensed under the Apache License, Version 2.0 (the "License"); 5402 * you may not use this file except in compliance with the License. 5403 * You may obtain a copy of the License at 5404 * 5405 * http://www.apache.org/licenses/LICENSE-2.0 5406 * 5407 * Unless required by applicable law or agreed to in writing, software 5408 * distributed under the License is distributed on an "AS IS" BASIS, 5409 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5410 * See the License for the specific language governing permissions and 5411 * limitations under the License. 5412 * ============================================================================= 5413 */function sD(n,e=null,t=!1){let r=$(n,"x","sum");r.dtype==="bool"&&(r=Kn(r,"int32"));const i={x:r},s={axis:e,keepDims:t};return ne.runKernel(Sx,i,s)}const Vn=q({sum_:sD});/** 5414 * @license 5415 * Copyright 2018 Google LLC. All Rights Reserved. 5416 * Licensed under the Apache License, Version 2.0 (the "License"); 5417 * you may not use this file except in compliance with the License. 5418 * You may obtain a copy of the License at 5419 * 5420 * http://www.apache.org/licenses/LICENSE-2.0 5421 * 5422 * Unless required by applicable law or agreed to in writing, software 5423 * distributed under the License is distributed on an "AS IS" BASIS, 5424 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5425 * See the License for the specific language governing permissions and 5426 * limitations under the License. 5427 * ============================================================================= 5428 */function aD(n,e="euclidean",t=null,r=!1){n=$(n,"x","norm");const i=Hb(n,e,t);let s=i.shape;if(r){const a=Br(t,n.shape);s=Qi(i.shape,a)}return Re(i,s)}function Hb(n,e,t=null){if(n.rank===0)return Mi(n);if(n.rank!==1&&t===null)return Hb(Re(n,[-1]),e,t);if(n.rank===1||typeof t=="number"||Array.isArray(t)&&t.length===1){if(e===1)return Vn(Mi(n),t);if(e===1/0)return ml(Mi(n),t);if(e===-1/0)return A1(Mi(n),t);if(e==="euclidean"||e===2)return Ba(Vn(Yc(Mi(n),yn(2,"int32")),t));throw new Error(`Error in norm: invalid ord value: ${e}`)}if(Array.isArray(t)&&t.length===2){if(e===1)return ml(Vn(Mi(n),t[0]),t[1]-1);if(e===1/0)return ml(Vn(Mi(n),t[1]),t[0]);if(e===-1/0)return A1(Vn(Mi(n),t[1]),t[0]);if(e==="fro"||e==="euclidean")return Ba(Vn(Es(n),t));throw new Error(`Error in norm: invalid ord value: ${e}`)}throw new Error(`Error in norm: invalid axis: ${t}`)}const Xf=q({norm_:aD});/** 5429 * @license 5430 * Copyright 2022 Google LLC. All Rights Reserved. 5431 * Licensed under the Apache License, Version 2.0 (the "License"); 5432 * you may not use this file except in compliance with the License. 5433 * You may obtain a copy of the License at 5434 * 5435 * http://www.apache.org/licenses/LICENSE-2.0 5436 * 5437 * Unless required by applicable law or agreed to in writing, software 5438 * distributed under the License is distributed on an "AS IS" BASIS, 5439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5440 * See the License for the specific language governing permissions and 5441 * limitations under the License. 5442 * ============================================================================= 5443 */function oD(n,e=null,t=!1){return Xf(n,"euclidean",e,t)}const AD=q({euclideanNorm_:oD});/** 5444 * @license 5445 * Copyright 2018 Google LLC. All Rights Reserved. 5446 * Licensed under the Apache License, Version 2.0 (the "License"); 5447 * you may not use this file except in compliance with the License. 5448 * You may obtain a copy of the License at 5449 * 5450 * http://www.apache.org/licenses/LICENSE-2.0 5451 * 5452 * Unless required by applicable law or agreed to in writing, softw
5452are 5453 * distributed under the License is distributed on an "AS IS" BASIS, 5454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5455 * See the License for the specific language governing permissions and 5456 * limitations under the License. 5457 * ============================================================================= 5458 */function lD(n){const t={x:$(n,"x","exp")};return ne.runKernel(rw,t)}const Ea=q({exp_:lD});/** 5459 * @license 5460 * Copyright 2020 Google LLC. All Rights Reserved. 5461 * Licensed under the Apache License, Version 2.0 (the "License"); 5462 * you may not use this file except in compliance with the License. 5463 * You may obtain a copy of the License at 5464 * 5465 * http://www.apache.org/licenses/LICENSE-2.0 5466 * 5467 * Unless required by applicable law or agreed to in writing, software 5468 * distributed under the License is distributed on an "AS IS" BASIS, 5469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5470 * See the License for the specific language governing permissions and 5471 * limitations under the License. 5472 * ============================================================================= 5473 */function cD(n,e=0){const t=$(n,"x","expandDims","string_or_numeric");H(e<=t.rank,()=>"Axis must be <= rank of the tensor");const r={input:t},i={dim:e};return ne.runKernel(iw,r,i)}const qi=q({expandDims_:cD});/** 5474 * @license 5475 * Copyright 2018 Google LLC. All Rights Reserved. 5476 * Licensed under the Apache License, Version 2.0 (the "License"); 5477 * you may not use this file except in compliance with the License. 5478 * You may obtain a copy of the License at 5479 * 5480 * http://www.apache.org/licenses/LICENSE-2.0 5481 * 5482 * Unless required by applicable law or agreed to in writing, software 5483 * distributed under the License is distributed on an "AS IS" BASIS, 5484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5485 * See the License for the specific language governing permissions and 5486 * limitations under the License. 5487 * ============================================================================= 5488 */function uD(n){const t={x:$(n,"x","expm1")};return ne.runKernel(sw,t)}const hD=q({expm1_:uD});/** 5489 * @license 5490 * Copyright 2020 Google LLC. All Rights Reserved. 5491 * Licensed under the Apache License, Version 2.0 (the "License"); 5492 * you may not use this file except in compliance with the License. 5493 * You may obtain a copy of the License at 5494 * 5495 * http://www.apache.org/licenses/LICENSE-2.0 5496 * 5497 * Unless required by applicable law or agreed to in writing, software 5498 * distributed under the License is distributed on an "AS IS" BASIS, 5499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5500 * See the License for the specific language governing permissions and 5501 * limitations under the License. 5502 * ============================================================================= 5503 */function fD(n,e){const t=$(n,"x","tile","string_or_numeric");H(t.rank===e.length,()=>`Error in transpose: rank of input ${t.rank} must match length of reps ${e}.`);const r={x:t},i={reps:e};return ne.runKernel(Sg,r,i)}const Nc=q({tile_:fD});/** 5504 * @license 5505 * Copyright 2020 Google LLC. All Rights Reserved. 5506 * Licensed under the Apache License, Version 2.0 (the "License"); 5507 * you may not use this file except in compliance with the License. 5508 * You may obtain a copy of the License at 5509 * 5510 * http://www.apache.org/licenses/LICENSE-2.0 5511 * 5512 * Unless required by applicable law or agreed to in writing, software 5513 * distributed under the License is distributed on an "AS IS" BASIS, 5514 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5515 * See the License for the specific language governing permissions and 5516 * limitations under the License. 5517 * ============================================================================= 5518 */function dD(n,e,t,r="float32"){e==null&&(e=n);const i=ir([n,e],r),s=n<=e?n:e;for(let o=0;o<s;++o)i.set(1,o,o);const a=Re(i.toTensor(),[n,e]);if(t==null)return a;
vendor: 4,176 bytes, lines 5518-5587
5518if(t.length===1)return Nc(qi(a,0),[t[0],1,1]);if(t.length===2)return Nc(qi(qi(a,0),0),[t[0],t[1],1,1]);if(t.length===3)return Nc(qi(qi(qi(a,0),0),0),[t[0],t[1],t[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${t.length}D.`)}const Vb=q({eye_:dD});/** 5519 * @license 5520 * Copyright 2018 Google LLC. All Rights Reserved. 5521 * Licensed under the Apache License, Version 2.0 (the "License"); 5522 * you may not use this file except in compliance with the License. 5523 * You may obtain a copy of the License at 5524 * 5525 * http://www.apache.org/licenses/LICENSE-2.0 5526 * 5527 * Unless required by applicable law or agreed to in writing, software 5528 * distributed under the License is distributed on an "AS IS" BASIS, 5529 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5530 * See the License for the specific language governing permissions and 5531 * limitations under the License. 5532 * ============================================================================= 5533 */function pD(n){const t={x:$(n,"x","floor","float32")};return ne.runKernel(lw,t)}const Gb=q({floor_:pD});/** 5534 * @license 5535 * Copyright 2018 Google LLC. All Rights Reserved. 5536 * Licensed under the Apache License, Version 2.0 (the "License"); 5537 * you may not use this file except in compliance with the License. 5538 * You may obtain a copy of the License at 5539 * 5540 * http://www.apache.org/licenses/LICENSE-2.0 5541 * 5542 * Unless required by applicable law or agreed to in writing, software 5543 * distributed under the License is distributed on an "AS IS" BASIS, 5544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5545 * See the License for the specific language governing permissions and 5546 * limitations under the License. 5547 * ============================================================================= 5548 */function mD(n,e,t=0,r=0){const i=$(n,"x","gather"),s=$(e,"indices","gather","int32"),a={x:i,indices:s},o={axis:t,batchDims:r};return ne.runKernel(hw,a,o)}const zb=q({gather_:mD});/** 5549 * @license 5550 * Copyright 2020 Google LLC. All Rights Reserved. 5551 * Licensed under the Apache License, Version 2.0 (the "License"); 5552 * you may not use this file except in compliance with the License. 5553 * You may obtain a copy of the License at 5554 * 5555 * http://www.apache.org/licenses/LICENSE-2.0 5556 * 5557 * Unless required by applicable law or agreed to in writing, software 5558 * distributed under the License is distributed on an "AS IS" BASIS, 5559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5560 * See the License for the specific language governing permissions and 5561 * limitations under the License. 5562 * ============================================================================= 5563 */function gD(n,e){let t=$(n,"a","greater","string_or_numeric"),r=$(e,"b","greater","string_or_numeric");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(dw,i)}const jf=q({greater_:gD});/** 5564 * @license 5565 * Copyright 2020 Google LLC. All Rights Reserved. 5566 * Licensed under the Apache License, Version 2.0 (the "License"); 5567 * you may not use this file except in compliance with the License. 5568 * You may obtain a copy of the License at 5569 * 5570 * http://www.apache.org/licenses/LICENSE-2.0 5571 * 5572 * Unless required by applicable law or agreed to in writing, software 5573 * distributed under the License is distributed on an "AS IS" BASIS, 5574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5575 * See the License for the specific language governing permissions and 5576 * limitations under the License. 5577 * ============================================================================= 5578 */function yD(n,e){let t=$(n,"a","greaterEqual","string_or_numeric"),r=$(e,"b","greaterEqual","string_or_numeric");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(pw,i)}const Wb=q({greaterEqual_:yD});/** 5579 * @license 5580 * Copyright 2020 Google LLC. All Rights Reserved. 5581 * Licensed under the Apache License, Version 2.0 (the "License"); 5582 * you may not use this file except in compliance with the License. 5583 * You may obtain a copy of the License at 5584 * 5585 * http://www.apache.org/licenses/LICENSE-2.0 5586 * 5587 * Unless required by applicable law or agreed to in writing, softw
5587are 5588 * distributed under the License is distributed on an "AS IS" BASIS, 5589 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5590 * See the License for the specific language governing permissions and 5591 * limitations under the License. 5592 * ============================================================================= 5593 */function vD(n){const t={input:$(n,"input","imag")};return ne.runKernel(gw,t)}const Yf=q({imag_:vD});/** 5594 * @license 5595 * Copyright 2018 Google LLC. All Rights Reserved. 5596 * Licensed under the Apache License, Version 2.0 (the "License"); 5597 * you may not use this file except in compliance with the License. 5598 * You may obtain a copy of the License at 5599 * 5600 * http://www.apache.org/licenses/LICENSE-2.0 5601 * 5602 * Unless required by applicable law or agreed to in writing, software 5603 * distributed under the License is distributed on an "AS IS" BASIS, 5604 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5605 * See the License for the specific language governing permissions and 5606 * limitations under the License. 5607 * ============================================================================= 5608 */function wD(n){const t={x:$(n,"x","isFinite")};return ne.runKernel(yw,t)}const xD=q({isFinite_:wD});/** 5609 * @license 5610 * Copyright 2018 Google LLC. All Rights Reserved. 5611 * Licensed under the Apache License, Version 2.0 (the "License"); 5612 * you may not use this file except in compliance with the License. 5613 * You may obtain a copy of the License at 5614 * 5615 * http://www.apache.org/licenses/LICENSE-2.0 5616 * 5617 * Unless required by applicable law or agreed to in writing, software 5618 * distributed under the License is distributed on an "AS IS" BASIS, 5619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5620 * See the License for the specific language governing permissions and 5621 * limitations under the License. 5622 * ============================================================================= 5623 */function bD(n){const t={x:$(n,"x","isInf")};return ne.runKernel(vw,t)}const CD=q({isInf_:bD});/** 5624 * @license 5625 * Copyright 2018 Google LLC. All Rights Reserved. 5626 * Licensed under the Apache License, Version 2.0 (the "License"); 5627 * you may not use this file except in compliance with the License. 5628 * You may obtain a copy of the License at 5629 * 5630 * http://www.apache.org/licenses/LICENSE-2.0 5631 * 5632 * Unless required by applicable law or agreed to in writing, software 5633 * distributed under the License is distributed on an "AS IS" BASIS, 5634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5635 * See the License for the specific language governing permissions and 5636 * limitations under the License. 5637 * ============================================================================= 5638 */function _D(n){const t={x:$(n,"x","isNaN")};return ne.runKernel(ww,t)}const BD=q({isNaN_:_D});/** 5639 * @license 5640 * Copyright 2020 Google LLC. All Rights Reserved. 5641 * Licensed under the Apache License, Version 2.0 (the "License"); 5642 * you may not use this file except in compliance with the License. 5643 * You may obtain a copy of the License at 5644 * 5645 * http://www.apache.org/licenses/LICENSE-2.0 5646 * 5647 * Unless required by applicable law or agreed to in writing, software 5648 * distributed under the License is distributed on an "AS IS" BASIS, 5649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5650 * See the License for the specific language governing permissions and 5651 * limitations under the License. 5652 * ============================================================================= 5653 */function ED(n,e=.2){const r={x:$(n,"x","leakyRelu")},i={alpha:e};return ne.runKernel(xw,r,i)}const Kb=q({leakyRelu_:ED});/** 5654 * @license 5655 * Copyright 2020 Google LLC. All Rights Reserved. 5656 * Licensed under the Apache License, Version 2.0 (the "License"); 5657 * you may not use this file except in compliance with the License. 5658 * You may obtain a copy of the License at 5659 * 5660 * http://www.apache.org/licenses/LICENSE-2.0 5661 * 5662 * Unless required by applicable law or agreed to in writing, software 5663 * distributed under the License is distributed on an "AS IS" BASIS, 5664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5665 * See the License for the specific language governing permissions and 5666 * limitations under the License. 5667 * ============================================================================= 5668 */function SD(n,e){let t=$(n,"a","less","string_or_numeric"),r=$(e,"b","less","string_or_numeric");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(bw,i)}const l1=q({less_:SD});/** 5669 * @license 5670 * Copyright 2020 Google LLC. All Rights Reserved. 5671 * Licensed under the Apache License, Version 2.0 (the "License");
5672 * you may not use this file except in compliance with the License. 5673 * You may obtain a copy of the License at 5674 * 5675 * http://www.apache.org/licenses/LICENSE-2.0 5676 * 5677 * Unless required by applicable law or agreed to in writing, software 5678 * distributed under the License is distributed on an "AS IS" BASIS, 5679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5680 * See the License for the specific language governing permissions and 5681 * limitations under the License. 5682 * ============================================================================= 5683 */function TD(n,e){let t=$(n,"a","lessEqual","string_or_numeric"),r=$(e,"b","lessEqual","string_or_numeric");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(Cw,i)}const Lg=q({lessEqual_:TD});/** 5684 * @license 5685 * Copyright 2018 Google LLC. All Rights Reserved. 5686 * Licensed under the Apache License, Version 2.0 (the "License"); 5687 * you may not use this file except in compliance with the License. 5688 * You may obtain a copy of the License at 5689 * 5690 * http://www.apache.org/licenses/LICENSE-2.0 5691 * 5692 * Unless required by applicable law or agreed to in writing, software 5693 * distributed under the License is distributed on an "AS IS" BASIS, 5694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5695 * See the License for the specific language governing permissions and 5696 * limitations under the License. 5697 * ============================================================================= 5698 */function ID(n,e,t){if(t<=0)throw new Error("The number of values should be positive.");const r={start:n,stop:e,num:t};return ne.runKernel(_w,{},r)}/** 5699 * @license 5700 * Copyright 2020 Google LLC. All Rights Reserved. 5701 * Licensed under the Apache License, Version 2.0 (the "License"); 5702 * you may not use this file except in compliance with the License. 5703 * You may obtain a copy of the License at 5704 * 5705 * http://www.apache.org/licenses/LICENSE-2.0 5706 * 5707 * Unless required by applicable law or agreed to in writing, software 5708 * distributed under the License is distributed on an "AS IS" BASIS, 5709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5710 * See the License for the specific language governing permissions and 5711 * limitations under the License. 5712 * ============================================================================= 5713 */function FD(n,e=5,t=1,r=1,i=.5){const s=$(n,"x","localResponseNormalization");H(s.rank===4||s.rank===3,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got 5714 rank ${s.rank}.`),H(Sl(e),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`);let a=s,o=!1;s.rank===3&&(o=!0,a=Re(s,[1,s.shape[0],s.shape[1],s.shape[2]]));const A={x:a},l={depthRadius:e,bias:t,alpha:r,beta:i},c=ne.runKernel(Fw,A,l);return o?Re(c,[c.shape[1],c.shape[2],c.shape[3]]):c}const RD=q({localResponseNormalization_:FD});/** 5715 * @license 5716 * Copyright 2018 Google LLC. All Rights Reserved. 5717 * Licensed under the Apache License, Version 2.0 (the "License"); 5718 * you may not use this file except in compliance with the License. 5719 * You may obtain a copy of the License at 5720 * 5721 * http://www.apache.org/licenses/LICENSE-2.0 5722 * 5723 * Unless required by applicable law or agreed to in writing, software 5724 * distributed under the License is distributed on an "AS IS" BASIS, 5725 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5726 * See the License for the specific language governing permissions and 5727 * limitations under the License. 5728 * ============================================================================= 5729 */function UD(n){const t={x:$(n,"x","log","float32")};return ne.runKernel(Bw,t)}const qc=q({log_:UD});/** 5730 * @license 5731 * Copyright 2018 Google LLC. All Rights Reserved. 5732 * Licensed under the Apache License, Version 2.0 (the "License"); 5733 * you may not use this file except in compliance with the License. 5734 * You may obtain a copy of the License at 5735 * 5736 * http://www.apache.org/licenses/LICENSE-2.0 5737 * 5738 * Unless required by applicable law or agreed to in writing, software 5739 * distributed under the License is distributed on an "AS IS" BASIS, 5740 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5741 * See the License for the specific language governing permissions and 5742 * limitations under the License. 5743 * ============================================================================= 5744 */function MD(n){const t={x:$(n,"x","log1p")};return ne.runKernel(Ew,t)}const Xb=q({log1p_:MD});/** 5745 * @license 5746 * Copyright 2018 Google LLC. All Rights Reserved. 5747 * Licensed under the Apache License, Version 2.0 (the "License");
5748 * you may not use this file except in compliance with the License. 5749 * You may obtain a copy of the License at 5750 * 5751 * http://www.apache.org/licenses/LICENSE-2.0 5752 * 5753 * Unless required by applicable law or agreed to in writing, software 5754 * distributed under the License is distributed on an "AS IS" BASIS, 5755 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5756 * See the License for the specific language governing permissions and 5757 * limitations under the License. 5758 * ============================================================================= 5759 */function ND(n,e){H(Qm(n),()=>"The f passed in variableGrads(f) must be a function"),H(e==null||Array.isArray(e)&&e.every(l=>l instanceof ff),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const t=e!=null;if(!t){e=[];for(const l in ne.registeredVariables)e.push(ne.registeredVariables[l])}const r=t?e.filter(l=>!l.trainable):null,i=e.length;e=e.filter(l=>l.trainable),H(e.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${i} variables is trainable.`);const s=!0,{value:a,grads:o}=ne.gradients(n,e,null,s);H(o.some(l=>l!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),H(a.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`);const A={};return e.forEach((l,c)=>{o[c]!=null&&(A[l.name]=o[c])}),r!=null&&r.forEach(l=>A[l.name]=null),{value:a,grads:A}}function Sa(n){return ne.customGrad(n)}/** 5760 * @license 5761 * Copyright 2018 Google LLC. All Rights Reserved. 5762 * Licensed under the Apache License, Version 2.0 (the "License"); 5763 * you may not use this file except in compliance with the License. 5764 * You may obtain a copy of the License at 5765 * 5766 * http://www.apache.org/licenses/LICENSE-2.0 5767 * 5768 * Unless required by applicable law or agreed to in writing, software 5769 * distributed under the License is distributed on an "AS IS" BASIS, 5770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5771 * See the License for the specific language governing permissions and 5772 * limitations under the License. 5773 * ============================================================================= 5774 */function DD(n){const t={x:$(n,"x","neg")};return ne.runKernel(Vw,t)}const Ws=q({neg_:DD});/** 5775 * @license 5776 * Copyright 2018 Google LLC. All Rights Reserved. 5777 * Licensed under the Apache License, Version 2.0 (the "License"); 5778 * you may not use this file except in compliance with the License. 5779 * You may obtain a copy of the License at 5780 * 5781 * http://www.apache.org/licenses/LICENSE-2.0 5782 * 5783 * Unless required by applicable law or agreed to in writing, software 5784 * distributed under the License is distributed on an "AS IS" BASIS, 5785 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5786 * See the License for the specific language governing permissions and 5787 * limitations under the License. 5788 * ============================================================================= 5789 */function LD(n){const t={x:$(n,"x","softplus")};return ne.runKernel(Bx,t)}const jb=q({softplus_:LD});/** 5790 * @license 5791 * Copyright 2018 Google LLC. All Rights Reserved. 5792 * Licensed under the Apache License, Version 2.0 (the "License"); 5793 * you may not use this file except in compliance with the License. 5794 * You may obtain a copy of the License at 5795 * 5796 * http://www.apache.org/licenses/LICENSE-2.0 5797 * 5798 * Unless required by applicable law or agreed to in writing, software 5799 * distributed under the License is distributed on an "AS IS" BASIS, 5800 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5801 * See the License for the specific language governing permissions and 5802 * limitations under the License. 5803 * ============================================================================= 5804 */function OD(n){const e=$(n,"x","logSigmoid");return Sa(r=>({value:Ws(jb(Ws(r))),gradFunc:a=>Ye(a,rA(Ws(r)))}))(e)}const PD=q({logSigmoid_:OD});/** 5805 * @license 5806 * Copyright 2020 Google LLC. All Rights Reserved. 5807 * Licensed under the Apache License, Version 2.0 (the "License");
5808 * you may not use this file except in compliance with the License. 5809 * You may obtain a copy of the License at 5810 * 5811 * http://www.apache.org/licenses/LICENSE-2.0 5812 * 5813 * Unless required by applicable law or agreed to in writing, software 5814 * distributed under the License is distributed on an "AS IS" BASIS, 5815 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5816 * See the License for the specific language governing permissions and 5817 * limitations under the License. 5818 * ============================================================================= 5819 */function kD(n,e){let t=$(n,"a","sub"),r=$(e,"b","sub");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel(Hx,i)}const sn=q({sub_:kD});/** 5820 * @license 5821 * Copyright 2020 Google Inc. All Rights Reserved. 5822 * Licensed under the Apache License, Version 2.0 (the "License"); 5823 * you may not use this file except in compliance with the License. 5824 * You may obtain a copy of the License at 5825 * 5826 * http://www.apache.org/licenses/LICENSE-2.0 5827 * 5828 * Unless required by applicable law or agreed to in writing, software 5829 * distributed under the License is distributed on an "AS IS" BASIS, 5830 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5831 * See the License for the specific language governing permissions and 5832 * limitations under the License. 5833 * ============================================================================= 5834 */function $D(n,e=-1){const t=$(n,"logits","logSoftmax");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and axis was ${e}`);return Sa((i,s)=>{const o=ml(i,e,!0),A=sn(i,o),l=sn(Kn(A,"float32"),qc(Vn(Ea(A),e,!0)));return s([l]),{value:l,gradFunc:(u,h)=>{const[f]=h,d=!0,g=Ea(f);return sn(u,Ye(Vn(u,e,d),g))}}})(t)}const QD=q({logSoftmax_:$D});/** 5835 * @license 5836 * Copyright 2020 Google LLC. All Rights Reserved. 5837 * Licensed under the Apache License, Version 2.0 (the "License"); 5838 * you may not use this file except in compliance with the License. 5839 * You may obtain a copy of the License at 5840 * 5841 * http://www.apache.org/licenses/LICENSE-2.0 5842 * 5843 * Unless required by applicable law or agreed to in writing, software 5844 * distributed under the License is distributed on an "AS IS" BASIS, 5845 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5846 * See the License for the specific language governing permissions and 5847 * limitations under the License. 5848 * ============================================================================= 5849 */function HD(n,e=null,t=!1){const r=$(n,"x","logSumExp"),i=Br(e,r.shape),s=ml(r,i,!0),a=sn(r,s),o=Ea(a),A=Vn(o,i),l=qc(A),c=Ut(Re(s,l.shape),l);if(t){const u=Qi(c.shape,i);return Re(c,u)}return c}const Yb=q({logSumExp_:HD});/** 5850 * @license 5851 * Copyright 2020 Google LLC. All Rights Reserved. 5852 * Licensed under the Apache License, Version 2.0 (the "License"); 5853 * you may not use this file except in compliance with the License. 5854 * You may obtain a copy of the License at 5855 * 5856 * http://www.apache.org/licenses/LICENSE-2.0 5857 * 5858 * Unless required by applicable law or agreed to in writing, software 5859 * distributed under the License is distributed on an "AS IS" BASIS, 5860 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5861 * See the License for the specific language governing permissions and 5862 * limitations under the License. 5863 * ============================================================================= 5864 */function VD(n,e){const t=$(n,"a","logicalAnd","bool"),r=$(e,"b","logicalAnd","bool");Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(Sw,i)}const mf=q({logicalAnd_:VD});/** 5865 * @license 5866 * Copyright 2020 Google LLC. All Rights Reserved. 5867 * Licensed under the Apache License, Version 2.0 (the "License"); 5868 * you may not use this file except in compliance with the License. 5869 * You may obtain a copy of the License at 5870 * 5871 * http://www.apache.org/licenses/LICENSE-2.0 5872 * 5873 * Unless required by applicable law or agreed to in writing, software 5874 * distributed under the License is distributed on an "AS IS" BASIS, 5875 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5876 * See the License for the specific language governing permissions and 5877 * limitations under the License. 5878 * ============================================================================= 5879 */function GD(n){const t={x:$(n,"x","logicalNot","bool")};return ne.runKernel(Tw,t)}const qb=q({logicalNot_:GD});/** 5880 * @license 5881 * Copyright 2020 Google LLC. All Rights Reserved. 5882 * Licensed under the Apache License, Version 2.0 (the "License");
5883 * you may not use this file except in compliance with the License. 5884 * You may obtain a copy of the License at 5885 * 5886 * http://www.apache.org/licenses/LICENSE-2.0 5887 * 5888 * Unless required by applicable law or agreed to in writing, software 5889 * distributed under the License is distributed on an "AS IS" BASIS, 5890 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5891 * See the License for the specific language governing permissions and 5892 * limitations under the License. 5893 * ============================================================================= 5894 */function zD(n,e){const t=$(n,"a","logicalOr","bool"),r=$(e,"b","logicalOr","bool");Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(Iw,i)}const Jb=q({logicalOr_:zD});/** 5895 * @license 5896 * Copyright 2020 Google LLC. All Rights Reserved. 5897 * Licensed under the Apache License, Version 2.0 (the "License"); 5898 * you may not use this file except in compliance with the License. 5899 * You may obtain a copy of the License at 5900 * 5901 * http://www.apache.org/licenses/LICENSE-2.0 5902 * 5903 * Unless required by applicable law or agreed to in writing, software 5904 * distributed under the License is distributed on an "AS IS" BASIS, 5905 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5906 * See the License for the specific language governing permissions and 5907 * limitations under the License. 5908 * ============================================================================= 5909 */function WD(n,e){const t=$(n,"a","logicalXor","bool"),r=$(e,"b","logicalXor","bool");return Cn(t.shape,r.shape),mf(Jb(n,e),qb(mf(n,e)))}const KD=q({logicalXor_:WD});/** 5910 * @license 5911 * Copyright 2022 Google LLC. All Rights Reserved. 5912 * Licensed under the Apache License, Version 2.0 (the "License"); 5913 * you may not use this file except in compliance with the License. 5914 * You may obtain a copy of the License at 5915 * 5916 * http://www.apache.org/licenses/LICENSE-2.0 5917 * 5918 * Unless required by applicable law or agreed to in writing, software 5919 * distributed under the License is distributed on an "AS IS" BASIS, 5920 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5921 * See the License for the specific language governing permissions and 5922 * limitations under the License. 5923 * ============================================================================= 5924 */const rh=2147483648;function XD(n,e,t="left"){const r=$(n,"sortedSequence","searchSorted"),i=$(e,"values","searchSorted"),s=r.shape[r.shape.length-1],a=i.shape[i.shape.length-1],o=Re(r,[-1,s]),A=Re(i,[-1,a]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==A.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(ze(A.shape)>=rh)throw new Error(`values tensor size must less than ${rh}`);if(o.shape[1]>=rh)throw new Error(`trailing dim_size must less than ${rh} for int32 output type, was ${o.shape[1]}`);const l={sortedSequence:o,values:A},c={side:t};return ne.runKernel(gx,l,c)}const Og=q({searchSorted_:XD});/** 5925 * @license 5926 * Copyright 2022 Google LLC. All Rights Reserved. 5927 * Licensed under the Apache License, Version 2.0 (the "License"); 5928 * you may not use this file except in compliance with the License. 5929 * You may obtain a copy of the License at 5930 * 5931 * http://www.apache.org/licenses/LICENSE-2.0 5932 * 5933 * Unless required by applicable law or agreed to in writing, software 5934 * distributed under the License is distributed on an "AS IS" BASIS, 5935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5936 * See the License for the specific language governing permissions and 5937 * limitations under the License. 5938 * ============================================================================= 5939 */function jD(n,e){return Og(n,e,"left")}/** 5940 * @license 5941 * Copyright 2020 Google LLC. All Rights Reserved. 5942 * Licensed under the Apache License, Version 2.0 (the "License"); 5943 * you may not use this file except in compliance with the License. 5944 * You may obtain a copy of the License at 5945 * 5946 * http://www.apache.org/licenses/LICENSE-2.0 5947 * 5948 * Unless required by applicable law or agreed to in writing, softw
5948are 5949 * distributed under the License is distributed on an "AS IS" BASIS, 5950 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5951 * See the License for the specific language governing permissions and 5952 * limitations under the License. 5953 * ============================================================================= 5954 */function YD(n,e,t,r,i){const s=$(n,"x","maxPool"),a=1;let o=s,A=!1;s.rank===3&&(A=!0,o=Re(s,[1,s.shape[0],s.shape[1],s.shape[2]])),H(o.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),H(Ti(t,a),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${a}'`),os("maxPool",r,i);const l={x:o},c={filterSize:e,strides:t,pad:r,dimRoundingMode:i},u=ne.runKernel(Mw,l,c);return A?Re(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const Zb=q({maxPool_:YD});/** 5955 * @license 5956 * Copyright 2020 Google LLC. All Rights Reserved. 5957 * Licensed under the Apache License, Version 2.0 (the "License"); 5958 * you may not use this file except in compliance with the License. 5959 * You may obtain a copy of the License at 5960 * 5961 * http://www.apache.org/licenses/LICENSE-2.0 5962 * 5963 * Unless required by applicable law or agreed to in writing, software 5964 * distributed under the License is distributed on an "AS IS" BASIS, 5965 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5966 * See the License for the specific language governing permissions and 5967 * limitations under the License. 5968 * ============================================================================= 5969 */function qD(n,e=[1,1,1],t,r,i,s="NDHWC"){const a=$(n,"x","maxPool3d");let o=a,A=!1;a.rank===4&&(A=!0,o=Re(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),H(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),H(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),os("maxPool3d",r,i);const l={x:o},c={filterSize:e,strides:t,pad:r,dimRoundingMode:i,dataFormat:s},u=ne.runKernel(Nw,l,c);return A?Re(u,[u.shape[1],u.shape[2],u.shape[3],u.shape[4]]):u}const JD=q({maxPool3d_:qD});/** 5970 * @license 5971 * Copyright 2018 Google LLC. All Rights Reserved. 5972 * Licensed under the Apache License, Version 2.0 (the "License"); 5973 * you may not use this file except in compliance with the License. 5974 * You may obtain a copy of the License at 5975 * 5976 * http://www.apache.org/licenses/LICENSE-2.0 5977 * 5978 * Unless required by applicable law or agreed to in writing, software 5979 * distributed under the License is distributed on an "AS IS" BASIS, 5980 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5981 * See the License for the specific language governing permissions and 5982 * limitations under the License. 5983 * ============================================================================= 5984 */function ZD(n,e,t,r,i=!1){const a={x:$(n,"x","maxPoolWithArgmax")},o={filterSize:e,strides:t,pad:r,includeBatchInIndex:i},A=ne.runKernel(Dw,a,o);return{result:A[0],indexes:A[1]}}const e9=q({maxPoolWithArgmax_:ZD});/** 5985 * @license 5986 * Copyright 2020 Google LLC. All Rights Reserved. 5987 * Licensed under the Apache License, Version 2.0 (the "License"); 5988 * you may not use this file except in compliance with the License. 5989 * You may obtain a copy of the License at 5990 * 5991 * http://www.apache.org/licenses/LICENSE-2.0 5992 * 5993 * Unless required by applicable law or agreed to in writing, software 5994 * distributed under the License is distributed on an "AS IS" BASIS, 5995 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5996 * See the License for the specific language governing permissions and 5997 * limitations under the License. 5998 * ============================================================================= 5999 */function t9(n,e){let t=$(n,"a","maximum"),r=$(e,"b","maximum");[t,r]=Ar(t,r),t.dtype==="bool"&&(t=Kn(t,"int32"),r=Kn(r,"int32")),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(Uw,i)}const eC=q({maximum_:t9});/** 6000 * @license 6001 * Copyright 2020 Google Inc. All Rights Reserved. 6002 * Licensed under the Apache License, Version 2.0 (the "License"); 6003 * you may not use this file except in compliance with the License. 6004 * You may obtain a copy of the License at 6005 * 6006 * http://www.apache.org/licenses/LICENSE-2.0 6007 * 6008 * Unless required by applicable law or agreed to in writing, softw
6008are 6009 * distributed under the License is distributed on an "AS IS" BASIS, 6010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6011 * See the License for the specific language governing permissions and 6012 * limitations under the License. 6013 * ============================================================================= 6014 */function n9(n,e=null,t=!1){const i={x:$(n,"x","mean")},s={axis:e,keepDims:t};return ne.runKernel(Lw,i,s)}const gf=q({mean_:n9});/** 6015 * @license 6016 * Copyright 2018 Google LLC. All Rights Reserved. 6017 * Licensed under the Apache License, Version 2.0 (the "License"); 6018 * you may not use this file except in compliance with the License. 6019 * You may obtain a copy of the License at 6020 * 6021 * http://www.apache.org/licenses/LICENSE-2.0 6022 * 6023 * Unless required by applicable law or agreed to in writing, software 6024 * distributed under the License is distributed on an "AS IS" BASIS, 6025 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6026 * See the License for the specific language governing permissions and 6027 * limitations under the License. 6028 * ============================================================================= 6029 */function pA(n,e="float32"){if(ki(n),e==="complex64"){const r=pA(n,"float32"),i=pA(n,"float32");return xo(r,i)}const t=wo(ze(n),e);return ne.makeTensor(t,n,e)}/** 6030 * @license 6031 * Copyright 2018 Google LLC. All Rights Reserved. 6032 * Licensed under the Apache License, Version 2.0 (the "License"); 6033 * you may not use this file except in compliance with the License. 6034 * You may obtain a copy of the License at 6035 * 6036 * http://www.apache.org/licenses/LICENSE-2.0 6037 * 6038 * Unless required by applicable law or agreed to in writing, software 6039 * distributed under the License is distributed on an "AS IS" BASIS, 6040 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6041 * See the License for the specific language governing permissions and 6042 * limitations under the License. 6043 * ============================================================================= 6044 */function eA(n,e="float32"){if(ki(n),e==="complex64"){const r=eA(n,"float32"),i=pA(n,"float32");return xo(r,i)}const t=ov(ze(n),e);return ne.makeTensor(t,n,e)}/** 6045 * @license 6046 * Copyright 2021 Google LLC. All Rights Reserved. 6047 * Licensed under the Apache License, Version 2.0 (the "License"); 6048 * you may not use this file except in compliance with the License. 6049 * You may obtain a copy of the License at 6050 * 6051 * http://www.apache.org/licenses/LICENSE-2.0 6052 * 6053 * Unless required by applicable law or agreed to in writing, software 6054 * distributed under the License is distributed on an "AS IS" BASIS, 6055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6056 * See the License for the specific language governing permissions and 6057 * limitations under the License. 6058 * ============================================================================= 6059 */function r9(n,e,{indexing:t="xy"}={}){if(t!=="xy"&&t!=="ij")throw new TypeError(`${t} is not a valid third argument to meshgrid`);if(n===void 0)return[];let r=$(n,"x","meshgrid",n instanceof ar?n.dtype:"float32");if(e===void 0)return[r];let i=$(e,"y","meshgrid",e instanceof ar?e.dtype:"float32");const s=ze(r.shape),a=ze(i.shape);return t==="xy"?(r=Re(r,[1,-1]),i=Re(i,[-1,1]),[Un(eA([a,1],r.dtype),r),Un(i,eA([1,s],i.dtype))]):(r=Re(r,[-1,1]),i=Re(i,[1,-1]),[Un(r,eA([1,a],r.dtype)),Un(eA([s,1],i.dtype),i)])}/** 6060 * @license 6061 * Copyright 2020 Google LLC. All Rights Reserved. 6062 * Licensed under the Apache License, Version 2.0 (the "License"); 6063 * you may not use this file except in compliance with the License. 6064 * You may obtain a copy of the License at 6065 * 6066 * http://www.apache.org/licenses/LICENSE-2.0 6067 * 6068 * Unless required by applicable law or agreed to in writing, software 6069 * distributed under the License is distributed on an "AS IS" BASIS, 6070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6071 * See the License for the specific language governing permissions and 6072 * limitations under the License. 6073 * ============================================================================= 6074 */function i9(n,e){let t=$(n,"a","minimum"),r=$(e,"b","minimum");[t,r]=Ar(t,r),t.dtype==="bool"&&(t=Kn(t,"int32"),r=Kn(r,"int32")),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(Pw,i)}const yf=q({minimum_:i9});/** 6075 * @license 6076 * Copyright 2020 Google LLC. All Rights Reserved. 6077 * Licensed under the Apache License, Version 2.0 (the "License");
6078 * you may not use this file except in compliance with the License. 6079 * You may obtain a copy of the License at 6080 * 6081 * http://www.apache.org/licenses/LICENSE-2.0 6082 * 6083 * Unless required by applicable law or agreed to in writing, software 6084 * distributed under the License is distributed on an "AS IS" BASIS, 6085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6086 * See the License for the specific language governing permissions and 6087 * limitations under the License. 6088 * ============================================================================= 6089 */function s9(n,e,t){H(t==="reflect"||t==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${t}.`);const r=$(n,"x","mirrorPad");if(r.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");H(e.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${e.length}.`);const i=t==="reflect"?1:0;for(let o=0;o<r.rank;o++)H(e[o].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),H(e[o][0]>=0&&e[o][0]<=r.shape[o]-i&&e[o][1]>=0&&e[o][1]<=r.shape[o]-i,()=>`Padding in dimension ${o} cannot be greater than or equal to ${r.shape[o]-i} or less than 0 for input of shape ${r.shape}`);const s={paddings:e,mode:t},a={x:r};return ne.runKernel(kw,a,s)}const a9=q({mirrorPad_:s9});/** 6090 * @license 6091 * Copyright 2020 Google LLC. All Rights Reserved. 6092 * Licensed under the Apache License, Version 2.0 (the "License"); 6093 * you may not use this file except in compliance with the License. 6094 * You may obtain a copy of the License at 6095 * 6096 * http://www.apache.org/licenses/LICENSE-2.0 6097 * 6098 * Unless required by applicable law or agreed to in writing, software 6099 * distributed under the License is distributed on an "AS IS" BASIS, 6100 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6101 * See the License for the specific language governing permissions and 6102 * limitations under the License. 6103 * ============================================================================= 6104 */function o9(n,e){let t=$(n,"a","mod"),r=$(e,"b","mod");[t,r]=Ar(t,r);const i={a:t,b:r};return ne.runKernel($w,i)}const A9=q({mod_:o9});/** 6105 * @license 6106 * Copyright 2020 Google LLC. All Rights Reserved. 6107 * Licensed under the Apache License, Version 2.0 (the "License"); 6108 * you may not use this file except in compliance with the License. 6109 * You may obtain a copy of the License at 6110 * 6111 * http://www.apache.org/licenses/LICENSE-2.0 6112 * 6113 * Unless required by applicable law or agreed to in writing, software 6114 * distributed under the License is distributed on an "AS IS" BASIS, 6115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6116 * See the License for the specific language governing permissions and 6117 * limitations under the License. 6118 * ============================================================================= 6119 */function l9(n,e=null,t=!1){n=$(n,"x","moments");const r=Br(e,n.shape),i=gf(n,r,t);let s=i.shape;t||(s=Qi(i.shape,r));const a=Es(sn(Kn(n,"float32"),Re(i,s))),o=gf(a,r,t);return{mean:i,variance:o}}const c9=q({moments_:l9});function u9(n,e,t,r){const i=$(e,"data","multiRNNCell"),s=df(t,"c","multiRNNCell"),a=df(r,"h","multiRNNCell");let o=i;const A=[];for(let u=0;u<n.length;u++){const h=n[u](o,s[u],a[u]);A.push(h[0]),A.push(h[1]),o=h[1]}const l=[],c=[];for(let u=0;u<A.length;u+=2)l.push(A[u]),c.push(A[u+1]);return[l,c]}const h9=q({multiRNNCell_:u9});/** 6120 * @license 6121 * Copyright 2020 Google LLC. All Rights Reserved. 6122 * Licensed under the Apache License, Version 2.0 (the "License"); 6123 * you may not use this file except in compliance with the License. 6124 * You may obtain a copy of the License at 6125 * 6126 * http://www.apache.org/licenses/LICENSE-2.0 6127 * 6128 * Unless required by applicable law or agreed to in writing, software 6129 * distributed under the License is distributed on an "AS IS" BASIS, 6130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6131 * See the License for the specific language governing permissions and 6132 * limitations under the License. 6133 * ============================================================================= 6134 */function f9(n,e,t,r=!1){const i=$(n,"logits","multinomial"),s=i.size,a=i.rank;if(s<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${s}.`);if(a>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);t=t||Math.random();const A={logits:a===1?Re(i,[1,-1]):i},l={numSamples:e,seed:t,normalized:r},c=ne.runKernel(Qw,A,l);return a===1?Re(c,[c.size]):c}const d9=q({multinomial_:f9});/** 6135 * @license 6136 * Copyright 2020 Google LLC. All Rights Reserved. 6137 * Licensed under the Apache License, Version 2.0 (the "License");
6138 * you may not use this file except in compliance with the License. 6139 * You may obtain a copy of the License at 6140 * 6141 * http://www.apache.org/licenses/LICENSE-2.0 6142 * 6143 * Unless required by applicable law or agreed to in writing, software 6144 * distributed under the License is distributed on an "AS IS" BASIS, 6145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6146 * See the License for the specific language governing permissions and 6147 * limitations under the License. 6148 * ============================================================================= 6149 */function p9(n,e){let t=$(n,"a","notEqual","string_or_numeric"),r=$(e,"b","notEqual","string_or_numeric");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r};return ne.runKernel(Gw,i)}const tC=q({notEqual_:p9});/** 6150 * @license 6151 * Copyright 2020 Google LLC. All Rights Reserved. 6152 * Licensed under the Apache License, Version 2.0 (the "License"); 6153 * you may not use this file except in compliance with the License. 6154 * You may obtain a copy of the License at 6155 * 6156 * http://www.apache.org/licenses/LICENSE-2.0 6157 * 6158 * Unless required by applicable law or agreed to in writing, software 6159 * distributed under the License is distributed on an "AS IS" BASIS, 6160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6161 * See the License for the specific language governing permissions and 6162 * limitations under the License. 6163 * ============================================================================= 6164 */function m9(n,e,t=1,r=0,i="int32"){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const a={indices:$(n,"indices","oneHot","int32")},o={dtype:i,depth:e,onValue:t,offValue:r};return ne.runKernel(jw,a,o)}const g9=q({oneHot_:m9});/** 6165 * @license 6166 * Copyright 2018 Google LLC. All Rights Reserved. 6167 * Licensed under the Apache License, Version 2.0 (the "License"); 6168 * you may not use this file except in compliance with the License. 6169 * You may obtain a copy of the License at 6170 * 6171 * http://www.apache.org/licenses/LICENSE-2.0 6172 * 6173 * Unless required by applicable law or agreed to in writing, software 6174 * distributed under the License is distributed on an "AS IS" BASIS, 6175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6176 * See the License for the specific language governing permissions and 6177 * limitations under the License. 6178 * ============================================================================= 6179 */function y9(n){const t={x:$(n,"x","onesLike")};return ne.runKernel(Xw,t)}const v9=q({onesLike_:y9});function w9(n,e){const t=$(n,"v1","outerProduct"),r=$(e,"v2","outerProduct");H(t.rank===1&&r.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${t.rank} and ${r.rank}.`);const i=Re(t,[-1,1]),s=Re(r,[1,-1]);return Un(i,s)}const x9=q({outerProduct_:w9});/** 6180 * @license 6181 * Copyright 2020 Google LLC. All Rights Reserved. 6182 * Licensed under the Apache License, Version 2.0 (the "License"); 6183 * you may not use this file except in compliance with the License. 6184 * You may obtain a copy of the License at 6185 * 6186 * http://www.apache.org/licenses/LICENSE-2.0 6187 * 6188 * Unless required by applicable law or agreed to in writing, software 6189 * distributed under the License is distributed on an "AS IS" BASIS, 6190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6191 * See the License for the specific language governing permissions and 6192 * limitations under the License. 6193 * ============================================================================= 6194 */function b9(n,e,t=0){const r=$(n,"x","pad");if(r.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:e,constantValue:t},s={x:r};return ne.runKernel(qw,s,i)}const vu=q({pad_:b9});function C9(n,e,t=0){return H(e.length===2,()=>"Invalid number of paddings. Must be length of 2."),vu(n,[e],t)}const _9=q({pad1d_:C9});function B9(n,e,t=0){return H(e.length===2&&e[0].length===2&&e[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),vu(n,e,t)}const E9=q({pad2d_:B9});function S9(n,e,t=0){return H(e.length===3&&e[0].length===2&&e[1].length===2&&e[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),vu(n,e,t)}const T9=q({pad3d_:S9});function I9(n,e,t=0){return H(e.length===4&&e[0].length===2&&e[1].length===2&&e[2].length===2&&e[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),vu(n,e,t)}const F9=q({pad4d_:I9});/** 6195 * @license 6196 * Copyright 2020 Google LLC. All Rights Reserved. 6197 * Licensed under the Apache License, Version 2.0 (the "License");
6198 * you may not use this file except in compliance with the License. 6199 * You may obtain a copy of the License at 6200 * 6201 * http://www.apache.org/licenses/LICENSE-2.0 6202 * 6203 * Unless required by applicable law or agreed to in writing, software 6204 * distributed under the License is distributed on an "AS IS" BASIS, 6205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6206 * See the License for the specific language governing permissions and 6207 * limitations under the License. 6208 * ============================================================================= 6209 */function R9(n,e,t){const r=$(n,"x","spaceToBatchND");H(r.rank>=1+e.length,()=>`input rank ${r.rank} should be > than [blockShape] ${e.length}`),H(t.length===e.length,()=>`paddings.shape[0] ${t.length} must be equal to [blockShape] ${e.length}`),H(r.shape.reduce((a,o,A)=>A>0&&A<=e.length?a&&(o+t[A-1][0]+t[A-1][1])%e[A-1]===0:a,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${t.toString()} must be divisible by blockShapes ${e.toString()}`);const i={x:r},s={blockShape:e,paddings:t};return ne.runKernel(Tx,i,s)}const nC=q({spaceToBatchND_:R9});/** 6210 * @license 6211 * Copyright 2018 Google LLC. All Rights Reserved. 6212 * Licensed under the Apache License, Version 2.0 (the "License"); 6213 * you may not use this file except in compliance with the License. 6214 * You may obtain a copy of the License at 6215 * 6216 * http://www.apache.org/licenses/LICENSE-2.0 6217 * 6218 * Unless required by applicable law or agreed to in writing, software 6219 * distributed under the License is distributed on an "AS IS" BASIS, 6220 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6221 * See the License for the specific language governing permissions and 6222 * limitations under the License. 6223 * ============================================================================= 6224 */function U9(n,e,t,r,i,s,a){i==null&&(i=[1,1]),s==null&&(s=1),r===0&&(r="valid");const o=$(n,"x","maxPool");let A=o,l=!1;o.rank===3&&(l=!0,A=Re(o,[1,o.shape[0],o.shape[1],o.shape[2]])),H(Ti(s,i),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${i}'`);const c=CA(A.shape,e,s,i,r),u=[c.dilationHeight,c.dilationWidth];let h;r==="same"?h=N9([c.filterHeight,c.filterWidth],u):h=[[0,0],[0,0]];const f=u[0]===1&&u[1]===1,[d,g]=M9([c.inHeight,c.inWidth],u,h),m=f?r:"valid",p=f?A:nC(A,u,d),C=(t==="avg"?()=>Mb(p,e,s,m,a):()=>Zb(p,e,s,m,a))(),b=f?C:Nb(C,u,g);return l?Re(b,[b.shape[1],b.shape[2],b.shape[3]]):b}function M9(n,e,t){const r=t.map(c=>c[0]),i=t.map(c=>c[1]),s=n.concat(r,i),a=e.map((c,u)=>(c-s[u]%c)%c),o=i.map((c,u)=>c+a[u]),A=e.map((c,u)=>[r[u],o[u]]),l=e.map((c,u)=>[0,a[u]]);return[A,l]}function N9(n,e){const r=n.map((a,o)=>a+(a-1)*(e[o]-1)).map(a=>a-1),i=r.map(a=>Math.floor(a/2)),s=r.map((a,o)=>a-i[o]);return r.map((a,o)=>[i[o],s[o]])}const D9=q({pool_:U9});/** 6225 * @license 6226 * Copyright 2020 Google LLC. All Rights Reserved. 6227 * Licensed under the Apache License, Version 2.0 (the "License"); 6228 * you may not use this file except in compliance with the License. 6229 * You may obtain a copy of the License at 6230 * 6231 * http://www.apache.org/licenses/LICENSE-2.0 6232 * 6233 * Unless required by applicable law or agreed to in writing, software 6234 * distributed under the License is distributed on an "AS IS" BASIS, 6235 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6236 * See the License for the specific language governing permissions and 6237 * limitations under the License. 6238 * ============================================================================= 6239 */function L9(n,e){const t=$(n,"x","prelu"),r=$(e,"alpha","prelu"),i={x:t,alpha:r};return ne.runKernel(Zw,i)}const rC=q({prelu_:L9});/** 6240 * @license 6241 * Copyright 2020 Google LLC. All Rights Reserved. 6242 * Licensed under the Apache License, Version 2.0 (the "License"); 6243 * you may not use this file except in compliance with the License. 6244 * You may obtain a copy of the License at 6245 * 6246 * http://www.apache.org/licenses/LICENSE-2.0 6247 * 6248 * Unless required by applicable law or agreed to in writing, software 6249 * distributed under the License is distributed on an "AS IS" BASIS, 6250 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6251 * See the License for the specific language governing permissions and 6252 * limitations under the License. 6253 * ============================================================================= 6254 */function O9(n,e=null,t=!1){let r=$(n,"x","prod");r.dtype==="bool"&&(r=Kn(r,"int32"));const i={x:r},s={axis:e,keepDims:t};return ne.runKernel(ex,i,s)}const P9=q({prod_:O9});/** 6255 * @license 6256 * Copyright 2022 Google LLC. All Rights Reserved. 6257 * Licensed under the Apache License, Version 2.0 (the "License");
6258 * you may not use this file except in compliance with the License. 6259 * You may obtain a copy of the License at 6260 * 6261 * http://www.apache.org/licenses/LICENSE-2.0 6262 * 6263 * Unless required by applicable law or agreed to in writing, software 6264 * distributed under the License is distributed on an "AS IS" BASIS, 6265 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6266 * See the License for the specific language governing permissions and 6267 * limitations under the License. 6268 * ============================================================================= 6269 */function k9(n,e,t,r){const i=n.map((c,u)=>$(c,`tensors${u}`,"raggedGather","int32")),s=$(e,"paramsDenseValues","raggedGather"),a=$(t,"indices","raggedGather","int32"),o={paramsNestedSplits:i,paramsDenseValues:s,indices:a},A={outputRaggedRank:r},l=ne.runKernel(tx,o,A);return{outputNestedSplits:l.slice(0,l.length-1),outputDenseValues:l[l.length-1]}}const $9=q({raggedGather_:k9});/** 6270 * @license 6271 * Copyright 2022 Google LLC. 6272 * Licensed under the Apache License, Version 2.0 (the "License"); 6273 * you may not use this file except in compliance with the License. 6274 * You may obtain a copy of the License at 6275 * 6276 * http://www.apache.org/licenses/LICENSE-2.0 6277 * 6278 * Unless required by applicable law or agreed to in writing, software 6279 * distributed under the License is distributed on an "AS IS" BASIS, 6280 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6281 * See the License for the specific language governing permissions and 6282 * limitations under the License. 6283 * ============================================================================= 6284 */function Q9(n,e,t){const r=$(n,"starts","raggedRange"),i=$(e,"limits","raggedRange",r.dtype),s=$(t,"deltas","raggedRange",r.dtype),a={starts:r,limits:i,deltas:s},o=ne.runKernel(nx,a);return{rtNestedSplits:o[0],rtDenseValues:o[1]}}const H9=q({raggedRange_:Q9});/** 6285 * @license 6286 * Copyright 2022 Google LLC. All Rights Reserved. 6287 * Licensed under the Apache License, Version 2.0 (the "License"); 6288 * you may not use this file except in compliance with the License. 6289 * You may obtain a copy of the License at 6290 * 6291 * http://www.apache.org/licenses/LICENSE-2.0 6292 * 6293 * Unless required by applicable law or agreed to in writing, software 6294 * distributed under the License is distributed on an "AS IS" BASIS, 6295 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6296 * See the License for the specific language governing permissions and 6297 * limitations under the License. 6298 * ============================================================================= 6299 */function V9(n,e,t,r,i){const s=$(n,"shape","raggedTensorToTensor","int32"),a=$(e,"values","raggedTensorToTensor"),o=$(t,"defaultValue","raggedTensorToTensor",a.dtype),A=r.map((u,h)=>$(u,`tensors${h}`,"raggedTensorToTensor","int32")),l={shape:s,values:a,defaultValue:o,rowPartitionTensors:A},c={rowPartitionTypes:i};return ne.runKernel(rx,l,c)}const G9=q({raggedTensorToTensor_:V9});/** 6300 * @license 6301 * Copyright 2020 Google LLC. All Rights Reserved. 6302 * Licensed under the Apache License, Version 2.0 (the "License"); 6303 * you may not use this file except in compliance with the License. 6304 * You may obtain a copy of the License at 6305 * 6306 * http://www.apache.org/licenses/LICENSE-2.0 6307 * 6308 * Unless required by applicable law or agreed to in writing, software 6309 * distributed under the License is distributed on an "AS IS" BASIS, 6310 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6311 * See the License for the specific language governing permissions and 6312 * limitations under the License. 6313 * ============================================================================= 6314 */function z9(n,e,t){ki(n);const r=ze(n);let i=null;if(t==null||t==="float32")i=new Float32Array(r);else if(t==="int32")i=new Int32Array(r);else if(t==="bool")i=new Uint8Array(r);else throw new Error(`Unknown data type ${t}`);for(let s=0;s<r;s++)i[s]=e();return ne.makeTensor(i,n,t)}const W9=q({rand_:z9});var iC={exports:{}};(function(n){(function(e,t,r){function i(A){var l=this,c=o();l.next=function(){var u=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=u-(l.c=u|0)},l.c=1,l.s0=c(" "),l.s1=c(" "),l.s2=c(" "),l.s0-=c(A),l.s0<0&&(l.s0+=1),l.s1-=c(A),l.s1<0&&(l.s1+=1),l.s2-=c(A),l.s2<0&&(l.s2+=1),c=null}function s(A,l){return l.c=A.c,l.s0=A.s0,l.s1=A.s1,l.s2=A.s2,l}function a(A,l){var c=new i(A),u=l&&l.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,u&&(typeof u=="object"&&s(u,c),h.state=function(){return s(c,{})}),h}function o(){var A=4022871197,l=function(c){c=String(c);for(var u=0;u<c.length;u++){A+=c.charCodeAt(u);var h=.02519603282416938*A;A=h>>>0,h-=A,h*=A,A=h>>>0,h-=A,A+=h*4294967296}return(A>>>0)*23283064365386963e-26};return l}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.alea=a})(Li,n,!1)})(iC);var sC={exports:{}};(function(n){(function(e,t,r){function i(o){var A=this,l="";A.x=0,A.y=0,A.z=0,A.w=0,A.next=function(){var u=A.x^A.x<<11;return A.x=A.y,A.y=A.z,A.z=A.w,A.w^=A.w>>>19^u^u>>>8},o===(o|0)?A.x=o:l+=o;for(var c=0;c<l.length+64;c++)A.x^=l.charCodeAt(c)|0,A.next()}function s(o,A){return A.x=o.x,A.y=o.y,A.z=o.z,A.w=o.w,A}function a(o,A){var l=new i(o),c=A&&A.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var h=l.next()>>>11,f=(l.next()>>>0)/4294967296,d=(h+f)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,c&&(typeof c=="object"&&s(c,l),u.state=function(){return s(l,{})}),u}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xor128=a})(Li,n,!1)})(sC);var aC={exports:{}};(function(n){(function(e,t,r){function i(o){var A=this,l="";A.next=function(){var u=A.x^A.x>>>2;return A.x=A.y,A.y=A.z,A.z=A.w,A.w=A.v,(A.d=A.d+362437|0)+(A.v=A.v^A.v<<4^(u^u<<1))|0},A.x=0,A.y=0,A.z=0,A.w=0,A.v=0,o===(o|0)?A.x=o:l+=o;for(var c=0;c<l.length+64;c++)A.x^=l.charCodeAt(c)|0,c==l.length&&(A.d=A.x<<10^A.x>>>4),A.next()}function s(o,A){return A.x=o.x,A.y=o.y,A.z=o.z,A.w=o.w,A.v=o.v,A.d=o.d,A}function a(o,A){var l=new i(o),c=A&&A.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var h=l.next()>>>11,f=(l.next()>>>0)/4294967296,d=(h+f)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,c&&(typeof c=="object"&&s(c,l),u.state=function(){return s(l,{})}),u}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xorwow=a})(Li,n,!1)})(aC);var oC={exports:{}};(function(n){(function(e,t,r){function i(o){var A=this;A.next=function(){var c=A.x,u=A.i,h,f;return h=c[u],h^=h>>>7,f=h^h<<24,h=c[u+1&7],f^=h^h>>>10,h=c[u+3&7],f^=h^h>>>3,h=c[u+4&7],f^=h^h<<7,h=c[u+7&7],h=h^h<<13,f^=h^h<<9,c[u]=f,A.i=u+1&7,f};function l(c,u){var h,f=[];if(u===(u|0))f[0]=u;else for(u=""+u,h=0;h<u.length;++h)f[h&7]=f[h&7]<<15^u.charCodeAt(h)+f[h+1&7]<<13;for(;f.length<8;)f.push(0);for(h=0;h<8&&f[h]===0;++h);for(h==8?f[7]=-1:f[h],c.x=f,c.i=0,h=256;h>0;--h)c.next()}l(A,o)}function s(o,A){return A.x=o.x.slice(),A.i=o.i,A}function a(o,A){o==null&&(o=+new Date);var l=new i(o),c=A&&A.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var h=l.next()>>>11,f=(l.next()>>>0)/4294967296,d=(h+f)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,c&&(c.x&&s(c,l),u.state=function(){return s(l,{})}),u}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xorshift7=a})(Li,n,!1)})(oC);var AC={exports:{}};(function(n){(function(e,t,r){function i(o){var A=this;A.next=function(){var c=A.w,u=A.X,h=A.i,f,d;return A.w=c=c+1640531527|0,d=u[h+34&127],f=u[h=h+1&127],d^=d<<13,f^=f<<17,d^=d>>>15,f^=f>>>12,d=u[h]=d^f,A.i=h,d+(c^c>>>16)|0};function l(c,u){var h,f,d,g,m,p=[],w=128;
vendor: 5,000 bytes, lines 6314-6329
6314for(u===(u|0)?(f=u,u=null):(u=u+"\0",f=0,w=Math.max(w,u.length)),d=0,g=-32;g<w;++g)u&&(f^=u.charCodeAt((g+32)%u.length)),g===0&&(m=f),f^=f<<10,f^=f>>>15,f^=f<<4,f^=f>>>13,g>=0&&(m=m+1640531527|0,h=p[g&127]^=f+m,d=h==0?d+1:0);for(d>=128&&(p[(u&&u.length||0)&127]=-1),d=127,g=4*128;g>0;--g)f=p[d+34&127],h=p[d=d+1&127],f^=f<<13,h^=h<<17,f^=f>>>15,h^=h>>>12,p[d]=f^h;c.w=m,c.X=p,c.i=d}l(A,o)}function s(o,A){return A.i=o.i,A.w=o.w,A.X=o.X.slice(),A}function a(o,A){o==null&&(o=+new Date);var l=new i(o),c=A&&A.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var h=l.next()>>>11,f=(l.next()>>>0)/4294967296,d=(h+f)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,c&&(c.X&&s(c,l),u.state=function(){return s(l,{})}),u}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xor4096=a})(Li,n,!1)})(AC);var lC={exports:{}};(function(n){(function(e,t,r){function i(o){var A=this,l="";A.next=function(){var u=A.b,h=A.c,f=A.d,d=A.a;return u=u<<25^u>>>7^h,h=h-f|0,f=f<<24^f>>>8^d,d=d-u|0,A.b=u=u<<20^u>>>12^h,A.c=h=h-f|0,A.d=f<<16^h>>>16^d,A.a=d-u|0},A.a=0,A.b=0,A.c=-1640531527,A.d=1367130551,o===Math.floor(o)?(A.a=o/4294967296|0,A.b=o|0):l+=o;for(var c=0;c<l.length+20;c++)A.b^=l.charCodeAt(c)|0,A.next()}function s(o,A){return A.a=o.a,A.b=o.b,A.c=o.c,A.d=o.d,A}function a(o,A){var l=new i(o),c=A&&A.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var h=l.next()>>>11,f=(l.next()>>>0)/4294967296,d=(h+f)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,c&&(typeof c=="object"&&s(c,l),u.state=function(){return s(l,{})}),u}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.tychei=a})(Li,n,!1)})(lC);var cC={exports:{}};(function(n){(function(e,t,r){var i=256,s=6,a=52,o="random",A=r.pow(i,s),l=r.pow(2,a),c=l*2,u=i-1,h;function f(b,U,F){var D=[];U=U==!0?{entropy:!0}:U||{};var O=p(m(U.entropy?[b,C(t)]:b==null?w():b,3),D),I=new d(D),R=function(){for(var V=I.g(s),re=A,Y=0;V<l;)V=(V+Y)*i,re*=i,Y=I.g(1);for(;V>=c;)V/=2,re/=2,Y>>>=1;return(V+Y)/re};return R.int32=function(){return I.g(4)|0},R.quick=function(){return I.g(4)/4294967296},R.double=R,p(C(I.S),t),(U.pass||F||function(V,re,Y,se){return se&&(se.S&&g(se,I),V.state=function(){return g(I,{})}),Y?(r[o]=V,re):V})(R,O,"global"in U?U.global:this==r,U.state)}function d(b){var U,F=b.length,D=this,O=0,I=D.i=D.j=0,R=D.S=[];for(F||(b=[F++]);O<i;)R[O]=O++;for(O=0;O<i;O++)R[O]=R[I=u&I+b[O%F]+(U=R[O])],R[I]=U;(D.g=function(V){for(var re,Y=0,se=D.i,ge=D.j,ue=D.S;V--;)re=ue[se=u&se+1],Y=Y*i+ue[u&(ue[se]=ue[ge=u&ge+re])+(ue[ge]=re)];return D.i=se,D.j=ge,Y})(i)}function g(b,U){return U.i=b.i,U.j=b.j,U.S=b.S.slice(),U}function m(b,U){var F=[],D=typeof b,O;if(U&&D=="object")for(O in b)try{F.push(m(b[O],U-1))}catch{}return F.length?F:D=="string"?b:b+"\0"}function p(b,U){for(var F=b+"",D,O=0;O<F.length;)U[u&O]=u&(D^=U[u&O]*19)+F.charCodeAt(O++);return C(U)}function w(){try{var b;return h&&(b=h.randomBytes)?b=b(i):(b=new Uint8Array(i),(e.crypto||e.msCrypto).getRandomValues(b)),C(b)}catch{var U=e.navigator,F=U&&U.plugins;return[+new Date,e,F,e.screen,C(t)]}}function C(b){return String.fromCharCode.apply(0,b)}if(p(r.random(),t),n.exports){n.exports=f;try{h=zE}catch{}}else r["seed"+o]=f})(typeof self<"u"?self:Li,[],Math)})(cC);var K9=iC.exports,X9=sC.exports,j9=aC.exports,Y9=oC.exports,q9=AC.exports,J9=lC.exports,_A=cC.exports;_A.alea=K9;_A.xor128=X9;_A.xorwow=j9;_A.xorshift7=Y9;_A.xor4096=q9;_A.tychei=J9;var Pg=_A;/** 6315 * @license 6316 * Copyright 2018 Google LLC. All Rights Reserved. 6317 * Licensed under the Apache License, Version 2.0 (the "License"); 6318 * you may not use this file except in compliance with the License. 6319 * You may obtain a copy of the License at 6320 * 6321 * http://www.apache.org/licenses/LICENSE-2.0 6322 * 6323 * Unless required by applicable law or agreed to in writing, software 6324 * distributed under the License is distributed on an "AS IS" BASIS, 6325 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6326 * See the License for the specific language governing permissions and 6327 * limitations under the License. 6328 * ============================================================================= 6329 */class kg{constructor(e,t,r,i,s){this.mean=e,this.stdDev=t,this.dtype=r,this.nextVal=NaN,this.truncated=i,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);const a=s||Math.random();this.random=Pg.alea(a.toString())}nextValue(){if(!isNaN(this.nextVal)){const i=this.nextVal;return this.nextVal=NaN,i}let e,t,r=!1;for(;!r;){let i,s,a;do i=2*this.random()-1,s=2*this.random()-1,a=i*i+s*s;while(a>=1||a===0);const o=Math.sqrt(-2*Math.log(a)/a);e=this.mean+this.stdDev*i*o,t=this.mean+this.stdDev*s*o,(!this.truncated||this.isValidTruncated(e))&&(r=!0)}return(!this.truncated||this.isValidTruncated(t))&&(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}
vendor: 4,236 bytes, lines 6329-6383
6329class Z9{constructor(e,t,r,i){this.alpha=e,this.beta=1/t,this.dtype=r;const s=i||Math.random();this.randu=Pg.alea(s.toString()),this.randn=new kg(0,1,r,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,r,i,s,a;for(;;){do i=this.randn.nextValue(),a=1+this.c*i;while(a<=0);if(a*=a*a,e=i*i,t=1-.331*e*e,r=.5*e+this.d*(1-a+Math.log(a)),s=this.randu(),s<t||Math.log(s)<r)break}return a=1/this.beta*this.d*a,this.alpha<1&&(a*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(a)}convertValue(e){return this.dtype==="float32"?e:Math.round(e)}}class eL{constructor(e=0,t=1,r,i){if(this.canReturnFloat=()=>this.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=r,i==null&&(i=Math.random()),typeof i=="number"&&(i=i.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=Pg.alea(i)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}/** 6330 * @license 6331 * Copyright 2020 Google LLC. All Rights Reserved. 6332 * Licensed under the Apache License, Version 2.0 (the "License"); 6333 * you may not use this file except in compliance with the License. 6334 * You may obtain a copy of the License at 6335 * 6336 * http://www.apache.org/licenses/LICENSE-2.0 6337 * 6338 * Unless required by applicable law or agreed to in writing, software 6339 * distributed under the License is distributed on an "AS IS" BASIS, 6340 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6341 * See the License for the specific language governing permissions and 6342 * limitations under the License. 6343 * ============================================================================= 6344 */function tL(n,e,t=1,r="float32",i){if(ki(n),t==null&&(t=1),r==null&&(r="float32"),r!=="float32"&&r!=="int32")throw new Error(`Unsupported data type ${r}`);const s=new Z9(e,t,r,i),a=ir(n,r);for(let o=0;o<a.values.length;o++)a.values[o]=s.nextValue();return a.toTensor()}const nL=q({randomGamma_:tL});/** 6345 * @license 6346 * Copyright 2020 Google LLC. All Rights Reserved. 6347 * Licensed under the Apache License, Version 2.0 (the "License"); 6348 * you may not use this file except in compliance with the License. 6349 * You may obtain a copy of the License at 6350 * 6351 * http://www.apache.org/licenses/LICENSE-2.0 6352 * 6353 * Unless required by applicable law or agreed to in writing, software 6354 * distributed under the License is distributed on an "AS IS" BASIS, 6355 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6356 * See the License for the specific language governing permissions and 6357 * limitations under the License. 6358 * ============================================================================= 6359 */function rL(n,e=0,t=1,r,i){if(ki(n),r!=null&&r==="bool")throw new Error(`Unsupported data type ${r}`);const s=new kg(e,t,r,!1,i),a=ir(n,r);for(let o=0;o<a.values.length;o++)a.values[o]=s.nextValue();return a.toTensor()}const uC=q({randomNormal_:rL});/** 6360 * @license 6361 * Copyright 2022 Google LLC. All Rights Reserved. 6362 * Licensed under the Apache License, Version 2.0 (the "License"); 6363 * you may not use this file except in compliance with the License. 6364 * You may obtain a copy of the License at 6365 * 6366 * http://www.apache.org/licenses/LICENSE-2.0 6367 * 6368 * Unless required by applicable law or agreed to in writing, software 6369 * distributed under the License is distributed on an "AS IS" BASIS, 6370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6371 * See the License for the specific language governing permissions and 6372 * limitations under the License. 6373 * ============================================================================= 6374 */function iL(n,e,t){if(e!=null&&e==="bool")throw new Error(`Unsupported data type ${e}`);return uC(n,0,1,e,t)}const sL=q({randomStandardNormal_:iL});/** 6375 * @license 6376 * Copyright 2020 Google LLC. All Rights Reserved. 6377 * Licensed under the Apache License, Version 2.0 (the "License"); 6378 * you may not use this file except in compliance with the License. 6379 * You may obtain a copy of the License at 6380 * 6381 * http://www.apache.org/licenses/LICENSE-2.0 6382 * 6383 * Unless required by applicable law or agreed to in writing, softw
6383are 6384 * distributed under the License is distributed on an "AS IS" BASIS, 6385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6386 * See the License for the specific language governing permissions and 6387 * limitations under the License. 6388 * ============================================================================= 6389 */function aL(n,e=0,t=1,r="float32",i){ki(n);const s=ir(n,r),a=new eL(e,t,null,i);for(let o=0;o<s.values.length;o++)s.values[o]=a.nextValue();return s.toTensor()}const $g=q({randomUniform_:aL});/** 6390 * @license 6391 * Copyright 2023 Google LLC. 6392 * Licensed under the Apache License, Version 2.0 (the "License"); 6393 * you may not use this file except in compliance with the License. 6394 * You may obtain a copy of the License at 6395 * 6396 * http://www.apache.org/licenses/LICENSE-2.0 6397 * 6398 * Unless required by applicable law or agreed to in writing, software 6399 * distributed under the License is distributed on an "AS IS" BASIS, 6400 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6401 * See the License for the specific language governing permissions and 6402 * limitations under the License. 6403 * ============================================================================= 6404 */function oL(n,e,t,r){return $g(n,e,t,"int32",r)}const AL=q({randomUniformInt_:oL});/** 6405 * @license 6406 * Copyright 2018 Google LLC. All Rights Reserved. 6407 * Licensed under the Apache License, Version 2.0 (the "License"); 6408 * you may not use this file except in compliance with the License. 6409 * You may obtain a copy of the License at 6410 * 6411 * http://www.apache.org/licenses/LICENSE-2.0 6412 * 6413 * Unless required by applicable law or agreed to in writing, software 6414 * distributed under the License is distributed on an "AS IS" BASIS, 6415 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6416 * See the License for the specific language governing permissions and 6417 * limitations under the License. 6418 * ============================================================================= 6419 */function Jc(n,e,t=1,r="float32"){if(t===0)throw new Error("Cannot have a step of zero");const i={start:n,stop:e,step:t,dtype:r};return ne.runKernel(ix,{},i)}/** 6420 * @license 6421 * Copyright 2020 Google LLC. All Rights Reserved. 6422 * Licensed under the Apache License, Version 2.0 (the "License"); 6423 * you may not use this file except in compliance with the License. 6424 * You may obtain a copy of the License at 6425 * 6426 * http://www.apache.org/licenses/LICENSE-2.0 6427 * 6428 * Unless required by applicable law or agreed to in writing, software 6429 * distributed under the License is distributed on an "AS IS" BASIS, 6430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6431 * See the License for the specific language governing permissions and 6432 * limitations under the License. 6433 * ============================================================================= 6434 */function lL(n){const t={input:$(n,"input","real")};return ne.runKernel(sx,t)}const Zc=q({real_:lL});/** 6435 * @license 6436 * Copyright 2018 Google LLC. All Rights Reserved. 6437 * Licensed under the Apache License, Version 2.0 (the "License"); 6438 * you may not use this file except in compliance with the License. 6439 * You may obtain a copy of the License at 6440 * 6441 * http://www.apache.org/licenses/LICENSE-2.0 6442 * 6443 * Unless required by applicable law or agreed to in writing, software 6444 * distributed under the License is distributed on an "AS IS" BASIS, 6445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6446 * See the License for the specific language governing permissions and 6447 * limitations under the License. 6448 * ============================================================================= 6449 */function cL(n){const t={x:$(n,"x","reciprocal")};return ne.runKernel(ax,t)}const uL=q({reciprocal_:cL});/** 6450 * @license 6451 * Copyright 2020 Google LLC. All Rights Reserved. 6452 * Licensed under the Apache License, Version 2.0 (the "License"); 6453 * you may not use this file except in compliance with the License. 6454 * You may obtain a copy of the License at 6455 * 6456 * http://www.apache.org/licenses/LICENSE-2.0 6457 * 6458 * Unless required by applicable law or agreed to in writing, softw
6458are 6459 * distributed under the License is distributed on an "AS IS" BASIS, 6460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6461 * See the License for the specific language governing permissions and 6462 * limitations under the License. 6463 * ============================================================================= 6464 */function hL(n){const t={x:$(n,"x","relu")};return ne.runKernel(ox,t)}const qf=q({relu_:hL});/** 6465 * @license 6466 * Copyright 2020 Google LLC. All Rights Reserved. 6467 * Licensed under the Apache License, Version 2.0 (the "License"); 6468 * you may not use this file except in compliance with the License. 6469 * You may obtain a copy of the License at 6470 * 6471 * http://www.apache.org/licenses/LICENSE-2.0 6472 * 6473 * Unless required by applicable law or agreed to in writing, software 6474 * distributed under the License is distributed on an "AS IS" BASIS, 6475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6476 * See the License for the specific language governing permissions and 6477 * limitations under the License. 6478 * ============================================================================= 6479 */function fL(n){const t={x:$(n,"x","relu6")};return ne.runKernel(ux,t)}const hC=q({relu6_:fL});/** 6480 * @license 6481 * Copyright 2018 Google LLC. All Rights Reserved. 6482 * Licensed under the Apache License, Version 2.0 (the "License"); 6483 * you may not use this file except in compliance with the License. 6484 * You may obtain a copy of the License at 6485 * 6486 * http://www.apache.org/licenses/LICENSE-2.0 6487 * 6488 * Unless required by applicable law or agreed to in writing, software 6489 * distributed under the License is distributed on an "AS IS" BASIS, 6490 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6491 * See the License for the specific language governing permissions and 6492 * limitations under the License. 6493 * ============================================================================= 6494 */function dL(n,e){const r={x:$(n,"x","reverse")},i={dims:e};return ne.runKernel(hx,r,i)}const mA=q({reverse_:dL});/** 6495 * @license 6496 * Copyright 2020 Google LLC. All Rights Reserved. 6497 * Licensed under the Apache License, Version 2.0 (the "License"); 6498 * you may not use this file except in compliance with the License. 6499 * You may obtain a copy of the License at 6500 * 6501 * http://www.apache.org/licenses/LICENSE-2.0 6502 * 6503 * Unless required by applicable law or agreed to in writing, software 6504 * distributed under the License is distributed on an "AS IS" BASIS, 6505 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6506 * See the License for the specific language governing permissions and 6507 * limitations under the License. 6508 * ============================================================================= 6509 */function pL(n){const e=$(n,"x","reverse");return H(e.rank===1,()=>`Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`),mA(e,0)}const mL=q({reverse1d_:pL});/** 6510 * @license 6511 * Copyright 2020 Google LLC. All Rights Reserved. 6512 * Licensed under the Apache License, Version 2.0 (the "License"); 6513 * you may not use this file except in compliance with the License. 6514 * You may obtain a copy of the License at 6515 * 6516 * http://www.apache.org/licenses/LICENSE-2.0 6517 * 6518 * Unless required by applicable law or agreed to in writing, software 6519 * distributed under the License is distributed on an "AS IS" BASIS, 6520 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6521 * See the License for the specific language governing permissions and 6522 * limitations under the License. 6523 * ============================================================================= 6524 */function gL(n,e){const t=$(n,"x","reverse");return H(t.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${t.rank}.`),mA(t,e)}const yL=q({reverse2d_:gL});/** 6525 * @license 6526 * Copyright 2020 Google LLC. All Rights Reserved. 6527 * Licensed under the Apache License, Version 2.0 (the "License"); 6528 * you may not use this file except in compliance with the License. 6529 * You may obtain a copy of the License at 6530 * 6531 * http://www.apache.org/licenses/LICENSE-2.0 6532 * 6533 * Unless required by applicable law or agreed to in writing, softw
6533are 6534 * distributed under the License is distributed on an "AS IS" BASIS, 6535 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6536 * See the License for the specific language governing permissions and 6537 * limitations under the License. 6538 * ============================================================================= 6539 */function vL(n,e){const t=$(n,"x","reverse");return H(t.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${t.rank}.`),mA(t,e)}const wL=q({reverse3d_:vL});/** 6540 * @license 6541 * Copyright 2020 Google LLC. All Rights Reserved. 6542 * Licensed under the Apache License, Version 2.0 (the "License"); 6543 * you may not use this file except in compliance with the License. 6544 * You may obtain a copy of the License at 6545 * 6546 * http://www.apache.org/licenses/LICENSE-2.0 6547 * 6548 * Unless required by applicable law or agreed to in writing, software 6549 * distributed under the License is distributed on an "AS IS" BASIS, 6550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6551 * See the License for the specific language governing permissions and 6552 * limitations under the License. 6553 * ============================================================================= 6554 */function xL(n,e){const t=$(n,"x","reverse");return H(t.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${t.rank}.`),mA(t,e)}const bL=q({reverse4d_:xL});/** 6555 * @license 6556 * Copyright 2018 Google LLC. All Rights Reserved. 6557 * Licensed under the Apache License, Version 2.0 (the "License"); 6558 * you may not use this file except in compliance with the License. 6559 * You may obtain a copy of the License at 6560 * 6561 * http://www.apache.org/licenses/LICENSE-2.0 6562 * 6563 * Unless required by applicable law or agreed to in writing, software 6564 * distributed under the License is distributed on an "AS IS" BASIS, 6565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6566 * See the License for the specific language governing permissions and 6567 * limitations under the License. 6568 * ============================================================================= 6569 */function CL(n){const t={x:$(n,"x","round")};return ne.runKernel(fx,t)}const fC=q({round_:CL});/** 6570 * @license 6571 * Copyright 2018 Google LLC. All Rights Reserved. 6572 * Licensed under the Apache License, Version 2.0 (the "License"); 6573 * you may not use this file except in compliance with the License. 6574 * You may obtain a copy of the License at 6575 * 6576 * http://www.apache.org/licenses/LICENSE-2.0 6577 * 6578 * Unless required by applicable law or agreed to in writing, software 6579 * distributed under the License is distributed on an "AS IS" BASIS, 6580 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6581 * See the License for the specific language governing permissions and 6582 * limitations under the License. 6583 * ============================================================================= 6584 */function _L(n){const t={x:$(n,"x","rsqrt","float32")};return ne.runKernel(dx,t)}const BL=q({rsqrt_:_L});/** 6585 * @license 6586 * Copyright 2020 Google LLC. All Rights Reserved. 6587 * Licensed under the Apache License, Version 2.0 (the "License"); 6588 * you may not use this file except in compliance with the License. 6589 * You may obtain a copy of the License at 6590 * 6591 * http://www.apache.org/licenses/LICENSE-2.0 6592 * 6593 * Unless required by applicable law or agreed to in writing, software 6594 * distributed under the License is distributed on an "AS IS" BASIS, 6595 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6596 * See the License for the specific language governing permissions and 6597 * limitations under the License. 6598 * ============================================================================= 6599 */function EL(n){const t={x:$(n,"x","selu")};return ne.runKernel(vx,t)}const SL=q({selu_:EL});function TL(n,e,t,r,i,s=[1,1],a="NHWC"){const o=$(n,"x","separableConv2d"),A=$(e,"depthwiseFilter","separableConv2d"),l=$(t,"pointwiseFilter","separableConv2d");let c=o,u=!1;if(o.rank===3&&(u=!0,c=Re(o,[1,o.shape[0],o.shape[1],o.shape[2]])),a==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");H(c.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`),H(A.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${A.rank}.`),H(l.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${A.rank}.`),H(l.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${l.shape[0]}.`),H(l.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${l.shape[1]}.`);const h=A.shape[2],f=A.shape[3];H(l.shape[2]===h*f,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${h*f}, but got ${l.shape[2]}.`);const d=Mg(c,A,r,i,a,s),m=Kf(d,l,1,"valid",a);return u?Re(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const IL=q({separableConv2d_:TL});/** 6600 * @license 6601 * Copyright 2020 Google Inc. All Rights Reserved. 6602 * Licensed under the Apache License, Version 2.0 (the "License");
6603 * you may not use this file except in compliance with the License. 6604 * You may obtain a copy of the License at 6605 * 6606 * http://www.apache.org/licenses/LICENSE-2.0 6607 * 6608 * Unless required by applicable law or agreed to in writing, software 6609 * distributed under the License is distributed on an "AS IS" BASIS, 6610 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6611 * See the License for the specific language governing permissions and 6612 * limitations under the License. 6613 * ============================================================================= 6614 */async function FL(n,e){const t=$(n,"x","setdiff1d"),r=$(e,"y","setdiff1d");H(t.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${t.dtype}) and y (${r.dtype}).`),H(t.rank===1,()=>`x should be 1D tensor, but got x (${t.shape}).`),H(r.rank===1,()=>`y should be 1D tensor, but got y (${r.shape}).`);const i=await t.data(),s=await r.data(),a=new Set(s);let o=0;for(let c=0;c<i.length;c++)a.has(i[c])||o++;const A=new Fl([o],t.dtype),l=new Fl([o],"int32");for(let c=0,u=0;c<i.length;c++)a.has(i[c])||(A.values[u]=i[c],l.values[u]=c,u++);return[A.toTensor(),l.toTensor()]}const RL=FL;/** 6615 * @license 6616 * Copyright 2018 Google LLC. All Rights Reserved. 6617 * Licensed under the Apache License, Version 2.0 (the "License"); 6618 * you may not use this file except in compliance with the License. 6619 * You may obtain a copy of the License at 6620 * 6621 * http://www.apache.org/licenses/LICENSE-2.0 6622 * 6623 * Unless required by applicable law or agreed to in writing, software 6624 * distributed under the License is distributed on an "AS IS" BASIS, 6625 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6626 * See the License for the specific language governing permissions and 6627 * limitations under the License. 6628 * ============================================================================= 6629 */function UL(n){const t={x:$(n,"x","sign")};return ne.runKernel(Cx,t)}const ML=q({sign_:UL});/** 6630 * @license 6631 * Copyright 2018 Google LLC. All Rights Reserved. 6632 * Licensed under the Apache License, Version 2.0 (the "License"); 6633 * you may not use this file except in compliance with the License. 6634 * You may obtain a copy of the License at 6635 * 6636 * http://www.apache.org/licenses/LICENSE-2.0 6637 * 6638 * Unless required by applicable law or agreed to in writing, software 6639 * distributed under the License is distributed on an "AS IS" BASIS, 6640 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6641 * See the License for the specific language governing permissions and 6642 * limitations under the License. 6643 * ============================================================================= 6644 */function NL(n){const t={x:$(n,"x","sin","float32")};return ne.runKernel(xx,t)}const DL=q({sin_:NL});/** 6645 * @license 6646 * Copyright 2018 Google LLC. All Rights Reserved. 6647 * Licensed under the Apache License, Version 2.0 (the "License"); 6648 * you may not use this file except in compliance with the License. 6649 * You may obtain a copy of the License at 6650 * 6651 * http://www.apache.org/licenses/LICENSE-2.0 6652 * 6653 * Unless required by applicable law or agreed to in writing, software 6654 * distributed under the License is distributed on an "AS IS" BASIS, 6655 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6656 * See the License for the specific language governing permissions and 6657 * limitations under the License. 6658 * ============================================================================= 6659 */function LL(n){const t={x:$(n,"x","sinh")};return ne.runKernel(bx,t)}const OL=q({sinh_:LL});/** 6660 * @license 6661 * Copyright 2018 Google LLC. All Rights Reserved. 6662 * Licensed under the Apache License, Version 2.0 (the "License"); 6663 * you may not use this file except in compliance with the License. 6664 * You may obtain a copy of the License at 6665 * 6666 * http://www.apache.org/licenses/LICENSE-2.0 6667 * 6668 * Unless required by applicable law or agreed to in writing, software 6669 * distributed under the License is distributed on an "AS IS" BASIS, 6670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6671 * See the License for the specific language governing permissions and 6672 * limitations under the License. 6673 * ============================================================================= 6674 */function PL(n,e,t){const r=$(n,"x","slice1d");return H(r.rank===1,()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),rn(r,[e],[t])}const kL=q({slice1d_:PL});/** 6675 * @license 6676 * Copyright 2018 Google LLC. All Rights Reserved. 6677 * Licensed under the Apache License, Version 2.0 (the "License");
6678 * you may not use this file except in compliance with the License. 6679 * You may obtain a copy of the License at 6680 * 6681 * http://www.apache.org/licenses/LICENSE-2.0 6682 * 6683 * Unless required by applicable law or agreed to in writing, software 6684 * distributed under the License is distributed on an "AS IS" BASIS, 6685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6686 * See the License for the specific language governing permissions and 6687 * limitations under the License. 6688 * ============================================================================= 6689 */function $L(n,e,t){const r=$(n,"x","slice2d");return H(r.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),rn(r,e,t)}const QL=q({slice2d_:$L});/** 6690 * @license 6691 * Copyright 2018 Google LLC. All Rights Reserved. 6692 * Licensed under the Apache License, Version 2.0 (the "License"); 6693 * you may not use this file except in compliance with the License. 6694 * You may obtain a copy of the License at 6695 * 6696 * http://www.apache.org/licenses/LICENSE-2.0 6697 * 6698 * Unless required by applicable law or agreed to in writing, software 6699 * distributed under the License is distributed on an "AS IS" BASIS, 6700 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6701 * See the License for the specific language governing permissions and 6702 * limitations under the License. 6703 * ============================================================================= 6704 */function HL(n,e,t){const r=$(n,"x","slice3d");return H(r.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),rn(r,e,t)}const VL=q({slice3d_:HL});/** 6705 * @license 6706 * Copyright 2018 Google LLC. All Rights Reserved. 6707 * Licensed under the Apache License, Version 2.0 (the "License"); 6708 * you may not use this file except in compliance with the License. 6709 * You may obtain a copy of the License at 6710 * 6711 * http://www.apache.org/licenses/LICENSE-2.0 6712 * 6713 * Unless required by applicable law or agreed to in writing, software 6714 * distributed under the License is distributed on an "AS IS" BASIS, 6715 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6716 * See the License for the specific language governing permissions and 6717 * limitations under the License. 6718 * ============================================================================= 6719 */function GL(n,e,t){const r=$(n,"x","slice4d");return H(r.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),rn(r,e,t)}const zL=q({slice4d_:GL});/** 6720 * @license 6721 * Copyright 2018 Google LLC. All Rights Reserved. 6722 * Licensed under the Apache License, Version 2.0 (the "License"); 6723 * you may not use this file except in compliance with the License. 6724 * You may obtain a copy of the License at 6725 * 6726 * http://www.apache.org/licenses/LICENSE-2.0 6727 * 6728 * Unless required by applicable law or agreed to in writing, software 6729 * distributed under the License is distributed on an "AS IS" BASIS, 6730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6731 * See the License for the specific language governing permissions and 6732 * limitations under the License. 6733 * ============================================================================= 6734 */function WL(n,e=-1){const t=$(n,"logits","softmax","float32");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and dim was ${e}`);const r={logits:t},i={dim:e};return ne.runKernel(Fx,r,i)}const KL=q({softmax_:WL});/** 6735 * @license 6736 * Copyright 2020 Google LLC. All Rights Reserved. 6737 * Licensed under the Apache License, Version 2.0 (the "License"); 6738 * you may not use this file except in compliance with the License. 6739 * You may obtain a copy of the License at 6740 * 6741 * http://www.apache.org/licenses/LICENSE-2.0 6742 * 6743 * Unless required by applicable law or agreed to in writing, software 6744 * distributed under the License is distributed on an "AS IS" BASIS, 6745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6746 * See the License for the specific language governing permissions and 6747 * limitations under the License. 6748 * ============================================================================= 6749 */function XL(n){H(n.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${n.dtype}.`);const e={input:n};return ne.runKernel(aw,e)}const Qg=q({fft_:XL});/** 6750 * @license 6751 * Copyright 2020 Google LLC. All Rights Reserved. 6752 * Licensed under the Apache License, Version 2.0 (the "License");
6753 * you may not use this file except in compliance with the License. 6754 * You may obtain a copy of the License at 6755 * 6756 * http://www.apache.org/licenses/LICENSE-2.0 6757 * 6758 * Unless required by applicable law or agreed to in writing, software 6759 * distributed under the License is distributed on an "AS IS" BASIS, 6760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6761 * See the License for the specific language governing permissions and 6762 * limitations under the License. 6763 * ============================================================================= 6764 */function jL(n){H(n.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${n.dtype}.`);const e={input:n};return ne.runKernel(mw,e)}const vf=q({ifft_:jL});/** 6765 * @license 6766 * Copyright 2018 Google LLC. All Rights Reserved. 6767 * Licensed under the Apache License, Version 2.0 (the "License"); 6768 * you may not use this file except in compliance with the License. 6769 * You may obtain a copy of the License at 6770 * 6771 * http://www.apache.org/licenses/LICENSE-2.0 6772 * 6773 * Unless required by applicable law or agreed to in writing, software 6774 * distributed under the License is distributed on an "AS IS" BASIS, 6775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6776 * See the License for the specific language governing permissions and 6777 * limitations under the License. 6778 * ============================================================================= 6779 */function YL(n){const e=n.shape[n.shape.length-1],t=n.size/e;let r;if(e<=2){const i=Re(n,[t,e]);r=vf(i)}else{const i=[t,2*(e-1)],s=Re(Zc(n),[t,e]),a=Re(Yf(n),[t,e]),o=mA(rn(s,[0,1],[t,e-2]),1),A=Ye(mA(rn(a,[0,1],[t,e-2]),1),yn(-1)),l=Nr([s,o],1),c=Nr([a,A],1),u=Re(xo(l,c),[i[0],i[1]]);r=vf(u)}if(r=Zc(r),n.rank===3&&n.shape[0]!==0){const i=r,s=n.shape[0];r=Re(r,[s,r.shape[0]/s,r.shape[1]]),i.dispose()}return r}const dC=q({irfft_:YL});/** 6780 * @license 6781 * Copyright 2020 Google LLC. All Rights Reserved. 6782 * Licensed under the Apache License, Version 2.0 (the "License"); 6783 * you may not use this file except in compliance with the License. 6784 * You may obtain a copy of the License at 6785 * 6786 * http://www.apache.org/licenses/LICENSE-2.0 6787 * 6788 * Unless required by applicable law or agreed to in writing, software 6789 * distributed under the License is distributed on an "AS IS" BASIS, 6790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6791 * See the License for the specific language governing permissions and 6792 * limitations under the License. 6793 * ============================================================================= 6794 */function qL(n,e,t=0){const i={x:$(n,"x","split")},s={numOrSizeSplits:e,axis:t};return ne.runKernel(Ix,i,s)}const eu=q({split_:qL});/** 6795 * @license 6796 * Copyright 2018 Google LLC. All Rights Reserved. 6797 * Licensed under the Apache License, Version 2.0 (the "License"); 6798 * you may not use this file except in compliance with the License. 6799 * You may obtain a copy of the License at 6800 * 6801 * http://www.apache.org/licenses/LICENSE-2.0 6802 * 6803 * Unless required by applicable law or agreed to in writing, software 6804 * distributed under the License is distributed on an "AS IS" BASIS, 6805 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6806 * See the License for the specific language governing permissions and 6807 * limitations under the License. 6808 * ============================================================================= 6809 */function JL(n,e){H(n.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${n.dtype}`);let t=n.shape[n.shape.length-1];const r=n.size/t;let i;if(e!=null&&e<t){const d=n.shape.map(m=>0),g=n.shape.map(m=>m);g[n.shape.length-1]=e,i=rn(n,d,g),t=e}else if(e!=null&&e>t){const d=n.shape.map(g=>g);d[n.shape.length-1]=e-t,i=Nr([n,pA(d)],n.shape.length-1),t=e}else i=n;const s=Oi(i),a=Re(xo(i,s),[r,t]),o=Qg(a),A=Math.floor(t/2)+1,l=Zc(o),c=Yf(o),u=eu(l,[A,t-A],l.shape.length-1),h=eu(c,[A,t-A],c.shape.length-1),f=i.shape.slice();return f[i.shape.length-1]=A,Re(xo(u[0],h[0]),f)}const Hg=q({rfft_:JL});/** 6810 * @license 6811 * Copyright 2020 Google LLC. All Rights Reserved. 6812 * Licensed under the Apache License, Version 2.0 (the "License");
6813 * you may not use this file except in compliance with the License. 6814 * You may obtain a copy of the License at 6815 * 6816 * http://www.apache.org/licenses/LICENSE-2.0 6817 * 6818 * Unless required by applicable law or agreed to in writing, software 6819 * distributed under the License is distributed on an "AS IS" BASIS, 6820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6821 * See the License for the specific language governing permissions and 6822 * limitations under the License. 6823 * ============================================================================= 6824 */function ZL(n,e){let t=$(n,"a","squaredDifference"),r=$(e,"b","squaredDifference");[t,r]=Ar(t,r),Cn(t.shape,r.shape);const i={a:t,b:r},s={};return ne.runKernel(Lx,i,s)}const pC=q({squaredDifference_:ZL});/** 6825 * @license 6826 * Copyright 2020 Google LLC. All Rights Reserved. 6827 * Licensed under the Apache License, Version 2.0 (the "License"); 6828 * you may not use this file except in compliance with the License. 6829 * You may obtain a copy of the License at 6830 * 6831 * http://www.apache.org/licenses/LICENSE-2.0 6832 * 6833 * Unless required by applicable law or agreed to in writing, software 6834 * distributed under the License is distributed on an "AS IS" BASIS, 6835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6836 * See the License for the specific language governing permissions and 6837 * limitations under the License. 6838 * ============================================================================= 6839 */function eO(n,e){const t=$(n,"x","squeeze","string_or_numeric");return Re(t,Bo(t.shape,e).newShape)}const vr=q({squeeze_:eO});/** 6840 * @license 6841 * Copyright 2020 Google LLC. All Rights Reserved. 6842 * Licensed under the Apache License, Version 2.0 (the "License"); 6843 * you may not use this file except in compliance with the License. 6844 * You may obtain a copy of the License at 6845 * 6846 * http://www.apache.org/licenses/LICENSE-2.0 6847 * 6848 * Unless required by applicable law or agreed to in writing, software 6849 * distributed under the License is distributed on an "AS IS" BASIS, 6850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6851 * See the License for the specific language governing permissions and 6852 * limitations under the License. 6853 * ============================================================================= 6854 */function tO(n,e=0){const t=df(n,"tensors","stack","string_or_numeric");H(t.length>=1,()=>"Pass at least one tensor to tf.stack"),t.length>0&&H(e<=t[0].rank,()=>"Axis must be <= rank of the tensor");const r=t,i={axis:e};return ne.runKernel(Yw,r,i)}const Ta=q({stack_:tO});/** 6855 * @license 6856 * Copyright 2018 Google LLC. All Rights Reserved. 6857 * Licensed under the Apache License, Version 2.0 (the "License"); 6858 * you may not use this file except in compliance with the License. 6859 * You may obtain a copy of the License at 6860 * 6861 * http://www.apache.org/licenses/LICENSE-2.0 6862 * 6863 * Unless required by applicable law or agreed to in writing, software 6864 * distributed under the License is distributed on an "AS IS" BASIS, 6865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6866 * See the License for the specific language governing permissions and 6867 * limitations under the License. 6868 * ============================================================================= 6869 */function nO(n,e=0){const r={x:$(n,"x","step")},i={alpha:e};return ne.runKernel(qx,r,i)}const mC=q({step_:nO});/** 6870 * @license 6871 * Copyright 2018 Google LLC. All Rights Reserved. 6872 * Licensed under the Apache License, Version 2.0 (the "License"); 6873 * you may not use this file except in compliance with the License. 6874 * You may obtain a copy of the License at 6875 * 6876 * http://www.apache.org/licenses/LICENSE-2.0 6877 * 6878 * Unless required by applicable law or agreed to in writing, software 6879 * distributed under the License is distributed on an "AS IS" BASIS, 6880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6881 * See the License for the specific language governing permissions and 6882 * limitations under the License. 6883 * ============================================================================= 6884 */function rO(n,e,t,r,i=0,s=0,a=0,o=0,A=0){const c={x:$(n,"x","stridedSlice","string_or_numeric")},u={begin:e,end:t,strides:r,beginMask:i,endMask:s,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:A};return ne.runKernel(Px,c,u)}const iO=q({stridedSlice_:rO});/** 6885 * @license 6886 * Copyright 2018 Google LLC. All Rights Reserved. 6887 * Licensed under the Apache License, Version 2.0 (the "License");
6888 * you may not use this file except in compliance with the License. 6889 * You may obtain a copy of the License at 6890 * 6891 * http://www.apache.org/licenses/LICENSE-2.0 6892 * 6893 * Unless required by applicable law or agreed to in writing, software 6894 * distributed under the License is distributed on an "AS IS" BASIS, 6895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6896 * See the License for the specific language governing permissions and 6897 * limitations under the License. 6898 * ============================================================================= 6899 */function sO(n){const t={x:$(n,"x","tan","float32")};return ne.runKernel(Vx,t)}const aO=q({tan_:sO});/** 6900 * @license 6901 * Copyright 2018 Google LLC. All Rights Reserved. 6902 * Licensed under the Apache License, Version 2.0 (the "License"); 6903 * you may not use this file except in compliance with the License. 6904 * You may obtain a copy of the License at 6905 * 6906 * http://www.apache.org/licenses/LICENSE-2.0 6907 * 6908 * Unless required by applicable law or agreed to in writing, software 6909 * distributed under the License is distributed on an "AS IS" BASIS, 6910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6911 * See the License for the specific language governing permissions and 6912 * limitations under the License. 6913 * ============================================================================= 6914 */function Qr(n,e){Ql(n);const t=Eo(n,e);if(t.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return So(n,null,t,e)}/** 6915 * @license 6916 * Copyright 2018 Google LLC. All Rights Reserved. 6917 * Licensed under the Apache License, Version 2.0 (the "License"); 6918 * you may not use this file except in compliance with the License. 6919 * You may obtain a copy of the License at 6920 * 6921 * http://www.apache.org/licenses/LICENSE-2.0 6922 * 6923 * Unless required by applicable law or agreed to in writing, software 6924 * distributed under the License is distributed on an "AS IS" BASIS, 6925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6926 * See the License for the specific language governing permissions and 6927 * limitations under the License. 6928 * ============================================================================= 6929 */function po(n,e,t){if(Ql(n),e!=null&&e.length!==2)throw new Error("tensor2d() requires shape to have two numbers");const r=Eo(n,t);if(r.length!==2&&r.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return So(n,e,r,t)}/** 6930 * @license 6931 * Copyright 2018 Google LLC. All Rights Reserved. 6932 * Licensed under the Apache License, Version 2.0 (the "License"); 6933 * you may not use this file except in compliance with the License. 6934 * You may obtain a copy of the License at 6935 * 6936 * http://www.apache.org/licenses/LICENSE-2.0 6937 * 6938 * Unless required by applicable law or agreed to in writing, software 6939 * distributed under the License is distributed on an "AS IS" BASIS, 6940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6941 * See the License for the specific language governing permissions and 6942 * limitations under the License. 6943 * ============================================================================= 6944 */function gC(n,e,t){if(Ql(n),e!=null&&e.length!==3)throw new Error("tensor3d() requires shape to have three numbers");const r=Eo(n,t);if(r.length!==3&&r.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return So(n,e,r,t)}/** 6945 * @license 6946 * Copyright 2018 Google LLC. All Rights Reserved. 6947 * Licensed under the Apache License, Version 2.0 (the "License"); 6948 * you may not use this file except in compliance with the License. 6949 * You may obtain a copy of the License at 6950 * 6951 * http://www.apache.org/licenses/LICENSE-2.0 6952 * 6953 * Unless required by applicable law or agreed to in writing, software 6954 * distributed under the License is distributed on an "AS IS" BASIS, 6955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6956 * See the License for the specific language governing permissions and 6957 * limitations under the License. 6958 * ============================================================================= 6959 */function oO(n,e,t){if(Ql(n),e!=null&&e.length!==4)throw new Error("tensor4d() requires shape to have four numbers");const r=Eo(n,t);if(r.length!==4&&r.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return So(n,e,r,t)}/** 6960 * @license 6961 * Copyright 2018 Google LLC. All Rights Reserved. 6962 * Licensed under the Apache License, Version 2.0 (the "License");
6963 * you may not use this file except in compliance with the License. 6964 * You may obtain a copy of the License at 6965 * 6966 * http://www.apache.org/licenses/LICENSE-2.0 6967 * 6968 * Unless required by applicable law or agreed to in writing, software 6969 * distributed under the License is distributed on an "AS IS" BASIS, 6970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6971 * See the License for the specific language governing permissions and 6972 * limitations under the License. 6973 * ============================================================================= 6974 */function AO(n,e,t){if(Ql(n),e!=null&&e.length!==5)throw new Error("tensor5d() requires shape to have five numbers");const r=Eo(n,t);if(r.length!==5&&r.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return So(n,e,r,t)}/** 6975 * @license 6976 * Copyright 2018 Google LLC. All Rights Reserved. 6977 * Licensed under the Apache License, Version 2.0 (the "License"); 6978 * you may not use this file except in compliance with the License. 6979 * You may obtain a copy of the License at 6980 * 6981 * http://www.apache.org/licenses/LICENSE-2.0 6982 * 6983 * Unless required by applicable law or agreed to in writing, software 6984 * distributed under the License is distributed on an "AS IS" BASIS, 6985 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6986 * See the License for the specific language governing permissions and 6987 * limitations under the License. 6988 * ============================================================================= 6989 */function lO(n,e,t){if(Ql(n),e!=null&&e.length!==6)throw new Error("tensor6d() requires shape to have six numbers");const r=Eo(n,t);if(r.length!==6&&r.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return e=e||r,So(n,e,r,t)}function yC(n,e,t){const r=e.rank>1?e.shape[e.rank-1]:1,i=e.rank>1?e.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${t.shape}, indices.shape: ${e.shape}, shape: ${n}, sliceDim: ${r}, and batchDim: ${i}.`;if(t.rank<i)throw new Error(s+` update.rank < ${i}. `);if(n.length<r+(t.rank-i))throw new Error(s+` Output shape length < ${r+(t.rank-i)}`);if(t.rank!==i+n.length-r)throw new Error(s+` update.rank != ${i+n.length-r}`);for(let a=0;a<i;++a)if(t.shape[a]!==e.shape[a])throw new Error(s+` updates.shape[${a}] (${t.shape[a]}) != indices.shape[${a}] (${e.shape[a]}).`);for(let a=0;a<t.rank-i;++a)if(t.shape[a+i]!==n[a+r])throw new Error(s+` updates.shape[${a+i}] (${t.shape[a+i]}) != shape[${a+i}] (${n[a+i]})`)}function Vg(n,e,t){if(e.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${e.rank}.`);if(n.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${n.rank}.`);if(e.dtype!=="int32")throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${e.dtype}`);if(t.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${t}`);if(t.length===0){if(e.size===0)throw new Error(`Indices specified for empty output. indices shape: ${e.shape}`);if(n.size===0)throw new Error(`Updates specified for empty output. updates shape: ${n.shape}`)}yC(t,e,n)}function Jf(n,e,t){const r=e.shape.length,i=r>1?e.shape[r-1]:1,s=t.length;let a=1;for(let u=i;u<s;++u)a*=t[u];const o=i<1?1:i,A=ze(e.shape)/o,l=[...Mr(t.slice(0,i)),1],c=ze(t);return{sliceRank:i,numUpdates:A,sliceSize:a,strides:l,outputSize:c}}/** 6990 * @license 6991 * Copyright 2022 Google LLC. All Rights Reserved. 6992 * Licensed under the Apache License, Version 2.0 (the "License"); 6993 * you may not use this file except in compliance with the License. 6994 * You may obtain a copy of the License at 6995 * 6996 * http://www.apache.org/licenses/LICENSE-2.0 6997 * 6998 * Unless required by applicable law or agreed to in writing, softw
6998are 6999 * distributed under the License is distributed on an "AS IS" BASIS, 7000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7001 * See the License for the specific language governing permissions and 7002 * limitations under the License. 7003 * ============================================================================= 7004 */function cO(n,e,t){const r=$(n,"tensor","tensorScatterupdate"),i=$(e,"indices","tensorScatterupdate","int32"),s=$(t,"updates","tensorScatterupdate");if(Vg(s,i,r.shape),r.dtype!==s.dtype)throw new Error(`tensor and updates must have the same dtype, instead they are ${r.dtype} and ${s.dtype}.`);const a={tensor:r,indices:i,updates:s},o={};return ne.runKernel(mx,a,o)}const uO=q({tensorScatterUpdate_:cO});/** 7005 * @license 7006 * Copyright 2018 Google LLC. All Rights Reserved. 7007 * Licensed under the Apache License, Version 2.0 (the "License"); 7008 * you may not use this file except in compliance with the License. 7009 * You may obtain a copy of the License at 7010 * 7011 * http://www.apache.org/licenses/LICENSE-2.0 7012 * 7013 * Unless required by applicable law or agreed to in writing, software 7014 * distributed under the License is distributed on an "AS IS" BASIS, 7015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7016 * See the License for the specific language governing permissions and 7017 * limitations under the License. 7018 * ============================================================================= 7019 */function hO(n,e=1,t=!0){const r=$(n,"x","topk");
vendor: 4,343 bytes, lines 7019-7082
7019if(r.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");const i=r.shape[r.shape.length-1];if(e<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${e}`);if(e>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) but got ${e}`);const s={x:r},a={k:e,sorted:t},[o,A]=ne.runKernel(zx,s,a);return{values:o,indices:A}}const fO=q({topk_:hO});/** 7020 * @license 7021 * Copyright 2020 Google LLC. All Rights Reserved. 7022 * Licensed under the Apache License, Version 2.0 (the "License"); 7023 * you may not use this file except in compliance with the License. 7024 * You may obtain a copy of the License at 7025 * 7026 * http://www.apache.org/licenses/LICENSE-2.0 7027 * 7028 * Unless required by applicable law or agreed to in writing, software 7029 * distributed under the License is distributed on an "AS IS" BASIS, 7030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7031 * See the License for the specific language governing permissions and 7032 * limitations under the License. 7033 * ============================================================================= 7034 */function dO(n,e=0,t=1,r,i){if(ki(n),r!=null&&r==="bool")throw new Error("Unsupported data type $ { dtype }");const s=new kg(e,t,r,!0,i),a=ir(n,r);for(let o=0;o<a.values.length;o++)a.values[o]=s.nextValue();return a.toTensor()}const pO=q({truncatedNormal_:dO});/** 7035 * @license 7036 * Copyright 2020 Google LLC. All Rights Reserved. 7037 * Licensed under the Apache License, Version 2.0 (the "License"); 7038 * you may not use this file except in compliance with the License. 7039 * You may obtain a copy of the License at 7040 * 7041 * http://www.apache.org/licenses/LICENSE-2.0 7042 * 7043 * Unless required by applicable law or agreed to in writing, software 7044 * distributed under the License is distributed on an "AS IS" BASIS, 7045 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7046 * See the License for the specific language governing permissions and 7047 * limitations under the License. 7048 * ============================================================================= 7049 */function mO(n,e=0){const t=$(n,"x","unique","string_or_numeric");H(t.rank>0,()=>"The input tensor must be at least 1D");const r={x:t},i={axis:e},[s,a]=ne.runKernel(Kx,r,i);return{values:s,indices:a}}const gO=q({unique_:mO});/** 7050 * @license 7051 * Copyright 2020 Google LLC. All Rights Reserved. 7052 * Licensed under the Apache License, Version 2.0 (the "License"); 7053 * you may not use this file except in compliance with the License. 7054 * You may obtain a copy of the License at 7055 * 7056 * http://www.apache.org/licenses/LICENSE-2.0 7057 * 7058 * Unless required by applicable law or agreed to in writing, software 7059 * distributed under the License is distributed on an "AS IS" BASIS, 7060 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7061 * See the License for the specific language governing permissions and 7062 * limitations under the License. 7063 * ============================================================================= 7064 */function yO(n,e,t){const r=$(n,"x","unsortedSegmentSum"),i=$(e,"segmentIds","unsortedSegmentSum","int32");H(Sl(t),()=>"numSegments must be of dtype int");const s={x:r,segmentIds:i},a={numSegments:t};return ne.runKernel(jx,s,a)}const vO=q({unsortedSegmentSum_:yO});/** 7065 * @license 7066 * Copyright 2020 Google LLC. All Rights Reserved. 7067 * Licensed under the Apache License, Version 2.0 (the "License"); 7068 * you may not use this file except in compliance with the License. 7069 * You may obtain a copy of the License at 7070 * 7071 * http://www.apache.org/licenses/LICENSE-2.0 7072 * 7073 * Unless required by applicable law or agreed to in writing, software 7074 * distributed under the License is distributed on an "AS IS" BASIS, 7075 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7076 * See the License for the specific language governing permissions and 7077 * limitations under the License. 7078 * ============================================================================= 7079 */function wO(n,e=0){const t=$(n,"x","unstack","string_or_numeric");H(e>=-t.shape.length&&e<t.shape.length,()=>`Axis = ${e} is not in [-${t.shape.length}, ${t.shape.length})`);const r={value:t},i={axis:e};return ne.runKernel(Xx,r,i)}const BA=q({unstack_:wO});/** 7080 * @license 7081 * Copyright 2022 Google LLC. All Rights Reserved. 7082 * Licensed under the Apache License, Version 2.0 (the "License");
7083 * you may not use this file except in compliance with the License. 7084 * You may obtain a copy of the License at 7085 * 7086 * http://www.apache.org/licenses/LICENSE-2.0 7087 * 7088 * Unless required by applicable law or agreed to in writing, software 7089 * distributed under the License is distributed on an "AS IS" BASIS, 7090 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7091 * See the License for the specific language governing permissions and 7092 * limitations under the License. 7093 * ============================================================================= 7094 */function xO(n,e){return Og(n,e,"right")}/** 7095 * @license 7096 * Copyright 2018 Google LLC. All Rights Reserved. 7097 * Licensed under the Apache License, Version 2.0 (the "License"); 7098 * you may not use this file except in compliance with the License. 7099 * You may obtain a copy of the License at 7100 * 7101 * http://www.apache.org/licenses/LICENSE-2.0 7102 * 7103 * Unless required by applicable law or agreed to in writing, software 7104 * distributed under the License is distributed on an "AS IS" BASIS, 7105 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7106 * See the License for the specific language governing permissions and 7107 * limitations under the License. 7108 * ============================================================================= 7109 */function bO(n,e=!0,t,r){return ne.makeVariable(n,e,t,r)}/** 7110 * @license 7111 * Copyright 2018 Google LLC. All Rights Reserved. 7112 * Licensed under the Apache License, Version 2.0 (the "License"); 7113 * you may not use this file except in compliance with the License. 7114 * You may obtain a copy of the License at 7115 * 7116 * http://www.apache.org/licenses/LICENSE-2.0 7117 * 7118 * Unless required by applicable law or agreed to in writing, software 7119 * distributed under the License is distributed on an "AS IS" BASIS, 7120 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7121 * See the License for the specific language governing permissions and 7122 * limitations under the License. 7123 * ============================================================================= 7124 */function vC(n,e){const t=[];for(let s=0;s<e.length;s++)e[s]&&t.push(s);const r=ir(n,"int32"),i=ir([t.length,n.length],"int32");for(let s=0;s<t.length;s++){const a=r.indexToLoc(t[s]),o=s*n.length;i.values.set(a,o)}return i.toTensor()}/** 7125 * @license 7126 * Copyright 2020 Google LLC. All Rights Reserved. 7127 * Licensed under the Apache License, Version 2.0 (the "License"); 7128 * you may not use this file except in compliance with the License. 7129 * You may obtain a copy of the License at 7130 * 7131 * http://www.apache.org/licenses/LICENSE-2.0 7132 * 7133 * Unless required by applicable law or agreed to in writing, software 7134 * distributed under the License is distributed on an "AS IS" BASIS, 7135 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7136 * See the License for the specific language governing permissions and 7137 * limitations under the License. 7138 * ============================================================================= 7139 */async function CO(n){const e=$(n,"condition","whereAsync","bool"),t=await e.data(),r=vC(e.shape,t);return n!==e&&e.dispose(),r}const wC=CO;/** 7140 * @license 7141 * Copyright 2018 Google LLC. All Rights Reserved. 7142 * Licensed under the Apache License, Version 2.0 (the "License"); 7143 * you may not use this file except in compliance with the License. 7144 * You may obtain a copy of the License at 7145 * 7146 * http://www.apache.org/licenses/LICENSE-2.0 7147 * 7148 * Unless required by applicable law or agreed to in writing, software 7149 * distributed under the License is distributed on an "AS IS" BASIS, 7150 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7151 * See the License for the specific language governing permissions and 7152 * limitations under the License. 7153 * ============================================================================= 7154 */async function _O(n,e,t){const r=$(n,"tensor","boolMask"),i=$(e,"mask","boolMask","bool"),s=t==null?0:t,a=i.rank,o=r.shape;H(a>0,()=>"mask cannot be scalar"),Pi(o.slice(s,s+a),i.shape,"mask's shape must match the first K dimensions of tensor's shape,");let A=1;for(let g=s;g<s+a;g++)A*=o[g];const l=o.slice(0,s).concat([A],o.slice(s+a)),c=Re(r,l),u=Re(i,[-1]),h=await wC(u),f=vr(h,[1]),d=zb(c,f,s);return n!==r&&r.dispose(),e!==i&&i.dispose(),f.dispose(),c.dispose(),u.dispose(),h.dispose(),d}const BO=_O;/** 7155 * @license 7156 * Copyright 2018 Google LLC. All Rights Reserved. 7157 * Licensed under the Apache License, Version 2.0 (the "License");
7158 * you may not use this file except in compliance with the License. 7159 * You may obtain a copy of the License at 7160 * 7161 * http://www.apache.org/licenses/LICENSE-2.0 7162 * 7163 * Unless required by applicable law or agreed to in writing, software 7164 * distributed under the License is distributed on an "AS IS" BASIS, 7165 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7166 * See the License for the specific language governing permissions and 7167 * limitations under the License. 7168 * ============================================================================= 7169 */function EO(n,e,t){const r=$(n,"x","transpose");if(e==null&&(e=r.shape.map((a,o)=>o).reverse()),H(r.rank===e.length,()=>`Error in transpose: rank of input ${r.rank} must match length of perm ${e}.`),e.forEach(a=>{H(a>=0&&a<r.rank,()=>`All entries in 'perm' must be between 0 and ${r.rank-1} but got ${e}`)}),r.rank<=1)return r.clone();const i={x:r},s={perm:e};return r.dtype==="complex64"?Jt(()=>{let a=Zc(r),o=Yf(r);return a=ne.runKernel(Wh,{x:a},s),o=ne.runKernel(Wh,{x:o},s),t&&(o=Ws(o)),xo(a,o)}):ne.runKernel(Wh,i,s)}const c1=q({transpose_:EO});/** 7170 * @license 7171 * Copyright 2018 Google LLC. All Rights Reserved. 7172 * Licensed under the Apache License, Version 2.0 (the "License"); 7173 * you may not use this file except in compliance with the License. 7174 * You may obtain a copy of the License at 7175 * 7176 * http://www.apache.org/licenses/LICENSE-2.0 7177 * 7178 * Unless required by applicable law or agreed to in writing, software 7179 * distributed under the License is distributed on an "AS IS" BASIS, 7180 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7181 * See the License for the specific language governing permissions and 7182 * limitations under the License. 7183 * ============================================================================= 7184 */function SO(n,e,t,r,i=!0){const s=$(n,"v","movingAverage"),a=$(e,"x","movingAverage"),o=$(t,"decay","movingAverage");iN(s,a),H(rr(s.shape,a.shape),()=>"Shape mismatch in v and x");const A=yn(1),l=sn(A,o);let c=Ye(sn(a,s),l);if(i){H(r!=null,()=>"When using zeroDebias: true, step is required.");const u=$(r,"step","movingAverage");c=dn(c,sn(A,Yc(o,u)))}return Ut(s,c)}const TO=q({movingAverage_:SO});/** 7185 * @license 7186 * Copyright 2018 Google LLC. All Rights Reserved. 7187 * Licensed under the Apache License, Version 2.0 (the "License"); 7188 * you may not use this file except in compliance with the License. 7189 * You may obtain a copy of the License at 7190 * 7191 * http://www.apache.org/licenses/LICENSE-2.0 7192 * 7193 * Unless required by applicable law or agreed to in writing, software 7194 * distributed under the License is distributed on an "AS IS" BASIS, 7195 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7196 * See the License for the specific language governing permissions and 7197 * limitations under the License. 7198 * ============================================================================= 7199 */function IO(n,e,t){ki(t);const r=$(n,"indices","scatterND","int32"),i=$(e,"updates","scatterND");Vg(i,r,t);const s={indices:r,updates:i},a={shape:t};return ne.runKernel(px,s,a)}const FO=q({scatterND_:IO});function RO(n,e,t,r){if(n.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${n.dtype}.`);if(n.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${n.shape}.`);const i=n.rank>0?n.shape[0]:1,s=n.rank>1?n.shape[1]:1;if(t.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${t.length}, should be: ${s}.`);const a=e.size;if(!(e.rank===0||e.rank===1&&a===i))throw new Error(`sparseValues has incorrect shape ${e.shape}, should be [] or [${i}]`);if(e.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}/** 7200 * @license 7201 * Copyright 2018 Google LLC. All Rights Reserved. 7202 * Licensed under the Apache License, Version 2.0 (the "License"); 7203 * you may not use this file except in compliance with the License. 7204 * You may obtain a copy of the License at 7205 * 7206 * http://www.apache.org/licenses/LICENSE-2.0 7207 * 7208 * Unless required by applicable law or agreed to in writing, softw
7208are 7209 * distributed under the License is distributed on an "AS IS" BASIS, 7210 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7211 * See the License for the specific language governing permissions and 7212 * limitations under the License. 7213 * ============================================================================= 7214 */function UO(n,e,t,r=0){ki(t);const i=$(n,"sparseIndices","sparseToDense","int32"),s=$(e,"sparseValues","sparseToDense","string_or_numeric"),a=$(r,"defaultValue","sparseToDense",s.dtype);RO(i,s,t,a);const o={sparseIndices:i,sparseValues:s,defaultValue:a},A={outputShape:t};return ne.runKernel(Dx,o,A)}const MO=q({sparseToDense_:UO});/** 7215 * @license 7216 * Copyright 2018 Google LLC. All Rights Reserved. 7217 * Licensed under the Apache License, Version 2.0 (the "License"); 7218 * you may not use this file except in compliance with the License. 7219 * You may obtain a copy of the License at 7220 * 7221 * http://www.apache.org/licenses/LICENSE-2.0 7222 * 7223 * Unless required by applicable law or agreed to in writing, software 7224 * distributed under the License is distributed on an "AS IS" BASIS, 7225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7226 * See the License for the specific language governing permissions and 7227 * limitations under the License. 7228 * ============================================================================= 7229 */function NO(n,e){const t=$(e,"indices","gatherND","int32"),i={params:$(n,"x","gatherND","string_or_numeric"),indices:t};return ne.runKernel(fw,i)}const DO=q({gatherND_:NO});/** 7230 * @license 7231 * Copyright 2019 Google LLC. All Rights Reserved. 7232 * Licensed under the Apache License, Version 2.0 (the "License"); 7233 * you may not use this file except in compliance with the License. 7234 * You may obtain a copy of the License at 7235 * 7236 * http://www.apache.org/licenses/LICENSE-2.0 7237 * 7238 * Unless required by applicable law or agreed to in writing, software 7239 * distributed under the License is distributed on an "AS IS" BASIS, 7240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7241 * See the License for the specific language governing permissions and 7242 * limitations under the License. 7243 * ============================================================================= 7244 */function LO(n,e){if(e==null)return n.shape.slice();if(rr(n.shape,e))return e;if(n.shape.length===e.length){const t=[];for(let r=0;r<n.shape.length;r++)e[r]==null&&n.shape[r]!=null?t.push(n.shape[r]):t.push(e[r]);return t}return e}/** 7245 * @license 7246 * Copyright 2018 Google LLC. All Rights Reserved. 7247 * Licensed under the Apache License, Version 2.0 (the "License"); 7248 * you may not use this file except in compliance with the License. 7249 * You may obtain a copy of the License at 7250 * 7251 * http://www.apache.org/licenses/LICENSE-2.0 7252 * 7253 * Unless required by applicable law or agreed to in writing, software 7254 * distributed under the License is distributed on an "AS IS" BASIS, 7255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7256 * See the License for the specific language governing permissions and 7257 * limitations under the License. 7258 * ============================================================================= 7259 */function OO(n,e,t,r){const i=$(n,"x","dropout");if(H(i.dtype==="float32",()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${i.dtype} tensor instead.`),H(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),e===0)return n instanceof ar?i.clone():i;const s=LO(i,t),a=1-e,o=dn(Gb(Ut($g(s,0,1,"float32",r),a)),a);return Ye(i,o)}const PO=q({dropout_:OO});/** 7260 * @license 7261 * Copyright 2019 Google LLC. All Rights Reserved. 7262 * Licensed under the Apache License, Version 2.0 (the "License"); 7263 * you may not use this file except in compliance with the License. 7264 * You may obtain a copy of the License at 7265 * 7266 * http://www.apache.org/licenses/LICENSE-2.0 7267 * 7268 * Unless required by applicable law or agreed to in writing, software 7269 * distributed under the License is distributed on an "AS IS" BASIS, 7270 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7271 * See the License for the specific language governing permissions and 7272 * limitations under the License. 7273 * ============================================================================= 7274 */function xC(n){return Math.floor(Math.pow(2,Math.ceil(Math.log(n)/Math.log(2))))}function Gg(n,e,t){const r=1-n%2,i=new Float32Array(n);for(let s=0;s<n;++s){const a=2*Math.PI*s/(n+r-1);i[s]=e-t*Math.cos(a)}return Qr(i,"float32")}/** 7275 * @license 7276 * Copyright 2019 Google LLC. All Rights Reserved. 7277 * Licensed under the Apache License, Version 2.0 (the "License");
7278 * you may not use this file except in compliance with the License. 7279 * You may obtain a copy of the License at 7280 * 7281 * http://www.apache.org/licenses/LICENSE-2.0 7282 * 7283 * Unless required by applicable law or agreed to in writing, software 7284 * distributed under the License is distributed on an "AS IS" BASIS, 7285 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7286 * See the License for the specific language governing permissions and 7287 * limitations under the License. 7288 * ============================================================================= 7289 */async function kO(n,e,t=1){const r=$(n,"predictions","inTopK"),i=$(e,"targets","inTopK");H(r.rank>1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`),H(r.rank-1===i.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${i.rank}`),Pi(r.shape.slice(0,r.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const s=r.shape[r.shape.length-1];H(t>0&&t<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${t}`);const a=await r.data(),o=await i.data(),[A,l]=[a.length/s,s],c=vo("bool",A);for(let u=0;u<A;u++){const h=u*l,f=a.subarray(h,h+l),d=[];for(let g=0;g<f.length;g++)d.push({value:f[g],index:g});d.sort((g,m)=>m.value-g.value),c[u]=0;for(let g=0;g<t;g++)if(d[g].index===o[u]){c[u]=1;break}}return n!==r&&r.dispose(),e!==i&&i.dispose(),zs(c,i.shape,"bool")}const $O=kO;/** 7290 * @license 7291 * Copyright 2020 Google LLC. All Rights Reserved. 7292 * Licensed under the Apache License, Version 2.0 (the "License"); 7293 * you may not use this file except in compliance with the License. 7294 * You may obtain a copy of the License at 7295 * 7296 * http://www.apache.org/licenses/LICENSE-2.0 7297 * 7298 * Unless required by applicable law or agreed to in writing, software 7299 * distributed under the License is distributed on an "AS IS" BASIS, 7300 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7301 * See the License for the specific language governing permissions and 7302 * limitations under the License. 7303 * ============================================================================= 7304 */function QO(n,e,t,r,i,s="NHWC",a){let o=n;n.rank===3&&(o=Re(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let A=e;A.rank===3&&(A=Re(e,[1,e.shape[0],e.shape[1],e.shape[2]])),H(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),H(A.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${A.shape}.`),H(t.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${t}.`);const l=s==="NHWC"?o.shape[3]:o.shape[1],c=s==="NHWC"?A.shape[3]:A.shape[1];H(l===t[2],()=>`Error in conv2dDerFilter: depth of input ${l}) must match input depth in filter (${t[2]}.`),H(c===t[3],()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${t[3]}).`),os("conv2dDerFilter",i,a);const u={x:o,dy:A},h={strides:r,pad:i,dataFormat:s,dimRoundingMode:a,filterShape:t};return ne.runKernel(Lv,u,h)}const HO=q({conv2DBackpropFilter_:QO});/** 7305 * @license 7306 * Copyright 2019 Google LLC. All Rights Reserved. 7307 * Licensed under the Apache License, Version 2.0 (the "License"); 7308 * you may not use this file except in compliance with the License. 7309 * You may obtain a copy of the License at 7310 * 7311 * http://www.apache.org/licenses/LICENSE-2.0 7312 * 7313 * Unless required by applicable law or agreed to in writing, software 7314 * distributed under the License is distributed on an "AS IS" BASIS, 7315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7316 * See the License for the specific language governing permissions and 7317 * limitations under the License. 7318 * ============================================================================= 7319 */function Zf(n,e,t){if(t==null||t==="linear")return n;if(t==="relu")return Ye(n,mC(e));throw new Error(`Cannot compute gradient for fused activation ${t}.`)}function ed(n,e){let t=e;const r=Pb(n.shape,e.shape);return r.length>0&&(t=Vn(t,r)),Re(t,n.shape)}function td(n,e,t,r){if(e==="linear")return n;if(e==="relu")return qf(n);if(e==="elu")return $b(n);if(e==="relu6")return hC(n);if(e==="prelu")return rC(n,t);if(e==="leakyrelu")return Kb(n,r);if(e==="sigmoid")return rA(n);throw new Error(`Unknown fused activation ${e}.`)}const nd=(n,e)=>!(n>0)||e==="linear";/** 7320 * @license 7321 * Copyright 2019 Google LLC. All Rights Reserved. 7322 * Licensed under the Apache License, Version 2.0 (the "License");
7323 * you may not use this file except in compliance with the License. 7324 * You may obtain a copy of the License at 7325 * 7326 * http://www.apache.org/licenses/LICENSE-2.0 7327 * 7328 * Unless required by applicable law or agreed to in writing, software 7329 * distributed under the License is distributed on an "AS IS" BASIS, 7330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7331 * See the License for the specific language governing permissions and 7332 * limitations under the License. 7333 * ============================================================================= 7334 */function VO({x:n,filter:e,strides:t,pad:r,dataFormat:i="NHWC",dilations:s=[1,1],dimRoundingMode:a,bias:o,activation:A="linear",preluActivationWeights:l,leakyreluAlpha:c}){if(A=A||"linear",nd(ne.state.gradientDepth,A)===!1){H(i==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${i} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let F=Kf(n,e,t,r,i,s,a);return o!=null&&(F=Ut(F,o)),td(F,A,l,c)}const u=$(n,"x","conv2d","float32"),h=$(e,"filter","conv2d","float32");let f=u,d=!1;u.rank===3&&(d=!0,f=Re(u,[1,u.shape[0],u.shape[1],u.shape[2]])),H(f.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${f.rank}.`),H(h.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${h.rank}.`),os("fused conv2d",r,a);const g=i==="NHWC"?f.shape[3]:f.shape[1];H(h.shape[2]===g,()=>`Error in conv2d: depth of input (${g}) must match input depth for filter ${h.shape[2]}.`),H(Ti(t,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`);const m=$i(f.shape,h.shape,t,s,r,a);let p;o!=null&&(p=$(o,"bias","fused conv2d"),[p]=Ar(p,u),i==="NHWC"?Cn(m.outShape,p.shape):(H(p.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${p.shape.length}.`),H(p.shape.length===0||p.shape[0]===m.outChannels||p.shape[0]===1,()=>`Error in fused conv2d: bias shape (${p.shape}) is not compatible with the number of output channels (${m.outChannels})`)));let w;if(l!=null){const F=l.shape;if(H(F.length<=1||F.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${F.length}.`),F.length===1)H(F[0]===1||F[0]===m.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${F}) is not compatible with the number of output channels (${m.outChannels}).`);else if(F.length===3)try{Cn(F,m.outShape)}catch{const O=`Error in fused conv2d: PReLU activation weights (${F}) is not compatible with the output shape of the conv2d (${m.outShape}).`;throw Error(O)}w=$(l,"prelu weights","fused conv2d")}const C=(F,D)=>{H(i==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${i} but only NHWC is currently supported.`);const[O,I,R,V]=D,re=Zf(F,R,A);H(jc(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);const Y=Ob(I.shape,re,O,t,r),se=HO(I,re,O.shape,t,r),ge=[Y,se];if(V!=null){const ue=ed(V,re);ge.push(ue)}return ge},b={x:f,filter:h,bias:p,preluActivationWeights:w},U={strides:t,pad:r,dataFormat:i,dilations:s,dimRoundingMode:a,activation:A,leakyreluAlpha:c};return o==null?Sa((D,O,I)=>{let R=ne.runKernel(Km,b,U);return I([O,D,R]),d&&(R=Re(R,[R.shape[1],R.shape[2],R.shape[3]])),{value:R,gradFunc:C}})(f,h):Sa((D,O,I,R)=>{let V=ne.runKernel(Km,b,U);return R([O,D,V,I]),d&&(V=Re(V,[V.shape[1],V.shape[2],V.shape[3]])),{value:V,gradFunc:C}})(f,h,p)}const GO=q({fusedConv2d_:VO});/** 7335 * @license 7336 * Copyright 2020 Google LLC. All Rights Reserved. 7337 * Licensed under the Apache License, Version 2.0 (the "License"); 7338 * you may not use this file except in compliance with the License. 7339 * You may obtain a copy of the License at 7340 * 7341 * http://www.apache.org/licenses/LICENSE-2.0 7342 * 7343 * Unless required by applicable law or agreed to in writing, software 7344 * distributed under the License is distributed on an "AS IS" BASIS, 7345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7346 * See the License for the specific language governing permissions and 7347 * limitations under the License. 7348 * ============================================================================= 7349 */function zO(n,e,t,r,i,s=[1,1],a){let o=n;n.rank===3&&(o=Re(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let A=e;A.rank===3&&(A=Re(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const l={x:o,dy:A},c={strides:r,pad:i,dimRoundingMode:a,dilations:s,filterShape:t};return ne.runKernel(Xv,l,c)}const WO=q({depthwiseConv2dNativeBackpropFilter_:zO});/** 7350 * @license 7351 * Copyright 2020 Google LLC. All Rights Reserved. 7352 * Licensed under the Apache License, Version 2.0 (the "License");
7353 * you may not use this file except in compliance with the License. 7354 * You may obtain a copy of the License at 7355 * 7356 * http://www.apache.org/licenses/LICENSE-2.0 7357 * 7358 * Unless required by applicable law or agreed to in writing, software 7359 * distributed under the License is distributed on an "AS IS" BASIS, 7360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7361 * See the License for the specific language governing permissions and 7362 * limitations under the License. 7363 * ============================================================================= 7364 */function KO(n,e,t,r,i,s=[1,1],a){let o=e,A=!1;e.rank===3&&(A=!0,o=Re(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const l={dy:o,filter:t},c={strides:r,pad:i,dimRoundingMode:a,dilations:s,inputShape:n},u=ne.runKernel(jv,l,c);return A?Re(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const XO=q({depthwiseConv2dNativeBackpropInput_:KO});/** 7365 * @license 7366 * Copyright 2019 Google LLC. All Rights Reserved. 7367 * Licensed under the Apache License, Version 2.0 (the "License"); 7368 * you may not use this file except in compliance with the License. 7369 * You may obtain a copy of the License at 7370 * 7371 * http://www.apache.org/licenses/LICENSE-2.0 7372 * 7373 * Unless required by applicable law or agreed to in writing, software 7374 * distributed under the License is distributed on an "AS IS" BASIS, 7375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7376 * See the License for the specific language governing permissions and 7377 * limitations under the License. 7378 * ============================================================================= 7379 */function jO({x:n,filter:e,strides:t,pad:r,dataFormat:i="NHWC",dilations:s=[1,1],dimRoundingMode:a,bias:o,activation:A="linear",preluActivationWeights:l,leakyreluAlpha:c}){if(nd(ne.state.gradientDepth,A)===!1){let U=Mg(n,e,t,r,i,s,a);return o!=null&&(U=Ut(U,o)),td(U,A,l,c)}const u=$(n,"x","depthwiseConv2d","float32"),h=$(e,"filter","depthwiseConv2d","float32");let f=u,d=!1;u.rank===3&&(d=!0,f=Re(u,[1,u.shape[0],u.shape[1],u.shape[2]])),H(f.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${f.rank}.`),H(h.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`),H(f.shape[3]===h.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${f.shape[3]}) must match the inChannels dimension in filter ${h.shape[2]}
7379.`),s==null&&(s=[1,1]),H(Ti(t,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),os("fused depthwiseConv2d",r,a);const g=$i(f.shape,h.shape,t,s,r,a,!0);let m;o!=null&&(m=$(o,"bias","fused conv2d"),[m]=Ar(m,u),Cn(g.outShape,m.shape));let p;l!=null&&(p=$(l,"prelu weights","fused depthwiseConv2d"));const w=(U,F)=>{H(jc(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);const[D,O,I,R]=F,V=Zf(U,I,A),re=XO(O.shape,V,D,t,r,s,a),Y=WO(O,V,D.shape,t,r,s,a);if(R!=null){const se=ed(m,V);return[re,Y,se]}return[re,Y]},C={x:f,filter:h,bias:m,preluActivationWeights:p},b={strides:t,pad:r,dataFormat:i,dilations:s,dimRoundingMode:a,activation:A,leakyreluAlpha:c};return o==null?Sa((F,D,O)=>{let I=ne.runKernel(Xm,C,b);return O([D,F,I]),d&&(I=Re(I,[I.shape[1],I.shape[2],I.shape[3]])),{value:I,gradFunc:w}})(f,h):Sa((F,D,O,I)=>{let R=ne.runKernel(Xm,C,b);return I([D,F,R,O]),d&&(R=Re(R,[R.shape[1],R.shape[2],R.shape[3]])),{value:R,gradFunc:w}})(f,h,m)}const YO=q({fusedDepthwiseConv2d_:jO});/** 7380 * @license 7381 * Copyright 2019 Google LLC. All Rights Reserved. 7382 * Licensed under the Apache License, Version 2.0 (the "License"); 7383 * you may not use this file except in compliance with the License. 7384 * You may obtain a copy of the License at 7385 * 7386 * http://www.apache.org/licenses/LICENSE-2.0 7387 * 7388 * Unless required by applicable law or agreed to in writing, software 7389 * distributed under the License is distributed on an "AS IS" BASIS, 7390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7391 * See the License for the specific language governing permissions and 7392 * limitations under the License. 7393 * ============================================================================= 7394 */function qO({a:n,b:e,transposeA:t=!1,transposeB:r=!1,bias:i,activation:s="linear",preluActivationWeights:a,leakyreluAlpha:o=.2}){if(nd(ne.state.gradientDepth,s)===!1){let V=Un(n,e,t,r);return i!=null&&(V=Ut(V,i)),td(V,s,a,o)}let A=$(n,"a","fused matMul"),l=$(e,"b","fused matMul");[A,l]=Ar(A,l);const c=t?A.shape[A.rank-2]:A.shape[A.rank-1],u=r?l.shape[l.rank-1]:l.shape[l.rank-2],h=t?A.shape[A.rank-1]:A.shape[A.rank-2],f=r?l.shape[l.rank-2]:l.shape[l.rank-1],d=A.shape.slice(0,-2),g=l.shape.slice(0,-2),m=ze(d),p=ze(g);H(c===u,()=>`Error in fused matMul: inner shapes (${c}) and (${u}) of Tensors with shapes ${A.shape} and ${l.shape} and transposeA=${t} and transposeB=${r} must match.`);const C=Cn(A.shape.slice(0,-2),l.shape.slice(0,-2)).concat([h,f]),b=t?Re(A,[m,c,h]):Re(A,[m,h,c]),U=r?Re(l,[p,f,u]):Re(l,[p,u,f]);let F;i!=null&&(F=$(i,"bias","fused matMul"),[F]=Ar(F,A),Cn(C,F.shape));let D;a!=null&&(D=$(a,"prelu weights","fused matMul"));const O=(V,re)=>{const[Y,se,ge,ue]=re,Ce=Zf(Re(V,ge.shape),ge,s);let ae,we;if(!t&&!r?(ae=Un(Ce,se,!1,!0),we=Un(Y,Ce,!0,!1)):!t&&r?(ae=Un(Ce,se,!1,!1),we=Un(Ce,Y,!0,!1)):t&&!r?(ae=Un(se,Ce,!1,!0),we=Un(Y,Ce,!1,!1)):(ae=Un(se,Ce,!0,!0),we=Un(Ce,Y,!0,!0)),i!=null){const Pe=ed(ue,Ce);return[ae,we,Pe]}else return[ae,we]},I={a:b,b:U,bias:F,preluActivationWeights:D},R={transposeA:t,transposeB:r,activation:s,leakyreluAlpha:o};return i==null?Sa((re,Y,se)=>{const ge=ne.runKernel(Wm,I,R);return se([re,Y,ge]),{value:Re(ge,C),gradFunc:O}})(b,U):Sa((re,Y,se,ge)=>{const ue=ne.runKernel(Wm,I,R);return ge([re,Y,ue,se]),{value:Re(ue,C),gradFunc:O}})(b,U,F)}const JO=q({fusedMatMul_:qO});/** 7395 * @license 7396 * Copyright 2019 Google LLC. All Rights Reserved. 7397 * Licensed under the Apache License, Version 2.0 (the "License"); 7398 * you may not use this file except in compliance with the License. 7399 * You may obtain a copy of the License at 7400 * 7401 * http://www.apache.org/licenses/LICENSE-2.0 7402 * 7403 * Unless required by applicable law or agreed to in writing, software 7404 * distributed under the License is distributed on an "AS IS" BASIS, 7405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7406 * See the License for the specific language governing permissions and 7407 * limitations under the License. 7408 * ============================================================================= 7409 */const ZO=Object.freeze(Object.defineProperty({__proto__:null,conv2d:GO,depthwiseConv2d:YO,matMul:JO},Symbol.toStringTag,{value:"Module"}));/** 7410 * @license 7411 * Copyright 2019 Google LLC. All Rights Reserved. 7412 * Licensed under the Apache License, Version 2.0 (the "License");
7413 * you may not use this file except in compliance with the License. 7414 * You may obtain a copy of the License at 7415 * 7416 * http://www.apache.org/licenses/LICENSE-2.0 7417 * 7418 * Unless required by applicable law or agreed to in writing, software 7419 * distributed under the License is distributed on an "AS IS" BASIS, 7420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7421 * See the License for the specific language governing permissions and 7422 * limitations under the License. 7423 * ============================================================================= 7424 */function eP(n){return Gg(n,.54,.46)}const tP=q({hammingWindow_:eP});/** 7425 * @license 7426 * Copyright 2019 Google LLC. All Rights Reserved. 7427 * Licensed under the Apache License, Version 2.0 (the "License"); 7428 * you may not use this file except in compliance with the License. 7429 * You may obtain a copy of the License at 7430 * 7431 * http://www.apache.org/licenses/LICENSE-2.0 7432 * 7433 * Unless required by applicable law or agreed to in writing, software 7434 * distributed under the License is distributed on an "AS IS" BASIS, 7435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7436 * See the License for the specific language governing permissions and 7437 * limitations under the License. 7438 * ============================================================================= 7439 */function nP(n){return Gg(n,.5,.5)}const bC=q({hannWindow_:nP});/** 7440 * @license 7441 * Copyright 2019 Google LLC. All Rights Reserved. 7442 * Licensed under the Apache License, Version 2.0 (the "License"); 7443 * you may not use this file except in compliance with the License. 7444 * You may obtain a copy of the License at 7445 * 7446 * http://www.apache.org/licenses/LICENSE-2.0 7447 * 7448 * Unless required by applicable law or agreed to in writing, software 7449 * distributed under the License is distributed on an "AS IS" BASIS, 7450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7451 * See the License for the specific language governing permissions and 7452 * limitations under the License. 7453 * ============================================================================= 7454 */function rP(n,e,t,r=!1,i=0){let s=0;const a=[];for(;s+e<=n.size;)a.push(rn(n,s,e)),s+=t;if(r)for(;s<n.size;){const o=s+e-n.size,A=Nr([rn(n,s,e-o),yu([o],i)]);a.push(A),s+=t}return a.length===0?po([],[0,e]):Re(Nr(a),[a.length,e])}const CC=q({frame_:rP});/** 7455 * @license 7456 * Copyright 2019 Google LLC. All Rights Reserved. 7457 * Licensed under the Apache License, Version 2.0 (the "License"); 7458 * you may not use this file except in compliance with the License. 7459 * You may obtain a copy of the License at 7460 * 7461 * http://www.apache.org/licenses/LICENSE-2.0 7462 * 7463 * Unless required by applicable law or agreed to in writing, software 7464 * distributed under the License is distributed on an "AS IS" BASIS, 7465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7466 * See the License for the specific language governing permissions and 7467 * limitations under the License. 7468 * ============================================================================= 7469 */function iP(n,e,t,r,i=bC){r==null&&(r=xC(e));const s=CC(n,e,t),a=Ye(s,i(e));return Hg(a,r)}const sP=q({stft_:iP});/** 7470 * @license 7471 * Copyright 2020 Google LLC. All Rights Reserved. 7472 * Licensed under the Apache License, Version 2.0 (the "License"); 7473 * you may not use this file except in compliance with the License. 7474 * You may obtain a copy of the License at 7475 * 7476 * http://www.apache.org/licenses/LICENSE-2.0 7477 * 7478 * Unless required by applicable law or agreed to in writing, software 7479 * distributed under the License is distributed on an "AS IS" BASIS, 7480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7481 * See the License for the specific language governing permissions and 7482 * limitations under the License. 7483 * ============================================================================= 7484 */function aP(n,e,t,r,i="bilinear",s=0){const a=$(n,"image","cropAndResize"),o=$(e,"boxes","cropAndResize","float32"),A=$(t,"boxInd","cropAndResize","int32"),l=o.shape[0];H(a.rank===4,()=>`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),H(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${l},4] but had shape ${o.shape}.`),H(A.rank===1&&A.shape[0]===l,()=>`Error in cropAndResize: boxInd must be have size [${l}] but had shape ${o.shape}.`),H(r.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),H(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),H(i==="bilinear"||i==="nearest",()=>`method must be bilinear or nearest, but was ${i}`);const c={image:a,boxes:o,boxInd:A},u={method:i,extrapolationValue:s,cropSize:r};return ne.runKernel(Gv,c,u)}const oP=q({cropAndResize_:aP});/** 7485 * @license 7486 * Copyright 2020 Google LLC. All Rights Reserved. 7487 * Licensed under the Apache License, Version 2.0 (the "License");
7488 * you may not use this file except in compliance with the License. 7489 * You may obtain a copy of the License at 7490 * 7491 * http://www.apache.org/licenses/LICENSE-2.0 7492 * 7493 * Unless required by applicable law or agreed to in writing, software 7494 * distributed under the License is distributed on an "AS IS" BASIS, 7495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7496 * See the License for the specific language governing permissions and 7497 * limitations under the License. 7498 * ============================================================================= 7499 */function AP(n){const e=$(n,"image","flipLeftRight","float32");H(e.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`);const t={image:e};return ne.runKernel(Aw,t,{})}const lP=q({flipLeftRight_:AP});/** 7500 * @license 7501 * Copyright 2021 Google LLC. All Rights Reserved. 7502 * Licensed under the Apache License, Version 2.0 (the "License"); 7503 * you may not use this file except in compliance with the License. 7504 * You may obtain a copy of the License at 7505 * 7506 * http://www.apache.org/licenses/LICENSE-2.0 7507 * 7508 * Unless required by applicable law or agreed to in writing, software 7509 * distributed under the License is distributed on an "AS IS" BASIS, 7510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7511 * See the License for the specific language governing permissions and 7512 * limitations under the License. 7513 * ============================================================================= 7514 */function cP(n){const e=$(n,"image","grayscaleToRGB"),t=e.rank-1,r=e.shape[t];H(e.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`),H(r===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`);const i=new Array(e.rank);return i.fill(1,0,t),i[t]=3,Nc(e,i)}const uP=q({grayscaleToRGB_:cP});/** 7515 * @license 7516 * Copyright 2023 Google LLC. 7517 * Licensed under the Apache License, Version 2.0 (the "License"); 7518 * you may not use this file except in compliance with the License. 7519 * You may obtain a copy of the License at 7520 * 7521 * http://www.apache.org/licenses/LICENSE-2.0 7522 * 7523 * Unless required by applicable law or agreed to in writing, software 7524 * distributed under the License is distributed on an "AS IS" BASIS, 7525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7526 * See the License for the specific language governing permissions and 7527 * limitations under the License. 7528 * ============================================================================= 7529 */function hP(n){const e=$(n,"image","RGBToGrayscale"),t=e.rank-1,r=e.shape[t];H(e.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${e.rank}.`),H(r===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${r}.`);const i=e.dtype,s=Kn(e,"float32"),a=Qr([.2989,.587,.114]);let o;switch(e.rank){case 2:o=tl("ij,j->i",s,a);break;case 3:o=tl("ijk,k->ij",s,a);break;case 4:o=tl("ijkl,l->ijk",s,a);break;case 5:o=tl("ijklm,m->ijkl",s,a);break;case 6:o=tl("ijklmn,n->ijklm",s,a);break;default:throw new Error("Not a valid tensor rank.")}return o=qi(o,-1),Kn(o,i)}const fP=q({rgbToGrayscale_:hP});/** 7530 * @license 7531 * Copyright 2020 Google LLC. All Rights Reserved. 7532 * Licensed under the Apache License, Version 2.0 (the "License"); 7533 * you may not use this file except in compliance with the License. 7534 * You may obtain a copy of the License at 7535 * 7536 * http://www.apache.org/licenses/LICENSE-2.0 7537 * 7538 * Unless required by applicable law or agreed to in writing, software 7539 * distributed under the License is distributed on an "AS IS" BASIS, 7540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7541 * See the License for the specific language governing permissions and 7542 * limitations under the License. 7543 * ============================================================================= 7544 */function dP(n,e,t=0,r=.5){const i=$(n,"image","rotateWithOffset","float32");H(i.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${i.rank}.`);const s={image:i},a={radians:e,fillValue:t,center:r};return ne.runKernel(Jx,s,a)}const pP=q({rotateWithOffset_:dP});/** 7545 * @license 7546 * Copyright 2020 Google LLC. All Rights Reserved. 7547 * Licensed under the Apache License, Version 2.0 (the "License");
7548 * you may not use this file except in compliance with the License. 7549 * You may obtain a copy of the License at 7550 * 7551 * http://www.apache.org/licenses/LICENSE-2.0 7552 * 7553 * Unless required by applicable law or agreed to in writing, software 7554 * distributed under the License is distributed on an "AS IS" BASIS, 7555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7556 * See the License for the specific language governing permissions and 7557 * limitations under the License. 7558 * ============================================================================= 7559 */function Gl(n,e,t,r,i,s){r==null&&(r=.5),i==null&&(i=Number.NEGATIVE_INFINITY),s==null&&(s=0);const a=n.shape[0];return t=Math.min(t,a),H(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),H(n.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${n.rank}'`),H(n.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${n.shape[1]}`),H(e.rank===1,()=>"scores must be a 1D tensor"),H(e.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${e.shape[0]}`),H(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:t,iouThreshold:r,scoreThreshold:i,softNmsSigma:s}}/** 7560 * @license 7561 * Copyright 2020 Google LLC. All Rights Reserved. 7562 * Licensed under the Apache License, Version 2.0 (the "License"); 7563 * you may not use this file except in compliance with the License. 7564 * You may obtain a copy of the License at 7565 * 7566 * http://www.apache.org/licenses/LICENSE-2.0 7567 * 7568 * Unless required by applicable law or agreed to in writing, software 7569 * distributed under the License is distributed on an "AS IS" BASIS, 7570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7571 * See the License for the specific language governing permissions and 7572 * limitations under the License. 7573 * ============================================================================= 7574 */function mP(n,e,t,r=.5,i=Number.NEGATIVE_INFINITY){const s=$(n,"boxes","nonMaxSuppression","float32"),a=$(e,"scores","nonMaxSuppression","float32"),o=Gl(s,a,t,r,i);t=o.maxOutputSize,r=o.iouThreshold,i=o.scoreThreshold;const A={maxOutputSize:t,iouThreshold:r,scoreThreshold:i};return ne.runKernel(zw,{boxes:s,scores:a},A)}const gP=q({nonMaxSuppression_:mP});/** 7575 * @license 7576 * Copyright 2019 Google LLC. All Rights Reserved. 7577 * Licensed under the Apache License, Version 2.0 (the "License"); 7578 * you may not use this file except in compliance with the License. 7579 * You may obtain a copy of the License at 7580 * 7581 * http://www.apache.org/licenses/LICENSE-2.0 7582 * 7583 * Unless required by applicable law or agreed to in writing, software 7584 * distributed under the License is distributed on an "AS IS" BASIS, 7585 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7586 * See the License for the specific language governing permissions and 7587 * limitations under the License. 7588 * ============================================================================= 7589 */function yP(n,e,t){const r=vP(n,e,t),i=r<0?-(r+1):r;n.splice(i,0,e)}function vP(n,e,t){return xP(n,e,t||wP)}function wP(n,e){return n>e?1:n<e?-1:0}function xP(n,e,t){let r=0,i=n.length,s=0,a=!1;for(;r<i;){s=r+(i-r>>>1);const o=t(e,n[s]);o>0?r=s+1:(i=s,a=!o)}return a?r:-r-1}/** 7590 * @license 7591 * Copyright 2020 Google LLC. All Rights Reserved. 7592 * Licensed under the Apache License, Version 2.0 (the "License"); 7593 * you may not use this file except in compliance with the License. 7594 * You may obtain a copy of the License at 7595 * 7596 * http://www.apache.org/licenses/LICENSE-2.0 7597 * 7598 * Unless required by applicable law or agreed to in writing, software 7599 * distributed under the License is distributed on an "AS IS" BASIS, 7600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7601 * See the License for the specific language governing permissions and 7602 * limitations under the License. 7603 * ============================================================================= 7604 */function _C(n,e,t,r,i){return zg(n,e,t,r,i,0)}function BC(n,e,t,r,i,s){return zg(n,e,t,r,i,0,!1,s,!0)}function EC(n,e,t,r,i,s){return zg(n,e,t,r,i,s,!0)}function zg(n,e,t,r,i,s,a=!1,o=!1,A=!1){const l=[];for(let m=0;m<e.length;m++)e[m]>i&&l.push({score:e[m],boxIndex:m,suppressBeginIndex:0});l.sort(o3);const c=s>0?-.5/s:0,u=[],h=[];for(;u.length<t&&l.length>0;){const m=l.pop(),{score:p,boxIndex:w,suppressBeginIndex:C}=m;if(p<i)break;let b=!1;for(let U=u.length-1;U>=C;--U){const F=bP(n,w,u[U]);if(F>=r){b=!0;break}if(m.score=m.score*CP(r,c,F),m.score<=i)break}m.suppressBeginIndex=u.length,b||(m.score===p?(u.push(w),h.push(m.score)):m.score>i&&yP(l,m,o3))}const f=u.length,d=t-f;o&&d>
vendor: 4,227 bytes, lines 7604-7652
76040&&(u.push(...new Array(d).fill(0)),h.push(...new Array(d).fill(0)));const g={selectedIndices:u};return a&&(g.selectedScores=h),A&&(g.validOutputs=f),g}function bP(n,e,t){const r=n.subarray(e*4,e*4+4),i=n.subarray(t*4,t*4+4),s=Math.min(r[0],r[2]),a=Math.min(r[1],r[3]),o=Math.max(r[0],r[2]),A=Math.max(r[1],r[3]),l=Math.min(i[0],i[2]),c=Math.min(i[1],i[3]),u=Math.max(i[0],i[2]),h=Math.max(i[1],i[3]),f=(o-s)*(A-a),d=(u-l)*(h-c);if(f<=0||d<=0)return 0;const g=Math.max(s,l),m=Math.max(a,c),p=Math.min(o,u),w=Math.min(A,h),C=Math.max(p-g,0)*Math.max(w-m,0);return C/(f+d-C)}function CP(n,e,t){const r=Math.exp(e*t*t);return t<=n?r:0}function o3(n,e){return n.score-e.score||n.score===e.score&&e.boxIndex-n.boxIndex}/** 7605 * @license 7606 * Copyright 2020 Google LLC. All Rights Reserved. 7607 * Licensed under the Apache License, Version 2.0 (the "License"); 7608 * you may not use this file except in compliance with the License. 7609 * You may obtain a copy of the License at 7610 * 7611 * http://www.apache.org/licenses/LICENSE-2.0 7612 * 7613 * Unless required by applicable law or agreed to in writing, software 7614 * distributed under the License is distributed on an "AS IS" BASIS, 7615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7616 * See the License for the specific language governing permissions and 7617 * limitations under the License. 7618 * ============================================================================= 7619 */async function _P(n,e,t,r=.5,i=Number.NEGATIVE_INFINITY){const s=$(n,"boxes","nonMaxSuppressionAsync"),a=$(e,"scores","nonMaxSuppressionAsync"),o=Gl(s,a,t,r,i);t=o.maxOutputSize,r=o.iouThreshold,i=o.scoreThreshold;const A=await Promise.all([s.data(),a.data()]),l=A[0],c=A[1],{selectedIndices:u}=_C(l,c,t,r,i);return s!==n&&s.dispose(),a!==e&&a.dispose(),Qr(u,"int32")}const BP=_P;/** 7620 * @license 7621 * Copyright 2020 Google LLC. All Rights Reserved. 7622 * Licensed under the Apache License, Version 2.0 (the "License"); 7623 * you may not use this file except in compliance with the License. 7624 * You may obtain a copy of the License at 7625 * 7626 * http://www.apache.org/licenses/LICENSE-2.0 7627 * 7628 * Unless required by applicable law or agreed to in writing, software 7629 * distributed under the License is distributed on an "AS IS" BASIS, 7630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7631 * See the License for the specific language governing permissions and 7632 * limitations under the License. 7633 * ============================================================================= 7634 */function EP(n,e,t,r=.5,i=Number.NEGATIVE_INFINITY,s=0){const a=$(n,"boxes","nonMaxSuppression"),o=$(e,"scores","nonMaxSuppression"),A=Gl(a,o,t,r,i,s);t=A.maxOutputSize,r=A.iouThreshold,i=A.scoreThreshold,s=A.softNmsSigma;const l={boxes:a,scores:o},c={maxOutputSize:t,iouThreshold:r,scoreThreshold:i,softNmsSigma:s},u=ne.runKernel(Kw,l,c);return{selectedIndices:u[0],selectedScores:u[1]}}const SP=q({nonMaxSuppressionWithScore_:EP});/** 7635 * @license 7636 * Copyright 2020 Google LLC. All Rights Reserved. 7637 * Licensed under the Apache License, Version 2.0 (the "License"); 7638 * you may not use this file except in compliance with the License. 7639 * You may obtain a copy of the License at 7640 * 7641 * http://www.apache.org/licenses/LICENSE-2.0 7642 * 7643 * Unless required by applicable law or agreed to in writing, software 7644 * distributed under the License is distributed on an "AS IS" BASIS, 7645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7646 * See the License for the specific language governing permissions and 7647 * limitations under the License. 7648 * ============================================================================= 7649 */async function TP(n,e,t,r=.5,i=Number.NEGATIVE_INFINITY,s=0){const a=$(n,"boxes","nonMaxSuppressionAsync"),o=$(e,"scores","nonMaxSuppressionAsync"),A=Gl(a,o,t,r,i,s);t=A.maxOutputSize,r=A.iouThreshold,i=A.scoreThreshold,s=A.softNmsSigma;const l=await Promise.all([a.data(),o.data()]),c=l[0],u=l[1],{selectedIndices:h,selectedScores:f}=EC(c,u,t,r,i,s);return a!==n&&a.dispose(),o!==e&&o.dispose(),{selectedIndices:Qr(h,"int32"),selectedScores:Qr(f)}}const IP=TP;/** 7650 * @license 7651 * Copyright 2020 Google LLC. All Rights Reserved. 7652 * Licensed under the Apache License, Version 2.0 (the "License");
7653 * you may not use this file except in compliance with the License. 7654 * You may obtain a copy of the License at 7655 * 7656 * http://www.apache.org/licenses/LICENSE-2.0 7657 * 7658 * Unless required by applicable law or agreed to in writing, software 7659 * distributed under the License is distributed on an "AS IS" BASIS, 7660 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7661 * See the License for the specific language governing permissions and 7662 * limitations under the License. 7663 * ============================================================================= 7664 */function FP(n,e,t,r=.5,i=Number.NEGATIVE_INFINITY,s=!1){const a=$(n,"boxes","nonMaxSuppression"),o=$(e,"scores","nonMaxSuppression"),A=Gl(a,o,t,r,i,null),l=A.maxOutputSize,c=A.iouThreshold,u=A.scoreThreshold,h={boxes:a,scores:o},f={maxOutputSize:l,iouThreshold:c,scoreThreshold:u,padToMaxOutputSize:s},d=ne.runKernel(Ww,h,f);return{selectedIndices:d[0],validOutputs:d[1]}}const RP=q({nonMaxSuppressionPadded_:FP});/** 7665 * @license 7666 * Copyright 2020 Google LLC. All Rights Reserved. 7667 * Licensed under the Apache License, Version 2.0 (the "License"); 7668 * you may not use this file except in compliance with the License. 7669 * You may obtain a copy of the License at 7670 * 7671 * http://www.apache.org/licenses/LICENSE-2.0 7672 * 7673 * Unless required by applicable law or agreed to in writing, software 7674 * distributed under the License is distributed on an "AS IS" BASIS, 7675 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7676 * See the License for the specific language governing permissions and 7677 * limitations under the License. 7678 * ============================================================================= 7679 */async function UP(n,e,t,r=.5,i=Number.NEGATIVE_INFINITY,s=!1){const a=$(n,"boxes","nonMaxSuppressionAsync"),o=$(e,"scores","nonMaxSuppressionAsync"),A=Gl(a,o,t,r,i,null),l=A.maxOutputSize,c=A.iouThreshold,u=A.scoreThreshold,[h,f]=await Promise.all([a.data(),o.data()]),{selectedIndices:d,validOutputs:g}=BC(h,f,l,c,u,s);return a!==n&&a.dispose(),o!==e&&o.dispose(),{selectedIndices:Qr(d,"int32"),validOutputs:yn(g,"int32")}}const MP=UP;/** 7680 * @license 7681 * Copyright 2020 Google LLC. All Rights Reserved. 7682 * Licensed under the Apache License, Version 2.0 (the "License"); 7683 * you may not use this file except in compliance with the License. 7684 * You may obtain a copy of the License at 7685 * 7686 * http://www.apache.org/licenses/LICENSE-2.0 7687 * 7688 * Unless required by applicable law or agreed to in writing, software 7689 * distributed under the License is distributed on an "AS IS" BASIS, 7690 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7691 * See the License for the specific language governing permissions and 7692 * limitations under the License. 7693 * ============================================================================= 7694 */function NP(n,e,t=!1,r=!1){const i=$(n,"images","resizeBilinear");H(i.rank===3||i.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${i.rank}.`),H(e.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`),H(r===!1||t===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=i,a=!1;i.rank===3&&(a=!0,s=Re(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const o={images:s},A={alignCorners:t,halfPixelCenters:r,size:e},l=ne.runKernel(cx,o,A);return a?Re(l,[l.shape[1],l.shape[2],l.shape[3]]):l}const DP=q({resizeBilinear_:NP});/** 7695 * @license 7696 * Copyright 2020 Google LLC. All Rights Reserved. 7697 * Licensed under the Apache License, Version 2.0 (the "License"); 7698 * you may not use this file except in compliance with the License. 7699 * You may obtain a copy of the License at 7700 * 7701 * http://www.apache.org/licenses/LICENSE-2.0 7702 * 7703 * Unless required by applicable law or agreed to in writing, software 7704 * distributed under the License is distributed on an "AS IS" BASIS, 7705 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7706 * See the License for the specific language governing permissions and 7707 * limitations under the License. 7708 * ============================================================================= 7709 */function LP(n,e,t=!1,r=!1){const i=$(n,"images","resizeNearestNeighbor");H(i.rank===3||i.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${i.rank}
7709.`),H(e.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`),H(i.dtype==="float32"||i.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),H(r===!1||t===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=i,a=!1;i.rank===3&&(a=!0,s=Re(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const o={images:s},A={alignCorners:t,halfPixelCenters:r,size:e},l=ne.runKernel(lx,o,A);return a?Re(l,[l.shape[1],l.shape[2],l.shape[3]]):l}const OP=q({resizeNearestNeighbor_:LP});/** 7710 * @license 7711 * Copyright 2021 Google LLC. All Rights Reserved. 7712 * Licensed under the Apache License, Version 2.0 (the "License"); 7713 * you may not use this file except in compliance with the License. 7714 * You may obtain a copy of the License at 7715 * 7716 * https://www.apache.org/licenses/LICENSE-2.0 7717 * 7718 * Unless required by applicable law or agreed to in writing, software 7719 * distributed under the License is distributed on an "AS IS" BASIS, 7720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7721 * See the License for the specific language governing permissions and 7722 * limitations under the License. 7723 * ============================================================================= 7724 */function PP(n,e="binary",t=!1,r=.5){const i=$(n,"image","threshold"),s=.2989,a=.587,o=.114,A=i.shape[0]*i.shape[1];let l=Ye(Qr([r]),255),c,u,h,f;if(H(i.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${i.rank}.`),H(i.shape[2]===3||i.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${i.shape[2]}.`),H(i.dtype==="int32"||i.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${i.dtype}.`),H(e==="otsu"||e==="binary",()=>`Method must be binary or otsu, but was ${e}`),i.shape[2]===3){[c,u,h]=eu(i,[1,1,1],-1);const m=Ye(c,s),p=Ye(u,a),w=Ye(h,o);f=Ut(Ut(m,p),w)}else f=n;if(e==="otsu"){const m=Db(Kn(fC(f),"int32"),zs([]),256);l=kP(m,A)}const d=t?Lg(f,l):jf(f,l);return Kn(Ye(d,255),"int32")}function kP(n,e){let t=Qr([-1]),r=Qr([0]),i=Qr([0]),s,a,o,A,l,c;for(let u=0;u<n.size-1;u++){s=rn(n,0,u+1),a=rn(n,u+1),l=dn(Vn(s),e),c=dn(Vn(a),e);const h=Vn(Ye(s,Jc(0,s.size)));o=dn(h,Vn(s));const f=yu(a.shape,s.size),d=Ut(Jc(0,a.size),f),g=Ye(a,d);A=dn(Vn(g),Vn(a));const m=sn(o,A),p=sn(o,A),w=Ye(l,c);i=Ye(Ye(w,m),p);const C=jf(i,r);r=fo(C,i,r),t=fo(C,Qr([u]),t)}return t}const $P=q({threshold_:PP});/** 7725 * @license 7726 * Copyright 2021 Google LLC. All Rights Reserved. 7727 * Licensed under the Apache License, Version 2.0 (the "License"); 7728 * you may not use this file except in compliance with the License. 7729 * You may obtain a copy of the License at 7730 * 7731 * http://www.apache.org/licenses/LICENSE-2.0 7732 * 7733 * Unless required by applicable law or agreed to in writing, software 7734 * distributed under the License is distributed on an "AS IS" BASIS, 7735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7736 * See the License for the specific language governing permissions and 7737 * limitations under the License. 7738 * ============================================================================= 7739 */function QP(n,e,t="nearest",r="constant",i=0,s){const a=$(n,"image","transform","float32"),o=$(e,"transforms","transform","float32");H(a.rank===4,()=>`Error in transform: image must be rank 4,but got rank ${a.rank}.`),H(o.rank===2&&(o.shape[0]===a.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),H(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);const A={image:a,transforms:o},l={interpolation:t,fillMode:r,fillValue:i,outputShape:s};return ne.runKernel(Wx,A,l)}const HP=q({transform_:QP});/** 7740 * @license 7741 * Copyright 2020 Google LLC. All Rights Reserved. 7742 * Licensed under the Apache License, Version 2.0 (the "License"); 7743 * you may not use this file except in compliance with the License. 7744 * You may obtain a copy of the License at 7745 * 7746 * http://www.apache.org/licenses/LICENSE-2.0 7747 * 7748 * Unless required by applicable law or agreed to in writing, softw
7748are 7749 * distributed under the License is distributed on an "AS IS" BASIS, 7750 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7751 * See the License for the specific language governing permissions and 7752 * limitations under the License. 7753 * ============================================================================= 7754 */function VP(n,e,t){const r=$(n,"a","bandPart");H(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);const i=r.shape,[s,a]=r.shape.slice(-2);let o,A;typeof e=="number"?(H(e%1===0,()=>`bandPart(): numLower must be an integer, got ${e}.`),H(e<=s,()=>`bandPart(): numLower (${e}) must not be greater than the number of rows (${s}).`),o=$(e<0?s:e,"numLower","bandPart")):(H(e.dtype==="int32",()=>"bandPart(): numLower's dtype must be an int32."),o=fo(l1(e,0),s,yf(e,s))),typeof t=="number"?(H(t%1===0,()=>`bandPart(): numUpper must be an integer, got ${t}.`),H(t<=a,()=>`bandPart(): numUpper (${t}) must not be greater than the number of columns (${a}).`),A=$(t<0?a:t,"numUpper","bandPart")):(H(t.dtype==="int32",()=>"bandPart(): numUpper's dtype must be an int32."),A=fo(l1(t,0),a,yf(t,a)));const l=Re(Jc(0,s,1,"int32"),[-1,1]),c=Jc(0,a,1,"int32"),u=sn(l,c),h=mf(Lg(u,o),Wb(u,Ws(A))),f=pA([s,a],r.dtype);return Re(Ta(BA(Re(r,[-1,s,a])).map(d=>fo(h,d,f))),i)}const GP=q({bandPart_:VP});/** 7755 * @license 7756 * Copyright 2020 Google LLC. All Rights Reserved. 7757 * Licensed under the Apache License, Version 2.0 (the "License"); 7758 * you may not use this file except in compliance with the License. 7759 * You may obtain a copy of the License at 7760 * 7761 * http://www.apache.org/licenses/LICENSE-2.0 7762 * 7763 * Unless required by applicable law or agreed to in writing, software 7764 * distributed under the License is distributed on an "AS IS" BASIS, 7765 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7766 * See the License for the specific language governing permissions and 7767 * limitations under the License. 7768 * ============================================================================= 7769 */function zP(n){let e;if(Array.isArray(n)){e=!1,H(n!=null&&n.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const i=n[0].shape[0];for(let s=1;s<n.length;++s)H(n[s].shape[0]===i,()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${n[s].shape[0]} vs. ${i})`)}else e=!0,n=eu(n,n.shape[0],0).map(i=>vr(i,[0]));H(n.length<=n[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${n.length}) exceeds number of dimensions (${n[0].shape[0]}).`);const t=[],r=n;for(let i=0;i<n.length;++i)t.push(ne.tidy(()=>{let s=r[i];if(i>0)for(let a=0;a<i;++a){const o=Ye(Vn(Ye(t[a],s)),t[a]);s=sn(s,o)}return dn(s,Xf(s,"euclidean"))}));return e?Ta(t,0):t}const WP=q({gramSchmidt_:zP});/** 7770 * @license 7771 * Copyright 2020 Google LLC. All Rights Reserved. 7772 * Licensed under the Apache License, Version 2.0 (the "License"); 7773 * you may not use this file except in compliance with the License. 7774 * You may obtain a copy of the License at 7775 * 7776 * http://www.apache.org/licenses/LICENSE-2.0 7777 * 7778 * Unless required by applicable law or agreed to in writing, software 7779 * distributed under the License is distributed on an "AS IS" BASIS, 7780 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7781 * See the License for the specific language governing permissions and 7782 * limitations under the License. 7783 * ============================================================================= 7784 */function KP(n,e=!1){if(H(n.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${n.rank}`),n.rank===2)return A3(n,e);{const t=n.shape.slice(0,n.shape.length-2).reduce((A,l)=>A*l),r=BA(Re(n,[t,n.shape[n.shape.length-2],n.shape[n.shape.length-1]]),0),i=[],s=[];r.forEach(A=>{const[l,c]=A3(A,e);i.push(l),s.push(c)});const a=Re(Ta(i,0),n.shape),o=Re(Ta(s,0),n.shape);return[a,o]}}function A3(n,e=!1){return ne.tidy(()=>{H(n.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${n.shape.length}D Tensor.`);const t=n.shape[0],r=n.shape[1];let i=Vb(t),s=ho(n);const a=po([[1]],[1,1]);let o=ho(a);const A=t>=r?r:t;for(let l=0;l<A;++l){const c=s,u=o,h=i;[o,s,i]=ne.tidy(()=>{const f=rn(s,[l,l],[t-l,1]),d=Xf(f),g=rn(s,[l,l],[1,1]),m=fo(jf(g,0),po([[-1]]),po([[1]])),p=sn(g,Ye(m,d)),w=dn(f,p);w.shape[0]===1?o=ho(a):o=Nr([a,rn(w,[1,0],[w.shape[0]-1,w.shape[1]])],0);const C=Ws(dn(Un(m,p),d)),b=rn(s,[l,0],[t-l,r]),U=Ye(C,o),F=c1(o);if(l===0)s=sn(b,Un(U,Un(F,b)));else{const I=sn(b,Un(U,Un(F,b)));s=Nr([rn(s,[0,0],[l,r]),I],0)}const D=c1(U),O=rn(i,[0,l],[t,i.shape[1]-l]);if(l===0)i=sn(O,Un(Un(O,o),D));else{const I=sn(O,Un(Un(O,o),D));i=Nr([rn(i,[0,0],[t,l]),I],1)}return[o,s,i]}),nr([c,u,h])}return!e&&t>r&&(i=rn(i,[0,0],[t,r]),s=rn(s,[0,0],[r,r])),[i,s]})}const XP=q({qr_:KP});/** 7785 * @license 7786 * Copyright 2020 Google LLC. All Rights Reserved. 7787 * Licensed under the Apache License, Version 2.0 (the "License");
7788 * you may not use this file except in compliance with the License. 7789 * You may obtain a copy of the License at 7790 * 7791 * http://www.apache.org/licenses/LICENSE-2.0 7792 * 7793 * Unless required by applicable law or agreed to in writing, software 7794 * distributed under the License is distributed on an "AS IS" BASIS, 7795 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7796 * See the License for the specific language governing permissions and 7797 * limitations under the License. 7798 * ============================================================================= 7799 */var Ai;(function(n){n[n.NONE=0]="NONE",n[n.MEAN=1]="MEAN",n[n.SUM=2]="SUM",n[n.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(Ai||(Ai={}));function jP(n,e,t=Ai.SUM_BY_NONZERO_WEIGHTS){const r=$(n,"losses","computeWeightedLoss");let i=null;e!=null&&(i=$(e,"weights","computeWeightedLoss"));const s=i==null?r:Ye(r,i);if(t===Ai.NONE)return s;if(t===Ai.SUM)return Vn(s);if(t===Ai.MEAN){if(i==null)return gf(s);{const a=r.size/i.size,o=dn(Vn(s),Vn(i));return a>1?dn(o,yn(a)):o}}if(t===Ai.SUM_BY_NONZERO_WEIGHTS){if(i==null)return dn(Vn(s),yn(r.size));{const a=Ye(i,eA(r.shape)),o=Kn(Vn(tC(a,yn(0))),"float32");return dn(Vn(s),o)}}throw Error(`Unknown reduction: ${t}`)}const Ma=q({computeWeightedLoss_:jP});/** 7800 * @license 7801 * Copyright 2020 Google LLC. All Rights Reserved. 7802 * Licensed under the Apache License, Version 2.0 (the "License"); 7803 * you may not use this file except in compliance with the License. 7804 * You may obtain a copy of the License at 7805 * 7806 * http://www.apache.org/licenses/LICENSE-2.0 7807 * 7808 * Unless required by applicable law or agreed to in writing, software 7809 * distributed under the License is distributed on an "AS IS" BASIS, 7810 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7811 * See the License for the specific language governing permissions and 7812 * limitations under the License. 7813 * ============================================================================= 7814 */function YP(n,e,t,r=Ai.SUM_BY_NONZERO_WEIGHTS){const i=$(n,"labels","absoluteDifference"),s=$(e,"predictions","absoluteDifference");let a=null;t!=null&&(a=$(t,"weights","absoluteDifference")),Pi(i.shape,s.shape,"Error in absoluteDifference: ");const o=Mi(sn(i,s));return Ma(o,a,r)}const qP=q({absoluteDifference_:YP});function JP(n,e,t,r,i=Ai.SUM_BY_NONZERO_WEIGHTS){const s=$(n,"labels","cosineDistance"),a=$(e,"predictions","cosineDistance");let o=null;r!=null&&(o=$(r,"weights","cosineDistance")),Pi(s.shape,a.shape,"Error in cosineDistance: ");const A=yn(1),l=sn(A,Vn(Ye(s,a),t,!0));return Ma(l,o,i)}const ZP=q({cosineDistance_:JP});function ek(n,e,t,r=Ai.SUM_BY_NONZERO_WEIGHTS){let i=$(n,"labels","hingeLoss");const s=$(e,"predictions","hingeLoss");let a=null;t!=null&&(a=$(t,"weights","hingeLoss")),Pi(i.shape,s.shape,"Error in hingeLoss: ");const o=yn(1);i=sn(Ye(yn(2),i),o);const A=qf(sn(o,Ye(i,s)));return Ma(A,a,r)}const tk=q({hingeLoss_:ek});/** 7815 * @license 7816 * Copyright 2020 Google LLC. All Rights Reserved. 7817 * Licensed under the Apache License, Version 2.0 (the "License"); 7818 * you may not use this file except in compliance with the License. 7819 * You may obtain a copy of the License at 7820 * 7821 * http://www.apache.org/licenses/LICENSE-2.0 7822 * 7823 * Unless required by applicable law or agreed to in writing, software 7824 * distributed under the License is distributed on an "AS IS" BASIS, 7825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7826 * See the License for the specific language governing permissions and 7827 * limitations under the License. 7828 * ============================================================================= 7829 */function nk(n,e,t,r=1,i=Ai.SUM_BY_NONZERO_WEIGHTS){const s=$(n,"labels","huberLoss"),a=$(e,"predictions","huberLoss");let o=null;t!=null&&(o=$(t,"weights","huberLoss")),Pi(s.shape,a.shape,"Error in huberLoss: ");const A=yn(r),l=Mi(sn(a,s)),c=yf(l,A),u=sn(l,c),h=Ut(Ye(yn(.5),Es(c)),Ye(A,u));return Ma(h,o,i)}const rk=q({huberLoss_:nk});/** 7830 * @license 7831 * Copyright 2020 Google LLC. All Rights Reserved. 7832 * Licensed under the Apache License, Version 2.0 (the "License");
7833 * you may not use this file except in compliance with the License. 7834 * You may obtain a copy of the License at 7835 * 7836 * http://www.apache.org/licenses/LICENSE-2.0 7837 * 7838 * Unless required by applicable law or agreed to in writing, software 7839 * distributed under the License is distributed on an "AS IS" BASIS, 7840 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7841 * See the License for the specific language governing permissions and 7842 * limitations under the License. 7843 * ============================================================================= 7844 */function ik(n,e,t,r=1e-7,i=Ai.SUM_BY_NONZERO_WEIGHTS){const s=$(n,"labels","logLoss"),a=$(e,"predictions","logLoss");let o=null;t!=null&&(o=$(t,"weights","logLoss")),Pi(s.shape,a.shape,"Error in logLoss: ");const A=yn(1),l=yn(r),c=Ws(Ye(s,qc(Ut(a,l)))),u=Ye(sn(A,s),qc(Ut(sn(A,a),l))),h=sn(c,u);return Ma(h,o,i)}const sk=q({logLoss_:ik});/** 7845 * @license 7846 * Copyright 2020 Google LLC. All Rights Reserved. 7847 * Licensed under the Apache License, Version 2.0 (the "License"); 7848 * you may not use this file except in compliance with the License. 7849 * You may obtain a copy of the License at 7850 * 7851 * http://www.apache.org/licenses/LICENSE-2.0 7852 * 7853 * Unless required by applicable law or agreed to in writing, software 7854 * distributed under the License is distributed on an "AS IS" BASIS, 7855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7856 * See the License for the specific language governing permissions and 7857 * limitations under the License. 7858 * ============================================================================= 7859 */function ak(n,e,t,r=Ai.SUM_BY_NONZERO_WEIGHTS){const i=$(n,"labels","meanSquaredError"),s=$(e,"predictions","meanSquaredError");let a=null;t!=null&&(a=$(t,"weights","meanSquaredError")),Pi(i.shape,s.shape,"Error in meanSquaredError: ");const o=pC(i,s);return Ma(o,a,r)}const ok=q({meanSquaredError_:ak});/** 7860 * @license 7861 * Copyright 2020 Google LLC. All Rights Reserved. 7862 * Licensed under the Apache License, Version 2.0 (the "License"); 7863 * you may not use this file except in compliance with the License. 7864 * You may obtain a copy of the License at 7865 * 7866 * http://www.apache.org/licenses/LICENSE-2.0 7867 * 7868 * Unless required by applicable law or agreed to in writing, software 7869 * distributed under the License is distributed on an "AS IS" BASIS, 7870 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7871 * See the License for the specific language governing permissions and 7872 * limitations under the License. 7873 * ============================================================================= 7874 */function Ak(n,e){const t=$(n,"labels","sigmoidCrossEntropyWithLogits"),r=$(e,"logits","sigmoidCrossEntropyWithLogits");Pi(t.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const i=qf(r),s=Ye(r,t),a=Xb(Ea(Ws(Mi(r))));return Ut(sn(i,s),a)}function lk(n,e,t,r=0,i=Ai.SUM_BY_NONZERO_WEIGHTS){let s=$(n,"multiClassLabels","sigmoidCrossEntropy");const a=$(e,"logits","sigmoidCrossEntropy");let o=null;if(t!=null&&(o=$(t,"weights","sigmoidCrossEntropy")),Pi(s.shape,a.shape,"Error in sigmoidCrossEntropy: "),r>0){const l=yn(r),c=yn(1),u=yn(.5);s=Ut(Ye(s,sn(c,l)),Ye(u,l))}const A=Ak(s,a);return Ma(A,o,i)}const ck=q({sigmoidCrossEntropy_:lk});/** 7875 * @license 7876 * Copyright 2020 Google LLC. All Rights Reserved. 7877 * Licensed under the Apache License, Version 2.0 (the "License"); 7878 * you may not use this file except in compliance with the License. 7879 * You may obtain a copy of the License at 7880 * 7881 * http://www.apache.org/licenses/LICENSE-2.0 7882 * 7883 * Unless required by applicable law or agreed to in writing, software 7884 * distributed under the License is distributed on an "AS IS" BASIS, 7885 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7886 * See the License for the specific language governing permissions and 7887 * limitations under the License. 7888 * ============================================================================= 7889 */function uk(n,e,t=-1){if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${e.rank} and dim was ${t}`);return Sa((i,s,a)=>{const A=Yb(s,[t],!0),l=sn(Kn(s,"float32"),A);a([i,l]);const c=Ws(Ye(l,i));return{value:Vn(c,[t]),gradFunc:(f,d)=>{const[g,m]=d,p=Qi(f.shape,[t]);return[Ye(Re(f,p),sn(Kn(g,"float32"),Ea(m))),Ye(Re(f,p),sn(Ea(m),Kn(g,"float32")))]}}})(n,e)}function hk(n,e,t,r=0,i=Ai.SUM_BY_NONZERO_WEIGHTS){let s=$(n,"onehotLabels","softmaxCrossEntropy");const a=$(e,"logits","softmaxCrossEntropy");let o=null;if(t!=null&&(o=$(t,"weights","softmaxCrossEntropy")),Pi(s.shape,a.shape,"Error in softmaxCrossEntropy: "),r>0){const l=yn(r),c=yn(1),u=yn(s.shape[1]);s=Ut(Ye(s,sn(c,l)),dn(l,u))}const A=uk(s,a);return Ma(A,o,i)}const fk=q({softmaxCrossEntropy_:hk});/** 7890 * @license 7891 * Copyright 2021 Google LLC. All Rights Reserved. 7892 * Licensed under the Apache License, Version 2.0 (the "License");
7893 * you may not use this file except in compliance with the License. 7894 * You may obtain a copy of the License at 7895 * 7896 * http://www.apache.org/licenses/LICENSE-2.0 7897 * 7898 * Unless required by applicable law or agreed to in writing, software 7899 * distributed under the License is distributed on an "AS IS" BASIS, 7900 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7901 * See the License for the specific language governing permissions and 7902 * limitations under the License. 7903 * ============================================================================= 7904 */function dk(n,e,t,r){const i=$(n,"indices","sparseFillEmptyRows","int32"),s=$(e,"values","sparseFillEmptyRows"),a=$(t,"denseShape","sparseFillEmptyRows","int32"),o=$(r,"defaultValue","sparseFillEmptyRows",s.dtype);if(i.rank!==2)throw new Error(`Indices should be Tensor2D but received shape 7905 ${i.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(a.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(o.rank!==0)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const A={indices:i,values:s,denseShape:a,defaultValue:o},l=ne.runKernel(Rx,A);return{outputIndices:l[0],outputValues:l[1],emptyRowIndicator:l[2],reverseIndexMap:l[3]}}const pk=q({sparseFillEmptyRows_:dk});/** 7906 * @license 7907 * Copyright 2021 Google LLC. All Rights Reserved. 7908 * Licensed under the Apache License, Version 2.0 (the "License"); 7909 * you may not use this file except in compliance with the License. 7910 * You may obtain a copy of the License at 7911 * 7912 * http://www.apache.org/licenses/LICENSE-2.0 7913 * 7914 * Unless required by applicable law or agreed to in writing, software 7915 * distributed under the License is distributed on an "AS IS" BASIS, 7916 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7917 * See the License for the specific language governing permissions and 7918 * limitations under the License. 7919 * ============================================================================= 7920 */function mk(n,e,t){const r=$(n,"inputIndices","sparseReshape","int32"),i=$(e,"inputShape","sparseReshape","int32"),s=$(t,"newShape","sparseReshape","int32");if(r.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape 7921 ${r.shape}`);if(i.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${i.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);const a={inputIndices:r,inputShape:i,newShape:s},o=ne.runKernel(Ux,a);return{outputIndices:o[0],outputShape:o[1]}}const gk=q({sparseReshape_:mk});/** 7922 * @license 7923 * Copyright 2021 Google LLC. All Rights Reserved. 7924 * Licensed under the Apache License, Version 2.0 (the "License"); 7925 * you may not use this file except in compliance with the License. 7926 * You may obtain a copy of the License at 7927 * 7928 * http://www.apache.org/licenses/LICENSE-2.0 7929 * 7930 * Unless required by applicable law or agreed to in writing, software 7931 * distributed under the License is distributed on an "AS IS" BASIS, 7932 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7933 * See the License for the specific language governing permissions and 7934 * limitations under the License. 7935 * ============================================================================= 7936 */function yk(n,e,t){const r=$(n,"data","sparseSegmentMean"),i=$(e,"indices","sparseSegmentMean","int32"),s=$(t,"segmentIds","sparseSegmentMean","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(i.rank!==1)throw new Error(`Indices should be Tensor1D but received shape 7937 ${i.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape 7938 ${s.shape}`);const a={data:r,indices:i,segmentIds:s};return ne.runKernel(Mx,a)}const vk=q({sparseSegmentMean_:yk});/** 7939 * @license 7940 * Copyright 2021 Google LLC. All Rights Reserved. 7941 * Licensed under the Apache License, Version 2.0 (the "License"); 7942 * you may not use this file except in compliance with the License. 7943 * You may obtain a copy of the License at 7944 * 7945 * http://www.apache.org/licenses/LICENSE-2.0 7946 * 7947 * Unless required by applicable law or agreed to in writing, softw
7947are 7948 * distributed under the License is distributed on an "AS IS" BASIS, 7949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7950 * See the License for the specific language governing permissions and 7951 * limitations under the License. 7952 * ============================================================================= 7953 */function wk(n,e,t){const r=$(n,"data","sparseSegmentSum"),i=$(e,"indices","sparseSegmentSum","int32"),s=$(t,"segmentIds","sparseSegmentSum","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(i.rank!==1)throw new Error(`Indices should be Tensor1D but received shape 7954 ${i.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape 7955 ${s.shape}`);const a={data:r,indices:i,segmentIds:s};return ne.runKernel(Nx,a)}const xk=q({sparseSegmentSum_:wk});/** 7956 * @license 7957 * Copyright 2021 Google LLC. All Rights Reserved. 7958 * Licensed under the Apache License, Version 2.0 (the "License"); 7959 * you may not use this file except in compliance with the License. 7960 * You may obtain a copy of the License at 7961 * 7962 * http://www.apache.org/licenses/LICENSE-2.0 7963 * 7964 * Unless required by applicable law or agreed to in writing, software 7965 * distributed under the License is distributed on an "AS IS" BASIS, 7966 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7967 * See the License for the specific language governing permissions and 7968 * limitations under the License. 7969 * ============================================================================= 7970 */function bk(n,e,t,r,i,s,a,o){const A=$(n,"data","stringNGrams","string");if(A.dtype!=="string")throw new Error("Data must be of datatype string");if(A.shape.length!==1)throw new Error(`Data must be a vector, saw: ${A.shape}`);const l=$(e,"dataSplits","stringNGrams");if(l.dtype!=="int32")throw new Error("Data splits must be of datatype int32");const c={separator:t,nGramWidths:r,leftPad:i,rightPad:s,padWidth:a,preserveShortSequences:o},u={data:A,dataSplits:l},h=ne.runKernel(kx,u,c);return{nGrams:h[0],nGramsSplits:h[1]}}const Ck=q({stringNGrams_:bk});/** 7971 * @license 7972 * Copyright 2021 Google LLC. All Rights Reserved. 7973 * Licensed under the Apache License, Version 2.0 (the "License"); 7974 * you may not use this file except in compliance with the License. 7975 * You may obtain a copy of the License at 7976 * 7977 * http://www.apache.org/licenses/LICENSE-2.0 7978 * 7979 * Unless required by applicable law or agreed to in writing, software 7980 * distributed under the License is distributed on an "AS IS" BASIS, 7981 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7982 * See the License for the specific language governing permissions and 7983 * limitations under the License. 7984 * ============================================================================= 7985 */function _k(n,e,t=!0){const r=$(n,"input","stringSplit","string"),i=$(e,"delimiter","stringSplit","string");if(r.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(i.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${i.shape}`);const s={skipEmpty:t},a={input:r,delimiter:i},o=ne.runKernel($x,a,s);return{indices:o[0],values:o[1],shape:o[2]}}const Bk=q({stringSplit_:_k});/** 7986 * @license 7987 * Copyright 2021 Google LLC. All Rights Reserved. 7988 * Licensed under the Apache License, Version 2.0 (the "License"); 7989 * you may not use this file except in compliance with the License. 7990 * You may obtain a copy of the License at 7991 * 7992 * http://www.apache.org/licenses/LICENSE-2.0 7993 * 7994 * Unless required by applicable law or agreed to in writing, software 7995 * distributed under the License is distributed on an "AS IS" BASIS, 7996 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7997 * See the License for the specific language governing permissions and 7998 * limitations under the License. 7999 * ============================================================================= 8000 */function Ek(n,e){const t=$(n,"input","stringToHashBucketFast","string"),r={numBuckets:e};if(e<=0)throw new Error("Number of buckets must be at least 1");const i={input:t};return ne.runKernel(Qx,i,r)}const Sk=q({stringToHashBucketFast_:Ek});/** 8001 * @license 8002 * Copyright 2023 Google LLC. 8003 * Licensed under the Apache License, Version 2.0 (the "License");
8004 * you may not use this file except in compliance with the License. 8005 * You may obtain a copy of the License at 8006 * 8007 * http://www.apache.org/licenses/LICENSE-2.0 8008 * 8009 * Unless required by applicable law or agreed to in writing, software 8010 * distributed under the License is distributed on an "AS IS" BASIS, 8011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8012 * See the License for the specific language governing permissions and 8013 * limitations under the License. 8014 * ============================================================================= 8015 */function Tk(n,e,t,r=!0){const i=$(n,"input","staticRegexReplace","string"),s={pattern:e,rewrite:t,replaceGlobal:r};return ne.runKernel(Ox,{x:i},s)}const Ik=q({staticRegexReplace_:Tk});/** 8016 * @license 8017 * Copyright 2020 Google LLC. All Rights Reserved. 8018 * Licensed under the Apache License, Version 2.0 (the "License"); 8019 * you may not use this file except in compliance with the License. 8020 * You may obtain a copy of the License at 8021 * 8022 * http://www.apache.org/licenses/LICENSE-2.0 8023 * 8024 * Unless required by applicable law or agreed to in writing, software 8025 * distributed under the License is distributed on an "AS IS" BASIS, 8026 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8027 * See the License for the specific language governing permissions and 8028 * limitations under the License. 8029 * ============================================================================= 8030 */const Fk={fft:Qg,ifft:vf,rfft:Hg,irfft:dC},Rk={hammingWindow:tP,hannWindow:bC,frame:CC,stft:sP},zl={flipLeftRight:lP,grayscaleToRGB:uP,resizeNearestNeighbor:OP,resizeBilinear:DP,rgbToGrayscale:fP,rotateWithOffset:pP,cropAndResize:oP,nonMaxSuppression:gP,nonMaxSuppressionAsync:BP,nonMaxSuppressionWithScore:SP,nonMaxSuppressionWithScoreAsync:IP,nonMaxSuppressionPadded:RP,nonMaxSuppressionPaddedAsync:MP,threshold:$P,transform:HP},Uk={bandPart:GP,gramSchmidt:WP,qr:XP},Mk={absoluteDifference:qP,computeWeightedLoss:Ma,cosineDistance:ZP,hingeLoss:tk,huberLoss:rk,logLoss:sk,meanSquaredError:ok,sigmoidCrossEntropy:ck,softmaxCrossEntropy:fk},Nk={sparseFillEmptyRows:pk,sparseReshape:gk,sparseSegmentMean:vk,sparseSegmentSum:xk},Dk={stringNGrams:Ck,stringSplit:Bk,stringToHashBucketFast:Sk,staticRegexReplace:Ik};/** 8031 * @license 8032 * Copyright 2018 Google LLC. All Rights Reserved. 8033 * Licensed under the Apache License, Version 2.0 (the "License"); 8034 * you may not use this file except in compliance with the License. 8035 * You may obtain a copy of the License at 8036 * 8037 * http://www.apache.org/licenses/LICENSE-2.0 8038 * 8039 * Unless required by applicable law or agreed to in writing, software 8040 * distributed under the License is distributed on an "AS IS" BASIS, 8041 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8042 * See the License for the specific language governing permissions and 8043 * limitations under the License. 8044 * ============================================================================= 8045 */const Lk=new Map,Ok=new Map;class Pk{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Ko{constructor(){this.classNameMap={}}static getMap(){return Ko.instance==null&&(Ko.instance=new Ko),Ko.instance}static register(e){Ko.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function kk(n,e,t){H(n.className!=null,()=>"Class being registered does not have the static className property defined."),H(typeof n.className=="string",()=>"className is required to be a string, but got type "+typeof n.className),H(n.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),typeof e>"u"&&(e="Custom"),typeof t>"u"&&(t=n.className);const r=t,i=e+">"+r;return Ko.register(n),Lk.set(i,n),Ok.set(n,i),n}/** 8046 * @license 8047 * Copyright 2018 Google LLC. All Rights Reserved. 8048 * Licensed under the Apache License, Version 2.0 (the "License"); 8049 * you may not use this file except in compliance with the License. 8050 * You may obtain a copy of the License at 8051 * 8052 * http://www.apache.org/licenses/LICENSE-2.0 8053 * 8054 * Unless required by applicable law or agreed to in writing, softw
8054are 8055 * distributed under the License is distributed on an "AS IS" BASIS, 8056 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8057 * See the License for the specific language governing permissions and 8058 * limitations under the License. 8059 * ============================================================================= 8060 */class EA extends Pk{minimize(e,t=!1,r){const{value:i,grads:s}=this.computeGradients(e,r);if(r!=null){const a=r.map(o=>({name:o.name,tensor:s[o.name]}));this.applyGradients(a)}else this.applyGradients(s);return nr(s),t?i:(i.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return ND(e,t)}dispose(){this.iterations_!=null&&nr(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:yn(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(EA,Symbol.hasInstance,{value:n=>n.minimize!=null&&n.computeGradients!=null&&n.applyGradients!=null});/** 8061 * @license 8062 * Copyright 2018 Google LLC. All Rights Reserved. 8063 * Licensed under the Apache License, Version 2.0 (the "License"); 8064 * you may not use this file except in compliance with the License. 8065 * You may obtain a copy of the License at 8066 * 8067 * http://www.apache.org/licenses/LICENSE-2.0 8068 * 8069 * Unless required by applicable law or agreed to in writing, software 8070 * distributed under the License is distributed on an "AS IS" BASIS, 8071 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8072 * See the License for the specific language governing permissions and 8073 * limitations under the License. 8074 * ============================================================================= 8075 */class $k extends EA{static get className(){return"Adadelta"}constructor(e,t,r=null){super(),this.learningRate=e,this.rho=t,this.epsilon=r,this.accumulatedGrads=[],this.accumulatedUpdates=[],r==null&&(this.epsilon=ne.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(r=>r.name):Object.keys(e)).forEach((r,i)=>{const s=ne.registeredVariables[r],a=!1;this.accumulatedGrads[i]==null&&(this.accumulatedGrads[i]={originalName:`${r}/accum_grad`,variable:Jt(()=>Oi(s).variable(a))}),this.accumulatedUpdates[i]==null&&(this.accumulatedUpdates[i]={originalName:`${r}/accum_var`,variable:Jt(()=>Oi(s).variable(a))});const o=Array.isArray(e)?e[i].tensor:e[r];if(o==null)return;const A=this.accumulatedGrads[i].variable,l=this.accumulatedUpdates[i].variable;Jt(()=>{const c=Ut(Ye(A,this.rho),Ye(Es(o),1-this.rho)),u=Ye(dn(Ba(Ut(l,this.epsilon)),Ba(Ut(A,this.epsilon))),o),h=Ut(Ye(l,this.rho),Ye(Es(u),1-this.rho));A.assign(c),l.assign(h);const f=Ut(Ye(u,-this.learningRate),s);s.assign(f)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(nr(this.accumulatedGrads.map(e=>e.variable)),nr(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);const t=e.length/2,r=!1;this.accumulatedGrads=e.slice(0,t).map(i=>({originalName:i.name,variable:i.tensor.variable(r)})),this.accumulatedUpdates=e.slice(t,t*2).map(i=>({originalName:i.name,variable:i.tensor.variable(r)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}/** 8076 * @license 8077 * Copyright 2018 Google LLC. All Rights Reserved. 8078 * Licensed under the Apache License, Version 2.0 (the "License"); 8079 * you may not use this file except in compliance with the License. 8080 * You may obtain a copy of the License at 8081 * 8082 * http://www.apache.org/licenses/LICENSE-2.0 8083 * 8084 * Unless required by applicable law or agreed to in writing, softw
8084are 8085 * distributed under the License is distributed on an "AS IS" BASIS, 8086 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8087 * See the License for the specific language governing permissions and 8088 * limitations under the License. 8089 * ============================================================================= 8090 */class Qk extends EA{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(r=>r.name):Object.keys(e)).forEach((r,i)=>{const s=ne.registeredVariables[r];this.accumulatedGrads[i]==null&&(this.accumulatedGrads[i]={originalName:`${r}/accumulator`,variable:Jt(()=>yu(s.shape,this.initialAccumulatorValue).variable(!1))});const a=Array.isArray(e)?e[i].tensor:e[r];if(a==null)return;const o=this.accumulatedGrads[i].variable;Jt(()=>{const A=Ut(o,Es(a));o.assign(A);const l=Ut(Ye(dn(a,Ba(Ut(A,ne.backend.epsilon()))),-this.learningRate),s);s.assign(l)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&nr(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const t=!1;this.accumulatedGrads=e.map(r=>({originalName:r.name,variable:r.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}/** 8091 * @license 8092 * Copyright 2018 Google LLC. All Rights Reserved. 8093 * Licensed under the Apache License, Version 2.0 (the "License"); 8094 * you may not use this file except in compliance with the License. 8095 * You may obtain a copy of the License at 8096 * 8097 * http://www.apache.org/licenses/LICENSE-2.0 8098 * 8099 * Unless required by applicable law or agreed to in writing, software 8100 * distributed under the License is distributed on an "AS IS" BASIS, 8101 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8102 * See the License for the specific language governing permissions and 8103 * limitations under the License. 8104 * ============================================================================= 8105 */class Hk extends EA{static get className(){return"Adam"}constructor(e,t,r,i=null){super(),this.learningRate=e,this.beta1=t,this.beta2=r,this.epsilon=i,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Jt(()=>{this.accBeta1=yn(t).variable(),this.accBeta2=yn(r).variable()}),i==null&&(this.epsilon=ne.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map(r=>r.name):Object.keys(e);Jt(()=>{const r=sn(1,this.accBeta1),i=sn(1,this.accBeta2);t.forEach((s,a)=>{const o=ne.registeredVariables[s],A=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:Jt(()=>Oi(o).variable(A))}),this.accumulatedSecondMoment[a]==null&&(this.accumulatedSecondMoment[a]={originalName:`${s}/v`,variable:Jt(()=>Oi(o).variable(A))});const l=Array.isArray(e)?e[a].tensor:e[s];if(l==null)return;const c=this.accumulatedFirstMoment[a].variable,u=this.accumulatedSecondMoment[a].variable,h=Ut(Ye(c,this.beta1),Ye(l,1-this.beta1)),f=Ut(Ye(u,this.beta2),Ye(Es(l),1-this.beta2)),d=dn(h,r),g=dn(f,i);c.assign(h),u.assign(f);const m=Ut(Ye(dn(d,Ut(Ba(g),this.epsilon)),-this.learningRate),o);o.assign(m)}),this.accBeta1.assign(Ye(this.accBeta1,this.beta1)),this.accBeta2.assign(Ye(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&nr(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&nr(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e),Jt(()=>{this.accBeta1.assign(Yc(this.beta1,this.iterations_+1)),this.accBeta2.assign(Yc(this.beta2,this.iterations_+1))});const t=e.length/2,r=!1;this.accumulatedFirstMoment=e.slice(0,t).map(i=>({originalName:i.name,variable:i.tensor.variable(r)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(i=>({originalName:i.name,variable:i.tensor.variable(r)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}/** 8106 * @license 8107 * Copyright 2018 Google LLC. All Rights Reserved. 8108 * Licensed under the Apache License, Version 2.0 (the "License");
8109 * you may not use this file except in compliance with the License. 8110 * You may obtain a copy of the License at 8111 * 8112 * http://www.apache.org/licenses/LICENSE-2.0 8113 * 8114 * Unless required by applicable law or agreed to in writing, software 8115 * distributed under the License is distributed on an "AS IS" BASIS, 8116 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8117 * See the License for the specific language governing permissions and 8118 * limitations under the License. 8119 * ============================================================================= 8120 */class Vk extends EA{static get className(){return"Adamax"}constructor(e,t,r,i=null,s=0){super(),this.learningRate=e,this.beta1=t,this.beta2=r,this.epsilon=i,this.decay=s,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Jt(()=>{this.iteration=yn(0).variable(),this.accBeta1=yn(t).variable()}),i==null&&(this.epsilon=ne.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map(r=>r.name):Object.keys(e);Jt(()=>{const r=sn(1,this.accBeta1),i=dn(-this.learningRate,Ut(Ye(this.iteration,this.decay),1));t.forEach((s,a)=>{const o=ne.registeredVariables[s],A=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:Oi(o).variable(A)}),this.accumulatedWeightedInfNorm[a]==null&&(this.accumulatedWeightedInfNorm[a]={originalName:`${s}/v`,variable:Oi(o).variable(A)});const l=Array.isArray(e)?e[a].tensor:e[s];if(l==null)return;const c=this.accumulatedFirstMoment[a].variable,u=this.accumulatedWeightedInfNorm[a].variable,h=Ut(Ye(c,this.beta1),Ye(l,1-this.beta1)),f=Ye(u,this.beta2),d=Mi(l),g=eC(f,d);c.assign(h),u.assign(g);const m=Ut(Ye(dn(i,r),dn(h,Ut(g,this.epsilon))),o);o.assign(m)}),this.iteration.assign(Ut(this.iteration,1)),this.accBeta1.assign(Ye(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&nr(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&nr(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}/** 8121 * @license 8122 * Copyright 2018 Google LLC. All Rights Reserved. 8123 * Licensed under the Apache License, Version 2.0 (the "License"); 8124 * you may not use this file except in compliance with the License. 8125 * You may obtain a copy of the License at 8126 * 8127 * http://www.apache.org/licenses/LICENSE-2.0 8128 * 8129 * Unless required by applicable law or agreed to in writing, software 8130 * distributed under the License is distributed on an "AS IS" BASIS, 8131 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8132 * See the License for the specific language governing permissions and 8133 * limitations under the License. 8134 * ============================================================================= 8135 */class SC extends EA{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(r=>r.name):Object.keys(e)).forEach((r,i)=>{const s=Array.isArray(e)?e[i].tensor:e[r];if(s==null)return;const a=ne.registeredVariables[r];Jt(()=>{const o=Ut(Ye(this.c,s),a);a.assign(o)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Qs(yn(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}/** 8136 * @license 8137 * Copyright 2018 Google LLC. All Rights Reserved. 8138 * Licensed under the Apache License, Version 2.0 (the "License");
8139 * you may not use this file except in compliance with the License. 8140 * You may obtain a copy of the License at 8141 * 8142 * http://www.apache.org/licenses/LICENSE-2.0 8143 * 8144 * Unless required by applicable law or agreed to in writing, software 8145 * distributed under the License is distributed on an "AS IS" BASIS, 8146 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8147 * See the License for the specific language governing permissions and 8148 * limitations under the License. 8149 * ============================================================================= 8150 */class Gk extends SC{static get className(){return"Momentum"}constructor(e,t,r=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=r,this.accumulations=[],this.m=yn(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(r=>r.name):Object.keys(e)).forEach((r,i)=>{const s=ne.registeredVariables[r];this.accumulations[i]==null&&(this.accumulations[i]={originalName:`${r}/momentum`,variable:Jt(()=>Oi(s).variable(!1))});const a=this.accumulations[i].variable,o=Array.isArray(e)?e[i].tensor:e[r];o!=null&&Jt(()=>{let A;const l=Ut(Ye(this.m,a),o);this.useNesterov?A=Ut(Ye(this.c,Ut(o,Ye(l,this.m))),s):A=Ut(Ye(this.c,l),s),a.assign(l),s.assign(A)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&nr(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const t=!1;this.accumulations=e.map(r=>({originalName:r.name,variable:r.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}/** 8151 * @license 8152 * Copyright 2018 Google LLC. All Rights Reserved. 8153 * Licensed under the Apache License, Version 2.0 (the "License"); 8154 * you may not use this file except in compliance with the License. 8155 * You may obtain a copy of the License at 8156 * 8157 * http://www.apache.org/licenses/LICENSE-2.0 8158 * 8159 * Unless required by applicable law or agreed to in writing, software 8160 * distributed under the License is distributed on an "AS IS" BASIS, 8161 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8162 * See the License for the specific language governing permissions and 8163 * limitations under the License. 8164 * ============================================================================= 8165 */class zk extends EA{static get className(){return"RMSProp"}constructor(e,t=.9,r=0,i=null,s=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=r,this.epsilon=i,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=s,i==null&&(this.epsilon=ne.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(r=>r.name):Object.keys(e)).forEach((r,i)=>{const s=ne.registeredVariables[r],a=!1;this.accumulatedMeanSquares[i]==null&&(this.accumulatedMeanSquares[i]={originalName:`${r}/rms`,variable:Jt(()=>Oi(s).variable(a))}),this.accumulatedMoments[i]==null&&(this.accumulatedMoments[i]={originalName:`${r}/momentum`,variable:Jt(()=>Oi(s).variable(a))}),this.accumulatedMeanGrads[i]==null&&this.centered&&(this.accumulatedMeanGrads[i]={originalName:`${r}/mg`,variable:Jt(()=>Oi(s).variable(a))});const o=Array.isArray(e)?e[i].tensor:e[r];if(o==null)return;const A=this.accumulatedMeanSquares[i].variable,l=this.accumulatedMoments[i].variable;Jt(()=>{const c=Ut(Ye(A,this.decay),Ye(Es(o),1-this.decay));if(this.centered){const u=this.accumulatedMeanGrads[i].variable,h=Ut(Ye(u,this.decay),Ye(o,1-this.decay)),f=dn(Ye(o,this.learningRate),Ba(sn(c,Ut(Es(h),this.epsilon)))),d=Ut(Ye(l,this.momentum),f);A.assign(c),u.assign(h),l.assign(d);const g=sn(s,d);s.assign(g)}else{const u=Ut(Ye(A,this.decay),Ye(Es(o),1-this.decay)),h=Ut(Ye(l,this.momentum),dn(Ye(o,this.learningRate),Ba(Ut(u,this.epsilon))));A.assign(u),l.assign(h);const f=sn(s,h);s.assign(f)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&nr(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&nr(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&nr(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable}
8165)))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,r=!1;this.accumulatedMeanSquares=e.slice(0,t).map(i=>({originalName:i.name,variable:i.tensor.variable(r)})),this.accumulatedMoments=e.slice(t,t*2).map(i=>({originalName:i.name,variable:i.tensor.variable(r)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(i=>({originalName:i.name,variable:i.tensor.variable(r)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}/** 8166 * @license 8167 * Copyright 2022 Google LLC. 8168 * Licensed under the Apache License, Version 2.0 (the "License"); 8169 * you may not use this file except in compliance with the License. 8170 * You may obtain a copy of the License at 8171 * 8172 * http://www.apache.org/licenses/LICENSE-2.0 8173 * 8174 * Unless required by applicable law or agreed to in writing, software 8175 * distributed under the License is distributed on an "AS IS" BASIS, 8176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8177 * See the License for the specific language governing permissions and 8178 * limitations under the License. 8179 * ============================================================================= 8180 */const Wk=[$k,Qk,Hk,Vk,Gk,zk,SC];function Kk(){for(const n of Wk)kk(n)}/** 8181 * @license 8182 * Copyright 2018 Google LLC. All Rights Reserved. 8183 * Licensed under the Apache License, Version 2.0 (the "License"); 8184 * you may not use this file except in compliance with the License. 8185 * You may obtain a copy of the License at 8186 * 8187 * http://www.apache.org/licenses/LICENSE-2.0 8188 * 8189 * Unless required by applicable law or agreed to in writing, software 8190 * distributed under the License is distributed on an "AS IS" BASIS, 8191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8192 * See the License for the specific language governing permissions and 8193 * limitations under the License. 8194 * ============================================================================= 8195 */const Xk="model",jk=".json",Yk=".weights.bin";function l3(n){return new Promise(e=>setTimeout(e)).then(n)}class gA{constructor(e){if(!pe().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(gA.URL_SCHEME)&&(e=e.slice(gA.URL_SCHEME.length)),(e==null||e.length===0)&&(e=Xk),this.modelJsonFileName=e+jk,this.weightDataFileName=e+Yk}async save(e){if(typeof document>"u")throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=Us.join(e.weightData),r=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const i=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],s=xb(e,i),a=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:"application/json"})),o=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=a,await l3(()=>o.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){const A=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;A.download=this.weightDataFileName,A.href=r,await l3(()=>A.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:pu(e)}}}}gA.URL_SCHEME="downloads://";class qk{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,t)=>{const r=new FileReader;r.onload=i=>{const s=JSON.parse(i.target.result),a=s.modelTopology;if(a==null){t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(s.weightsManifest==null){t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:a});return}const A=Rg(s,l=>this.loadWeights(l));e(A)},r.onerror=i=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(this.jsonFile)})}loadWeights(e){const t=[],r=[];for(const a of e)t.push(...a.weights),r.push(...a.paths);const i=this.checkManifestAndWeightFiles(e),s=r.map(a=>this.loadWeightsFile(a,i[a]));return Promise.all(s).then(a=>[t,a])}loadWeightsFile(e,t){return new Promise((r,i)=>{const s=new FileReader;s.onload=a=>{const o=a.target.result;r(o)},s.onerror=a=>i(`Failed to weights data from file of path '${e}'.`),s.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){const t=[],r=this.weightsFiles.map(s=>a3(s.name)),i={};for(const s of e)s.paths.forEach(a=>{const o=a3(a);if(t.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(t.push(o),r.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);i[a]=this.weightsFiles[r.indexOf(o)]});if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return i}}const Jk=n=>
8195pe().getBool("IS_BROWSER")&&!Array.isArray(n)&&n.startsWith(gA.URL_SCHEME)?Zk(n.slice(gA.URL_SCHEME.length)):null;er.registerSaveRouter(Jk);function Zk(n="model"){return new gA(n)}function e$(n){return new qk(n)}/** 8196 * @license 8197 * Copyright 2019 Google LLC. All Rights Reserved. 8198 * Licensed under the Apache License, Version 2.0 (the "License"); 8199 * you may not use this file except in compliance with the License. 8200 * You may obtain a copy of the License at 8201 * 8202 * http://www.apache.org/licenses/LICENSE-2.0 8203 * 8204 * Unless required by applicable law or agreed to in writing, software 8205 * distributed under the License is distributed on an "AS IS" BASIS, 8206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8207 * See the License for the specific language governing permissions and 8208 * limitations under the License. 8209 * ============================================================================= 8210 */function c3(n,e,t,r){a(n),t=t==null?0:t,r=r==null?1:r,o(t,r);let i=0;const s=A=>(A.then(l=>{const c=t+ ++i/n.length*(r-t);return e(c),l}),A);function a(A){H(A!=null&&Array.isArray(A)&&A.length>0,()=>"promises must be a none empty array")}function o(A,l){H(A>=0&&A<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${A}`),H(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${l}`),H(l>=A,()=>`startFraction must be no more than endFraction, but got startFraction ${A} and endFraction ${l}`)}return Promise.all(n.map(s))}/** 8211 * @license 8212 * Copyright 2018 Google LLC. All Rights Reserved. 8213 * Licensed under the Apache License, Version 2.0 (the "License"); 8214 * you may not use this file except in compliance with the License. 8215 * You may obtain a copy of the License at 8216 * 8217 * http://www.apache.org/licenses/LICENSE-2.0 8218 * 8219 * Unless required by applicable law or agreed to in writing, software 8220 * distributed under the License is distributed on an "AS IS" BASIS, 8221 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8222 * See the License for the specific language governing permissions and 8223 * limitations under the License. 8224 * ============================================================================= 8225 */async function TC(n,e){e==null&&(e={});const t=e.fetchFunc==null?pe().platform.fetch:e.fetchFunc,r=n.map(u=>t(u,e.requestInit,{isBinary:!0})),i=0,s=.5,o=(e.onProgress==null?await Promise.all(r):await c3(r,e.onProgress,i,s)).map(u=>u.arrayBuffer()),A=.5,l=1;return e.onProgress==null?await Promise.all(o):await c3(o,e.onProgress,A,l)}function t$(n,e){var t;const r=e.fetchFunc==null?pe().platform.fetch:e.fetchFunc;let i=0,s;return(t=e.onProgress)===null||t===void 0||t.call(e,0),new ReadableStream({pull:async a=>{for(var o;i<n.length;){s||(s=(await r(n[i],e.requestInit,{isBinary:!0})).body.getReader());const{done:A,value:l}=await s.read();if(A){i++,s=void 0,(o=e.onProgress)===null||o===void 0||o.call(e,i/n.length);continue}a.enqueue(l);return}a.close()}})}async function n$(n,e="",t,r){return IC(a=>TC(a,{requestInit:r}))(n,e,t)}function IC(n){return async(e,t="",r)=>{const i=e.map(()=>!1),s={},a=r!=null?r.map(()=>!1):[],o=[];if(e.forEach((f,d)=>{let g=0;f.weights.forEach(m=>{const p="quantization"in m?m.quantization.dtype:m.dtype,w=uA[p]*ze(m.shape),C=()=>{i[d]=!0,s[d]==null&&(s[d]=[]),s[d].push({manifestEntry:m,groupOffset:g,sizeBytes:w})};r!=null?r.forEach((b,U)=>{b===m.name&&(C(),a[U]=!0)}):C(),o.push(m.name),g+=w})}),!a.every(f=>f)){const f=r.filter((d,g)=>!a[g]);throw new Error(`Could not find weights in manifest with names: ${f.join(", ")}. 8226Manifest JSON has weights with names: ${o.join(", ")}.`)}const A=i.reduce((f,d,g)=>(d&&f.push(g),f),[]),l=[];A.forEach(f=>{e[f].paths.forEach(d=>{const g=t+(t.endsWith("/")?"":"/")+d;l.push(g)})});const c=await n(l),u={};let h=0;return A.forEach(f=>{const d=e[f].paths.length,g=new Us(c.slice(h,h+d));s[f].forEach(p=>{const w=g.slice(p.groupOffset,p.groupOffset+p.sizeBytes),C=yb(w,[p.manifestEntry]);for(const b in C)u[b]=C[b]}),h+=d}),u}}/** 8227 * @license 8228 * Copyright 2018 Google LLC. All Rights Reserved. 8229 * Licensed under the Apache License, Version 2.0 (the "License");
8230 * you may not use this file except in compliance with the License. 8231 * You may obtain a copy of the License at 8232 * 8233 * http://www.apache.org/licenses/LICENSE-2.0 8234 * 8235 * Unless required by applicable law or agreed to in writing, software 8236 * distributed under the License is distributed on an "AS IS" BASIS, 8237 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8238 * See the License for the specific language governing permissions and 8239 * limitations under the License. 8240 * ============================================================================= 8241 */const r$="application/octet-stream",i$="application/json";class Wg{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(H(typeof t.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=t.fetchFunc):this.fetch=pe().platform.fetch,H(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&H(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,t.requestInit!=null&&t.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{},this.loadOptions=t}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const r=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],i=xb(e,r);if(t.body.append("model.json",new Blob([JSON.stringify(i)],{type:i$}),"model.json"),e.weightData!=null){const a=Us.join(e.weightData);t.body.append("model.weights.bin",new Blob([a],{type:r$}),"model.weights.bin")}const s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:pu(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch{let a=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?a+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":a+=" Please make sure the server is serving valid JSON for this request.",new Error(a)}const r=t.modelTopology,i=t.weightsManifest;if(r==null&&i==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();const e=await this.loadModelJSON();return Rg(e,t=>this.loadWeights(t))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),r=n1(e.weightsManifest),i=()=>t$(t,this.loadOptions);return Object.assign(Object.assign({},e),{weightSpecs:r,getWeightStream:i})}async getWeightUrls(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[r,i]=s$(t),s=this.weightPathPrefix||r,a=[],o=[];for(const A of e)for(const l of A.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(l)):a.push(s+l+i);return this.weightUrlConverter&&a.push(...await Promise.all(o)),a}async loadWeights(e){const t=await this.getWeightUrls(e),r=n1(e),i=await TC(t,this.loadOptions);return[r,i]}}Wg.URL_SCHEME_REGEX=/^https?:\/\//;function s$(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("?"),r=n.substring(0,e),i=t>e?n.substring(t):"";return[r+"/",i]}function u1(n){return n.match(Wg.URL_SCHEME_REGEX)!=null}const FC=(n,e)=>{if(typeof fetch>"u"&&(e==null||e.fetchFunc==null))return null;{let t=!0;if(Array.isArray(n)?t=n.every(r=>u1(r)):t=u1(n),t)return Kg(n,e)}return null};er.registerSaveRouter(FC);er.registerLoadRouter(FC);function Kg(n,e){return new Wg(n,e)}function a$(n,e){return Kg(n,e)}/** 8242 * @license 8243 * Copyright 2018 Google LLC. All Rights Reserved. 8244 * Licensed under the Apache License, Version 2.0 (the "License");
8245 * you may not use this file except in compliance with the License. 8246 * You may obtain a copy of the License at 8247 * 8248 * http://www.apache.org/licenses/LICENSE-2.0 8249 * 8250 * Unless required by applicable law or agreed to in writing, software 8251 * distributed under the License is distributed on an "AS IS" BASIS, 8252 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8253 * See the License for the specific language governing permissions and 8254 * limitations under the License. 8255 * ============================================================================= 8256 */class op{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class RC{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class o${constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function A$(n,e,t,r){const i=arguments;return new o$(UC(...i))}function UC(n,e,t,r){return arguments.length===1?n.modelTopology!=null||n.weightSpecs!=null?new op(n):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new op({modelTopology:n})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new op({modelTopology:n,weightSpecs:e,weightData:t,trainingConfig:r}))}function l$(n){return new RC(n)}function c$(n){return new RC(n)}/** 8257 * @license 8258 * Copyright 2018 Google LLC. All Rights Reserved. 8259 * Licensed under the Apache License, Version 2.0 (the "License"); 8260 * you may not use this file except in compliance with the License. 8261 * You may obtain a copy of the License at 8262 * 8263 * http://www.apache.org/licenses/LICENSE-2.0 8264 * 8265 * Unless required by applicable law or agreed to in writing, software 8266 * distributed under the License is distributed on an "AS IS" BASIS, 8267 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8268 * See the License for the specific language governing permissions and 8269 * limitations under the License. 8270 * ============================================================================= 8271 */const MC=Object.freeze(Object.defineProperty({__proto__:null,browserFiles:e$,browserHTTPRequest:a$,CompositeArrayBuffer:Us,concatenateArrayBuffers:wN,decodeWeights:yb,decodeWeightsStream:wb,encodeWeights:dN,fromMemory:A$,fromMemorySync:UC,getLoadHandlers:TN,getModelArtifactsForJSON:Rg,getModelArtifactsForJSONSync:bb,getModelArtifactsInfoForJSON:pu,getSaveHandlers:SN,getWeightSpecs:n1,http:Kg,isHTTPScheme:u1,loadWeights:n$,registerLoadRouter:EN,registerSaveRouter:BN,weightsLoaderFactory:IC,withSaveHandler:l$,withSaveHandlerSync:c$,copyModel:HN,listModels:$N,moveModel:VN,removeModel:QN},Symbol.toStringTag,{value:"Module"}));/** 8272 * @license 8273 * Copyright 2019 Google LLC. All Rights Reserved. 8274 * Licensed under the Apache License, Version 2.0 (the "License"); 8275 * you may not use this file except in compliance with the License. 8276 * You may obtain a copy of the License at 8277 * 8278 * http://www.apache.org/licenses/LICENSE-2.0 8279 * 8280 * Unless required by applicable law or agreed to in writing, software 8281 * distributed under the License is distributed on an "AS IS" BASIS, 8282 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8283 * See the License for the specific language governing permissions and 8284 * limitations under the License. 8285 * ============================================================================= 8286 */let Po,u3=!1;function u$(n,e=3){if(e>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(n==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let t=!1,r=!1,i=!1,s=!1,a=!1,o=!1;if(n.data instanceof Uint8Array)t=!0;else if(typeof ImageData<"u"&&n instanceof ImageData)r=!0;else if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)i=!0;else if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement)s=!0;else if(n.getContext!=null)a=!0;else if(typeof ImageBitmap<"u"&&n instanceof ImageBitmap)o=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${n.constructor.name}`);if(uf(zm,ne.backendName)!=null){const d={pixels:n},g={numChannels:e};return ne.runKernel(zm,d,g)}const[l,c]=i?[n.videoWidth,n.videoHeight]:[n.width,n.height];let u;if(a)u=n.getContext("2d").getImageData(0,0,l,c).data;else if(r||t)u=n.data;else if(s||i||o){if(Po==null)if(typeof document>"u")if(typeof OffscreenCanvas<"u"&&typeof OffscreenCanvasRenderingContext2D<"u")Po=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else Po=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});
8286Po.canvas.width=l,Po.canvas.height=c,Po.drawImage(n,0,0,l,c),u=Po.getImageData(0,0,l,c).data}let h;if(e===4)h=new Int32Array(u);else{const d=l*c;h=new Int32Array(d*e);for(let g=0;g<d;g++)for(let m=0;m<e;++m)h[g*e+m]=u[g*4+m]}return gC(h,[c,l,e],"int32")}function h$(n){if(n.rank!==2&&n.rank!==3)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${n.rank}.`);const e=n.rank===2?1:n.shape[2];if(e>4||e===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${e}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`)}async function NC(n,e){let t=$(n,"img","toPixels");if(!(n instanceof ar)){const l=t;t=Kn(l,"int32"),l.dispose()}h$(t);const[r,i]=t.shape.slice(0,2),s=t.rank===2?1:t.shape[2],a=await t.data(),o=t.dtype==="float32"?255:1,A=new Uint8ClampedArray(i*r*4);for(let l=0;l<r*i;++l){const c=[0,0,0,255];for(let h=0;h<s;h++){const f=a[l*s+h];if(t.dtype==="float32"){if(f<0||f>1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${f}.`)}else if(t.dtype==="int32"&&(f<0||f>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${f}.`);s===1?(c[0]=f*o,c[1]=f*o,c[2]=f*o):c[h]=f*o}const u=l*4;A[u+0]=Math.round(c[0]),A[u+1]=Math.round(c[1]),A[u+2]=Math.round(c[2]),A[u+3]=Math.round(c[3])}if(e!=null){u3||uf(IM,ne.backendName)!=null&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),u3=!0),e.width=i,e.height=r;const l=e.getContext("2d"),c=new ImageData(A,i,r);l.putImageData(c,0,0)}return t!==n&&t.dispose(),A}const DC=q({fromPixels_:u$});function LC(n,e){const t=n.shape.length,r=e.shape.length;if(t<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${t}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if(e.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.shape[r-1]>t)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[r-1]} vs. ${t}`);if(ze(n.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${n.shape}.`);const i=e.shape,s=i[i.length-1];let a=1;for(let u=0;u<i.length-1;++u)a*=i[u];const o=n.shape,A=i.slice();A.pop();let l=1;for(let u=s;u<t;++u)l*=o[u],A.push(o[u]);const c=[...Mr(n.shape).map(u=>u/l),1].slice(0,s);return[A,a,l,c]}/** 8287 * @license 8288 * Copyright 2021 Google LLC. All Rights Reserved. 8289 * Licensed under the Apache License, Version 2.0 (the "License"); 8290 * you may not use this file except in compliance with the License. 8291 * You may obtain a copy of the License at 8292 * 8293 * http://www.apache.org/licenses/LICENSE-2.0 8294 * 8295 * Unless required by applicable law or agreed to in writing, software 8296 * distributed under the License is distributed on an "AS IS" BASIS, 8297 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8298 * See the License for the specific language governing permissions and 8299 * limitations under the License. 8300 * ============================================================================= 8301 */const h1=-2,f$=-1;function OC(n,e,t){const r=n.shape.length;H(r===e.length,()=>`Error in slice${r}D: Length of begin ${e} must match the rank of the array (${r}).`),H(r===t.length,()=>`Error in slice${r}D: Length of size ${t} must match the rank of the array (${r}).`);for(let i=0;i<r;++i)H(e[i]+t[i]<=n.shape[i],()=>`Error in slice${r}D: begin[${i}] + size[${i}] (${e[i]+t[i]}) would overflow input.shape[${i}] (${n.shape[i]})`)}function d$(n){const e=[];let t=0;for(;n>0;)n&1&&e.push(t),n/=2,t++;return e}function PC(n,e,t){const r=[];for(let i=0;i<n.length;i++)r[i]=Math.ceil((e[i]-n[i])/t[i]);return r}function kC(n,e,t,r){const i=[...n];for(let s=i.length;s<r.length;s++)i.push(1);for(let s=0;s<t;s++)s===0?i[e]=1:(i.splice(e,0,1),i.pop());return i}function $C(n,e,t){return t<=n?t:t-(e-1)}function QC(n,e){const t=[];for(let r=0;r<n;r++)t.push(e+r);return t}function p$(n,e,t,r,i,s,a,o,A){const l=n.length;let c=new Array(l),u=new Array(l),h=new Array(l);if(e.length&&t>0){const f=e[0],d=t+1;c=HC(a,f,d,r,n),u=VC(o,f,d,i,n),h=kC(s,f,d,n)}else for(let f=0;f<l;f++)c[f]=zC(a,r,s,n,f,A),u[f]=WC(o,i,s,n,f,A),h[f]=GC(s,f,A);return{begin:c,end:u,strides:h}}function HC(n,e,t,r,i){const s=[...i],a=QC(t,e);for(let o=0;o<s.length;o++)if(a.indexOf(o)>-1)s[o]=0;else{const A=$C(e,t,o);let l=r[A];n&1<<A&&(l=0),s[o]=l}return s}function VC(n,e,t,r,i){const s=[...i],a=QC(t,e);for(let o=0;o<s.length;o++)if(a.indexOf(o)>-1)s[o]=Number.MAX_SAFE_INTEGER;else{const A=$C(e,t,o);let l=r[A];n&1<<A&&(l=Number.MAX_SAFE_INTEGER),s[o]=l}for(let o=0;o<s.length;o++){const A=i[o];s[o]<0&&(s[o]+=A),s[o]=Af(0,s[o],i[o])}return s}function GC(n,e,t){let r=n[e];return(t&1<<e||r==null)&&(r=1),r}function zC(n,e,t,r,i,s){let a=e[i];const o=t[i]||1;(n&1<<i||s&1<<i||a==null)&&(o>0?a=Number.MIN_SAFE_INTEGER:a=Number.MAX_SAFE_INTEGER);const A=r[i];return a<0&&(a+=A),a=Af(0,a,A-1),a}function WC(n,e,t,r,i,s){let a=e[i];const o=t[i]||1;(n&1<<i||s&1<<i||a==null)&&(o>0?a=Number.MAX_SAFE_INTEGER:a=Number.MIN_SAFE_INTEGER);const A=r[i];return a<0&&(a+=A),o>0?a=Af(0,a,A):a=Af(-1,a,A-1),a}function Xg(n,e,t){let r=t.length;for(let i=0;i<t.length;i++)if(t[i]>1){r=i;break}for(let i=r+1;i<t.length;i++)if(e[i]>0||t[i]!==n[i])return!1;return!0}function jg(n,e){let t=n.length>0?n[n.length-1]:1;for(let r=0;r<n.length-1;r++)t+=n[r]*e[r];return t}function KC(n,e,t){let r;const i=n.shape.length;typeof e=="number"?r=[e,...new Array(i-1).fill(0)]:e.length<i?r=e.concat(new Array(i-e.length).fill(0)):r=e.slice(),r.forEach(a=>{H(a!==-1,()=>"slice() does not support negative begin indexing.")});let s;return t==null?s=new Array(i).fill(-1):typeof t=="number"?s=[t,...new Array(i-1).fill(-1)]:t.length<i?s=t.concat(new Array(i-t.length).fill(-1)):s=t,s=s.map((a,o)=>a>=0?a:(H(a===-1,()=>`Negative size values should be exactly -1 but got ${a} for the slice() size at index ${o}.`),n.shape[o]-r[o])),[r,s]}function XC(n,e,t,r,i,s,a,o,A){let l;if(r==null?(l=new Array(e.length),l.fill(1)):l=r,a!=null&&(a&a-1)!==0)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const u={dims:l.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:t.slice(),strides:l.slice(),beginMask:i,endMask:s,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:A};for(let C=0;C<u.dims;
vendor: 4,395 bytes, lines 8301-8319
8301C++)c&&(1<<C&o)!==0&&u.numAddAxisAfterEllipsis++,1<<C&a&&(c=!0);c||(u.ellipsisMask|=1<<u.dims,u.dims++);const h={dims:n.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};m$(u,h);let f=!0,d=!0,g=!0;const m=[],p=[];for(let C=0;C<n.length;++C){if(h.strides[C]===0)throw Error(`strides[${C}] must be non-zero`);const b=!!(h.shrinkAxisMask&1<<C),U=n[C];if(U===-1){m.push(b?1:-1);continue}const F=[h.beginMask&1<<C,h.endMask&1<<C],D=[h.strides[C]>0?0:-1,h.strides[C]>0?U:U-1];if(b&&h.strides[C]<=0)throw Error("only stride 1 allowed on non-range indexing.");g=g&&h.strides[C]===1;const O=!!(h.beginMask&1<<C&&h.endMask&1<<C);if(h.beginValid&&h.endValid){if(b){const re=h.begin[C]<0?U+h.begin[C]:h.begin[C];if(h.begin[C]=re,h.end[C]=h.begin[C]+1,re<0||re>=U)throw Error(`slice index ${h.begin[C]} of dimension ${C} out of bounds.`)}else h.begin[C]=h3(h.begin[C],0,h.strides[C],U,F,D),h.end[C]=h3(h.end[C],1,h.strides[C],U,F,D);const V=h.strides[C]===1&&h.begin[C]===0&&h.end[C]===U;f=f&&V,d=d&&(C===0&&h.strides[C]===1||V)}else f=f&&h.strides[C]===1&&O,d=d&&(C===0&&h.strides[C]===1||O);let I,R=!1;if(h.beginValid&&h.endValid?(I=h.end[C]-h.begin[C],R=!0):b?(I=1,R=!0):O&&U>=0&&(h.strides[C]<0?I=-U:I=U,R=!0),R){let V;I===0||I<0!=h.strides[C]<0?V=0:V=Math.trunc(I/h.strides[C])+(I%h.strides[C]!==0?1:0),m.push(V)}else m.push(-1)}for(let C=0;C<h.finalShapeGatherIndices.length;++C){const b=h.finalShapeGatherIndices[C];b>=0?p.push(m[b]):b===h1&&p.push(1)}return{finalShapeSparse:p.filter((C,b)=>h.finalShapeGatherIndices[b]!==h1),finalShape:p,isIdentity:f,sliceDim0:d,isSimpleSlice:g,begin:h.begin,end:h.end,strides:h.strides}}function m$(n,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let t=0;e.beginValid=n.begin!=null,e.endValid=n.end!=null,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let r=0;r<n.dims;r++)if(1<<r&n.ellipsisMask){const i=Math.min(e.dims-(n.dims-r)+1+n.numAddAxisAfterEllipsis,e.dims);for(;t<i;t++)e.begin[t]=0,e.end[t]=0,e.strides[t]=1,e.beginMask|=1<<t,e.endMask|=1<<t,e.finalShapeGatherIndices.push(t),e.finalShapeGatherIndicesSparse.push(-1),e.inputShapeGatherIndicesSparse[t]=r}else if(1<<r&n.newAxisMask)e.finalShapeGatherIndices.push(h1),e.finalShapeGatherIndicesSparse.push(-1);else{if(t===e.begin.length)throw Error(`Index out of range using input dim ${t}; input has only ${e.dims} dims, ${e.begin.length}.`);n.begin!=null&&(e.begin[t]=n.begin[r]),n.end!=null&&(e.end[t]=n.end[r]),e.strides[t]=n.strides[r],n.beginMask&1<<r&&(e.beginMask|=1<<t),n.endMask&1<<r&&(e.endMask|=1<<t),n.shrinkAxisMask&1<<r?(e.finalShapeGatherIndices.push(f$),e.finalShapeGatherIndicesSparse.push(-1),e.shrinkAxisMask|=1<<t):(e.finalShapeGatherIndices.push(t),e.finalShapeGatherIndicesSparse.push(r)),e.inputShapeGatherIndicesSparse[t]=r,t++}}function h3(n,e,t,r,i,s){if(i[e])return t>0?s[e]:s[e+1&1];{const a=n<0?r+n:n;return a<s[0]?s[0]:a>s[1]?s[1]:a}}const g$=Object.freeze(Object.defineProperty({__proto__:null,assertParamsValid:OC,maskToAxes:d$,computeOutShape:PC,stridesWithElidedDims:kC,getNormalizedAxes:p$,startIndicesWithElidedDims:HC,stopIndicesWithElidedDims:VC,stridesForAxis:GC,startForAxis:zC,stopForAxis:WC,isSliceContinous:Xg,computeFlatOffset:jg,parseSliceParams:KC,sliceInfo:XC},Symbol.toStringTag,{value:"Module"}));/** 8302 * @license 8303 * Copyright 2017 Google LLC. All Rights Reserved. 8304 * Licensed under the Apache License, Version 2.0 (the "License"); 8305 * you may not use this file except in compliance with the License. 8306 * You may obtain a copy of the License at 8307 * 8308 * http://www.apache.org/licenses/LICENSE-2.0 8309 * 8310 * Unless required by applicable law or agreed to in writing, software 8311 * distributed under the License is distributed on an "AS IS" BASIS, 8312 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8313 * See the License for the specific language governing permissions and 8314 * limitations under the License. 8315 * ============================================================================= 8316 */const y$=(()=>typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:n=>n())();function v$(){return new Promise(n=>y$(()=>n()))}/** 8317 * @license 8318 * Copyright 2017 Google LLC. All Rights Reserved. 8319 * Licensed under the Apache License, Version 2.0 (the "License");
8320 * you may not use this file except in compliance with the License. 8321 * You may obtain a copy of the License at 8322 * 8323 * http://www.apache.org/licenses/LICENSE-2.0 8324 * 8325 * Unless required by applicable law or agreed to in writing, software 8326 * distributed under the License is distributed on an "AS IS" BASIS, 8327 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8328 * See the License for the specific language governing permissions and 8329 * limitations under the License. 8330 * ============================================================================= 8331 */function jC(n,e){const t=n[0].length;n.forEach((i,s)=>{H(i.length===t,()=>`Error in concat${t}D: rank of tensors[${s}] must be the same as the rank of the rest (${t})`)}),H(e>=0&&e<t,()=>`Error in concat${t}D: axis must be between 0 and ${t-1}.`);const r=n[0];n.forEach((i,s)=>{for(let a=0;a<t;a++)H(a===e||i[a]===r[a],()=>`Error in concat${t}D: Shape of tensors[${s}] (${i}) does not match the shape of the rest (${r}) along the non-concatenated axis ${s}.`)})}function yA(n,e){const t=n[0].slice();for(let r=1;r<n.length;r++)t[e]+=n[r][e];return t}/** 8332 * @license 8333 * Copyright 2022 Google LLC. All Rights Reserved. 8334 * Licensed under the Apache License, Version 2.0 (the "License"); 8335 * you may not use this file except in compliance with the License. 8336 * You may obtain a copy of the License at 8337 * 8338 * http://www.apache.org/licenses/LICENSE-2.0 8339 * 8340 * Unless required by applicable law or agreed to in writing, software 8341 * distributed under the License is distributed on an "AS IS" BASIS, 8342 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8343 * See the License for the specific language governing permissions and 8344 * limitations under the License. 8345 * ============================================================================= 8346 */var vs;(function(n){n[n.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",n[n.VALUE_ROWIDS=1]="VALUE_ROWIDS",n[n.ROW_LENGTHS=2]="ROW_LENGTHS",n[n.ROW_SPLITS=3]="ROW_SPLITS",n[n.ROW_LIMITS=4]="ROW_LIMITS",n[n.ROW_STARTS=5]="ROW_STARTS"})(vs||(vs={}));function YC(n,e,t){let r=new Array;if(t==null&&e==null)return r;if(e==null)for(;r.length<n+t.length;)r.push(-1);else r=e.slice();if(t==null)return r;if(n+t.length!==r.length)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.rank = ${n+t.length}, but shape.rank = ${r.length}`);for(let i=1;i<t.length;++i){const s=t[i],a=r[r.length-t.length+i],o=r[a];if(s>=0)if(o>=0){if(o!==s)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${i+n}] = ${s} but shape[${i+n}] = ${o}`)}else r[a]=s}return r}function qC(n){const e={FIRST_DIM_SIZE:vs.FIRST_DIM_SIZE,VALUE_ROWIDS:vs.VALUE_ROWIDS,ROW_LENGTHS:vs.ROW_LENGTHS,ROW_SPLITS:vs.ROW_SPLITS,ROW_LIMITS:vs.ROW_LIMITS,ROW_STARTS:vs.ROW_STARTS},t=[];for(const r of n)if(r in e)t.push(e[r]);else break;return t}function JC(n){return n.length===0?0:n[0]===vs.FIRST_DIM_SIZE?n.length-1:n.length}function ZC(n,e){if(n==null||e==null)return;const t=n.length,r=e.length;if(t>=r)throw new Error(`defaultValue.shape=${n} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${t} must be less than ragged tensor input flatValues.rank = ${r})`);for(let i=0;i<Math.min(t,r-1);++i){const s=n[i],a=e[i+1];if(s>=0&&a>=0&&s!==1&&s!==a)throw new Error(`defaultValue.shape=${n}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${i-n.length}] = ${s} but ragged tensor input.flatValues.shape[${i-n.length}] = ${a}`)}}/** 8347 * @license 8348 * Copyright 2017 Google LLC. All Rights Reserved. 8349 * Licensed under the Apache License, Version 2.0 (the "License"); 8350 * you may not use this file except in compliance with the License. 8351 * You may obtain a copy of the License at 8352 * 8353 * http://www.apache.org/licenses/LICENSE-2.0 8354 * 8355 * Unless required by applicable law or agreed to in writing, software 8356 * distributed under the License is distributed on an "AS IS" BASIS, 8357 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8358 * See the License for the specific language governing permissions and 8359 * limitations under the License. 8360 * ============================================================================= 8361 */const Yg=30;function rd(n){return n<=Yg?n:Hm(n,Math.floor(Math.sqrt(n)))}/** 8362 * @license 8363 * Copyright 2020 Google LLC. All Rights Reserved. 8364 * Licensed under the Apache License, Version 2.0 (the "License");
8365 * you may not use this file except in compliance with the License. 8366 * You may obtain a copy of the License at 8367 * 8368 * http://www.apache.org/licenses/LICENSE-2.0 8369 * 8370 * Unless required by applicable law or agreed to in writing, software 8371 * distributed under the License is distributed on an "AS IS" BASIS, 8372 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8373 * See the License for the specific language governing permissions and 8374 * limitations under the License. 8375 * ============================================================================= 8376 */function e_(n,e,t){const r=t*(typeof n=="number"?n:n[0]),i=e*(typeof n=="number"?n:n[1]);return[r,i]}/** 8377 * @license 8378 * Copyright 2018 Google LLC. All Rights Reserved. 8379 * Licensed under the Apache License, Version 2.0 (the "License"); 8380 * you may not use this file except in compliance with the License. 8381 * You may obtain a copy of the License at 8382 * 8383 * http://www.apache.org/licenses/LICENSE-2.0 8384 * 8385 * Unless required by applicable law or agreed to in writing, software 8386 * distributed under the License is distributed on an "AS IS" BASIS, 8387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8388 * See the License for the specific language governing permissions and 8389 * limitations under the License. 8390 * ============================================================================= 8391 */function qg(n,e,t,r=!0){let i=[];if(r)i=i.concat(e.slice(0)),i.push(n[0]/t),i=i.concat(n.slice(1));else{i=i.concat(n[0]);const s=e.length;for(let a=0;a<s;++a)i=i.concat([n[a+1]/e[a],e[a]]);i=i.concat(n.slice(s+1))}return i}function Jg(n,e,t=!0){const r=[];if(t){r.push(e);for(let i=e+1;i<n;++i)i<=2*e?(r.push(i),r.push(i-(e+1))):r.push(i)}else{const i=[],s=[];for(let a=1;a<n;++a)a>=e*2+1||a%2===1?s.push(a):i.push(a);r.push(...i),r.push(0),r.push(...s)}return r}function Zg(n,e,t,r=!0){const i=[];r?i.push(n[0]/t):i.push(n[0]*t);for(let s=1;s<n.length;++s)s<=e.length?r?i.push(e[s-1]*n[s]):i.push(n[s]/e[s-1]):i.push(n[s]);return i}function t_(n,e){const t=[0];for(let r=0;r<e;++r)t.push(n[r][0]);return t}function n_(n,e,t){const r=n.slice(0,1);for(let i=0;i<t;++i)r.push(n[i+1]-e[i][0]-e[i][1]);return r}/** 8392 * @license 8393 * Copyright 2018 Google LLC. All Rights Reserved. 8394 * Licensed under the Apache License, Version 2.0 (the "License"); 8395 * you may not use this file except in compliance with the License. 8396 * You may obtain a copy of the License at 8397 * 8398 * http://www.apache.org/licenses/LICENSE-2.0 8399 * 8400 * Unless required by applicable law or agreed to in writing, software 8401 * distributed under the License is distributed on an "AS IS" BASIS, 8402 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8403 * See the License for the specific language governing permissions and 8404 * limitations under the License. 8405 * ============================================================================= 8406 */const r_=1.7580993408473768,i_=1.0507009873554805;/** 8407 * @license 8408 * Copyright 2018 Google LLC. All Rights Reserved. 8409 * Licensed under the Apache License, Version 2.0 (the "License"); 8410 * you may not use this file except in compliance with the License. 8411 * You may obtain a copy of the License at 8412 * 8413 * http://www.apache.org/licenses/LICENSE-2.0 8414 * 8415 * Unless required by applicable law or agreed to in writing, software 8416 * distributed under the License is distributed on an "AS IS" BASIS, 8417 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8418 * See the License for the specific language governing permissions and 8419 * limitations under the License. 8420 * ============================================================================= 8421 */const s_=.3275911,a_=.254829592,o_=-.284496736,A_=1.421413741,l_=-1.453152027,c_=1.061405429;/** 8422 * @license 8423 * Copyright 2018 Google LLC. All Rights Reserved. 8424 * Licensed under the Apache License, Version 2.0 (the "License"); 8425 * you may not use this file except in compliance with the License. 8426 * You may obtain a copy of the License at 8427 * 8428 * http://www.apache.org/licenses/LICENSE-2.0 8429 * 8430 * Unless required by applicable law or agreed to in writing, software 8431 * distributed under the License is distributed on an "AS IS" BASIS, 8432 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8433 * See the License for the specific language governing permissions and 8434 * limitations under the License. 8435 * ============================================================================= 8436 */function f1(n,e){if(n.length!==e.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${n.length}, imag: ${e.length}.`);const t=new Float32Array(n.length*2);for(let r=0;r<t.length;r+=2)t[r]=n[r/2],t[r+1]=e[r/2];return t}function w$(n){const e=new Float32Array(n.length/2),t=new Float32Array(n.length/2);for(let r=0;r<n.length;r+=2)e[r/2]=n[r],t[r/2]=n[r+1];return{real:e,imag:t}}function x$(n){const e=Math.ceil(n.length/4),t=new Float32Array(e),r=new Float32Array(e);for(let i=0;i<n.length;i+=4)t[Math.floor(i/4)]=n[i],r[Math.floor(i/4)]=n[i+1];return{real:t,imag:r}}function b$(n){const e=Math.floor(n.length/4),t=new Float32Array(e),r=new Float32Array(e);for(let i=2;i<n.length;i+=4)t[Math.floor(i/4)]=n[i],r[Math.floor(i/4)]=n[i+1];return{real:t,imag:r}}function C$(n,e){const t=n[e*2],r=n[e*2+1];return{real:t,imag:r}}function _$(n,e,t,r){n[r*2]=e,n[r*2+1]=t}function B$(n,e){const t=new Float32Array(n/2),r=new Float32Array(n/2);for(let i=0;i<Math.ceil(n/2);i++){const s=(e?2:-2)*Math.PI*(i/n);t[i]=Math.cos(s),r[i]=Math.sin(s)}return{real:t,imag:r}}function E$(n,e,t){const r=(t?2:-2)*Math.PI*(n/e),i=Math.cos(r),s=Math.sin(r);return{real:i,imag:s}}/** 8437 * @license 8438 * Copyright 2021 Google LLC. All Rights Reserved. 8439 * Licensed under the Apache License, Version 2.0 (the "License");
8440 * you may not use this file except in compliance with the License. 8441 * You may obtain a copy of the License at 8442 * 8443 * http://www.apache.org/licenses/LICENSE-2.0 8444 * 8445 * Unless required by applicable law or agreed to in writing, software 8446 * distributed under the License is distributed on an "AS IS" BASIS, 8447 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8448 * See the License for the specific language governing permissions and 8449 * limitations under the License. 8450 * ============================================================================= 8451 */const Ap="->",S$=/->/g,f3=",",d3="...";function u_(n,e){n=n.replace(/\s/g,"");const t=(n.length-n.replace(S$,"").length)/Ap.length;if(t<1)throw new Error("Equations without an arrow are not supported.");if(t>1)throw new Error(`Equation must contain exactly one arrow ("${Ap}").`);const[r,i]=n.split(Ap);H(r.indexOf(d3)===-1,()=>`The ellipsis notation ("${d3}") is not supported yet.`);const s=r.split(f3),a=s.length;if(e!==a)throw new Error(`Expected ${a} input tensors, received ${e}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const o=[];for(let h=0;h<i.length;++h){const f=i[h];if(!s.some(d=>d.indexOf(f)!==-1))throw new Error(`Output subscripts contain the label ${f} not present in the input subscripts.`);o.indexOf(f)===-1&&o.push(f)}for(let h=0;h<r.length;++h){const f=r[h];o.indexOf(f)===-1&&f!==f3&&o.push(f)}const A=new Array(s.length);for(let h=0;h<a;++h){if(new Set(s[h].split("")).size!==s[h].length)throw new Error(`Found duplicate axes in input component ${s[h]}. Support for duplicate axes in input is not implemented yet.`);A[h]=[];for(let f=0;f<s[h].length;++f)A[h].push(o.indexOf(s[h][f]))}const l=o.length,c=i.length,u=[];for(let h=c;h<l;++h)u.push(h);return{allDims:o,summedDims:u,idDims:A}}function h_(n,e){let t=new Array(n);t.fill(-1);for(let i=0;i<e.length;++i)t[e[i]]=i;const r=[];for(let i=0;i<n;++i)t[i]===-1&&r.push(i);return t=t.filter(i=>i!==-1),{permutationIndices:t,expandDims:r}}function f_(n,e,t){const r=new Array(n);for(let i=0;i<t.length;++i){const s=t[i].shape;for(let a=0;a<e[i].length;++a)r[e[i][a]]===void 0?r[e[i][a]]=s[a]:H(r[e[i][a]]===s[a],()=>`Expected dimension ${r[e[i][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`)}}function d_(n,e){const t=n,r=[];let i=0;n.length===0&&t.push(-1),i=n.length+1;for(let a=0;a<i;++a)r.push([]);const s=[];for(let a=0;a<t.length;++a){const o=t[a],A=T$(e,o);for(const l of A)s.indexOf(l)===-1&&(r[a].push(l),s.push(l))}return{path:t,steps:r}}function p_(n){return n.every((e,t)=>e===t)}function T$(n,e){const t=[];for(let r=0;r<n.length;++r)(n[r].length===0||n[r].indexOf(e)!==-1||e===-1)&&t.push(r);return t}function m_(n,e,t=0){let r=[];if(typeof e=="number")H(n.shape[t]%e===0,()=>"Number of splits must evenly divide the axis."),r=new Array(e).fill(n.shape[t]/e);else{const i=e.reduce((a,o)=>(o===-1&&(a+=1),a),0);H(i<=1,()=>"There should be only one negative value in split array.");const s=e.indexOf(-1);if(s!==-1){const a=e.reduce((o,A)=>A>0?o+A:o);e[s]=n.shape[t]-a}H(n.shape[t]===e.reduce((a,o)=>a+o),()=>"The sum of sizes must match the size of the axis dimension."),r=e}return r}/** 8452 * @license 8453 * Copyright 2021 Google LLC. All Rights Reserved. 8454 * Licensed under the Apache License, Version 2.0 (the "License"); 8455 * you may not use this file except in compliance with the License. 8456 * You may obtain a copy of the License at 8457 * 8458 * http://www.apache.org/licenses/LICENSE-2.0 8459 * 8460 * Unless required by applicable law or agreed to in writing, software 8461 * distributed under the License is distributed on an "AS IS" BASIS, 8462 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8463 * See the License for the specific language governing permissions and 8464 * limitations under the License. 8465 * ============================================================================= 8466 */function g_(n){return`Received SparseTensor with denseShape[0] = 0 but 8467 indices.shape[0] = ${n}`}function y_(n,e){return`indices(${n}, 0) is invalid: ${e} < 0`}function v_(n,e,t){return`indices(${n}
8467, 0) is invalid: ${e} >= ${t}`}/** 8468 * @license 8469 * Copyright 2021 Google LLC. All Rights Reserved. 8470 * Licensed under the Apache License, Version 2.0 (the "License"); 8471 * you may not use this file except in compliance with the License. 8472 * You may obtain a copy of the License at 8473 * 8474 * http://www.apache.org/licenses/LICENSE-2.0 8475 * 8476 * Unless required by applicable law or agreed to in writing, software 8477 * distributed under the License is distributed on an "AS IS" BASIS, 8478 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8479 * See the License for the specific language governing permissions and 8480 * limitations under the License. 8481 * ============================================================================= 8482 */function w_(n,e){return`only one output dimension may be -1, not both ${n} and ${e}`}function x_(n,e){return`size ${n} must be non-negative, not ${e}`}function b_(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function C_(n,e){const t=ze(n),r=ze(e);return`Input to reshape is a SparseTensor with ${t} 8483 dense values, but the requested shape requires a multiple of ${r}. inputShape=${n} outputShape= ${e}`}function __(n,e){const t=ze(n),r=ze(e);return`Input to reshape is a tensor with ${t} dense values, but the requested shape has ${r}. inputShape=${n} outputShape=${e}`}/** 8484 * @license 8485 * Copyright 2021 Google LLC. All Rights Reserved. 8486 * Licensed under the Apache License, Version 2.0 (the "License"); 8487 * you may not use this file except in compliance with the License. 8488 * You may obtain a copy of the License at 8489 * 8490 * http://www.apache.org/licenses/LICENSE-2.0 8491 * 8492 * Unless required by applicable law or agreed to in writing, software 8493 * distributed under the License is distributed on an "AS IS" BASIS, 8494 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8495 * See the License for the specific language governing permissions and 8496 * limitations under the License. 8497 * ============================================================================= 8498 */function d1(){return"segment ids must be >= 0"}function B_(){return"segment ids are not increasing"}function E_(n,e){return`Segment id ${n} out of range [0, ${e}), possibly because segmentIds input is not sorted.`}function S_(n,e,t){return`Bad: indices[${n}] == ${e} out of range [0, ${t})`}/** 8499 * @license 8500 * Copyright 2018 Google LLC. All Rights Reserved. 8501 * Licensed under the Apache License, Version 2.0 (the "License"); 8502 * you may not use this file except in compliance with the License. 8503 * You may obtain a copy of the License at 8504 * 8505 * http://www.apache.org/licenses/LICENSE-2.0 8506 * 8507 * Unless required by applicable law or agreed to in writing, software 8508 * distributed under the License is distributed on an "AS IS" BASIS, 8509 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8510 * See the License for the specific language governing permissions and 8511 * limitations under the License. 8512 * ============================================================================= 8513 */function T_(n,e){let t=!1,r;for(n<=Yg?(r=n,t=!0):r=Hm(n,Math.floor(Math.sqrt(n)));!t;)r>e||r===n?t=!0:r=Hm(n,r+1);return r}function I_(n,e,t){const r=[],i=n.length;for(let s=0;s<i;s++)s!==e?r.push(n[s]):r.push(t);return r}function F_(n,e,t,r){const i=e.shape.length,s=n.shape.length;if(r!==0&&(r<-i||r>i))throw new Error(`Expect batchDims in the range of [-${i}, ${i}], but got ${r}`);if(r<0&&(r+=i),r>s)throw new Error(`batchDims (${r}) must be less than rank(x) ( 8514 ${s}).`);if(t<r)throw new Error(`batchDims (${r}) must be less than or equal to axis (${t}).`);for(let u=0;u<r;++u)if(n.shape[u]!==e.shape[u])throw new Error(`x.shape[${u}]: ${n.shape[u]} should be equal to indices.shape[${u}]: ${e.shape[u]}.`);const a=n.shape[t],o=[];let A=1,l=1,c=1;for(let u=0;u<r;++u)o.push(n.shape[u]),A*=n.shape[u];for(let u=r;u<t;u++)o.push(n.shape[u]),l*=n.shape[u];for(let u=r;u<i;u++)o.push(e.shape[u]);for(let u=t+1;u<s;u++)o.push(n.shape[u]),c*=n.shape[u];return{batchSize:A,sliceSize:c,outerSize:l,dimSize:a,outputShape:o}}const I$=Object.freeze(Object.defineProperty({__proto__:null,segOpComputeOptimalWindowSize:T_,computeOutShape:I_,collectGatherOpShapeInfo:F_},Symbol.toStringTag,{value:"Module"}));/** 8515 * @license 8516 * Copyright 2018 Google LLC. All Rights Reserved. 8517 * Licensed under the Apache License, Version 2.0 (the "License");
8518 * you may not use this file except in compliance with the License. 8519 * You may obtain a copy of the License at 8520 * 8521 * http://www.apache.org/licenses/LICENSE-2.0 8522 * 8523 * Unless required by applicable law or agreed to in writing, software 8524 * distributed under the License is distributed on an "AS IS" BASIS, 8525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8526 * See the License for the specific language governing permissions and 8527 * limitations under the License. 8528 * ============================================================================= 8529 */function Ul(n){try{return n.map(e=>Il(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function R_(n){return n.map(e=>nA(e))}const F$=Object.freeze(Object.defineProperty({__proto__:null,slice_util:g$,segment_util:I$,fromUint8ToStringArray:Ul,fromStringArrayToUint8:R_,upcastType:Ys,axesAreInnerMostDims:Ng,combineLocations:Qb,computeOutAndReduceShapes:Zs,expandShapeToKeepDim:Qi,assertAxesAreInnerMostDims:Ms,getAxesPermutation:As,getUndoAxesPermutation:Dg,getInnerMostAxes:ls,getBroadcastDims:pf,getReductionAxes:Pb,assertAndGetBroadcastShape:Cn,assertParamsConsistent:jC,computeOutShape:yA,computeDilation2DInfo:Ub,computePool2DInfo:CA,computePool3DInfo:mu,computeConv2DInfo:$i,computeConv3DInfo:gu,computeDefaultPad:Ug,tupleValuesAreOne:jc,eitherStridesOrDilationsAreOne:Ti,stridesOrDilationsArePositive:dA,convertConv2DDataFormat:Vl,checkPadOnDimRoundingMode:os,getFusedDyActivation:Zf,getFusedBiasGradient:ed,applyActivation:td,shouldFuse:nd,get RowPartitionType(){return vs},combineRaggedTensorToTensorShapes:YC,getRowPartitionTypesHelper:qC,getRaggedRank:JC,validateDefaultValueShape:ZC,PARALLELIZE_THRESHOLD:Yg,computeOptimalWindowSize:rd,getImageCenter:e_,getReshaped:qg,getPermuted:Jg,getReshapedPermuted:Zg,getSliceBeginCoords:t_,getSliceSize:n_,prepareAndValidate:LC,validateUpdateShape:yC,validateInput:Vg,calculateShapes:Jf,SELU_SCALEALPHA:r_,SELU_SCALE:i_,ERF_P:s_,ERF_A1:a_,ERF_A2:o_,ERF_A3:A_,ERF_A4:l_,ERF_A5:c_,warn:Cs,log:OM,mergeRealAndImagArrays:f1,splitRealAndImagArrays:w$,complexWithEvenIndex:x$,complexWithOddIndex:b$,getComplexWithIndex:C$,assignToTypedArray:_$,exponents:B$,exponent:E$,decodeEinsumEquation:u_,getEinsumPermutation:h_,checkEinsumDimSizes:f_,getEinsumComputePath:d_,isIdentityPermutation:p_,prepareSplitSize:m_,getSparseFillEmptyRowsIndicesDenseShapeMismatch:g_,getSparseFillEmptyRowsNegativeIndexErrorMessage:y_,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:v_,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:w_,getSparseReshapeNegativeOutputDimErrorMessage:x_,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:b_,getSparseReshapeInputOutputMultipleErrorMessage:C_,getSparseReshapeInputOutputMismatchErrorMessage:__,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:d1,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:B_,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:E_,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:S_},Symbol.toStringTag,{value:"Module"}));/** 8530 * @license 8531 * Copyright 2017 Google LLC. All Rights Reserved. 8532 * Licensed under the Apache License, Version 2.0 (the "License"); 8533 * you may not use this file except in compliance with the License. 8534 * You may obtain a copy of the License at 8535 * 8536 * http://www.apache.org/licenses/LICENSE-2.0 8537 * 8538 * Unless required by applicable law or agreed to in writing, software 8539 * distributed under the License is distributed on an "AS IS" BASIS, 8540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8541 * See the License for the specific language governing permissions and 8542 * limitations under the License. 8543 * ============================================================================= 8544 */Kk();/** 8545 * @license 8546 * Copyright 2021 Google LLC. All Rights Reserved. 8547 * Licensed under the Apache License, Version 2.0 (the "License"); 8548 * you may not use this file except in compliance with the License. 8549 * You may obtain a copy of the License at 8550 * 8551 * http://www.apache.org/licenses/LICENSE-2.0 8552 * 8553 * Unless required by applicable law or agreed to in writing, softw
8553are 8554 * distributed under the License is distributed on an "AS IS" BASIS, 8555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8556 * See the License for the specific language governing permissions and 8557 * limitations under the License. 8558 * ============================================================================= 8559 */const R$=pe();R$.registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,n=>{n&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});/** 8560 * @license 8561 * Copyright 2019 Google LLC. All Rights Reserved. 8562 * Licensed under the Apache License, Version 2.0 (the "License"); 8563 * you may not use this file except in compliance with the License. 8564 * You may obtain a copy of the License at 8565 * 8566 * http://www.apache.org/licenses/LICENSE-2.0 8567 * 8568 * Unless required by applicable law or agreed to in writing, software 8569 * distributed under the License is distributed on an "AS IS" BASIS, 8570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8571 * See the License for the specific language governing permissions and 8572 * limitations under the License. 8573 * 8574 * ============================================================================= 8575 */var wi;(function(n){n[n.DT_INVALID=0]="DT_INVALID",n[n.DT_FLOAT=1]="DT_FLOAT",n[n.DT_DOUBLE=2]="DT_DOUBLE",n[n.DT_INT32=3]="DT_INT32",n[n.DT_UINT8=4]="DT_UINT8",n[n.DT_INT16=5]="DT_INT16",n[n.DT_INT8=6]="DT_INT8",n[n.DT_STRING=7]="DT_STRING",n[n.DT_COMPLEX64=8]="DT_COMPLEX64",n[n.DT_INT64=9]="DT_INT64",n[n.DT_BOOL=10]="DT_BOOL",n[n.DT_QINT8=11]="DT_QINT8",n[n.DT_QUINT8=12]="DT_QUINT8",n[n.DT_QINT32=13]="DT_QINT32",n[n.DT_BFLOAT16=14]="DT_BFLOAT16",n[n.DT_QINT16=15]="DT_QINT16",n[n.DT_QUINT16=16]="DT_QUINT16",n[n.DT_UINT16=17]="DT_UINT16",n[n.DT_COMPLEX128=18]="DT_COMPLEX128",n[n.DT_HALF=19]="DT_HALF",n[n.DT_RESOURCE=20]="DT_RESOURCE",n[n.DT_VARIANT=21]="DT_VARIANT",n[n.DT_UINT32=22]="DT_UINT32",n[n.DT_UINT64=23]="DT_UINT64",n[n.DT_FLOAT_REF=101]="DT_FLOAT_REF",n[n.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",n[n.DT_INT32_REF=103]="DT_INT32_REF",n[n.DT_UINT8_REF=104]="DT_UINT8_REF",n[n.DT_INT16_REF=105]="DT_INT16_REF",n[n.DT_INT8_REF=106]="DT_INT8_REF",n[n.DT_STRING_REF=107]="DT_STRING_REF",n[n.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",n[n.DT_INT64_REF=109]="DT_INT64_REF",n[n.DT_BOOL_REF=110]="DT_BOOL_REF",n[n.DT_QINT8_REF=111]="DT_QINT8_REF",n[n.DT_QUINT8_REF=112]="DT_QUINT8_REF",n[n.DT_QINT32_REF=113]="DT_QINT32_REF",n[n.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",n[n.DT_QINT16_REF=115]="DT_QINT16_REF",n[n.DT_QUINT16_REF=116]="DT_QUINT16_REF",n[n.DT_UINT16_REF=117]="DT_UINT16_REF",n[n.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",n[n.DT_HALF_REF=119]="DT_HALF_REF",n[n.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",n[n.DT_VARIANT_REF=121]="DT_VARIANT_REF",n[n.DT_UINT32_REF=122]="DT_UINT32_REF",n[n.DT_UINT64_REF=123]="DT_UINT64_REF"})(wi||(wi={}));var p3;(function(n){(function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"})(n.CheckpointFormatVersion||(n.CheckpointFormatVersion={}))})(p3||(p3={}));/** 8576 * @license 8577 * Copyright 2019 Google LLC. All Rights Reserved. 8578 * Licensed under the Apache License, Version 2.0 (the "License"); 8579 * you may not use this file except in compliance with the License. 8580 * You may obtain a copy of the License at 8581 * 8582 * http://www.apache.org/licenses/LICENSE-2.0 8583 * 8584 * Unless required by applicable law or agreed to in writing, software 8585 * distributed under the License is distributed on an "AS IS" BASIS, 8586 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8587 * See the License for the specific language governing permissions and 8588 * limitations under the License. 8589 * ============================================================================= 8590 */const U$={};function U_(n){return U$[n]}/** 8591 * @license 8592 * Copyright 2018 Google LLC. All Rights Reserved. 8593 * Licensed under the Apache License, Version 2.0 (the "License"); 8594 * you may not use this file except in compliance with the License. 8595 * You may obtain a copy of the License at 8596 * 8597 * http://www.apache.org/licenses/LICENSE-2.0 8598 * 8599 * Unless required by applicable law or agreed to in writing, softw
8599are 8600 * distributed under the License is distributed on an "AS IS" BASIS, 8601 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8602 * See the License for the specific language governing permissions and 8603 * limitations under the License. 8604 * ============================================================================= 8605 */function B(n,e,t,r,i){const s=e.inputParams[n];if(s&&s.inputIndexStart!==void 0){const o=s.inputIndexStart,A=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd,l=o<0?e.inputNames.length+o:o;if(s.type==="tensor")return Fr(e.inputNames[l],t,r,i);if(s.type==="tensors"){const h=e.inputs.slice(o,A);return e.inputNames.slice(o,A).filter((d,g)=>{var m;return((m=h[g])===null||m===void 0?void 0:m.op)!=="NoOp"}).map(d=>Fr(d,t,r,i))}const c=Fr(e.inputNames[l],t,r,i),u=c.dataSync();return s.type==="number"?u[0]:Vm(c.shape,u)}const a=e.attrParams[n];return a&&a.value}function Fr(n,e,t,r){const[i,s]=xi(n,t);if(r!=null){const o=r.getHashTableHandleByName(i);if(o!=null)return o}const a=t.currentContextIds.find(o=>!!e[wf(i,o)]);return a!==void 0?e[wf(i,a)][s]:void 0}function m3(n,e,t){return e[wf(n,t.currentContextId)]}function pa(n,e){const[t,r,i]=xi(n,e);return[wf(t,e&&e.currentContextId),r,i]}function wf(n,e){return e?`${n}-${e}`:n}function xi(n,e){if(n==="")return["",0,void 0];const t=e!=null&&e.parseNodeNameCache!=null;if(t){const s=e.parseNodeNameCache.get(n);if(s!=null)return s}const r=n.split(":");let i;if(r.length===1)i=[n,0,void 0];else{const s=r[0],a=r.length===3?r[1]:void 0,o=Number(r[r.length-1]);i=[s,o,a]}return t&&e.parseNodeNameCache.set(n,i),i}function jh(n,e,t){let r=B("pad",n,e,t);if(r==="explicit"){r=B("explicitPaddings",n,e,t);const i=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)i[s][0]=r[s*2],i[s][1]=r[s*2+1];return i}return r}function ma(n){return n.kept?n:ho(n)}/** 8606 * @license 8607 * Copyright 2023 Google LLC. All Rights Reserved. 8608 * Licensed under the Apache License, Version 2.0 (the "License"); 8609 * you may not use this file except in compliance with the License. 8610 * You may obtain a copy of the License at 8611 * 8612 * http://www.apache.org/licenses/LICENSE-2.0 8613 * 8614 * Unless required by applicable law or agreed to in writing, software 8615 * distributed under the License is distributed on an "AS IS" BASIS, 8616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8617 * See the License for the specific language governing permissions and 8618 * limitations under the License. 8619 * ============================================================================= 8620 */const M$=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
8620]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],N$=Object.freeze(Object.defineProperty({__proto__:null,json:M$},Symbol.toStringTag,{value:"Module"}));/** 8621 * @license 8622 * Copyright 2023 Google LLC. All Rights Reserved. 8623 * Licensed under the Apache License, Version 2.0 (the "License"); 8624 * you may not use this file except in compliance with the License. 8625 * You may obtain a copy of the License at 8626 * 8627 * http://www.apache.org/licenses/LICENSE-2.0 8628 * 8629 * Unless required by applicable law or agreed to in writing, software 8630 * distributed under the License is distributed on an "AS IS" BASIS, 8631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8632 * See the License for the specific language governing permissions and 8633 * limitations under the License. 8634 * ============================================================================= 8635 */const D$=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
8635]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
8635]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],L$=Object.freeze(Object.defineProperty({__proto__:null,json:D$},Symbol.toStringTag,{value:"Module"}));/** 8636 * @license 8637 * Copyright 2023 Google LLC. All Rights Reserved. 8638 * Licensed under the Apache License, Version 2.0 (the "License"); 8639 * you may not use this file except in compliance with the License. 8640 * You may obtain a copy of the License at 8641 * 8642 * http://www.apache.org/licenses/LICENSE-2.0 8643 * 8644 * Unless required by applicable law or agreed to in writing, software 8645 * distributed under the License is distributed on an "AS IS" BASIS, 8646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8647 * See the License for the specific language governing permissions and 8648 * limitations under the License. 8649 * ============================================================================= 8650 */const O$
vendor: 7,590 bytes, line 8650
8650=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],
8650P$=Object.freeze(Object.defineProperty({__proto__:null,json:O$},Symbol.toStringTag,{value:"Module"}));/** 8651 * @license 8652 * Copyright 2023 Google LLC. All Rights Reserved. 8653 * Licensed under the Apache License, Version 2.0 (the "License"); 8654 * you may not use this file except in compliance with the License. 8655 * You may obtain a copy of the License at 8656 * 8657 * http://www.apache.org/licenses/LICENSE-2.0 8658 * 8659 * Unless required by applicable law or agreed to in writing, software 8660 * distributed under the License is distributed on an "AS IS" BASIS, 8661 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8662 * See the License for the specific language governing permissions and 8663 * limitations under the License. 8664 * ============================================================================= 8665 */const k$=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
vendor: 4,262 bytes, lines 8665-8668
8665,{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],$$=Object.freeze(Object.defineProperty({__proto__:null,json:k$},Symbol.toStringTag,{value:"Module"}));/** 8666 * @license 8667 * Copyright 2023 Google LLC. All Rights Reserved. 8668 * Licensed under the Apache License, Version 2.0 (the "License");
8669 * you may not use this file except in compliance with the License. 8670 * You may obtain a copy of the License at 8671 * 8672 * http://www.apache.org/licenses/LICENSE-2.0 8673 * 8674 * Unless required by applicable law or agreed to in writing, software 8675 * distributed under the License is distributed on an "AS IS" BASIS, 8676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8677 * See the License for the specific language governing permissions and 8678 * limitations under the License. 8679 * ============================================================================= 8680 */const Q$=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],H$=Object.freeze(Object.defineProperty({__proto__:null,json:Q$},Symbol.toStringTag,{value:"Module"}));/** 8681 * @license 8682 * Copyright 2023 Google LLC. All Rights Reserved. 8683 * Licensed under the Apache License, Version 2.0 (the "License");
8684 * you may not use this file except in compliance with the License. 8685 * You may obtain a copy of the License at 8686 * 8687 * http://www.apache.org/licenses/LICENSE-2.0 8688 * 8689 * Unless required by applicable law or agreed to in writing, software 8690 * distributed under the License is distributed on an "AS IS" BASIS, 8691 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8692 * See the License for the specific language governing permissions and 8693 * limitations under the License. 8694 * ============================================================================= 8695 */const V$=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],G$=Object.freeze(Object.defineProperty({__proto__:null,json:V$},Symbol.toStringTag,{value:"Module"}));/** 8696 * @license 8697 * Copyright 2023 Google LLC. All Rights Reserved. 8698 * Licensed under the Apache License, Version 2.0 (the "License"); 8699 * you may not use this file except in compliance with the License. 8700 * You may obtain a copy of the License at 8701 * 8702 * http://www.apache.org/licenses/LICENSE-2.0 8703 * 8704 * Unless required by applicable law or agreed to in writing, software 8705 * distributed under the License is distributed on an "AS IS" BASIS, 8706 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8707 * See the License for the specific language governing permissions and 8708 * limitations under the License. 8709 * ============================================================================= 8710 */const z$=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],W$=Object.freeze(Object.defineProperty({__proto__:null,json:z$},Symbol.toStringTag,{value:"Module"}));/** 8711 * @license 8712 * Copyright 2023 Google LLC. All Rights Reserved. 8713 * Licensed under the Apache License, Version 2.0 (the "License"); 8714 * you may not use this file except in compliance with the License. 8715 * You may obtain a copy of the License at 8716 * 8717 * http://www.apache.org/licenses/LICENSE-2.0 8718 * 8719 * Unless required by applicable law or agreed to in writing, softw
8719are 8720 * distributed under the License is distributed on an "AS IS" BASIS, 8721 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8722 * See the License for the specific language governing permissions and 8723 * limitations under the License. 8724 * ============================================================================= 8725 */const K$=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],X$=Object.freeze(Object.defineProperty({__proto__:null,json:K$},Symbol.toStringTag,{value:"Module"}));/** 8726 * @license 8727 * Copyright 2023 Google LLC. All Rights Reserved. 8728 * Licensed under the Apache License, Version 2.0 (the "License"); 8729 * you may not use this file except in compliance with the License. 8730 * You may obtain a copy of the License at 8731 * 8732 * http://www.apache.org/licenses/LICENSE-2.0 8733 * 8734 * Unless required by applicable law or agreed to in writing, software 8735 * distributed under the License is distributed on an "AS IS" BASIS, 8736 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8737 * See the License for the specific language governing permissions and 8738 * limitations under the License. 8739 * ============================================================================= 8740 */const j$=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}
8740],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],Y$=Object.freeze(Object.defineProperty({__proto__:null,json:j$},Symbol.toStringTag,{value:"Module"}));/** 8741 * @license 8742 * Copyright 2023 Google LLC. All Rights Reserved. 8743 * Licensed under the Apache License, Version 2.0 (the "License"); 8744 * you may not use this file except in compliance with the License. 8745 * You may obtain a copy of the License at 8746 * 8747 * http://www.apache.org/licenses/LICENSE-2.0 8748 * 8749 * Unless required by applicable law or agreed to in writing, software 8750 * distributed under the License is distributed on an "AS IS" BASIS, 8751 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8752 * See the License for the specific language governing permissions and 8753 * limitations under the License. 8754 * ============================================================================= 8755 */const q$=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],J$=Object.freeze(Object.defineProperty({__proto__:null,json:q$},Symbol.toStringTag,{value:"Module"}));/** 8756 * @license 8757 * Copyright 2023 Google LLC. All Rights Reserved. 8758 * Licensed under the Apache License, Version 2.0 (the "License"); 8759 * you may not use this file except in compliance with the License. 8760 * You may obtain a copy of the License at 8761 * 8762 * http://www.apache.org/licenses/LICENSE-2.0 8763 * 8764 * Unless required by applicable law or agreed to in writing, software 8765 * distributed under the License is distributed on an "AS IS" BASIS, 8766 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8767 * See the License for the specific language governing permissions and 8768 * limitations under the License. 8769 * ============================================================================= 8770 */const Z$=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
8770]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],eQ=Object.freeze(Object.defineProperty({__proto__:null,json:Z$},Symbol.toStringTag,{value:"Module"}));/** 8771 * @license 8772 * Copyright 2023 Google LLC. All Rights Reserved. 8773 * Licensed under the Apache License, Version 2.0 (the "License"); 8774 * you may not use this file except in compliance with the License. 8775 * You may obtain a copy of the License at 8776 * 8777 * http://www.apache.org/licenses/LICENSE-2.0 8778 * 8779 * Unless required by applicable law or agreed to in writing, software 8780 * distributed under the License is distributed on an "AS IS" BASIS, 8781 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8782 * See the License for the specific language governing permissions and 8783 * limitations under the License. 8784 * ============================================================================= 8785 */const tQ=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
vendor: 15,939 bytes, lines 8785-8878
8785]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],nQ=Object.freeze(Object.defineProperty({__proto__:null,json:tQ},Symbol.toStringTag,{value:"Module"}));/** 8786 * @license 8787 * Copyright 2023 Google LLC. All Rights Reserved. 8788 * Licensed under the Apache License, Version 2.0 (the "License"); 8789 * you may not use this file except in compliance with the License. 8790 * You may obtain a copy of the License at 8791 * 8792 * http://www.apache.org/licenses/LICENSE-2.0 8793 * 8794 * Unless required by applicable law or agreed to in writing, software 8795 * distributed under the License is distributed on an "AS IS" BASIS, 8796 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8797 * See the License for the specific language governing permissions and 8798 * limitations under the License. 8799 * ============================================================================= 8800 */const rQ=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],iQ=Object.freeze(Object.defineProperty({__proto__:null,json:rQ},Symbol.toStringTag,{value:"Module"}));/** 8801 * @license 8802 * Copyright 2023 Google LLC. All Rights Reserved. 8803 * Licensed under the Apache License, Version 2.0 (the "License"); 8804 * you may not use this file except in compliance with the License. 8805 * You may obtain a copy of the License at 8806 * 8807 * http://www.apache.org/licenses/LICENSE-2.0 8808 * 8809 * Unless required by applicable law or agreed to in writing, software 8810 * distributed under the License is distributed on an "AS IS" BASIS, 8811 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8812 * See the License for the specific language governing permissions and 8813 * limitations under the License. 8814 * ============================================================================= 8815 */const sQ=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],aQ=Object.freeze(Object.defineProperty({__proto__:null,json:sQ},Symbol.toStringTag,{value:"Module"}));/** 8816 * @license 8817 * Copyright 2023 Google LLC. All Rights Reserved. 8818 * Licensed under the Apache License, Version 2.0 (the "License"); 8819 * you may not use this file except in compliance with the License. 8820 * You may obtain a copy of the License at 8821 * 8822 * http://www.apache.org/licenses/LICENSE-2.0 8823 * 8824 * Unless required by applicable law or agreed to in writing, software 8825 * distributed under the License is distributed on an "AS IS" BASIS, 8826 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8827 * See the License for the specific language governing permissions and 8828 * limitations under the License. 8829 * ============================================================================= 8830 */const oQ=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],AQ=Object.freeze(Object.defineProperty({__proto__:null,json:oQ},Symbol.toStringTag,{value:"Module"}));/** 8831 * @license 8832 * Copyright 2023 Google LLC. All Rights Reserved. 8833 * Licensed under the Apache License, Version 2.0 (the "License"); 8834 * you may not use this file except in compliance with the License. 8835 * You may obtain a copy of the License at 8836 * 8837 * http://www.apache.org/licenses/LICENSE-2.0 8838 * 8839 * Unless required by applicable law or agreed to in writing, software 8840 * distributed under the License is distributed on an "AS IS" BASIS, 8841 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8842 * See the License for the specific language governing permissions and 8843 * limitations under the License. 8844 * ============================================================================= 8845 */const lQ=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],cQ=Object.freeze(Object.defineProperty({__proto__:null,json:lQ},Symbol.toStringTag,{value:"Module"}));/** 8846 * @license 8847 * Copyright 2023 Google LLC. All Rights Reserved. 8848 * Licensed under the Apache License, Version 2.0 (the "License"); 8849 * you may not use this file except in compliance with the License. 8850 * You may obtain a copy of the License at 8851 * 8852 * http://www.apache.org/licenses/LICENSE-2.0 8853 * 8854 * Unless required by applicable law or agreed to in writing, software 8855 * distributed under the License is distributed on an "AS IS" BASIS, 8856 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8857 * See the License for the specific language governing permissions and 8858 * limitations under the License. 8859 * ============================================================================= 8860 */const uQ=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],hQ=Object.freeze(Object.defineProperty({__proto__:null,json:uQ},Symbol.toStringTag,{value:"Module"}));/** 8861 * @license 8862 * Copyright 2023 Google LLC. All Rights Reserved. 8863 * Licensed under the Apache License, Version 2.0 (the "License"); 8864 * you may not use this file except in compliance with the License. 8865 * You may obtain a copy of the License at 8866 * 8867 * http://www.apache.org/licenses/LICENSE-2.0 8868 * 8869 * Unless required by applicable law or agreed to in writing, software 8870 * distributed under the License is distributed on an "AS IS" BASIS, 8871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8872 * See the License for the specific language governing permissions and 8873 * limitations under the License. 8874 * ============================================================================= 8875 */const fQ=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],dQ=Object.freeze(Object.defineProperty({__proto__:null,json:fQ},Symbol.toStringTag,{value:"Module"}));/** 8876 * @license 8877 * Copyright 2023 Google LLC. All Rights Reserved. 8878 * Licensed under the Apache License, Version 2.0 (the "License");
8879 * you may not use this file except in compliance with the License. 8880 * You may obtain a copy of the License at 8881 * 8882 * http://www.apache.org/licenses/LICENSE-2.0 8883 * 8884 * Unless required by applicable law or agreed to in writing, software 8885 * distributed under the License is distributed on an "AS IS" BASIS, 8886 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8887 * See the License for the specific language governing permissions and 8888 * limitations under the License. 8889 * ============================================================================= 8890 */const pQ=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}],mQ=Object.freeze(Object.defineProperty({__proto__:null,json:pQ},Symbol.toStringTag,{value:"Module"}));/** 8891 * @license 8892 * Copyright 2018 Google LLC. All Rights Reserved. 8893 * Licensed under the Apache License, Version 2.0 (the "License"); 8894 * you may not use this file except in compliance with the License. 8895 * You may obtain a copy of the License at 8896 * 8897 * http://www.apache.org/licenses/LICENSE-2.0 8898 * 8899 * Unless required by applicable law or agreed to in writing, software 8900 * distributed under the License is distributed on an "AS IS" BASIS, 8901 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8902 * See the License for the specific language governing permissions and 8903 * limitations under the License. 8904 * ============================================================================= 8905 */class g3{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[N$,L$,P$,$$,H$,G$,W$,X$,Y$,J$,eQ,nQ,iQ,aQ,AQ,cQ,hQ,dQ,mQ],t=[].concat(...e.map(r=>r.json));this.opMappers=t.reduce((r,i)=>(r[i.tfOpName]=i,r),{})}transformGraph(e,t={}){const r=e.node,i=[],s=[],a=[],o=r.reduce((g,m)=>(g[m.name]=this.mapNode(m),m.op.startsWith("Placeholder")?i.push(g[m.name]):m.op==="Const"?s.push(g[m.name]):(m.input==null||m.input.length===0)&&a.push(g[m.name]),g),{});let A=[];const l=[];let c={},u={};t!=null&&(c=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));const h=Object.keys(o);h.forEach(g=>{const m=o[g];
8905m.inputNames.forEach((p,w)=>{const[C,,b]=pa(p),U=o[C];if(U.outputs!=null){const F=U.outputs.indexOf(b);if(F!==-1){const D=`${C}:${F}`;m.inputNames[w]=D}}m.inputs.push(U),U.children.push(m)})}),Object.keys(u).length===0?h.forEach(g=>{const m=o[g];m.children.length===0&&l.push(m)}):Object.keys(u).forEach(g=>{const[m]=pa(g),p=o[m];p!=null&&(p.signatureKey=u[g],l.push(p))}),Object.keys(c).length>0?Object.keys(c).forEach(g=>{const[m]=pa(g),p=o[m];p&&(p.signatureKey=c[g],A.push(p))}):A=i;let f={};e.library!=null&&e.library.function!=null&&(f=e.library.function.reduce((g,m)=>(g[m.signature.name]=this.mapFunction(m),g),{}));const d={nodes:o,inputs:A,outputs:l,weights:s,placeholders:i,signature:t,functions:f};return a.length>0&&(d.initNodes=a),d}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,r)=>(t[e[r].name]=r,t),{})}mapNode(e){const t=U_(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});const r={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(i=>i.startsWith("^")?i.slice(1):i),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(r.inputParams=t.inputs.reduce((i,s)=>(i[s.name]={type:s.type,inputIndexStart:s.start,inputIndexEnd:s.end},i),{})),t.attrs!=null&&(r.attrParams=t.attrs.reduce((i,s)=>{const a=s.type;let o;switch(s.type){case"string":o=p1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=p1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"string[]":o=b1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=b1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"number":o=g1(e.attr,s.tfName,s.defaultValue||0),o===void 0&&!!s.tfDeprecatedName&&(o=g1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"number[]":o=x1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=x1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"bool":o=m1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=m1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"bool[]":o=_1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=_1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"shape":o=w1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=w1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"shape[]":o=C1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=C1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"dtype":o=y1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=y1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"dtype[]":o=v1(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=v1(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"func":o=y3(e.attr,s.tfName,s.defaultValue),o===void 0&&!!s.tfDeprecatedName&&(o=y3(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${s.type} for op: ${e.op}`)}return i[s.name]={value:o,type:a},i},{})),r}mapFunction(e){const t=e.nodeDef,r=[],i=[];let s={};t!=null&&(s=t.reduce((u,h)=>(u[h.name]=this.mapNode(h),h.op==="Const"&&i.push(u[h.name]),u),{}));const a=[],o=[];e.signature.inputArg.forEach(u=>{const[h]=pa(u.name),f={name:h,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:e2(u.type),type:"dtype"}},children:[]};f.signatureKey=u.name,a.push(f),s[h]=f}),Object.keys(s).forEach(u=>{const h=s[u];h.inputNames.forEach((f,d)=>{const[g,,m]=pa(f),p=s[g];if(p.outputs!=null){const w=p.outputs.indexOf(m);if(w!==-1){const C=`${g}:${w}`;h.inputNames[d]=C}}h.inputs.push(p),p.children.push(h)})});const l=e.ret;e.signature.outputArg.forEach(u=>{const[h,f]=pa(l[u.name]),d=s[h];d!=null&&(d.defaultOutput=f,o.push(d))});const c=this.mapArgsToSignature(e);return{nodes:s,inputs:a,outputs:o,weights:i,placeholders:r,signature:c}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,r)=>(t[r.name]=this.mapArgToTensorInfo(r),t),{}),outputs:e.signature.outputArg.reduce((t,r)=>(t[r.name]=this.mapArgToTensorInfo(r,e.ret),t),{})}}mapArgToTensorInfo(e,t){let r=e.name;return t!=null&&(r=t[r]),{name:r,dtype:e.type}}}function gQ(n){const e=pe().global;if(typeof e.atob<"u")return e.atob(n);if(typeof Buffer<"u")return new Buffer(n,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function M_(n,e){const t=Array.isArray(n)?String.fromCharCode.apply(null,n):gQ(n);return e?t:t.toLowerCase()}function p1(n,e,t,r=!1){const i=n[e];return i!=null?M_(i.s,r):t}function m1(n,e,t){const r=n[e];return r?r.b:t}function g1(n,e,t){const r=n[e]||{},i=r.i!=null?r.i:r.f!=null?r.f:t;return typeof i=="number"?i:parseInt(i,10)}function e2(n){switch(typeof n=="string"&&(n=wi[n]),n){case wi.DT_FLOAT:case wi.DT_HALF:return"float32";case wi.DT_INT32:case wi.DT_INT64:case wi.DT_INT8:case wi.DT_UINT8:return"int32";case wi.DT_BOOL:return"bool";case wi.DT_DOUBLE:return"float32";case wi.DT_STRING:return"string";case wi.DT_COMPLEX64:case wi.DT_COMPLEX128:return"complex64";default:return null}}function y3(n,e,t){const r=n[e];return r&&r.func?r.func.name:t}function y1(n,e,t){const r=n[e];return r&&r.type?e2(r.type):t}function v1(n,e,t){const r=n[e];return r&&r.list&&r.list.type?r.list.type.map(i=>e2(i)):t}function N_(n){if(!n.unknownRank)return n.dim!=null?n.dim.map(e=>typeof e.size=="number"?e.size:parseInt(e.size,10)):[]}function w1(n,e,t){const r=n[e];return r&&r.shape?N_(r.shape):t}function x1(n,e,t){const r=n[e];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(i=>typeof i=="number"?i:parseInt(i,10)):t}function b1(n,e,t,r=!1){const i=n[e];return i&&i.list&&i.list.s?i.list.s.map(s=>M_(s,r)):t}function C1(n,e,t){const r=n[e];return r&&r.list&&r.list.shape?r.list.shape.map(i=>N_(i)):t}function _1(n,e,t){const r=n[e];return r&&r.list&&r.list.b?r.list.b:t}/** 8906 * @license 8907 * Copyright 2019 Google LLC. All Rights Reserved. 8908 * Licensed under the Apache License, Version 2.0 (the "License");
8909 * you may not use this file except in compliance with the License. 8910 * You may obtain a copy of the License at 8911 * 8912 * http://www.apache.org/licenses/LICENSE-2.0 8913 * 8914 * Unless required by applicable law or agreed to in writing, software 8915 * distributed under the License is distributed on an "AS IS" BASIS, 8916 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8917 * See the License for the specific language governing permissions and 8918 * limitations under the License. 8919 * ============================================================================= 8920 */class yQ{constructor(e,t,r){this.node=e,this.tensorMap=t,this.context=r,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(i=>this.getInput(i)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((i,s)=>(i[s]=this.getAttr(s),i),{}))}getInput(e){return Fr(e,this.tensorMap,this.context)}getAttr(e,t){const r=this.node.rawAttrs[e];if(r.tensor!=null)return Fr(e,this.tensorMap,this.context);if(r.i!=null||r.f!=null)return g1(this.node.rawAttrs,e,t);if(r.s!=null)return p1(this.node.rawAttrs,e,t);if(r.b!=null)return m1(this.node.rawAttrs,e,t);if(r.shape!=null)return w1(this.node.rawAttrs,e,t);if(r.type!=null)return y1(this.node.rawAttrs,e,t);if(r.list!=null){if(r.list.i!=null||r.list.f!=null)return x1(this.node.rawAttrs,e,t);if(r.list.s!=null)return b1(this.node.rawAttrs,e,t);if(r.list.shape!=null)return C1(this.node.rawAttrs,e,t);if(r.list.b!=null)return _1(this.node.rawAttrs,e,t);if(r.list.type!=null)return v1(this.node.rawAttrs,e,t)}return t}}/** 8921 * @license 8922 * Copyright 2020 Google LLC. All Rights Reserved. 8923 * Licensed under the Apache License, Version 2.0 (the "License"); 8924 * you may not use this file except in compliance with the License. 8925 * You may obtain a copy of the License at 8926 * 8927 * http://www.apache.org/licenses/LICENSE-2.0 8928 * 8929 * Unless required by applicable law or agreed to in writing, software 8930 * distributed under the License is distributed on an "AS IS" BASIS, 8931 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8932 * See the License for the specific language governing permissions and 8933 * limitations under the License. 8934 * ============================================================================= 8935 */const Dr=Object.freeze(Object.defineProperty({__proto__:null,abs:Mi,acos:n8,acosh:i8,add:Ut,addN:a8,all:A8,any:c8,argMax:h8,argMin:d8,asin:m8,asinh:y8,atan:w8,atan2:b8,atanh:_8,avgPool:Mb,avgPool3d:U8,basicLSTMCell:k8,batchToSpaceND:Nb,batchNorm:Wf,batchNorm2d:G8,batchNorm3d:W8,batchNorm4d:X8,bincount:Db,bitwiseAnd:q8,broadcastArgs:Z8,broadcastTo:Mc,buffer:ir,cast:Kn,ceil:n7,clipByValue:Lb,clone:ho,complex:xo,concat:Nr,concat1d:s7,concat2d:o7,concat3d:l7,concat4d:u7,conv1d:d7,conv2d:Kf,conv2dTranspose:g7,conv3d:v7,conv3dTranspose:C7,cos:B7,cosh:S7,cumprod:I7,cumsum:R7,denseBincount:M7,depthToSpace:D7,depthwiseConv2d:Mg,diag:P7,dilation2d:$7,div:dn,divNoNan:z7,dot:K7,einsum:tl,elu:$b,ensureShape:q7,equal:kb,erf:Z7,euclideanNorm:AD,exp:Ea,expandDims:qi,expm1:hD,eye:Vb,fill:yu,floor:Gb,floorDiv:Rb,gather:zb,greater:jf,greaterEqual:Wb,imag:Yf,isFinite:xD,isInf:CD,isNaN:BD,leakyRelu:Kb,less:l1,lessEqual:Lg,linspace:ID,localResponseNormalization:RD,log:qc,log1p:Xb,logSigmoid:PD,logSoftmax:QD,logSumExp:Yb,logicalAnd:mf,logicalNot:qb,logicalOr:Jb,logicalXor:KD,lowerBound:jD,matMul:Un,max:ml,maxPool:Zb,maxPool3d:JD,maxPoolWithArgmax:e9,maximum:eC,mean:gf,meshgrid:r9,min:A1,minimum:yf,mirrorPad:a9,mod:A9,moments:c9,mul:Ye,multiRNNCell:h9,multinomial:d9,neg:Ws,notEqual:tC,oneHot:g9,ones:eA,onesLike:v9,outerProduct:x9,pad:vu,pad1d:_9,pad2d:E9,pad3d:T9,pad4d:F9,pool:D9,pow:Yc,prelu:rC,print:Fb,prod:P9,raggedGather:$9,raggedRange:H9,raggedTensorToTensor:G9,rand:W9,randomGamma:nL,randomNormal:uC,randomStandardNormal:sL,randomUniform:$g,randomUniformInt:AL,range:Jc,real:Zc,reciprocal:uL,relu:qf,relu6:hC,reshape:Re,reverse:mA,reverse1d:mL,reverse2d:yL,reverse3d:wL,reverse4d:bL,round:fC,rsqrt:BL,scalar:yn,selu:SL,separableConv2d:IL,setdiff1dAsync:RL,sigmoid:rA,sign:ML,sin:DL,sinh:OL,slice:rn,slice1d:kL,slice2d:QL,slice3d:VL,slice4d:zL,softmax:KL,softplus:jb,spaceToBatchND:nC,fft:Qg,ifft:vf,irfft:dC,rfft:Hg,split:eu,sqrt:Ba,square:Es,squaredDifference:pC,squeeze:vr,stack:Ta,step:mC,stridedSlice:iO,sub:sn,sum:Vn,tan:aO,tanh:o1,tensor:zs,tensor1d:Qr,tensor2d:po,tensor3d:gC,tensor4d:oO,tensor5d:AO,tensor6d:lO,tensorScatterUpdate:uO,tile:Nc,topk:fO,truncatedNormal:pO,unique:gO,unsortedSegmentSum:vO,unstack:BA,upperBound:xO,variable:bO,where:fo,whereAsync:wC,zeros:pA,zerosLike:Oi,op:q,OP_SCOPE_SUFFIX:gb,booleanMaskAsync:BO,transpose:c1,norm:Xf,movingAverage:TO,scatterND:FO,searchSorted:Og,sparseToDense:MO,gatherND:DO,dropout:PO,enclosingPowerOfTwo:xC,cosineWindow:Gg,inTopKAsync:$O,image:zl,linalg:Uk,losses:Mk,spectral:Fk,fused:ZO,signal:Rk,sparse:Nk,string:Dk},Symbol.toStringTag,{value:"Module"}));/** 8936 * @license 8937 * Copyright 2018 Google LLC. All Rights Reserved. 8938 * Licensed under the Apache License, Version 2.0 (the "License");
8939 * you may not use this file except in compliance with the License. 8940 * You may obtain a copy of the License at 8941 * 8942 * http://www.apache.org/licenses/LICENSE-2.0 8943 * 8944 * Unless required by applicable law or agreed to in writing, software 8945 * distributed under the License is distributed on an "AS IS" BASIS, 8946 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8947 * See the License for the specific language governing permissions and 8948 * limitations under the License. 8949 * ============================================================================= 8950 */const vQ=(n,e,t,r=Dr)=>{switch(n.op){case"BiasAdd":case"AddV2":case"Add":return[r.add(B("a",n,e,t),B("b",n,e,t))];case"AddN":return[r.addN(B("tensors",n,e,t))];case"FloorMod":case"Mod":return[r.mod(B("a",n,e,t),B("b",n,e,t))];case"Mul":return[r.mul(B("a",n,e,t),B("b",n,e,t))];case"RealDiv":case"Div":return[r.div(B("a",n,e,t),B("b",n,e,t))];case"DivNoNan":return[r.divNoNan(B("a",n,e,t),B("b",n,e,t))];case"FloorDiv":return[r.floorDiv(B("a",n,e,t),B("b",n,e,t))];case"Sub":return[r.sub(B("a",n,e,t),B("b",n,e,t))];case"Minimum":return[r.minimum(B("a",n,e,t),B("b",n,e,t))];case"Maximum":return[r.maximum(B("a",n,e,t),B("b",n,e,t))];case"Pow":return[r.pow(B("a",n,e,t),B("b",n,e,t))];case"SquaredDifference":return[r.squaredDifference(B("a",n,e,t),B("b",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 8951 * @license 8952 * Copyright 2018 Google LLC. All Rights Reserved. 8953 * Licensed under the Apache License, Version 2.0 (the "License"); 8954 * you may not use this file except in compliance with the License. 8955 * You may obtain a copy of the License at 8956 * 8957 * http://www.apache.org/licenses/LICENSE-2.0 8958 * 8959 * Unless required by applicable law or agreed to in writing, software 8960 * distributed under the License is distributed on an "AS IS" BASIS, 8961 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8962 * See the License for the specific language governing permissions and 8963 * limitations under the License. 8964 * ============================================================================= 8965 */const wQ=(n,e,t,r=Dr)=>{switch(n.op){case"Abs":case"ComplexAbs":return[r.abs(B("x",n,e,t))];case"Acos":return[r.acos(B("x",n,e,t))];case"Acosh":return[r.acosh(B("x",n,e,t))];case"Asin":return[r.asin(B("x",n,e,t))];case"Asinh":return[r.asinh(B("x",n,e,t))];case"Atan":return[r.atan(B("x",n,e,t))];case"Atan2":return[r.atan2(B("x",n,e,t),B("y",n,e,t))];case"Atanh":return[r.atanh(B("x",n,e,t))];case"Ceil":return[r.ceil(B("x",n,e,t))];case"Complex":return[r.complex(B("real",n,e,t),B("imag",n,e,t))];case"Cos":return[r.cos(B("x",n,e,t))];case"Cosh":return[r.cosh(B("x",n,e,t))];case"Elu":return[r.elu(B("x",n,e,t))];case"Erf":return[r.erf(B("x",n,e,t))];case"Exp":return[r.exp(B("x",n,e,t))];case"Expm1":return[r.expm1(B("x",n,e,t))];case"Floor":return[r.floor(B("x",n,e,t))];case"Log":return[r.log(B("x",n,e,t))];case"Log1p":return[r.log1p(B("x",n,e,t))];case"Imag":return[r.imag(B("x",n,e,t))];case"Neg":return[r.neg(B("x",n,e,t))];case"Reciprocal":return[r.reciprocal(B("x",n,e,t))];case"Real":return[r.real(B("x",n,e,t))];case"Relu":return[r.relu(B("x",n,e,t))];case"Round":return[r.round(B("x",n,e,t))];case"Selu":return[r.selu(B("x",n,e,t))];case"Sigmoid":return[r.sigmoid(B("x",n,e,t))];case"Sin":return[r.sin(B("x",n,e,t))];case"Sign":return[r.sign(B("x",n,e,t))];case"Sinh":return[r.sinh(B("x",n,e,t))];case"Softplus":return[r.softplus(B("x",n,e,t))];case"Sqrt":return[r.sqrt(B("x",n,e,t))];case"Square":return[r.square(B("x",n,e,t))];case"Tanh":return[r.tanh(B("x",n,e,t))];case"Tan":return[r.tan(B("x",n,e,t))];case"ClipByValue":return[r.clipByValue(B("x",n,e,t),B("clipValueMin",n,e,t),B("clipValueMax",n,e,t))];case"Relu6":return[r.relu6(B("x",n,e,t))];case"Rsqrt":return[r.rsqrt(Fr(n.inputNames[0],e,t))];case"LeakyRelu":return[r.leakyRelu(B("x",n,e,t),B("alpha",n,e,t))];case"Prelu":return[r.prelu(B("x",n,e,t),B("alpha",n,e,t))];case"IsNan":return[r.isNaN(Fr(n.inputNames[0],e,t))];case"IsInf":return[r.isInf(Fr(n.inputNames[0],e,t))];case"IsFinite":return[r.isFinite(Fr(n.inputNames[0],e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 8966 * @license 8967 * Copyright 2020 Google LLC. All Rights Reserved. 8968 * Licensed under the Apache License, Version 2.0 (the "License");
8969 * you may not use this file except in compliance with the License. 8970 * You may obtain a copy of the License at 8971 * 8972 * http://www.apache.org/licenses/LICENSE-2.0 8973 * 8974 * Unless required by applicable law or agreed to in writing, software 8975 * distributed under the License is distributed on an "AS IS" BASIS, 8976 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8977 * See the License for the specific language governing permissions and 8978 * limitations under the License. 8979 * ============================================================================= 8980 */function Yi(n,e,t=""){if(!(typeof n=="number"||typeof e=="number")){H(n.length===e.length,()=>t+` Shapes ${n} and ${e} must match`);for(let r=0;r<n.length;r++){const i=n[r],s=e[r];H(i<0||s<0||i===s,()=>t+` Shapes ${n} and ${e} must match`)}}}function v3(n){return!(typeof n=="number"||n.some(e=>e<0))}function hc(n,e,t){let r=B1(n,t);const i=!v3(r);if(i&&e.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(i&&e.forEach(s=>{r=B1(s.shape,r)}),!v3(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function B1(n,e){if(typeof n=="number")return e;if(typeof e=="number")return n;if(n.length!==e.length)throw new Error(`Incompatible ranks during merge: ${n} vs. ${e}`);const t=[];for(let r=0;r<n.length;++r){const i=n[r],s=e[r];if(i>=0&&s>=0&&i!==s)throw new Error(`Incompatible shape during merge: ${n} vs. ${e}`);t[r]=i>=0?i:s}return t}/** 8981 * @license 8982 * Copyright 2018 Google LLC. All Rights Reserved. 8983 * Licensed under the Apache License, Version 2.0 (the "License"); 8984 * you may not use this file except in compliance with the License. 8985 * You may obtain a copy of the License at 8986 * 8987 * http://www.apache.org/licenses/LICENSE-2.0 8988 * 8989 * Unless required by applicable law or agreed to in writing, software 8990 * distributed under the License is distributed on an "AS IS" BASIS, 8991 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8992 * See the License for the specific language governing permissions and 8993 * limitations under the License. 8994 * ============================================================================= 8995 */class xQ{constructor(e,t,r,i,s,a,o){this.name=e,this.dtype=t,this.maxSize=r,this.elementShape=i,this.identicalElementShapes=s,this.dynamicSize=a,this.clearAfterRead=o,this.tensors=[],this.closed_=!1,this.idTensor=yn(0),Qs(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.tensor.id))&&t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(t=>this.read(t))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const r=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, 8996 because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=t.shape),Yi(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),r.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(r.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);r.tensor=t,Qs(t),r.written=!0,this.tensors[e]=r}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((r,i)=>this.write(r,t[i]))}gather(e,t){if(!!t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let i=0;i<this.size();i++)e.push(i)}if(e.length===0)return zs([],[0].concat(this.elementShape));const r=this.readMany(e);return Yi(this.elementShape,r[0].shape,"TensorArray shape mismatch: "),Ta(r,0)}concat(e){if(!!e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(this.size()===0)return zs([],[0].concat(this.elementShape));const t=[];for(let i=0;i<this.size();i++)t.push(i);const r=this.readMany(t);return Yi(this.elementShape,r[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${r[0].shape})`),Nr(r,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const r=Math.max(...e);if(!this.dynamicSize&&r>=this.maxSize)throw new Error(`Max index must be < array size (${r} vs. ${this.maxSize})`);this.writeMany(e,BA(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let r=0;const i=e.map(A=>(r+=A,r));if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to 8997 tensor.shape[0], but sum of lengths is 8998 ${r}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const s=r===0?0:t.size/r,a=[];Jt(()=>{t=Re(t,[1,r,s]);for(let A=0;A<e.length;++A){const c=[0,A===0?0:i[A-1],0],u=[1,e[A],s];a[A]=Re(rn(t,c,u),this.elementShape)}return a});const o=[];for(let A=0;A<e.length;A++)o[A]=A;this.writeMany(o,a)}}/** 8999 * @license 9000 * Copyright 2020 Google LLC. All Rights Reserved. 9001 * Licensed under the Apache License, Version 2.0 (the "License");
9002 * you may not use this file except in compliance with the License. 9003 * You may obtain a copy of the License at 9004 * 9005 * http://www.apache.org/licenses/LICENSE-2.0 9006 * 9007 * Unless required by applicable law or agreed to in writing, software 9008 * distributed under the License is distributed on an "AS IS" BASIS, 9009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9010 * See the License for the specific language governing permissions and 9011 * limitations under the License. 9012 * ============================================================================= 9013 */class vA{get id(){return this.idTensor.id}constructor(e,t,r,i=-1){this.tensors=e,this.elementShape=t,this.elementDtype=r,e!=null&&e.forEach(s=>{if(r!==s.dtype)throw new Error(`Invalid data types; op elements ${r}, but list elements ${s.dtype}`);Yi(t,s.shape,"TensorList shape mismatch: "),Qs(s)}),this.idTensor=yn(0),this.maxNumElements=i,Qs(this.idTensor)}copy(){return new vA([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.id))&&t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,r=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(r!==-1&&this.tensors.length!==r)throw new Error(`Operation expected a list with ${r} elements but got a list with ${this.tensors.length} elements.`);Yi(e,this.elementShape,"TensorList shape mismatch: ");const i=hc(this.elementShape,this.tensors,e);return Jt(()=>{const s=this.tensors.map(a=>Re(a,i));return Ta(s,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");const r=hc(this.elementShape,this.tensors,e),i=this.tensors.pop();return i.kept=!1,Yi(i.shape,e,"TensorList shape mismatch: "),Re(i,r)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Yi(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Qs(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new vA([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let r=0;r<Math.min(this.tensors.length,e);++r)t.tensors[r]=this.tensors[r];return t}getItem(e,t,r){if(r!==this.elementDtype)throw new Error(`Invalid data types; op elements ${r}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);Yi(this.tensors[e].shape,t,"TensorList shape mismatch: ");const i=hc(this.elementShape,this.tensors,t);return Re(this.tensors[e],i)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);Yi(this.elementShape,t.shape,"TensorList shape mismatch: "),Qs(t),this.tensors[e]!=null&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,r){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);Yi(this.elementShape,r,"TensorList shape mismatch: "),e=e.slice(0,this.size());const i=hc(this.elementShape,this.tensors,r);return e.length===0?zs([],[0].concat(i)):Jt(()=>{const s=e.map(a=>Re(this.tensors[a],i));return Ta(s,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Yi(this.elementShape,t,"TensorList shape mismatch: ");const r=hc(this.elementShape,this.tensors,t);return this.size()===0?zs([],[0].concat(r)):Jt(()=>{const i=this.tensors.map(s=>Re(s,r));return Nr(i,0)})}}function bQ(n,e,t){const r=n.dtype;if(n.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${n.shape}`);if(n.dtype!==t)throw new Error(`Invalid data types; op elements ${n.dtype}, but list elements ${t}`);const i=n.shape.slice(1);Yi(i,e,"TensorList shape mismatch: ");const s=BA(n);return new vA(s,e,r)}function CQ(n,e,t,r){return new vA([],n,e,r)}function _Q(n,e,t,r){if(e.length!==n.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${n.shape[0]}`);const i=Math.max(...e);if(r!=null&&r!==-1&&i>=r)throw new Error(`Max index must be < array size (${i} vs. ${r})`);const s=new vA([],t,n.dtype,r),a=BA(n,0);return e.forEach((o,A)=>{s.setItem(o,a[A])}),s}function BQ(n,e,t){let r=0;const i=e.map(c=>(r+=c,r));if(r!==n.shape[0])throw new Error(`Expected sum of lengths to be equal to 9014 tensor.shape[0], but sum of lengths is 9015 ${r}, and tensor's shape is: ${n.shape}`);const s=n.shape.slice(1),a=B1(s,t),o=r===0?0:n.size/r,A=Jt(()=>{const c=[];n=Re(n,[1,r,o]);for(let u=0;u<e.length;++u){const f=[0,u===0?0:i[u-1],0],d=[1,e[u],o];c[u]=Re(rn(n,f,d),a)}return n.dispose(),c}),l=new vA([],t,n.dtype,e.length);for(let c=0;c<A.length;c++)l.setItem(c,A[c]);return l}/** 9016 * @license 9017 * Copyright 2018 Google LLC. All Rights Reserved. 9018 * Licensed under the Apache License, Version 2.0 (the "License");
9019 * you may not use this file except in compliance with the License. 9020 * You may obtain a copy of the License at 9021 * 9022 * http://www.apache.org/licenses/LICENSE-2.0 9023 * 9024 * Unless required by applicable law or agreed to in writing, software 9025 * distributed under the License is distributed on an "AS IS" BASIS, 9026 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9027 * See the License for the specific language governing permissions and 9028 * limitations under the License. 9029 * ============================================================================= 9030 */const EQ=async(n,e,t)=>{switch(n.op){case"If":case"StatelessIf":{const r=B("thenBranch",n,e,t),i=B("elseBranch",n,e,t),s=B("cond",n,e,t),a=B("args",n,e,t);return(await s.data())[0]?t.functionMap[r].executeFunctionAsync(a,t.tensorArrayMap,t.tensorListMap):t.functionMap[i].executeFunctionAsync(a,t.tensorArrayMap,t.tensorListMap)}case"While":case"StatelessWhile":{const r=B("body",n,e,t),i=B("cond",n,e,t),s=B("args",n,e,t),a=await t.functionMap[i].executeFunctionAsync(s,t.tensorArrayMap,t.tensorListMap),o=s.map(c=>c.id);let A=await a[0].data();a.forEach(c=>{!c.kept&&o.indexOf(c.id)===-1&&c.dispose()});let l=s;for(;A[0];){const c=l;l=await t.functionMap[r].executeFunctionAsync(l,t.tensorArrayMap,t.tensorListMap);const u=l.map(f=>f.id);c.forEach(f=>
9030{!f.kept&&o.indexOf(f.id)===-1&&u.indexOf(f.id)===-1&&f.dispose()});const h=await t.functionMap[i].executeFunctionAsync(l,t.tensorArrayMap,t.tensorListMap);A=await h[0].data(),h.forEach(f=>{!f.kept&&o.indexOf(f.id)===-1&&u.indexOf(f.id)===-1&&f.dispose()})}return l}case"LoopCond":{const r=B("pred",n,e,t);return[ma(r)]}case"Switch":{const r=B("pred",n,e,t);let i=B("data",n,e,t);return i.kept||(i=ma(i)),(await r.data())[0]?[void 0,i]:[i,void 0]}case"Merge":{const r=n.inputNames.find(i=>Fr(i,e,t)!==void 0);if(r){const i=Fr(r,e,t);return[ma(i)]}return}case"Enter":{const r=B("frameName",n,e,t),i=B("tensor",n,e,t);return t.enterFrame(r),[ma(i)]}case"Exit":{const r=B("tensor",n,e,t);return t.exitFrame(),[ma(r)]}case"NextIteration":{const r=B("tensor",n,e,t);return t.nextIteration(),[ma(r)]}case"TensorArrayV3":{const r=B("size",n,e,t),i=B("dtype",n,e,t),s=B("elementShape",n,e,t),a=B("dynamicSize",n,e,t),o=B("clearAfterRead",n,e,t),A=B("identicalElementShapes",n,e,t),l=B("name",n,e,t),c=new xQ(l,i,r,s,A,a,o);return t.addTensorArray(c),[c.idTensor,yn(1)]}case"TensorArrayWriteV3":{const r=B("tensorArrayId",n,e,t),i=B("index",n,e,t),s=B("tensor",n,e,t),a=t.getTensorArray(r.id);return a.write(i,s),[a.idTensor]}case"TensorArrayReadV3":{const r=B("tensorArrayId",n,e,t),i=B("index",n,e,t);return[t.getTensorArray(r.id).read(i)]}case"TensorArrayGatherV3":{const r=B("tensorArrayId",n,e,t),i=B("indices",n,e,t),s=B("dtype",n,e,t);return[t.getTensorArray(r.id).gather(i,s)]}case"TensorArrayScatterV3":{const r=B("tensorArrayId",n,e,t),i=B("indices",n,e,t),s=B("tensor",n,e,t),a=t.getTensorArray(r.id);return a.scatter(i,s),[a.idTensor]}case"TensorArrayConcatV3":{const r=B("tensorArrayId",n,e,t),i=t.getTensorArray(r.id),s=B("dtype",n,e,t);return[i.concat(s)]}case"TensorArraySplitV3":{const r=B("tensorArrayId",n,e,t),i=B("tensor",n,e,t),s=B("lengths",n,e,t),a=t.getTensorArray(r.id);return a.split(s,i),[a.idTensor]}case"TensorArraySizeV3":{const r=B("tensorArrayId",n,e,t),i=t.getTensorArray(r.id);return[yn(i.size(),"int32")]}case"TensorArrayCloseV3":{const r=B("tensorArrayId",n,e,t),i=t.getTensorArray(r.id);return i.clearAndClose(),[i.idTensor]}case"TensorListSetItem":{const r=B("tensorListId",n,e,t),i=B("index",n,e,t),s=B("tensor",n,e,t),a=t.getTensorList(r.id);return a.setItem(i,s),[a.idTensor]}case"TensorListGetItem":{const r=B("tensorListId",n,e,t),i=B("index",n,e,t),s=B("elementShape",n,e,t),a=B("elementDType",n,e,t);return[t.getTensorList(r.id).getItem(i,s,a)]}case"TensorListScatterV2":case"TensorListScatter":{const r=B("indices",n,e,t),i=B("tensor",n,e,t),s=B("elementShape",n,e,t),a=B("numElements",n,e,t),o=_Q(i,r,s,a);return t.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=B("elementShape",n,e,t),i=B("elementDType",n,e,t);let s;n.op==="TensorListReserve"?s="numElements":s="maxNumElements";const a=B(s,n,e,t),o=n.op==="TensorListReserve"?-1:a,A=CQ(r,i,a,o);return t.addTensorList(A),[A.idTensor]}case"TensorListGather":{const r=B("tensorListId",n,e,t),i=B("indices",n,e,t),s=B("elementShape",n,e,t),a=B("elementDType",n,e,t);return[t.getTensorList(r.id).gather(i,a,s)]}case"TensorListStack":{const r=B("tensorListId",n,e,t),i=B("elementShape",n,e,t),s=B("elementDType",n,e,t),a=B("numElements",n,e,t);return[t.getTensorList(r.id).stack(i,s,a)]}case"TensorListFromTensor":{const r=B("tensor",n,e,t),i=B("elementShape",n,e,t),s=B("elementDType",n,e,t),a=bQ(r,i,s);return t.addTensorList(a),[a.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const r=B("tensorListId",n,e,t),i=t.getTensorList(r.id),s=B("dtype",n,e,t),a=B("elementShape",n,e,t);return[i.concat(s,a)]}case"TensorListPushBack":{const r=B("tensorListId",n,e,t),i=B("tensor",n,e,t),s=t.getTensorList(r.id);return s.pushBack(i),[s.idTensor]}case"TensorListPopBack":{const r=B("tensorListId",n,e,t),i=B("elementShape",n,e,t),s=B("elementDType",n,e,t);return[t.getTensorList(r.id).popBack(i,s)]}case"TensorListSplit":{const r=B("tensor",n,e,t),i=B("elementShape",n,e,t),s=B("lengths",n,e,t),a=BQ(r,s,i);return t.addTensorList(a),[a.idTensor]}case"TensorListLength":{const r=B("tensorListId",n,e,t),i=t.getTensorList(r.id);return[yn(i.size(),"int32")]}case"TensorListResize":{const r=B("tensorListId",n,e,t),i=B("size",n,e,t),a=t.getTensorList(r.id).resize(i);return t.addTensorList(a),[a.idTensor]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9031 * @license 9032 * Copyright 2018 Google LLC. All Rights Reserved. 9033 * Licensed under the Apache License, Version 2.0 (the "License");
9034 * you may not use this file except in compliance with the License. 9035 * You may obtain a copy of the License at 9036 * 9037 * http://www.apache.org/licenses/LICENSE-2.0 9038 * 9039 * Unless required by applicable law or agreed to in writing, software 9040 * distributed under the License is distributed on an "AS IS" BASIS, 9041 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9042 * See the License for the specific language governing permissions and 9043 * limitations under the License. 9044 * ============================================================================= 9045 */function w3(n,e,t){const[r,i]=B("fusedOps",n,e,t),s=r==="biasadd",a=!s,o=i==="prelu",A=r==="fusedbatchnorm",l=B("numArgs",n,e,t);if(s){if(o&&l!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&s&&l!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(A)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const c=B("strides",n,e,t),u=jh(n,e,t),h=B("dataFormat",n,e,t).toUpperCase(),f=B("dilations",n,e,t);let[d,g]=B("args",n,e,t);a&&(g=d,d=void 0);const m=B("leakyreluAlpha",n,e,t);return{stride:c,pad:u,dataFormat:h,dilations:f,biasArg:d,preluArg:g,activationFunc:i,leakyreluAlpha:m}}const SQ=(n,e,t,r=Dr)=>{switch(n.op){case"Conv1D":{const i=B("stride",n,e,t),s=B("pad",n,e,t),a=B("dataFormat",n,e,t).toUpperCase(),o=B("dilation",n,e,t);return[r.conv1d(B("x",n,e,t),B("filter",n,e,t),i,s,a,o)]}case"Conv2D":{const i=B("strides",n,e,t),s=jh(n,e,t),a=B("dataFormat",n,e,t).toUpperCase(),o=B("dilations",n,e,t);return[r.conv2d(B("x",n,e,t),B("filter",n,e,t),[i[1],i[2]],s,a,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:i,pad:s,dataFormat:a,dilations:o,biasArg:A,preluArg:l,activationFunc:c,leakyreluAlpha:u}=w3(n,e,t);return[r.fused.conv2d({x:B("x",n,e,t),filter:B("filter",n,e,t),strides:[i[1],i[2]],pad:s,dataFormat:a,dilations:[o[1],o[2]],bias:A,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"FusedDepthwiseConv2dNative":{const{stride:i,pad:s,dataFormat:a,dilations:o,biasArg:A,preluArg:l,activationFunc:c,leakyreluAlpha:u}=w3(n,e,t);return[r.fused.depthwiseConv2d({x:B("x",n,e,t),filter:B("filter",n,e,t),strides:[i[1],i[2]],pad:s,dataFormat:a,dilations:[o[1],o[2]],bias:A,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const i=B("outputShape",n,e,t),s=B("strides",n,e,t),a=jh(n,e,t);return[r.conv2dTranspose(B("x",n,e,t),B("filter",n,e,t),i,[s[1],s[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const i=B("strides",n,e,t),s=jh(n,e,t),a=B("dilations",n,e,t),o=B("dataFormat",n,e,t).toUpperCase();return[r.depthwiseConv2d(B("input",n,e,t),B("filter",n,e,t),[i[1],i[2]],s,o,[a[1],a[2]])]}case"Conv3D":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("dataFormat",n,e,t).toUpperCase(),o=B("dilations",n,e,t);return[r.conv3d(B("x",n,e,t),B("filter",n,e,t),[i[1],i[2],i[3]],s,a,[o[1],o[2],o[3]])]}case"AvgPool":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("kernelSize",n,e,t);return[r.avgPool(B("x",n,e,t),[a[1],a[2]],[i[1],i[2]],s)]}case"MaxPool":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("kernelSize",n,e,t);return[r.maxPool(B("x",n,e,t),[a[1],a[2]],[i[1],i[2]],s)]}case"MaxPoolWithArgmax":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("kernelSize",n,e,t),o=B("includeBatchInIndex",n,e,t),{result:A,indexes:l}=r.maxPoolWithArgmax(B("x",n,e,t),[a[1],a[2]],[i[1],i[2]],s,o);return[A,l]}case"AvgPool3D":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("kernelSize",n,e,t);return[r.avgPool3d(B("x",n,e,t),[a[1],a[2],a[3]],[i[1],i[2],i[3]],s)]}case"MaxPool3D":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("kernelSize",n,e,t);return[r.maxPool3d(B("x",n,e,t),[a[1],a[2],a[3]],[i[1],i[2],i[3]],s)]}case"Dilation2D":{const i=B("strides",n,e,t),s=B("pad",n,e,t),a=B("dilations",n,e,t),o=i[1],A=i[2],l=a[1],c=a[2];return[r.dilation2d(B("x",n,e,t),B("filter",n,e,t),[o,A],s,[l,c],"NHWC")]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9046 * @license 9047 * Copyright 2018 Google LLC. All Rights Reserved. 9048 * Licensed under the Apache License, Version 2.0 (the "License");
9049 * you may not use this file except in compliance with the License. 9050 * You may obtain a copy of the License at 9051 * 9052 * http://www.apache.org/licenses/LICENSE-2.0 9053 * 9054 * Unless required by applicable law or agreed to in writing, software 9055 * distributed under the License is distributed on an "AS IS" BASIS, 9056 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9057 * See the License for the specific language governing permissions and 9058 * limitations under the License. 9059 * ============================================================================= 9060 */const TQ=(n,e,t,r=Dr)=>{switch(n.op){case"Fill":{const i=B("shape",n,e,t),s=B("dtype",n,e,t),a=B("value",n,e,t);return[r.fill(i,a,s)]}case"LinSpace":{const i=B("start",n,e,t),s=B("stop",n,e,t),a=B("num",n,e,t);return[r.linspace(i,s,a)]}case"Multinomial":{const i=B("logits",n,e,t),s=B("numSamples",n,e,t),a=B("seed",n,e,t);return[r.multinomial(i,s,a)]}case"OneHot":{const i=B("indices",n,e,t),s=B("depth",n,e,t),a=B("onValue",n,e,t),o=B("offValue",n,e,t),A=B("dtype",n,e,t);return[r.oneHot(i,s,a,o,A)]}case"Ones":return[r.ones(B("shape",n,e,t),B("dtype",n,e,t))];case"OnesLike":return[r.onesLike(B("x",n,e,t))];case"RandomStandardNormal":return[r.randomStandardNormal(B("shape",n,e,t),B("dtype",n,e,t),B("seed",n,e,t))];case"RandomUniform":return[r.randomUniform(B("shape",n,e,t),B("minval",n,e,t),B("maxval",n,e,t),B("dtype",n,e,t))];case"RandomUniformInt":return[r.randomUniformInt(B("shape",n,e,t),B("minval",n,e,t),B("maxval",n,e,t),B("seed",n,e,t))];case"Range":{const i=B("start",n,e,t),s=B("stop",n,e,t),a=B("step",n,e,t);return[r.range(i,s,a,B("dtype",n,e,t))]}case"TruncatedNormal":{const i=B("shape",n,e,t),s=B("mean",n,e,t),a=B("stdDev",n,e,t),o=B("seed",n,e,t);return[r.truncatedNormal(i,s,a,B("dtype",n,e,t),o)]}case"Zeros":return[r.zeros(B("shape",n,e,t),B("dtype",n,e,t))];case"ZerosLike":return[r.zerosLike(B("x",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9061 * @license 9062 * Copyright 2018 Google LLC. All Rights Reserved. 9063 * Licensed under the Apache License, Version 2.0 (the "License"); 9064 * you may not use this file except in compliance with the License. 9065 * You may obtain a copy of the License at 9066 * 9067 * http://www.apache.org/licenses/LICENSE-2.0 9068 * 9069 * Unless required by applicable law or agreed to in writing, software 9070 * distributed under the License is distributed on an "AS IS" BASIS, 9071 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9072 * See the License for the specific language governing permissions and 9073 * limitations under the License. 9074 * ============================================================================= 9075 */function lp(n,e,t){const r=B("boxes",n,e,t),i=B("scores",n,e,t),s=B("maxOutputSize",n,e,t),a=B("iouThreshold",n,e,t),o=B("scoreThreshold",n,e,t),A=B("softNmsSigma",n,e,t);return{boxes:r,scores:i,maxOutputSize:s,iouThreshold:a,scoreThreshold:o,softNmsSigma:A}}const IQ=async(n,e,t,r,i=Dr)=>{switch(n.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:a,maxOutputSize:o,iouThreshold:A,scoreThreshold:l,softNmsSigma:c}=lp(n,e,t),u=await i.image.nonMaxSuppressionWithScoreAsync(s,a,o,A,l,c);return[u.selectedIndices,u.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:a,maxOutputSize:o,iouThreshold:A,scoreThreshold:l}=lp(n,e,t),c=B("padToMaxOutputSize",n,e,t),u=await i.image.nonMaxSuppressionPaddedAsync(s,a,o,A,l,c);return[u.selectedIndices,u.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:a,maxOutputSize:o,iouThreshold:A,scoreThreshold:l}=lp(n,e,t);return[await i.image.nonMaxSuppressionAsync(s,a,o,A,l)]}case"Where":{const s=i.cast(B("condition",n,e,t),"bool"),a=[await i.whereAsync(s)];return s.dispose(),a}case"ListDiff":return i.setdiff1dAsync(B("x",n,e,t),B("y",n,e,t));default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9076 * @license 9077 * Copyright 2018 Google LLC. All Rights Reserved. 9078 * Licensed under the Apache License, Version 2.0 (the "License"); 9079 * you may not use this file except in compliance with the License. 9080 * You may obtain a copy of the License at 9081 * 9082 * http://www.apache.org/licenses/LICENSE-2.0 9083 * 9084 * Unless required by applicable law or agreed to in writing, softw
9084are 9085 * distributed under the License is distributed on an "AS IS" BASIS, 9086 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9087 * See the License for the specific language governing permissions and 9088 * limitations under the License. 9089 * ============================================================================= 9090 */const FQ=(n,e,t,r=Dr)=>{switch(n.op){case"LowerBound":{const i=B("sortedSequence",n,e,t),s=B("values",n,e,t);return[r.lowerBound(i,s)]}case"TopKV2":{const i=B("x",n,e,t),s=B("k",n,e,t),a=B("sorted",n,e,t),o=r.topk(i,s,a);return[o.values,o.indices]}case"UpperBound":{const i=B("sortedSequence",n,e,t),s=B("values",n,e,t);return[r.upperBound(i,s)]}case"Unique":{const i=B("x",n,e,t),s=r.unique(i);return[s.values,s.indices]}case"UniqueV2":{const i=B("x",n,e,t),s=B("axis",n,e,t),a=r.unique(i,s);return[a.values,a.indices]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9091 * @license 9092 * Copyright 2018 Google LLC. All Rights Reserved. 9093 * Licensed under the Apache License, Version 2.0 (the "License"); 9094 * you may not use this file except in compliance with the License. 9095 * You may obtain a copy of the License at 9096 * 9097 * http://www.apache.org/licenses/LICENSE-2.0 9098 * 9099 * Unless required by applicable law or agreed to in writing, software 9100 * distributed under the License is distributed on an "AS IS" BASIS, 9101 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9102 * See the License for the specific language governing permissions and 9103 * limitations under the License. 9104 * ============================================================================= 9105 */const RQ=(n,e,t,r=Dr)=>{switch(n.op){case"Const":return e[n.name];case"PlaceholderWithDefault":const i=B("default",n,e,t);return[Fr(n.name,e,t)||i];case"Placeholder":return[Fr(n.name,e,t)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{const c=B("x",n,e,t);return[ma(c)]}case"IdentityN":return B("x",n,e,t).map(c=>ma(c));case"Snapshot":const s=B("x",n,e,t);return[ma(s)];case"Shape":return[r.tensor1d(B("x",n,e,t).shape,"int32")];case"ShapeN":return B("x",n,e,t).map(c=>r.tensor1d(c.shape));case"Size":return[r.scalar(B("x",n,e,t).size,"int32")];case"Rank":return[r.scalar(B("x",n,e,t).rank,"int32")];case"NoOp":return[r.scalar(1)];case"Print":const a=B("x",n,e,t),o=B("data",n,e,t),A=B("message",n,e,t),l=B("summarize",n,e,t);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(A);for(let c=0;c<o.length;c++)console.log(Array.prototype.slice.call(o[c].dataSync()).slice(0,l));return[a];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9106 * @license 9107 * Copyright 2020 Google LLC. All Rights Reserved. 9108 * Licensed under the Apache License, Version 2.0 (the "License"); 9109 * you may not use this file except in compliance with the License. 9110 * You may obtain a copy of the License at 9111 * 9112 * http://www.apache.org/licenses/LICENSE-2.0 9113 * 9114 * Unless required by applicable law or agreed to in writing, software 9115 * distributed under the License is distributed on an "AS IS" BASIS, 9116 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9117 * See the License for the specific language governing permissions and 9118 * limitations under the License. 9119 * ============================================================================= 9120 */class UQ{get id(){return this.handle.id}constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=yn(0),this.tensorMap=new Map,Qs(this.handle)}clearAndClose(){this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return yn(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const r=await e.data();return this.tensorMap.forEach(i=>i.dispose()),this.tensorMap.clear(),Jt(()=>{const i=BA(t),s=r.length,a=i.length;H(s===a,()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${a} elements.`);for(let o=0;o<s;o++){const A=r[o],l=i[o];Qs(l),this.tensorMap.set(A,l)}return this.handle})}async find(e,t){this.checkKeyAndValueTensor(e,t);const r=await e.data();return Jt(()=>{const i=[];for(let s=0;s<r.length;s++){const a=r[s],o=this.findWithDefault(a,t);i.push(o)}return Ta(i)})}findWithDefault(e,t){const r=this.tensorMap.get(e);return r!=null?r:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}/** 9121 * @license 9122 * Copyright 2020 Google LLC. All Rights Reserved. 9123 * Licensed under the Apache License, Version 2.0 (the "License");
9124 * you may not use this file except in compliance with the License. 9125 * You may obtain a copy of the License at 9126 * 9127 * http://www.apache.org/licenses/LICENSE-2.0 9128 * 9129 * Unless required by applicable law or agreed to in writing, software 9130 * distributed under the License is distributed on an "AS IS" BASIS, 9131 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9132 * See the License for the specific language governing permissions and 9133 * limitations under the License. 9134 * ============================================================================= 9135 */const MQ=async(n,e,t,r)=>{switch(n.op){case"HashTable":case"HashTableV2":{const i=r.getHashTableHandleByName(n.name);if(i!=null)return[i];{const s=B("keyDType",n,e,t),a=B("valueDType",n,e,t),o=new UQ(s,a);return r.addHashTable(n.name,o),[o.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const i=B("tableHandle",n,e,t,r),s=B("keys",n,e,t),a=B("values",n,e,t);return[await r.getHashTableById(i.id).import(s,a)]}case"LookupTableFind":case"LookupTableFindV2":{const i=B("tableHandle",n,e,t,r),s=B("keys",n,e,t),a=B("defaultValue",n,e,t);return[await r.getHashTableById(i.id).find(s,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const i=B("tableHandle",n,e,t,r);return[r.getHashTableById(i.id).tensorSize()]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9136 * @license 9137 * Copyright 2018 Google LLC. All Rights Reserved. 9138 * Licensed under the Apache License, Version 2.0 (the "License"); 9139 * you may not use this file except in compliance with the License. 9140 * You may obtain a copy of the License at 9141 * 9142 * http://www.apache.org/licenses/LICENSE-2.0 9143 * 9144 * Unless required by applicable law or agreed to in writing, software 9145 * distributed under the License is distributed on an "AS IS" BASIS, 9146 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9147 * See the License for the specific language governing permissions and 9148 * limitations under the License. 9149 * ============================================================================= 9150 */const NQ=(n,e,t,r=Dr)=>{switch(n.op){case"ResizeBilinear":{const i=B("images",n,e,t),s=B("size",n,e,t),a=B("alignCorners",n,e,t),o=B("halfPixelCenters",n,e,t);return[r.image.resizeBilinear(i,[s[0],s[1]],a,o)]}case"ResizeNearestNeighbor":{const i=B("images",n,e,t),s=B("size",n,e,t),a=B("alignCorners",n,e,t),o=B("halfPixelCenters",n,e,t);return[r.image.resizeNearestNeighbor(i,[s[0],s[1]],a,o)]}case"CropAndResize":{const i=B("image",n,e,t),s=B("boxes",n,e,t),a=B("boxInd",n,e,t),o=B("cropSize",n,e,t),A=B("method",n,e,t),l=B("extrapolationValue",n,e,t);return[r.image.cropAndResize(i,s,a,o,A,l)]}case"ImageProjectiveTransformV3":{const i=B("images",n,e,t),s=B("transforms",n,e,t),a=B("outputShape",n,e,t),o=B("fillValue",n,e,t),A=B("interpolation",n,e,t),l=B("fillMode",n,e,t);return[r.image.transform(i,s,A.toLowerCase(),l.toLowerCase(),o,a)]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9151 * @license 9152 * Copyright 2018 Google LLC. All Rights Reserved. 9153 * Licensed under the Apache License, Version 2.0 (the "License"); 9154 * you may not use this file except in compliance with the License. 9155 * You may obtain a copy of the License at 9156 * 9157 * http://www.apache.org/licenses/LICENSE-2.0 9158 * 9159 * Unless required by applicable law or agreed to in writing, software 9160 * distributed under the License is distributed on an "AS IS" BASIS, 9161 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9162 * See the License for the specific language governing permissions and 9163 * limitations under the License. 9164 * ============================================================================= 9165 */const DQ=(n,e,t,r=Dr)=>{switch(n.op){case"Equal":return[r.equal(B("a",n,e,t),B("b",n,e,t))];case"NotEqual":return[r.notEqual(B("a",n,e,t),B("b",n,e,t))];case"Greater":return[r.greater(B("a",n,e,t),B("b",n,e,t))];case"GreaterEqual":return[r.greaterEqual(B("a",n,e,t),B("b",n,e,t))];case"Less":return[r.less(B("a",n,e,t),B("b",n,e,t))];case"LessEqual":return[r.lessEqual(B("a",n,e,t),B("b",n,e,t))];case"LogicalAnd":return[r.logicalAnd(B("a",n,e,t),B("b",n,e,t))];case"LogicalNot":return[r.logicalNot(B("a",n,e,t))];case"LogicalOr":return[r.logicalOr(B("a",n,e,t),B("b",n,e,t))];case"Select":case"SelectV2":return[r.where(B("condition",n,e,t),B("a",n,e,t),B("b",n,e,t))];case"BitwiseAnd":return[r.bitwiseAnd(B("a",n,e,t),B("b",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9166 * @license 9167 * Copyright 2018 Google LLC. All Rights Reserved. 9168 * Licensed under the Apache License, Version 2.0 (the "License");
9169 * you may not use this file except in compliance with the License. 9170 * You may obtain a copy of the License at 9171 * 9172 * http://www.apache.org/licenses/LICENSE-2.0 9173 * 9174 * Unless required by applicable law or agreed to in writing, software 9175 * distributed under the License is distributed on an "AS IS" BASIS, 9176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9177 * See the License for the specific language governing permissions and 9178 * limitations under the License. 9179 * ============================================================================= 9180 */const LQ=(n,e,t,r=Dr)=>{switch(n.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[r.matMul(B("a",n,e,t),B("b",n,e,t),B("transposeA",n,e,t),B("transposeB",n,e,t))];case"Einsum":return[r.einsum(B("equation",n,e,t),...B("tensors",n,e,t))];case"Transpose":return[r.transpose(B("x",n,e,t),B("perm",n,e,t))];case"_FusedMatMul":const[i,s]=B("fusedOps",n,e,t),a=i==="biasadd",o=s==="prelu",A=B("numArgs",n,e,t),l=B("leakyreluAlpha",n,e,t);if(a){if(o&&A!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&A!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,u]=B("args",n,e,t);return[r.fused.matMul({a:B("a",n,e,t),b:B("b",n,e,t),transposeA:B("transposeA",n,e,t),transposeB:B("transposeB",n,e,t),bias:c,activation:s,preluActivationWeights:u,leakyreluAlpha:l})];case"MatrixBandPart":return[r.linalg.bandPart(B("a",n,e,t),B("numLower",n,e,t),B("numUpper",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9181 * @license 9182 * Copyright 2018 Google LLC. All Rights Reserved. 9183 * Licensed under the Apache License, Version 2.0 (the "License"); 9184 * you may not use this file except in compliance with the License. 9185 * You may obtain a copy of the License at 9186 * 9187 * http://www.apache.org/licenses/LICENSE-2.0 9188 * 9189 * Unless required by applicable law or agreed to in writing, software 9190 * distributed under the License is distributed on an "AS IS" BASIS, 9191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9192 * See the License for the specific language governing permissions and 9193 * limitations under the License. 9194 * ============================================================================= 9195 */const OQ=(n,e,t,r=Dr)=>{switch(n.op){case"EuclideanNorm":return[r.euclideanNorm(B("x",n,e,t),B("axis",n,e,t),B("keepDims",n,e,t))];case"FusedBatchNorm":case"FusedBatchNormV2":return[r.batchNorm(B("x",n,e,t),B("mean",n,e,t),B("variance",n,e,t),B("offset",n,e,t),B("scale",n,e,t),B("epsilon",n,e,t))];case"FusedBatchNormV3":return[r.batchNorm(B("x",n,e,t),B("mean",n,e,t),B("variance",n,e,t),B("offset",n,e,t),B("scale",n,e,t),B("epsilon",n,e,t))];case"LRN":return[r.localResponseNormalization(B("x",n,e,t),B("radius",n,e,t),B("bias",n,e,t),B("alpha",n,e,t),B("beta",n,e,t))];case"Softmax":return[r.softmax(B("x",n,e,t))];case"LogSoftmax":return[r.logSoftmax(B("x",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9196 * @license 9197 * Copyright 2022 Google LLC. All Rights Reserved. 9198 * Licensed under the Apache License, Version 2.0 (the "License"); 9199 * you may not use this file except in compliance with the License. 9200 * You may obtain a copy of the License at 9201 * 9202 * http://www.apache.org/licenses/LICENSE-2.0 9203 * 9204 * Unless required by applicable law or agreed to in writing, software 9205 * distributed under the License is distributed on an "AS IS" BASIS, 9206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9207 * See the License for the specific language governing permissions and 9208 * limitations under the License. 9209 * ============================================================================= 9210 */const PQ=(n,e,t,r=Dr)=>{switch(n.op){case"RaggedGather":{const{outputNestedSplits:i,outputDenseValues:s}=r.raggedGather(B("paramsNestedSplits",n,e,t),B("paramsDenseValues",n,e,t),B("indices",n,e,t),B("outputRaggedRank",n,e,t));return i.concat(s)}case"RaggedRange":{const{rtNestedSplits:i,rtDenseValues:s}=r.raggedRange(B("starts",n,e,t),B("limits",n,e,t),B("splits",n,e,t));return[i,s]}case"RaggedTensorToTensor":return[r.raggedTensorToTensor(B("shape",n,e,t),B("values",n,e,t),B("defaultValue",n,e,t),B("rowPartitionTensors",n,e,t),B("rowPartitionTypes",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9211 * @license 9212 * Copyright 2018 Google LLC. All Rights Reserved. 9213 * Licensed under the Apache License, Version 2.0 (the "License");
9214 * you may not use this file except in compliance with the License. 9215 * You may obtain a copy of the License at 9216 * 9217 * http://www.apache.org/licenses/LICENSE-2.0 9218 * 9219 * Unless required by applicable law or agreed to in writing, software 9220 * distributed under the License is distributed on an "AS IS" BASIS, 9221 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9222 * See the License for the specific language governing permissions and 9223 * limitations under the License. 9224 * ============================================================================= 9225 */const kQ=(n,e,t,r=Dr)=>{switch(n.op){case"Max":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.max(B("x",n,e,t),o,A)]}case"Mean":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.mean(B("x",n,e,t),o,A)]}case"Min":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.min(B("x",n,e,t),o,A)]}case"Sum":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.sum(B("x",n,e,t),o,A)]}case"All":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.all(B("x",n,e,t),o,A)]}case"Any":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.any(B("x",n,e,t),o,A)]}case"ArgMax":{const o=B("axis",n,e,t);return[r.argMax(B("x",n,e,t),o)]}case"ArgMin":{const o=B("axis",n,e,t);return[r.argMin(B("x",n,e,t),o)]}case"Prod":{const o=B("axis",n,e,t),A=B("keepDims",n,e,t);return[r.prod(B("x",n,e,t),o,A)]}case"Cumprod":{const o=B("axis",n,e,t),A=B("exclusive",n,e,t),l=B("reverse",n,e,t);return[r.cumprod(B("x",n,e,t),o,A,l)]}case"Cumsum":{const o=B("axis",n,e,t),A=B("exclusive",n,e,t),l=B("reverse",n,e,t);return[r.cumsum(B("x",n,e,t),o,A,l)]}case"Bincount":const i=B("x",n,e,t),s=B("weights",n,e,t),a=B("size",n,e,t);return[r.bincount(i,s,a)];case"DenseBincount":{const o=B("x",n,e,t),A=B("weights",n,e,t),l=B("size",n,e,t),c=B("binaryOutput",n,e,t);return[r.denseBincount(o,A,l,c)]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9226 * @license 9227 * Copyright 2018 Google LLC. All Rights Reserved. 9228 * Licensed under the Apache License, Version 2.0 (the "License"); 9229 * you may not use this file except in compliance with the License. 9230 * You may obtain a copy of the License at 9231 * 9232 * http://www.apache.org/licenses/LICENSE-2.0 9233 * 9234 * Unless required by applicable law or agreed to in writing, software 9235 * distributed under the License is distributed on an "AS IS" BASIS, 9236 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9237 * See the License for the specific language governing permissions and 9238 * limitations under the License. 9239 * ============================================================================= 9240 */const $Q=(n,e,t,r=Dr)=>{switch(n.op){case"ConcatV2":case"Concat":{const i=B("n",n,e,t),s=B("axis",n,e,t);let a=B("tensors",n,e,t);return a=a.slice(0,i),[r.concat(a,s)]}case"Gather":{const i=B("x",n,e,t),s=B("indices",n,e,t);return[r.gather(i,r.cast(s,"int32"),0)]}case"GatherV2":{const i=B("axis",n,e,t),s=B("batchDims",n,e,t),a=B("x",n,e,t),o=B("indices",n,e,t);return[r.gather(a,r.cast(o,"int32"),i,s)]}case"Reverse":{const i=B("dims",n,e,t),s=[];for(let o=0;o<i.length;o++)i[o]&&s.push(o);const a=B("x",n,e,t);return[r.reverse(a,s)]}case"ReverseV2":{const i=B("axis",n,e,t),s=B("x",n,e,t);return[r.reverse(s,i)]}case"Slice":{const i=B("begin",n,e,t),s=B("size",n,e,t);return[r.slice(B("x",n,e,t),i,s)]}case"StridedSlice":{const i=B("begin",n,e,t),s=B("end",n,e,t),a=B("strides",n,e,t),o=B("beginMask",n,e,t),A=B("endMask",n,e,t),l=B("ellipsisMask",n,e,t),c=B("newAxisMask",n,e,t),u=B("shrinkAxisMask",n,e,t),h=B("x",n,e,t);return[r.stridedSlice(h,i,s,a,o,A,l,c,u)]}case"Pack":return Jt(()=>{const i=B("axis",n,e,t),s=B("tensors",n,e,t),a=s[0].shape,o=r.squeeze(s[0]).shape,A=s.map(l=>{const c=rr(l.shape,a);if(!c&&!rr(r.squeeze(l).shape,o))throw new Error("the input tensors shape does not match");return c?l:r.reshape(l,a)});return[r.stack(A,i)]});case"Unpack":{const i=B("axis",n,e,t),s=B("tensor",n,e,t);return r.unstack(s,i)}case"Tile":{const i=B("reps",n,e,t);return[r.tile(B("x",n,e,t),i)]}case"Split":case"SplitV":{const i=B("axis",n,e,t),s=B("numOrSizeSplits",n,e,t),a=B("x",n,e,t);return r.split(a,s,i)}case"ScatterNd":{const i=B("indices",n,e,t),s=B("values",n,e,t),a=B("shape",n,e,t);return[r.scatterND(i,s,a)]}case"GatherNd":{const i=B("x",n,e,t),s=B("indices",n,e,t);return[r.gatherND(i,s)]}case"SparseToDense":{const i=B("sparseIndices",n,e,t),s=B("outputShape",n,e,t),a=B("sparseValues",n,e,t),o=B("defaultValue",n,e,t);return[r.sparseToDense(i,a,s,a.dtype===o.dtype?o:r.cast(o,a.dtype))]}case"TensorScatterUpdate":{const i=B("indices",n,e,t),s=B("values",n,e,t),a=B("tensor",n,e,t);return[r.tensorScatterUpdate(a,i,s)]}default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9241 * @license 9242 * Copyright 2021 Google LLC. All Rights Reserved. 9243 * Licensed under the Apache License, Version 2.0 (the "License");
9244 * you may not use this file except in compliance with the License. 9245 * You may obtain a copy of the License at 9246 * 9247 * http://www.apache.org/licenses/LICENSE-2.0 9248 * 9249 * Unless required by applicable law or agreed to in writing, software 9250 * distributed under the License is distributed on an "AS IS" BASIS, 9251 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9252 * See the License for the specific language governing permissions and 9253 * limitations under the License. 9254 * ============================================================================= 9255 */const QQ=(n,e,t,r=Dr)=>{switch(n.op){case"SparseFillEmptyRows":{const{outputIndices:i,outputValues:s,emptyRowIndicator:a,reverseIndexMap:o}=r.sparse.sparseFillEmptyRows(B("indices",n,e,t),B("values",n,e,t),B("denseShape",n,e,t),B("defaultValue",n,e,t));return[i,s,a,o]}case"SparseReshape":{const{outputIndices:i,outputShape:s}=r.sparse.sparseReshape(B("inputIndices",n,e,t),B("inputShape",n,e,t),B("newShape",n,e,t));return[i,s]}case"SparseSegmentMean":return[r.sparse.sparseSegmentMean(B("data",n,e,t),B("indices",n,e,t),B("segmentIds",n,e,t))];case"SparseSegmentSum":return[r.sparse.sparseSegmentSum(B("data",n,e,t),B("indices",n,e,t),B("segmentIds",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9256 * @license 9257 * Copyright 2018 Google LLC. All Rights Reserved. 9258 * Licensed under the Apache License, Version 2.0 (the "License"); 9259 * you may not use this file except in compliance with the License. 9260 * You may obtain a copy of the License at 9261 * 9262 * http://www.apache.org/licenses/LICENSE-2.0 9263 * 9264 * Unless required by applicable law or agreed to in writing, software 9265 * distributed under the License is distributed on an "AS IS" BASIS, 9266 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9267 * See the License for the specific language governing permissions and 9268 * limitations under the License. 9269 * ============================================================================= 9270 */const HQ=(n,e,t,r=Dr)=>{switch(n.op){case"FFT":return[r.fft(B("x",n,e,t))];case"IFFT":return[r.ifft(B("x",n,e,t))];case"RFFT":return[r.rfft(B("x",n,e,t))];case"IRFFT":return[r.irfft(B("x",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9271 * @license 9272 * Copyright 2021 Google LLC. All Rights Reserved. 9273 * Licensed under the Apache License, Version 2.0 (the "License"); 9274 * you may not use this file except in compliance with the License. 9275 * You may obtain a copy of the License at 9276 * 9277 * http://www.apache.org/licenses/LICENSE-2.0 9278 * 9279 * Unless required by applicable law or agreed to in writing, software 9280 * distributed under the License is distributed on an "AS IS" BASIS, 9281 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9282 * See the License for the specific language governing permissions and 9283 * limitations under the License. 9284 * ============================================================================= 9285 */const VQ=(n,e,t,r=Dr)=>{switch(n.op){case"StaticRegexReplace":return[r.string.staticRegexReplace(B("input",n,e,t),B("pattern",n,e,t),B("rewrite",n,e,t),B("replaceGlobal",n,e,t))];case"StringNGrams":{const{nGrams:i,nGramsSplits:s}=r.string.stringNGrams(B("data",n,e,t),B("dataSplits",n,e,t),B("separator",n,e,t),B("nGramWidths",n,e,t),B("leftPad",n,e,t),B("rightPad",n,e,t),B("padWidth",n,e,t),B("preserveShortSequences",n,e,t));return[i,s]}case"StringSplit":{const{indices:i,values:s,shape:a}=r.string.stringSplit(B("input",n,e,t),B("delimiter",n,e,t),B("skipEmpty",n,e,t));return[i,s,a]}case"StringToHashBucketFast":return[r.string.stringToHashBucketFast(B("input",n,e,t),B("numBuckets",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9286 * @license 9287 * Copyright 2018 Google LLC. All Rights Reserved. 9288 * Licensed under the Apache License, Version 2.0 (the "License"); 9289 * you may not use this file except in compliance with the License. 9290 * You may obtain a copy of the License at 9291 * 9292 * http://www.apache.org/licenses/LICENSE-2.0 9293 * 9294 * Unless required by applicable law or agreed to in writing, software 9295 * distributed under the License is distributed on an "AS IS" BASIS, 9296 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9297 * See the License for the specific language governing permissions and 9298 * limitations under the License. 9299 * ============================================================================= 9300 */const GQ=(n,e,t,r=Dr)=>{switch(n.op){case"Cast":return[r.cast(B("x",n,e,t),B("dtype",n,e,t))];case"ExpandDims":{const i=B("axis",n,e,t);return[r.expandDims(B("x",n,e,t),i)]}case"Squeeze":{const i=B("axis",n,e,t);return[r.squeeze(B("x",n,e,t),i)]}case"Reshape":return[r.reshape(B("x",n,e,t),B("shape",n,e,t))];case"EnsureShape":return[r.ensureShape(B("x",n,e,t),B("shape",n,e,t))];case"MirrorPad":return[r.mirrorPad(B("x",n,e,t),B("padding",n,e,t),B("mode",n,e,t))];case"PadV2":case"Pad":return[r.pad(B("x",n,e,t),B("padding",n,e,t),B("constantValue",n,e,t))];
9300case"SpaceToBatchND":{const i=B("blockShape",n,e,t),s=B("paddings",n,e,t);return[r.spaceToBatchND(B("x",n,e,t),i,s)]}case"BatchToSpaceND":{const i=B("blockShape",n,e,t),s=B("crops",n,e,t);return[r.batchToSpaceND(B("x",n,e,t),i,s)]}case"DepthToSpace":{const i=B("blockSize",n,e,t),s=B("dataFormat",n,e,t).toUpperCase();return[r.depthToSpace(B("x",n,e,t),i,s)]}case"BroadcastTo":return[r.broadcastTo(B("x",n,e,t),B("shape",n,e,t))];case"BroadcastArgs":return[r.broadcastArgs(B("s0",n,e,t),B("s1",n,e,t))];default:throw TypeError(`Node type ${n.op} is not implemented`)}};/** 9301 * @license 9302 * Copyright 2018 Google LLC. All Rights Reserved. 9303 * Licensed under the Apache License, Version 2.0 (the "License"); 9304 * you may not use this file except in compliance with the License. 9305 * You may obtain a copy of the License at 9306 * 9307 * http://www.apache.org/licenses/LICENSE-2.0 9308 * 9309 * Unless required by applicable law or agreed to in writing, software 9310 * distributed under the License is distributed on an "AS IS" BASIS, 9311 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9312 * See the License for the specific language governing permissions and 9313 * limitations under the License. 9314 * ============================================================================= 9315 */function x3(n,e,t,r,i=Jt){const s=((a,o,A)=>{switch(a.category){case"arithmetic":return i(()=>vQ(a,o,A));case"basic_math":return i(()=>wQ(a,o,A));case"control":return EQ(a,o,A);case"convolution":return i(()=>SQ(a,o,A));case"creation":return i(()=>TQ(a,o,A));case"dynamic":return IQ(a,o,A);case"evaluation":return i(()=>FQ(a,o,A));case"image":return i(()=>NQ(a,o,A));case"graph":return i(()=>RQ(a,o,A));case"logical":return i(()=>DQ(a,o,A));case"matrices":return i(()=>LQ(a,o,A));case"normalization":return i(()=>OQ(a,o,A));case"ragged":return i(()=>PQ(a,o,A));case"reduction":return i(()=>kQ(a,o,A));case"slice_join":return i(()=>$Q(a,o,A));case"sparse":return i(()=>QQ(a,o,A));case"spectral":return i(()=>HQ(a,o,A));case"string":return i(()=>VQ(a,o,A));case"transformation":return i(()=>GQ(a,o,A));case"hash_table":return MQ(a,o,A,r);case"custom":const l=U_(a.op);if(l&&l.customExecutor)return l.customExecutor(new yQ(a,o,A));throw TypeError(`Custom op ${a.op} is not registered.`);default:throw TypeError(`Unknown op '${a.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(n,e,t);return lA(s)?s.then(a=>[].concat(a)):[].concat(s)}class b3{constructor(e={},t={},r={},i={},s){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=r,this.functionMap=i,this.parseNodeNameCache=s,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t<this.contexts.length-1;t++){const r=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(r))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map(t=>t.id===0&&t.iterationId===0?"":`${t.frameName}-${t.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}/** 9316 * @license 9317 * Copyright 2019 Google LLC. All Rights Reserved. 9318 * Licensed under the Apache License, Version 2.0 (the "License");
9319 * you may not use this file except in compliance with the License. 9320 * You may obtain a copy of the License at 9321 * 9322 * http://www.apache.org/licenses/LICENSE-2.0 9323 * 9324 * Unless required by applicable law or agreed to in writing, software 9325 * distributed under the License is distributed on an "AS IS" BASIS, 9326 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9327 * See the License for the specific language governing permissions and 9328 * limitations under the License. 9329 * ============================================================================= 9330 */function C3(n,e,t,r){const i=new Set,s=[];let a=null,o=null;const A=new Set,l=new Set(Object.keys(n).map(h=>xi(h)[0]));r=r||[];const c=new Set(r.map(h=>xi(h.name)[0])),u=[...e];for(;u.length>0;){const h=u.pop();if((Xo(h)||JQ(h)||ZQ(h))&&a==null&&(a=h,o=a.children.map(f=>f.name).filter(f=>i.has(f))),i.add(h.name),t[h.name]==null&&!l.has(h.name)&&!c.has(h.name)){if(h.inputs.length===0){s.push(h.name);continue}h.inputs.forEach(f=>{A.has(f.name)||(A.add(f.name),u.push(f))})}}return{inputs:n,outputs:e,usedNodes:i,missingInputs:s,dynamicNode:a,syncInputs:o}}function zQ(n,e){const{usedNodes:t,inputs:r}=e,i=Object.keys(r).map(m=>xi(m)[0]).map(m=>n.nodes[m]),s=n.initNodes||[],a=m=>t.has(typeof m=="string"?m:m.name);function o(m){return[...new Map(m.map(p=>[p.name,p])).values()]}const A=o([...i,...n.weights,...s]).filter(a),l=o([...A,...Object.values(n.nodes)]).filter(a),c=new Map(l.map(m=>[m.name,m])),u={};for(const m of l){u[m.name]=u[m.name]||0;for(const p of m.children)a(p)||(u[p.name]=Number.POSITIVE_INFINITY),u[p.name]=(u[p.name]||0)+1}const h=Object.entries(u).filter(([,m])=>m===0).map(([m])=>m),f=[...h];for(;h.length>0;){const m=h.pop(),p=c.get(m);for(const w of p.children.filter(a))--u[w.name]===0&&(f.push(w.name),h.push(w.name))}const d=f.map(m=>c.get(m)),g=WQ(d,A);return KQ(g,A),g}function WQ(n,e){const t=new Map(n.map(a=>[a.name,a])),r=e.map(a=>a.name),i=new Set(r);for(;r.length>0;){const a=r.pop(),o=t.get(a);for(const A of o.children)!t.has(A.name)||i.has(A.name)||(i.add(A.name),r.push(A.name))}return n.filter(a=>i.has(a.name))}class ih extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}function KQ(n,e){const t=new Map(n.map((o,A)=>[o.name,A])),r=new Set(e.map(o=>o.name)),i=o=>r.has(typeof o=="string"?o:o.name),s=new Set(n.map(o=>o.name)),a=o=>s.has(typeof o=="string"?o:o.name);for(const o of n){for(const A of o.children.filter(a)){if(!t.has(A.name))throw new ih(`Child ${A.name} of node ${o.name} is unreachable.`);if(t.get(o.name)>t.get(A.name))throw new ih(`Node ${o.name} is scheduled to run after its child ${A.name}.`)}if(!i(o))for(const A of o.inputs){if(!t.has(A.name))throw new ih(`Input ${A.name} of node ${o.name} is unreachable.`);if(t.get(A.name)>t.get(o.name))throw new ih(`Node ${o.name} is scheduled to run before its input ${A.name}.`)}}}function XQ(n){const e=new Map(n.map((o,A)=>[o.name,A])),t=Number.MAX_SAFE_INTEGER,r=n.map((o,A)=>Xo(o)?t:A),i=o=>{const A=r[e.get(o.name)];return A==null?-1:A},s=n.map((o,A)=>o.children.map(i).reduce((l,c)=>Math.max(l,c),r[A])),a=new Map;for(let o=0;o<n.length;++o){const A=s[o];if(A===t)continue;const l=n[o],c=n[A];a.has(c.name)||a.set(c.name,[]),a.get(c.name).push(l)}return a}const jQ=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),YQ=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),qQ=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function Xo(n){return jQ.has(n.op)}function JQ(n){return YQ.has(n.op)}function ZQ(n){return qQ.has(n.op)}/** 9331 * @license 9332 * Copyright 2018 Google LLC. All Rights Reserved. 9333 * Licensed under the Apache License, Version 2.0 (the "License"); 9334 * you may not use this file except in compliance with the License. 9335 * You may obtain a copy of the License at 9336 * 9337 * http://www.apache.org/licenses/LICENSE-2.0 9338 * 9339 * Unless required by applicable law or agreed to in writing, software 9340 * distributed under the License is distributed on an "AS IS" BASIS, 9341 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9342 * See the License for the specific language governing permissions and 9343 * limitations under the License. 9344 * ============================================================================= 9345 */class xf{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map(r=>e[r].map(i=>i.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>
9345(e[t]=this._functions[t].signature,e),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(r=>{this._functionExecutorMap[r]=new xf(e.functions[r],this)})}getCompilationKey(e,t){const r=e.map(s=>s.name).sort(),i=t.map(s=>s.name).sort();return r.join(this.SEPARATOR)+"--"+i.join(this.SEPARATOR)}compile(e,t){const r=C3(e,t,this.weightMap,this._initNodes),{missingInputs:i,dynamicNode:s,syncInputs:a}=r;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(i.length>0){const l=t.map(u=>u.name),c=Object.keys(e);throw new Error(`Cannot compute the outputs [${l}] from the provided inputs [${c}]. Missing the following inputs: [${i}]`)}const o=zQ(this.graph,r),A=XQ(o);return{orderedNodes:o,nodeLiveUntilMap:A}}cloneAndKeepTensor(e){if(e==null)return null;const t=e.clone();return Qs(t),t}cloneTensorList(e){return e?e.map(r=>this.cloneAndKeepTensor(r)):null}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,this.cloneTensorList(r)]))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const i=r.map(h=>this.graph.nodes[xi(h)[0]]),s=t.map(h=>xi(h)[0]),a=new Set(s);let o=s.map(h=>this.graph.nodes[h]);o.length===0&&(o=this._outputs);const A=this.getCompilationKey(i,o);let l=this.compiledMap.get(A);l==null&&(l=this.compile(e,o),this.compiledMap.set(A,l));try{this.keepIntermediateTensors=pe().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(h){this.keepIntermediateTensors=!1,console.warn(h.message)}const c={},u={};return Jt(()=>{const h=new b3(this.weightMap,c,u,this.functionExecutorMap,this.parseNodeNameCache),f=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach(p=>{const[w,C]=xi(p,h),b=[];b[C]=e[p],f[w]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[w]=this.cloneTensorList(b))});const d=this.getFrozenTensorIds(f),{orderedNodes:g,nodeLiveUntilMap:m}=l;for(const p of g){if(f[p.name])continue;const w=x3(p,f,h,this._resourceManager);if(lA(w))throw new Error(`The execution of the op '${p.op}' returned a promise. Please use model.executeAsync() instead.`);f[p.name]=w,this.keepIntermediateTensors&&(this.clonedTensorsMap[p.name]=this.cloneTensorList(w)),this.checkTensorForDisposalWithNodeLiveUntilInfo(p,f,h,d,a,m.get(p.name))}return this.parent==null&&h.dispose(d),t.map(p=>Fr(p,f,h))})}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map(r=>e[r]).map(r=>r.map(i=>i.id)));return new Set(t)}checkTensorForDisposal(e,t,r,i,s,a,o){if(!(Xo(t)||a.has(e))){for(const A of r[e])A!=null&&(o[A.id]=(o[A.id]||0)+t.children.length);for(const A of t.inputs){if(Xo(A))continue;const l=m3(A.name,r,i);if(l!=null)for(const c of l){if(!c||c.kept||s.has(c.id))continue;const u=o[c.id];u===1?(c.dispose(),delete o[c.id]):u!=null&&o[c.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,r,i,s,a){function o(A){return Xo(A)||s.has(A.name)}if(!(Xo(e)||a==null))for(const A of a){if(o(A))continue;const l=m3(A.name,t,r);for(const c of l)!c||c.kept||i.has(c.id)||c.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){!this.clonedTensorsMap||(Object.values(this.clonedTensorsMap).forEach(e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,r=!1,i={},s={}){this.disposeIntermediateTensors(),r||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=pe().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(h){this.keepIntermediateTensors=!1,console.warn(h.message)}const a=new b3(this.weightMap,i,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const o=await this.executeWithControlFlow(e,a,t,r),A=t.map(h=>Fr(h,o,a)),l=A.map(h=>h.id),c=Object.keys(e).map(h=>e[h].id),u=new Set([...l,...c,...this.weightIds]);
9345return Object.values(o).forEach(h=>{h.forEach(f=>{f&&!f.isDisposed&&!u.has(f.id)&&f.dispose()})}),this.parent==null&&a.dispose(u),A}async executeFunctionAsync(e,t,r){const i=e.reduce((s,a,o)=>(s[this.inputs[o].name]=a,s),{});return this._executeAsync(i,this.outputNodes,!0,t,r)}async executeWithControlFlow(e,t,r,i){const s=Object.keys(e),a=s.map(b=>this.graph.nodes[xi(b)[0]]),o=r.map(b=>xi(b)[0]),A=new Set(o);let l=o.map(b=>this.graph.nodes[b]);l.length===0&&(l=this._outputs);const{usedNodes:c,missingInputs:u,dynamicNode:h,syncInputs:f}=C3(e,l,this.weightMap,this._initNodes),d=[...a,...this.graph.weights,...this._initNodes||[]].map(b=>({node:b,contexts:t.currentContext})),g=Object.assign({},this.weightMap);Object.keys(e).forEach(b=>{const[U,F]=xi(b),D=[];D[F]=e[b],g[U]=D});const m={},p=this.getFrozenTensorIds(g),w={};for(;d.length>0;){const b=this.processStack(a,d,t,g,w,p,A,m,c);await Promise.all(b)}h==null&&!i&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const C=l.filter(b=>!Xo(b)&&!Fr(b.name,g,t)).map(b=>b.name);if(C.length>0){let b="";throw h!=null&&(b=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${f}]`),new Error(`Cannot compute the outputs [${C}] from the provided inputs [${s}]. Consider providing the following inputs: [${u}]. ${b}`)}return g}processStack(e,t,r,i,s,a,o,A,l){const c=[];for(;t.length>0;){const u=t.pop();r.currentContext=u.contexts;let h="";if(u.node.op==="Enter"&&B("isConstant",u.node,i,r)&&([h]=pa(u.node.name,r)),i[u.node.name]==null){const f=x3(u.node,i,r,this._resourceManager);h||([h]=pa(u.node.name,r));const d=r.currentContext;lA(f)?c.push(f.then(g=>(i[h]=g,this.keepIntermediateTensors&&(this.clonedTensorsMap[h]=this.cloneTensorList(g)),r.currentContext=d,this.checkTensorForDisposal(h,u.node,i,r,a,o,A),this.processChildNodes(u.node,t,r,i,s,l),g))):(i[h]=f,this.keepIntermediateTensors&&(this.clonedTensorsMap[h]=this.cloneTensorList(f)),this.checkTensorForDisposal(h,u.node,i,r,a,o,A),this.processChildNodes(u.node,t,r,i,s,l))}else this.processChildNodes(u.node,t,r,i,s,l)}return c}processChildNodes(e,t,r,i,s,a){e.children.forEach(o=>{const[A]=pa(o.name,r);s[A]||!a.has(o.name)||(o.op==="Merge"?o.inputNames.some(l=>!!Fr(l,i,r))&&(s[A]=!0,t.push({contexts:r.currentContext,node:o})):o.inputNames.every(l=>!!Fr(l,i,r))&&(s[A]=!0,t.push({contexts:r.currentContext,node:o})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{const r=e[t],[i]=xi(t),s=this.graph.nodes[i];if(s.attrParams.shape&&s.attrParams.shape.value){const a=s.attrParams.shape.value,o=a.length===r.shape.length&&r.shape.every((A,l)=>a[l]===-1||a[l]===A);H(o,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${a}], but was [${r.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&H(r.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${r.dtype}`)})}mapInputs(e){var t,r;const i={};for(const s in e){const a=(r=(t=this._signature)===null||t===void 0?void 0:t.inputs)===null||r===void 0?void 0:r[s];a!=null?i[a.name]=e[s]:i[s]=e[s]}return i}checkInputs(e){const t=Object.keys(e).filter(r=>{const[i]=xi(r);return this.graph.nodes[i]==null});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(t=>{var r,i;const s=(i=(r=this._signature)===null||r===void 0?void 0:r.outputs)===null||i===void 0?void 0:i[t];return s!=null?s.name:t},{})}checkOutputs(e){e.forEach(t=>{const[r]=xi(t);if(!this.graph.nodes[r])throw new Error(`The output '${t}' is not found in the graph`)})}}class eH{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}/** 9346 * @license 9347 * Copyright 2018 Google LLC. All Rights Reserved. 9348 * Licensed under the Apache License, Version 2.0 (the "License");
9349 * you may not use this file except in compliance with the License. 9350 * You may obtain a copy of the License at 9351 * 9352 * http://www.apache.org/licenses/LICENSE-2.0 9353 * 9354 * Unless required by applicable law or agreed to in writing, software 9355 * distributed under the License is distributed on an "AS IS" BASIS, 9356 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9357 * See the License for the specific language governing permissions and 9358 * limitations under the License. 9359 * ============================================================================= 9360 */const tH="?tfjs-format=file",nH="model.json";class rH{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},r=MC){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=r,t==null&&(this.loadOptions={}),this.resourceManager=new eH}findIOHandler(){const e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return lA(e)?e.then(t=>t.getWeightStream==null?this.loadSync(t):this.loadStreaming(t)):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(e.getWeightStream==null)throw new Error("Model artifacts missing streamWeights function");const t=await wb(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const r=this.artifacts.modelTopology;let i=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){const s=this.artifacts.userDefinedMetadata;s.signature!=null&&(i=s.signature),s.structuredOutputKeys!=null&&(this.structuredOutputKeys=s.structuredOutputKeys)}if(this.signature=i,this.version=`${r.versions.producer}.${r.versions.minConsumer}`,this.executor=new xf(g3.Instance.transformGraph(r,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){const s=g3.Instance.transformGraph(e.modelInitializer);this.initializer=new xf(s),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if(typeof e=="string"){const r=this.io.getSaveHandlers(e);if(r.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(r.length>1)throw new Error(`Found more than one (${r.length}) save handlers for URL '${e}'`);e=r[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t=e instanceof ar?[e]:e,r={};return t.forEach((i,s)=>r[this.structuredOutputKeys[s]]=i),r}return e}predict(e,t){const r=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(r)}async predictAsync(e,t){const r=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(r)}normalizeInputs(e){var t;if(!(e instanceof ar)&&!Array.isArray(e)){const s=(t=this.signature)===null||t===void 0?void 0:t.inputs;if(s!=null)for(const a in s){const o=s[a];o.resourceId!=null&&(e[a]=this.resourceIdToCapturedInput[o.resourceId])}return e}e=Array.isArray(e)?e:[e];const r=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+r!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-r} non-resource placeholders, while there are ${e.length} input tensors provided.`);let i=0;return this.inputNodes.reduce((s,a)=>{var o,A,l;const c=(l=(A=(o=this.signature)===null||o===void 0?void 0:o.inputs)===null||A===void 0?void 0:A[a])===null||l===void 0?void 0:l.resourceId;return c!=null?s[a]=this.resourceIdToCapturedInput[c]:s[a]=e[i++],s},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,r=Object.keys(t);for(let i=0;i<r.length;i++){const s=r[i],a=t[s];this.resourceIdToCapturedInput[a.resourceId]=e[i]}}}execute(e,t){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(this.executeInitializerGraph()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const r=this.executor.execute(e,t);return r.length>1?r:r[0]}async executeAsync(e,t){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const r=await this.executor.executeAsync(e,t);return r.length>1?r:r[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,r)=>(t[r]=[e[r]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&nr(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function D_(n,e={},t=MC){if(n==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");e==null&&(e={}),e.fromTFHub&&typeof n=="string"&&(n=iH(n));const r=new rH(n,e,t);return await r.load(),r}function iH(n){return n.endsWith("/")||(n=n+"/"),`${n}${nH}${tH}`}/** 9361 * @license 9362 * Copyright 2024 Google LLC. All Rights Reserved. 9363 * Licensed under the Apache License, Version 2.0 (the "License");
9364 * you may not use this file except in compliance with the License. 9365 * You may obtain a copy of the License at 9366 * 9367 * http://www.apache.org/licenses/LICENSE-2.0 9368 * 9369 * Unless required by applicable law or agreed to in writing, software 9370 * distributed under the License is distributed on an "AS IS" BASIS, 9371 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9372 * See the License for the specific language governing permissions and 9373 * limitations under the License. 9374 * ============================================================================= 9375 */var Ss=function(){return Ss=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Ss.apply(this,arguments)};function wa(n,e,t,r){return new(t||(t=Promise))(function(i,s){function a(l){try{A(r.next(l))}catch(c){s(c)}}function o(l){try{A(r.throw(l))}catch(c){s(c)}}function A(l){var c;l.done?i(l.value):(c=l.value,c instanceof t?c:new t(function(u){u(c)})).then(a,o)}A((r=r.apply(n,e||[])).next())})}function xa(n,e){var t,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(A){return function(l){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!((i=i.length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(c[0]===6&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(n,a)}catch(u){c=[6,u],r=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([A,l])}}}function Ka(n){var e=n.map(function(t){return t[0]});return e.push(n[n.length-1][1]),e}var L_={lips:Ka([[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]]),leftEye:Ka([[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]]),leftEyebrow:Ka([[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]]),leftIris:Ka([[474,475],[475,476],[476,477],[477,474]]),rightEye:Ka([[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]]),rightEyebrow:Ka([[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]]),rightIris:Ka([[469,470],[470,471],[471,472],[472,469]]),faceOval:Ka([[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]])},sH=[
vendor: 24,341 bytes, line 9375
9375[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
9375],aH=Object.entries(L_).map(function(n){var e=n[0];return n[1].map(function(t){return[t,e]})}).flat(),O_=new Map(aH);function E1(n){for(var e={locationData:{relativeKeypoints:[]}},t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,a=0;a<n.length;++a){var o=n[a];t=Math.min(t,o.x),r=Math.max(r,o.x),i=Math.min(i,o.y),s=Math.max(s,o.y),e.locationData.relativeKeypoints.push({x:o.x,y:o.y})}return e.locationData.relativeBoundingBox={xMin:t,yMin:i,xMax:r,yMax:s,width:r-t,height:s-i},e}var cp={runtime:"mediapipe",maxFaces:1,refineLandmarks:!1},oH=function(){function n(e){var t=this;this.width=0,this.height=0,this.selfieMode=!1,this.faceMeshSolution=new oM({locateFile:function(r,i){return e.solutionPath?e.solutionPath.replace(/\/+$/,"")+"/"+r:i+"/"+r}}),this.faceMeshSolution.setOptions({refineLandmarks:e.refineLandmarks,selfieMode:this.selfieMode,maxNumFaces:e.maxFaces}),this.faceMeshSolution.onResults(function(r){if(t.height=r.image.height,t.width=r.image.width,t.faces=[],r.multiFaceLandmarks!==null)for(var i=r.multiFaceLandmarks,s=0;s<i.length;s++){var a=t.translateOutput(i[s]);t.faces.push({keypoints:a,box:E1(a).locationData.relativeBoundingBox})}})}return n.prototype.translateOutput=function(e){var t=this;return e.map(function(r,i){var s={x:r.x*t.width,y:r.y*t.height,z:r.z*t.width},a=O_.get(i);return a!=null&&(s.name=a),s})},n.prototype.estimateFaces=function(e,t){return wa(this,void 0,void 0,function(){var r,i;return xa(this,function(s){switch(s.label){case 0:return t&&t.flipHorizontal&&t.flipHorizontal!==this.selfieMode&&(this.selfieMode=t.flipHorizontal,this.faceMeshSolution.setOptions({selfieMode:this.selfieMode})),e instanceof ar?(i=ImageData.bind,[4,NC(e)]):[3,2];case 1:return r=new(i.apply(ImageData,[void 0,s.sent(),e.shape[1],e.shape[0]])),[3,3];case 2:r=e,s.label=3;case 3:return e=r,[4,this.faceMeshSolution.send({image:e})];case 4:return s.sent(),[2,this.faces]}})})},n.prototype.dispose=function(){this.faceMeshSolution.close()},n.prototype.reset=function(){this.faceMeshSolution.reset(),this.width=0,this.height=0,this.faces=null,this.selfieMode=!1},n.prototype.initialize=function(){return this.faceMeshSolution.initialize()},n}();function AH(n){return wa(this,void 0,void 0,function(){var e,t;return xa(this,function(r){switch(r.label){case 0:return e=function(i){if(i==null)return Ss({},cp);var s=Ss({},i);return s.runtime="mediapipe",s.maxFaces==null&&(s.maxFaces=cp.maxFaces),s.refineLandmarks==null&&(s.refineLandmarks=cp.refineLandmarks),s}(n),[4,(t=new oH(e)).initialize()];case 1:return r.sent(),[2,t]}})})}var up=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lH={};(function(){var n;function e(v){var S=0;return function(){return S<v.length?{done:!1,value:v[S++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(v,S,N){return v==Array.prototype||v==Object.prototype||(v[S]=N.value),v},r=function(v){v=[typeof globalThis=="object"&&globalThis,v,typeof window=="object"&&window,typeof self=="object"&&self,typeof up=="object"&&up];for(var S=0;S<v.length;++S){var N=v[S];if(N&&N.Math==Math)return N}throw Error("Cannot find global object")}(this);function i(v,S){if(S)e:{var N=r;v=v.split(".");for(var k=0;k<v.length-1;k++){var W=v[k];if(!(W in N))break e;N=N[W]}(S=S(k=N[v=v[v.length-1]]))!=k&&S!=null&&t(N,v,{configurable:!0,writable:!0,value:S})}}
vendor: 26,609 bytes, lines 9375-9392
9375function s(v){return(v={next:v})[Symbol.iterator]=function(){return this},v}function a(v){var S=typeof Symbol<"u"&&Symbol.iterator&&v[Symbol.iterator];return S?S.call(v):{next:e(v)}}function o(v){if(!(v instanceof Array)){v=a(v);for(var S,N=[];!(S=v.next()).done;)N.push(S.value);v=N}return v}i("Symbol",function(v){function S(W,z){this.g=W,t(this,"description",{configurable:!0,writable:!0,value:z})}if(v)return v;S.prototype.toString=function(){return this.g};var N="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",k=0;return function W(z){if(this instanceof W)throw new TypeError("Symbol is not a constructor");return new S(N+(z||"")+"_"+k++,z)}}),i("Symbol.iterator",function(v){if(v)return v;v=Symbol("Symbol.iterator");for(var S="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),N=0;N<S.length;N++){var k=r[S[N]];typeof k=="function"&&typeof k.prototype[v]!="function"&&t(k.prototype,v,{configurable:!0,writable:!0,value:function(){return s(e(this))}})}return v});var A,l=typeof Object.create=="function"?Object.create:function(v){function S(){}return S.prototype=v,new S};if(typeof Object.setPrototypeOf=="function")A=Object.setPrototypeOf;else{var c;e:{var u={};try{u.__proto__={a:!0},c=u.a;break e}catch{}c=!1}A=c?function(v,S){if(v.__proto__=S,v.__proto__!==S)throw new TypeError(v+" is not extensible");return v}:null}var h=A;function f(v,S){if(v.prototype=l(S.prototype),v.prototype.constructor=v,h)h(v,S);else for(var N in S)if(N!="prototype")if(Object.defineProperties){var k=Object.getOwnPropertyDescriptor(S,N);k&&Object.defineProperty(v,N,k)}else v[N]=S[N];v.na=S.prototype}function d(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function g(v){if(v.l)throw new TypeError("Generator is already running");v.l=!0}function m(v,S){v.j={da:S,ea:!0},v.g=v.o||v.u}function p(v,S,N){return v.g=N,{value:S}}function w(v){this.g=new d,this.h=v}function C(v,S,N,k){try{var W=S.call(v.g.i,N);if(!(W instanceof Object))throw new TypeError("Iterator result "+W+" is not an object");if(!W.done)return v.g.l=!1,W;var z=W.value}catch(j){return v.g.i=null,m(v.g,j),b(v)}return v.g.i=null,k.call(v.g,z),b(v)}function b(v){for(;v.g.g;)try{var S=v.h(v.g);if(S)return v.g.l=!1,{value:S.value,done:!1}}catch(N){v.g.h=void 0,m(v.g,N)}if(v.g.l=!1,v.g.j){if(S=v.g.j,v.g.j=null,S.ea)throw S.da;return{value:S.return,done:!0}}return{value:void 0,done:!0}}function U(v){this.next=function(S){return g(v.g),v.g.i?S=C(v,v.g.i.next,S,v.g.s):(v.g.s(S),S=b(v)),S},this.throw=function(S){return g(v.g),v.g.i?S=C(v,v.g.i.throw,S,v.g.s):(m(v.g,S),S=b(v)),S},this.return=function(S){return function(N,k){g(N.g);var W=N.g.i;return W?C(N,"return"in W?W.return:function(z){return{value:z,done:!0}},k,N.g.return):(N.g.return(k),b(N))}(v,S)},this[Symbol.iterator]=function(){return this}}function F(v){return function(S){function N(W){return S.next(W)}function k(W){return S.throw(W)}return new Promise(function(W,z){(function j(ee){ee.done?W(ee.value):Promise.resolve(ee.value).then(N,k).then(j,z)})(S.next())})}(new U(new w(v)))}d.prototype.s=function(v){this.h=v},d.prototype.return=function(v){this.j={return:v},this.g=this.u},i("Promise",function(v){function S(j){this.h=0,this.i=void 0,this.g=[],this.s=!1;var ee=this.j();try{j(ee.resolve,ee.reject)}catch(de){ee.reject(de)}}function N(){this.g=null}function k(j){return j instanceof S?j:new S(function(ee){ee(j)})}if(v)return v;N.prototype.h=function(j){if(this.g==null){this.g=[];var ee=this;this.i(function(){ee.l()})}this.g.push(j)};var W=r.setTimeout;N.prototype.i=function(j){W(j,0)},N.prototype.l=function(){for(;this.g&&this.g.length;){var j=this.g;this.g=[];for(var ee=0;ee<j.length;++ee){var de=j[ee];j[ee]=null;try{de()}catch(Ie){this.j(Ie)}}}this.g=null},N.prototype.j=function(j){this.i(function(){throw j})},S.prototype.j=function(){function j(Ie){return function(Me){de||(de=!0,Ie.call(ee,Me))}}var ee=this,de=!1;return{resolve:j(this.D),reject:j(this.l)}},S.prototype.D=function(j){if(j===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(j instanceof S)this.H(j);else{e:switch(typeof j){case"object":var ee=j!=null;break e;case"function":ee=!0;break e;default:ee=!1}ee?this.A(j):this.o(j)}},S.prototype.A=function(j){var ee=void 0;try{ee=j.then}catch(de){return void this.l(de)}typeof ee=="function"?this.I(ee,j):this.o(j)},S.prototype.l=function(j){this.u(2,j)},S.prototype.o=function(j){this.u(1,j)},S.prototype.u=function(j,ee){if(this.h!=0)throw Error("Cannot settle("+j+", "+ee+"): Promise already settled in state"+this.h);this.h=j,this.i=ee,this.h===2&&this.G(),this.B()},S.prototype.G=function(){var j=this;W(function(){if(j.C()){var ee=r.console;ee!==void 0&&ee.error(j.i)}},1)},S.prototype.C=function(){if(this.s)return!1;var j=r.CustomEvent,ee=r.Event,de=r.dispatchEvent;return de===void 0||(typeof j=="function"?j=new j("unhandledrejection",{cancelable:!0}):typeof ee=="function"?j=new ee("unhandledrejection",{cancelable:!0}):(j=r.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,j),j.promise=this,j.reason=this.i,de(j))},S.prototype.B=function(){if(this.g!=null){for(var j=0;j<this.g.length;++j)z.h(this.g[j]);this.g=null}};var z=new N;return S.prototype.H=function(j){var ee=this.j();j.M(ee.resolve,ee.reject)},S.prototype.I=function(j,ee){var de=this.j();try{j.call(ee,de.resolve,de.reject)}catch(Ie){de.reject(Ie)}},S.prototype.then=function(j,ee){function de(Xe,rt){return typeof Xe=="function"?function(Vt){try{Ie(Xe(Vt))}catch(Xt){Me(Xt)}}:rt}var Ie,Me,We=new S(function(Xe,rt){Ie=Xe,Me=rt});return this.M(de(j,Ie),de(ee,Me)),We},S.prototype.catch=function(j){return this.then(void 0,j)},S.prototype.M=function(j,ee){function de(){switch(Ie.h){case 1:j(Ie.i);break;case 2:ee(Ie.i);break;default:throw Error("Unexpected state: "+Ie.h)}}var Ie=this;this.g==null?z.h(de):this.g.push(de),this.s=!0},S.resolve=k,S.reject=function(j){return new S(function(ee,de){de(j)})},S.race=function(j){return new S(function(ee,de){for(var Ie=a(j),Me=Ie.next();!Me.done;Me=Ie.next())k(Me.value).M(ee,de)})},S.all=function(j){var ee=a(j),de=ee.next();return de.done?k([]):new S(function(Ie,Me){function We(Vt){return function(Xt){Xe[Vt]=Xt,--rt==0&&Ie(Xe)}}var Xe=[],rt=0;do Xe.push(void 0),rt++,k(de.value).M(We(Xe.length-1),Me),de=ee.next();while(!de.done)})},S});var D=typeof Object.assign=="function"?Object.assign:function(v,S){for(var N=1;N<arguments.length;N++){var k=arguments[N];if(k)for(var W in k)Object.prototype.hasOwnProperty.call(k,W)&&(v[W]=k[W])}return v};i("Object.assign",function(v){return v||D}),i("Object.is",function(v){return v||function(S,N){return S===N?S!==0||1/S==1/N:S!=S&&N!=N}}),i("Array.prototype.includes",function(v){return v||function(S,N){var k=this;k instanceof String&&(k=String(k));var W=k.length;for(0>(N=N||0)&&(N=Math.max(N+W,0));N<W;N++){var z=k[N];if(z===S||Object.is(z,S))return!0}return!1}}),i("String.prototype.includes",function(v){return v||function(S,N){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(S instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(S,N||0)!==-1}}),i("Array.prototype.keys",function(v){return v||function(){return function(S,N){S instanceof String&&(S+="");var k=0,W=!1,z={next:function(){if(!W&&k<S.length){var j=k++;return{value:N(j,S[j]),done:!1}}return W=!0,{done:!0,value:void 0}}};return z[Symbol.iterator]=function(){return z},z}(this,function(S){return S})}});var O=this||self;function I(v,S){v=v.split(".");var N,k=O;for((v[0]in k)||k.execScript===void 0||k.execScript("var "+v[0]);v.length&&(N=v.shift());)v.length||S===void 0?k=k[N]&&k[N]!==Object.prototype[N]?k[N]:k[N]={}:k[N]=S}function R(){throw Error("Invalid UTF8")}function V(v,S){return S=String.fromCharCode.apply(null,S),v==null?S:v+S}var re,Y,se=typeof TextDecoder<"u",ge=typeof TextEncoder<"u",ue={},Ce=null;function ae(v){var S;S===void 0&&(S=0),Pe(),S=ue[S];for(var N=Array(Math.floor(v.length/3)),k=S[64]||"",W=0,z=0;W<v.length-2;W+=3){var j=v[W],ee=v[W+1],de=v[W+2],Ie=S[j>>2];j=S[(3&j)<<4|ee>>4],ee=S[(15&ee)<<2|de>>6],de=S[63&de],N[z++]=Ie+j+ee+de}switch(Ie=0,de=k,v.length-W){case 2:de=S[(15&(Ie=v[W+1]))<<2]||k;case 1:v=v[W],N[z]=S[v>>2]+S[(3&v)<<4|Ie>>4]+de+k}return N.join("")}function we(v){var S=v.length,N=3*S/4;N%3?N=Math.floor(N):"=.".indexOf(v[S-1])!=-1&&(N="=.".indexOf(v[S-2])!=-1?N-2:N-1);var k=new Uint8Array(N),W=0;return function(z,j){function ee(rt){for(;de<z.length;){var Vt=z.charAt(de++),Xt=Ce[Vt];if(Xt!=null)return Xt;if(!/^[\s\xa0]*$/.test(Vt))throw Error("Unknown base64 encoding at char: "+Vt)}return rt}Pe();for(var de=0;;){var Ie=ee(-1),Me=ee(0),We=ee(64),Xe=ee(64);if(Xe===64&&Ie===-1)break;j(Ie<<2|Me>>4),We!=64&&(j(Me<<4&240|We>>2),Xe!=64&&j(We<<6&192|Xe))}}(v,function(z){k[W++]=z}),W!==N?k.subarray(0,W):k}function Pe(){if(!Ce){Ce={};for(var v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),S=["+/=","+/","-_=","-_.","-_"],N=0;5>N;N++){var k=v.concat(S[N].split(""));ue[N]=k;for(var W=0;W<k.length;W++){var z=k[W];Ce[z]===void 0&&(Ce[z]=W)}}}}var $e,yt=typeof Uint8Array=="function";function Dt(v){return yt&&v!=null&&v instanceof Uint8Array}function Be(v){if(this.L=v,v!==null&&v.length===0)throw Error("ByteString should be constructed with non-empty values")}var De=typeof Uint8Array.prototype.slice=="function",je=0;function Ke(v,S){return Error("Invalid wire type: "+v+" (at position "+S+")")}function xt(){return Error("Failed to read varint, encoding is invalid.")}function It(v,S){S=(S=S===void 0?{}:S).v!==void 0&&S.v,this.h=null,this.g=this.i=this.j=0,this.v=S,v&&ht(this,v)}function ht(v,S){v.h=function(N,k){if(N.constructor===Uint8Array)return N;if(N.constructor===ArrayBuffer)return new Uint8Array(N);if(N.constructor===Array)return new Uint8Array(N);if(N.constructor===String)return we(N);if(N.constructor===Be)return!k&&(k=N.L)&&k.constructor===Uint8Array?k:(k=(k=N.L)==null||Dt(k)?k:typeof k=="string"?we(k):null,(N=N.L=k)?new Uint8Array(N):$e||($e=new Uint8Array(0)));if(N instanceof Uint8Array)return new Uint8Array(N.buffer,N.byteOffset,N.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(S,v.v),v.j=0,v.i=v.h.length,v.g=v.j}function pt(v){if(v.g>v.i)throw Error("Tried to read past the end of the data "+v.g+" > "+v.i)}function Pt(v){var S=v.h,N=S[v.g],k=127&N;if(128>N)return v.g+=1,pt(v),k;if(k|=(127&(N=S[v.g+1]))<<7,128>N)return v.g+=2,pt(v),k;if(k|=(127&(N=S[v.g+2]))<<14,128>N)return v.g+=3,pt(v),k;if(k|=(127&(N=S[v.g+3]))<<21,128>N)return v.g+=4,pt(v),k;if(N=S[v.g+4],v.g+=5,k|=(15&N)<<28,128>N)return pt(v),k;if(128<=S[v.g++]&&128<=S[v.g++]&&128<=S[v.g++]&&128<=S[v.g++]&&128<=S[v.g++])throw xt();return pt(v),k}It.prototype.reset=function(){this.g=this.j};var bt=[];function Z(){this.g=[]}function cn(v,S){for(;127<S;)v.g.push(127&S|128),S>>>=7;v.g.push(S)}function Rt(v){var S={},N=S.W!==void 0&&S.W;this.l={v:S.v!==void 0&&S.v},this.W=N,S=this.l,bt.length?(N=bt.pop(),S&&(N.v=S.v),v&&ht(N,v),v=N):v=new It(v,S),this.g=v,this.j=this.g.g,this.h=this.i=-1}function kt(v){var S=v.g;if(S.g==S.i)return!1;v.j=v.g.g;var N=Pt(v.g)>>>0;if(S=N>>>3,!(0<=(N&=7)&&5>=N))throw Ke(N,v.j);if(1>S)throw Error("Invalid field number: "+S+" (at position "+v.j+")");return v.i=S,v.h=N,!0}function st(v){switch(v.h){case 0:if(v.h!=0)st(v);else e:{for(var S=(v=v.g).g,N=S+10;S<N;)if((128&v.h[S++])==0){v.g=S,pt(v);break e}throw xt()}break;case 1:(v=v.g).g+=8,pt(v);break;case 2:v.h!=2?st(v):(S=Pt(v.g)>>>0,(v=v.g).g+=S,pt(v));break;case 5:(v=v.g).g+=4,pt(v);break;case 3:for(S=v.i;;){if(!kt(v))throw Error("Unmatched start-group tag: stream EOF");if(v.h==4){if(v.i!=S)throw Error("Unmatched end-group tag");break}st(v)}break;default:throw Ke(v.h,v.j)}}Z.prototype.length=function(){return this.g.length},Z.prototype.end=function(){var v=this.g;return this.g=[],v},Rt.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var Tt=[];function lt(){this.i=[],this.h=0,this.g=new Z}function G(v,S){S.length!==0&&(v.i.push(S),v.h+=S.length)}var L=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol(void 0):void 0;function he(v,S){Object.isFrozen(v)||(L?v[L]|=S:v.N!==void 0?v.N|=S:Object.defineProperties(v,{N:{value:S,configurable:!0,writable:!0,enumerable:!1}}))}function Te(v){var S;return(S=L?v[L]:v.N)==null?0:S}function Ne(v){return he(v,1),v}function xe(v){return!!Array.isArray(v)&&!!(2&Te(v))}function qe(v){if(!Array.isArray(v))throw Error("cannot mark non-array as immutable");he(v,2)}function Ve(v){return v!==null&&typeof v=="object"&&!Array.isArray(v)&&v.constructor===Object}var vt=Object.freeze(Ne([]));function Mt(v){if(xe(v.m))throw Error("Cannot mutate an immutable Message")}var Oe,ut=typeof Symbol<"u"&&Symbol.hasInstance!==void 0;function Nt(v){return{value:v,configurable:!1,writable:!1,enumerable:!1}}function ft(v,S,N){return S===-1?null:S>=v.i?v.g?v.g[S]:void 0:N!==void 0&&N&&v.g&&(N=v.g[S])!=null?N:v.m[S+v.h]}function Ge(v,S,N,k){k=k!==void 0&&k,Mt(v),S<v.i&&!k?v.m[S+v.h]=N:(v.g||(v.g=v.m[v.i+v.h]={}))[S]=N}function _t(v,S,N,k){N=N===void 0||N;var W=ft(v,S,k=k!==void 0&&k);return W==null&&(W=vt),xe(v.m)?N&&(qe(W),Object.freeze(W)):(W===vt||xe(W))&&Ge(v,S,W=Ne(W.slice()),k),W}function Bt(v,S,N){return(v=(v=ft(v,S))==null?v:+v)==null?N===void 0?0:N:v}function un(v,S,N,k){v.j||(v.j={});var W=xe(v.m),z=v.j[N];if(!z){k=_t(v,N,!0,k!==void 0&&k),z=[],W=W||xe(k);for(var j=0;j<k.length;j++)z[j]=new S(k[j]),W&&qe(z[j].m);W&&(qe(z),Object.freeze(z)),v.j[N]=z}return z}function te(v,S,N,k,W){var z=z!==void 0&&z;return Mt(v),z=un(v,N,S,z),N=k||new N,v=_t(v,S),W!=null?(z.splice(W,0,N),v.splice(W,0,N.m)):(z.push(N),v.push(N.m)),N}function Je(v,S){return(v=ft(v,S))==null?0:v}function be(v,S){return(v=ft(v,S))==null?"":v}function Ee(v){var S=Ft;return Ue(v,S=S===void 0?wn:S)}function Le(v,S){if(v!=null){if(Array.isArray(v))v=Ue(v,S);else if(Ve(v)){var N,k={};for(N in v)k[N]=Le(v[N],S);v=k}else v=S(v);return v}}function Ue(v,S){for(var N=v.slice(),k=0;k<N.length;k++)N[k]=Le(N[k],S);return Array.isArray(v)&&1&Te(v)&&Ne(N),N}function Ft(v){return v&&typeof v=="object"&&v.toJSON?v.toJSON():(v=function(S){switch(typeof S){case"number":return isFinite(S)?S:String(S);case"object":if(S&&!Array.isArray(S)){if(Dt(S))return ae(S);if(S instanceof Be){var N=S.L;return N=N==null||typeof N=="string"?N:yt&&N instanceof Uint8Array?ae(N):null,(S.L=N)||""}}}return S}(v),Array.isArray(v)?Ee(v):v)}function wn(v){return Dt(v)?new Uint8Array(v):v}function Pn(v,S,N){v||(v=Oe),Oe=null;var k=this.constructor.h;if(v||(v=k?[k]:[]),this.h=(k?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=v,v=(k=this.m.length)-1,k&&Ve(k=this.m[v])?(this.i=v-this.h,this.g=k):S!==void 0&&-1<S?(this.i=Math.max(S,v+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,N)for(S=0;S<N.length;S++)if((v=N[S])<this.i)v+=this.h,(k=this.m[v])?Array.isArray(k)&&Ne(k):this.m[v]=vt;else{var W=(k=this.g||(this.g=this.m[this.i+this.h]={}))[v];W?Array.isArray(W)&&Ne(W):k[v]=vt}}function on(){Pn.apply(this,arguments)}if(Pn.prototype.toJSON=function(){return Ee(this.m)},Pn.prototype.toString=function(){return this.m.toString()},f(on,Pn),ut){var Xn={};Object.defineProperties(on,(Xn[Symbol.hasInstance]=Nt(function(){throw Error("Cannot perform instanceof checks for MutableMessage")}),Xn))}function Er(v,S,N){if(N){var k,W={};for(k in N){var z=N[k],j=z.ha;j||(W.F=z.la||z.fa.P,z.aa?(W.U=Hi(z.aa),j=function(ee){return function(de,Ie,Me){return ee.F(de,Ie,Me,ee.U)}}(W)):z.ca?(W.T=di(z.X.g,z.ca),j=function(ee){return function(de,Ie,Me){return ee.F(de,Ie,Me,ee.T)}}(W)):j=W.F,z.ha=j),j(S,v,z.X),W={F:W.F,U:W.U,T:W.T}}}(function(ee,de){if(de=de.ba){G(ee,ee.g.end());for(var Ie=0;Ie<de.length;Ie++)G(ee,de[Ie])}})(S,v)}var mr=Symbol();function Gr(v,S,N){return v[mr]||(v[mr]=function(k,W){return S(k,W,N)})}function ei(v){var S=v[mr];if(!S){var N=ye(v);S=function(k,W){return ve(k,W,N)},v[mr]=S}return S}function na(v){var S=function(W){var z=W.aa;return z?ei(z):(z=W.ka)?Gr(W.X.g,z,W.ca):void 0}(v),N=v.X,k=v.fa.O;return S?function(W,z){return k(W,z,N,S)}:function(W,z){return k(W,z,N)}}function sr(v,S,N,k,W,z){var j=0;for((v=v()).length&&typeof v[0]!="number"&&(N(S,v[0]),j++);j<v.length;){N=v[j++];for(var ee=j+1;ee<v.length&&typeof v[ee]!="number";)ee++;var de=v[j++];switch(ee-=j){case 0:k(S,N,de);break;case 1:k(S,N,de,v[j++]);break;case 2:W(S,N,de,v[j++],v[j++]);break;case 3:ee=v[j++];var Ie=v[j++],Me=v[j++];Array.isArray(Me)?W(S,N,de,ee,Ie,Me):z(S,N,de,ee,Ie,Me);break;case 4:z(S,N,de,v[j++],v[j++],v[j++],v[j++]);break;default:throw Error("unexpected number of binary field arguments: "+ee)}}return S}var Sr=Symbol();function Hi(v){var S=v[Sr];if(!S){var N=La(v);S=function(k,W){return ke(k,W,N)},v[Sr]=S}return S}function di(v,S){var N=v[Sr];return N||(N=function(k,W){return Er(k,W,S)},v[Sr]=N),N}var Vi=Symbol();function pi(v,S){v.push(S)}function us(v,S,N){v.push(S,N.P)}function ra(v,S,N,k,W){var z=Hi(W),j=N.P;v.push(S,function(ee,de,Ie){return j(ee,de,Ie,k,z)})}function ia(v,S,N,k,W,z){var j=di(k,z),ee=N.P;v.push(S,function(de,Ie,Me){return ee(de,Ie,Me,k,j)})}function La(v){var S=v[Vi];return S||sr(v,v[Vi]=[],pi,us,ra,ia)}var Ds=Symbol();function mi(v,S){v[0]=S}function Ls(v,S,N,k){var W=N.O;v[S]=k?function(z,j,ee){return W(z,j,ee,k)}:W}function Q(v,S,N,k,W,z){var j=N.O,ee=ei(W);v[S]=function(de,Ie,Me){return j(de,Ie,Me,k,ee,z)}}function oe(v,S,N,k,W,z,j){var ee=N.O,de=Gr(k,W,z);v[S]=function(Ie,Me,We){return ee(Ie,Me,We,k,de,j)}}function ye(v){var S=v[Ds];return S||sr(v,v[Ds]={},mi,Ls,Q,oe)}function ve(v,S,N){for(;kt(S)&&S.h!=4;){var k=S.i,W=N[k];if(!W){var z=N[0];z&&(z=z[k])&&(W=N[k]=na(z))}if(!(W&&W(S,v,k)||(W=S,k=v,z=W.j,st(W),W.W))){var j=W.g.h;W=z===(W=W.g.g)?$e||($e=new Uint8Array(0)):De?j.slice(z,W):new Uint8Array(j.subarray(z,W)),(z=k.ba)?z.push(W):k.ba=[W]}}return v}function le(v,S,N){if(Tt.length){var k=Tt.pop();v&&(ht(k.g,v),k.i=-1,k.h=-1),v=k}else v=new Rt(v);try{return ve(new S,v,ye(N))}finally{(S=v.g).h=null,S.j=0,S.i=0,S.g=0,S.v=!1,v.i=-1,v.h=-1,100>Tt.length&&Tt.push(v)}}function ke(v,S,N){for(var k=N.length,W=k%2==1,z=W?1:0;z<k;z+=2)(0,N[z+1])(S,v,N[z]);Er(v,S,W?N[0]:void 0)}function Ze(v,S){var N=new lt;ke(v,N,La(S)),G(N,N.g.end()),v=new Uint8Array(N.h);for(var k=(S=N.i).length,W=0,z=0;z<k;z++){var j=S[z];v.set(j,W),W+=j.length}return N.i=[v],v}function it(v,S){return{O:v,P:S}}var tt=it(function(v,S,N){if(v.h!==5)return!1;var k=(v=v.g).h[v.g],W=v.h[v.g+1],z=v.h[v.g+2],j=v.h[v.g+3];return v.g+=4,pt(v),v=2*((W=(k<<0|W<<8|z<<16|j<<24)>>>0)>>31)+1,k=W>>>23&255,W&=8388607,Ge(S,N,k==255?W?NaN:1/0*v:k==0?v*Math.pow(2,-149)*W:v*Math.pow(2,k-150)*(W+Math.pow(2,23))),!0},function(v,S,N){if((S=ft(S,N))!=null){cn(v.g,8*N+5),v=v.g;var k=S;(k=(N=0>k?1:0)?-k:k)===0?0<1/k?je=0:je=2147483648:isNaN(k)?je=2147483647:34028234663852886e22<k?je=(N<<31|2139095040)>>>0:11754943508222875e-54>k?(k=Math.round(k/Math.pow(2,-149)),je=(N<<31|k)>>>0):(S=Math.floor(Math.log(k)/Math.LN2),k*=Math.pow(2,-S),16777216<=(k=Math.round(8388608*k))&&++S,je=(N<<31|S+127<<23|8388607&k)>>>0),N=je,v.g.push(N>>>0&255),v.g.push(N>>>8&255),v.g.push(N>>>16&255),v.g.push(N>>>24&255)}}),Ot=it(function(v,S,N){if(v.h!==0)return!1;for(var k=v.g,W=128,z=0,j=v=0;4>j&&128<=W;j++)W=k.h[k.g++],pt(k),z|=(127&W)<<7*j;if(128<=W&&(W=k.h[k.g++],pt(k),z|=(127&W)<<28,v|=(127&W)>>4),128<=W)for(j=0;5>j&&128<=W;j++)W=k.h[k.g++],pt(k),v|=(127&W)<<7*j+3;if(!(128>W))throw xt();return k=z>>>0,(v=2147483648&(W=v>>>0))&&(W=~W>>>0,(k=1+~k>>>0)==0&&(W=W+1>>>0)),k=4294967296*W+(k>>>0),Ge(S,N,v?-k:k),!0},function(v,S,N){if((S=ft(S,N))!=null&&S!=null){cn(v.g,8*N),v=v.g;var k=S;for(N=0>k,S=(k=Math.abs(k))>>>0,k=Math.floor((k-S)/4294967296),k>>>=0,N&&(k=~k>>>0,4294967295<(S=1+(~S>>>0))&&(S=0,4294967295<++k&&(k=0))),N=je=S,S=k;0<S||127<N;)v.g.push(127&N|128),N=(N>>>7|S<<25)>>>0,S>>>=7;v.g.push(N)}}),Lt=it(function(v,S,N){return v.h===0&&(Ge(S,N,Pt(v.g)),!0)},function(v,S,N){if((S=ft(S,N))!=null&&S!=null)if(cn(v.g,8*N),v=v.g,0<=(N=S))cn(v,N);else{for(S=0;9>S;S++)v.g.push(127&N|128),N>>=7;v.g.push(1)}}),Et=it(function(v,S,N){if(v.h!==2)return!1;var k,W=Pt(v.g)>>>0,z=(v=v.g).g;if(v.g+=W,pt(v),v=v.h,se)(k=re)||(k=re=new TextDecoder("utf-8",{fatal:!0})),k=k.decode(v.subarray(z,z+W));else{W=z+W;for(var j,ee,de,Ie=[],Me=null;z<W;)128>(j=v[z++])?Ie.push(j):224>j?z>=W?R():(ee=v[z++],194>j||(192&ee)!=128?(z--,R()):Ie.push((31&j)<<6|63&ee)):240>j?z>=W-1?R():(192&(ee=v[z++]))!=128||j===224&&160>ee||j===237&&160<=ee||(192&(k=v[z++]))!=128?(z--,R()):Ie.push((15&j)<<12|(63&ee)<<6|63&k):244>=j?z>=W-2?R():(192&(ee=v[z++]))!=128||ee-144+(j<<28)>>30!=0||(192&(k=v[z++]))!=128||(192&(de=v[z++]))!=128?(z--,R()):(j=(7&j)<<18|(63&ee)<<12|(63&k)<<6|63&de,j-=65536,Ie.push(55296+(j>>10&1023),56320+(1023&j))):R(),8192<=Ie.length&&(Me=V(Me,Ie),Ie.length=0);k=V(Me,Ie)}return Ge(S,N,k),!0},function(v,S,N){if((S=ft(S,N))!=null){var k=!1;if(k=k!==void 0&&k,ge){if(k&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(S))throw Error("Found an unpaired surrogate");S=(Y||(Y=new TextEncoder)).encode(S)}else{for(var W=0,z=new Uint8Array(3*S.length),j=0;j<S.length;j++){var ee=S.charCodeAt(j);if(128>ee)z[W++]=ee;else{if(2048>ee)z[W++]=ee>>6|192;else{if(55296<=ee&&57343>=ee){if(56319>=ee&&j<S.length){var de=S.charCodeAt(++j);if(56320<=de&&57343>=de){ee=1024*(ee-55296)+de-56320+65536,z[W++]=ee>>18|240,z[W++]=ee>>12&63|128,z[W++]=ee>>6&63|128,z[W++]=63&ee|128;continue}j--}if(k)throw Error("Found an unpaired surrogate");ee=65533}z[W++]=ee>>12|224,z[W++]=ee>>6&63|128}z[W++]=63&ee|128}}S=z.subarray(0,W)}cn(v.g,8*N+2),cn(v.g,S.length),G(v,v.g.end()),G(v,S)}}),Zt=it(function(v,S,N,k,W){if(v.h!==2)return!1;S=te(S,N,k),N=v.g.i,k=Pt(v.g)>>>0;var z=v.g.g+k,j=z-N;if(0>=j&&(v.g.i=z,W(S,v),j=z-v.g.g),j)throw Error("Message parsing ended unexpectedly. Expected to read "+k+" bytes, instead read "+(k-j)+" bytes, either the data ended unexpectedly or the message misreported its own length");return v.g.g=z,v.g.i=N,!0},function(v,S,N,k,W){if((S=un(S,k,N))!=null)for(k=0;k<S.length;k++){var z=v;cn(z.g,8*N+2);var j=z.g.end();G(z,j),j.push(z.h),z=j,W(S[k],v),j=v;var ee=z.pop();for(ee=j.h+j.g.length()-ee;127<ee;)z.push(127&ee|128),ee>>>=7,j.h++;z.push(ee),j.h++}});function Ht(){on.apply(this,arguments)}if(f(Ht,on),ut){var Nn={};Object.defineProperties(Ht,(Nn[Symbol.hasInstance]=Nt(Object[Symbol.hasInstance]),Nn))}function mn(v){Ht.call(this,v)}function An(){return[1,Lt,2,tt,3,Et,4,Et]}function Ct(v){Ht.call(this,v,-1,zt)}function kn(){return[1,Zt,mn,An]}f(mn,Ht),f(Ct,Ht),Ct.prototype.addClassification=function(v,S){return te(this,1,mn,v,S),this};var zt=[1];function lr(v){Ht.call(this,v)}function Ii(){return[1,tt,2,tt,3,tt,4,tt,5,tt]}function cr(v){Ht.call(this,v,-1,en)}function Gi(){return[1,Zt,lr,Ii]}f(lr,Ht),f(cr,Ht);var en=[1];function ur(v){Ht.call(this,v)}function Yn(){return[1,tt,2,tt,3,tt,4,tt,5,tt,6,Ot]}f(ur,Ht);var qn=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Jn=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],hs=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ti=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Os=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Io=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Fo=[].concat(o(qn),o(Jn),o(hs),o(ti),o(Os),o(Io));function x(v,S,N){if(N=v.createShader(N===0?v.VERTEX_SHADER:v.FRAGMENT_SHADER),v.shaderSource(N,S),v.compileShader(N),!v.getShaderParameter(N,v.COMPILE_STATUS))throw Error(`Could not compile WebGL shader. 9376 9377`+v.getShaderInfoLog(N));return N}function E(v){return un(v,mn,1).map(function(S){return{index:Je(S,1),ga:Bt(S,2),label:ft(S,3)!=null?be(S,3):void 0,displayName:ft(S,4)!=null?be(S,4):void 0}})}function T(v){return{x:Bt(v,1),y:Bt(v,2),z:Bt(v,3),visibility:ft(v,4)!=null?Bt(v,4):void 0}}function X(v,S){this.h=v,this.g=S,this.l=0}function ce(v,S,N){return function(k,W){var z=k.g;if(k.o===void 0){var j=x(z,` 9378 attribute vec2 aVertex; 9379 attribute vec2 aTex; 9380 varying vec2 vTex; 9381 void main(void) { 9382 gl_Position = vec4(aVertex, 0.0, 1.0); 9383 vTex = aTex; 9384 }`,0),ee=x(z,` 9385 precision mediump float; 9386 varying vec2 vTex; 9387 uniform sampler2D sampler0; 9388 void main(){ 9389 gl_FragColor = texture2D(sampler0, vTex); 9390 }`,1),de=z.createProgram();if(z.attachShader(de,j),z.attachShader(de,ee),z.linkProgram(de),!z.getProgramParameter(de,z.LINK_STATUS))throw Error(`Could not compile WebGL program. 9391 9392`+z.getProgramInfoLog(de));j=k.o=de,z.useProgram(j),ee=z.getUniformLocation(j,"sampler0"),k.j={K:z.getAttribLocation(j,"aVertex"),J:z.getAttribLocation(j,"aTex"),ma:ee},k.u=z.createBuffer(),z.bindBuffer(z.ARRAY_BUFFER,k.u),z.enableVertexAttribArray(k.j.K),z.vertexAttribPointer(k.j.K,2,z.FLOAT,!1,0,0),z.bufferData(z.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),z.STATIC_DRAW),z.bindBuffer(z.ARRAY_BUFFER,null),k.s=z.createBuffer(),z.bindBuffer(z.ARRAY_BUFFER,k.s),z.enableVertexAttribArray(k.j.J),z.vertexAttribPointer(k.j.J,2,z.FLOAT,!1,0,0),z.bufferData(z.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),z.STATIC_DRAW),z.bindBuffer(z.ARRAY_BUFFER,null),z.uniform1i(ee,0)}j=k.j,z.useProgram(k.o),z.canvas.width=W.width,z.canvas.height=W.height,z.viewport(0,0,W.width,W.height),z.activeTexture(z.TEXTURE0),k.h.bindTexture2d(W.glName),z.enableVertexAttribArray(j.K),z.bindBuffer(z.ARRAY_BUFFER,k.u),z.vertexAttribPointer(j.K,2,z.FLOAT,!1,0,0),z.enableVertexAttribArray(j.J),z.bindBuffer(z.ARRAY_BUFFER,k.s),z.vertexAttribPointer(j.J,2,z.FLOAT,!1,0,0),z.bindFramebuffer(z.DRAW_FRAMEBUFFER?z.DRAW_FRAMEBUFFER:z.FRAMEBUFFER,null),z.clearColor(0,0,0,0),z.clear(z.COLOR_BUFFER_BIT),z.colorMask(!0,!0,
9392!0,!0),z.drawArrays(z.TRIANGLE_FAN,0,4),z.disableVertexAttribArray(j.K),z.disableVertexAttribArray(j.J),z.bindBuffer(z.ARRAY_BUFFER,null),k.h.bindTexture2d(0)}(v,S),typeof v.g.canvas.transferToImageBitmap=="function"?Promise.resolve(v.g.canvas.transferToImageBitmap()):N?Promise.resolve(v.g.canvas):typeof createImageBitmap=="function"?createImageBitmap(v.g.canvas):(v.i===void 0&&(v.i=document.createElement("canvas")),new Promise(function(k){v.i.height=v.g.canvas.height,v.i.width=v.g.canvas.width,v.i.getContext("2d",{}).drawImage(v.g.canvas,0,0,v.g.canvas.width,v.g.canvas.height),k(v.i)}))}function Se(v){this.g=v}var fe=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Fe(v,S){return S+v}function Qe(v,S){window[v]=S}function ot(v){if(this.g=v,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=v&&v.locateFile||Fe,typeof window=="object")var S=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(typeof location>"u")throw Error("solutions can only be loaded on a web page or in a web worker");S=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=S,v.options)for(var N=(S=a(Object.keys(v.options))).next();!N.done;N=S.next()){N=N.value;var k=v.options[N].default;k!==void 0&&(this.j[N]=typeof k=="function"?k():k)}}function Qt(v){var S,N,k,W,z,j,ee,de,Ie,Me,We;return F(function(Xe){switch(Xe.g){case 1:return v.Z?(S=v.g.files===void 0?[]:typeof v.g.files=="function"?v.g.files(v.j):v.g.files,p(Xe,F(function(rt){switch(rt.g){case 1:return rt.o=2,p(rt,WebAssembly.instantiate(fe),4);case 4:rt.g=3,rt.o=0;break;case 2:return rt.o=0,rt.j=null,rt.return(!1);case 3:return rt.return(!0)}}),2)):Xe.return();case 2:if(N=Xe.h,typeof window=="object")return Qe("createMediapipeSolutionsWasm",{locateFile:v.locateFile}),Qe("createMediapipeSolutionsPackedAssets",{locateFile:v.locateFile}),j=S.filter(function(rt){return rt.data!==void 0}),ee=S.filter(function(rt){return rt.data===void 0}),de=Promise.all(j.map(function(rt){var Vt=fn(v,rt.url);if(rt.path!==void 0){var Xt=rt.path;Vt=Vt.then(function(En){return v.overrideFile(Xt,En),Promise.resolve(En)})}return Vt})),Ie=Promise.all(ee.map(function(rt){return rt.simd===void 0||rt.simd&&N||!rt.simd&&!N?function(Vt){var Xt=document.createElement("script");return Xt.setAttribute("src",Vt),Xt.setAttribute("crossorigin","anonymous"),new Promise(function(En){Xt.addEventListener("load",function(){En()},!1),Xt.addEventListener("error",function(){En()},!1),document.body.appendChild(Xt)})}(v.locateFile(rt.url,v.$)):Promise.resolve()})).then(function(){var rt,Vt,Xt;return F(function(En){if(En.g==1)return rt=window.createMediapipeSolutionsWasm,Vt=window.createMediapipeSolutionsPackedAssets,Xt=v,p(En,rt(Vt),2);Xt.h=En.h,En.g=0})}),Me=F(function(rt){return v.g.graph&&v.g.graph.url?rt=p(rt,fn(v,v.g.graph.url),0):(rt.g=0,rt=void 0),rt}),p(Xe,Promise.all([Ie,de,Me]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return k=S.filter(function(rt){return rt.simd===void 0||rt.simd&&N||!rt.simd&&!N}).map(function(rt){return v.locateFile(rt.url,v.$)}),importScripts.apply(null,o(k)),W=v,p(Xe,createMediapipeSolutionsWasm(Module),6);case 6:W.h=Xe.h,v.l=new OffscreenCanvas(1,1),v.h.canvas=v.l,z=v.h.GL.createContext(v.l,{antialias:!1,alpha:!1,ja:typeof WebGL2RenderingContext<"u"?2:1}),v.h.GL.makeContextCurrent(z),Xe.g=4;break;case 7:if(v.l=document.createElement("canvas"),!(We=v.l.getContext("webgl2",{}))&&!(We=v.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),Xe.return();v.G=We,v.h.canvas=v.l,v.h.createContext(v.l,!0,!0,{});case 4:v.i=new v.h.SolutionWasm,v.Z=!1,Xe.g=0}})}function fn(v,S){var N,k;return F(function(W){return S in v.H?W.return(v.H[S]):(N=v.locateFile(S,""),k=fetch(N).then(function(z){return z.arrayBuffer()}),v.H[S]=k,W.return(k))})}function qt(v,S,N){var k,W,z,j,ee,de,Ie,Me,We,Xe,rt,Vt,Xt,En;return F(function(y){switch(y.g){case 1:if(!N)return y.return(S);for(k={},W=0,z=a(Object.keys(N)),j=z.next();!j.done;
vendor: 6,812 bytes, line 9392
9392j=z.next())ee=j.value,typeof(de=N[ee])!="string"&&de.type==="texture"&&S[de.stream]!==void 0&&++W;1<W&&(v.I=!1),Ie=a(Object.keys(N)),j=Ie.next();case 2:if(j.done){y.g=4;break}if(Me=j.value,typeof(We=N[Me])=="string")return Xt=k,En=Me,p(y,function(me,_e,He){var mt;return F(function($t){return typeof He=="number"||He instanceof Uint8Array||He instanceof me.h.Uint8BlobList?$t.return(He):He instanceof me.h.Texture2dDataOut?((mt=me.u[_e])||(mt=new X(me.h,me.G),me.u[_e]=mt),$t.return(ce(mt,He,me.I))):$t.return(void 0)})}(v,Me,S[We]),14);if(Xe=S[We.stream],We.type==="detection_list"){if(Xe){for(var _=Xe.getRectList(),M=Xe.getLandmarksList(),P=Xe.getClassificationsList(),K=[],ie=0;ie<_.size();++ie){var J=le(_.get(ie),ur,Yn);J={boundingBox:{xCenter:Bt(J,1),yCenter:Bt(J,2),height:Bt(J,3),width:Bt(J,4),rotation:Bt(J,5,0),rectId:Je(J,6)},landmarks:un(le(M.get(ie),cr,Gi),lr,1).map(T),V:E(le(P.get(ie),Ct,kn))},K.push(J)}_=K}else _=[];k[Me]=_,y.g=7;break}if(We.type==="proto_list"){if(Xe){for(_=Array(Xe.size()),M=0;M<Xe.size();M++)_[M]=Xe.get(M);Xe.delete()}else _=[];k[Me]=_,y.g=7;break}if(Xe===void 0){y.g=3;break}if(We.type==="float_list"){k[Me]=Xe,y.g=7;break}if(We.type==="proto"){k[Me]=Xe,y.g=7;break}if(We.type!=="texture")throw Error("Unknown output config type: '"+We.type+"'");return(rt=v.u[Me])||(rt=new X(v.h,v.G),v.u[Me]=rt),p(y,ce(rt,Xe,v.I),13);case 13:Vt=y.h,k[Me]=Vt;case 7:We.transform&&k[Me]&&(k[Me]=We.transform(k[Me])),y.g=3;break;case 14:Xt[En]=y.h;case 3:j=Ie.next(),y.g=2;break;case 4:return y.return(k)}})}function Gt(v,S){for(var N=S.name||"$",k=[].concat(o(S.wants)),W=new v.h.StringList,z=a(S.wants),j=z.next();!j.done;j=z.next())W.push_back(j.value);z=v.h.PacketListener.implement({onResults:function(ee){for(var de={},Ie=0;Ie<S.wants.length;++Ie)de[k[Ie]]=ee.get(Ie);var Me=v.listeners[N];Me&&(v.D=qt(v,de,S.outs).then(function(We){We=Me(We);for(var Xe=0;Xe<S.wants.length;++Xe){var rt=de[k[Xe]];typeof rt=="object"&&rt.hasOwnProperty&&rt.hasOwnProperty("delete")&&rt.delete()}We&&(v.D=We)}))}}),v.i.attachMultiListener(W,z),W.delete()}function gt(v){var S=this;v=v||{};var N={url:"face_detection_short.binarypb"},k={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new ot({locateFile:v.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:N,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:typeof window=="object"&&window.navigator!==void 0&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(W){var z,j,ee,de,Ie;return F(function(Me){switch(Me.g){case 1:z=a(W==="short"?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),j=z.next();case 2:if(j.done){Me.g=4;break}return ee=j.value,de="third_party/mediapipe/modules/face_detection/"+ee,p(Me,fn(S.g,ee),5);case 5:Ie=Me.h,S.g.overrideFile(de,Ie),j=z.next(),Me.g=2;break;case 4:return N.url=W==="short"?"face_detection_short.binarypb":"face_detection_full.binarypb",k.graphOptionXref.calculatorName=W==="short"?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",Me.return(!0)}})}},minDetectionConfidence:k}})}(n=ot.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},n.reset=function(){var v=this;return F(function(S){v.i&&(v.i.reset(),v.o={},v.u={}),S.g=0})},n.setOptions=function(v,S){var N=this;if(S=S||this.g.options){for(var k=[],W=[],z={},j=a(Object.keys(v)),ee=j.next();!ee.done;z={R:z.R,S:z.S},ee=j.next()){var de=ee.value;de in this.j&&this.j[de]===v[de]||(this.j[de]=v[de],(ee=S[de])!==void 0&&(ee.onChange&&(z.R=ee.onChange,z.S=v[de],k.push(function(Ie){return function(){return F(function(Me){if(Me.g==1)return p(Me,Ie.R(Ie.S),2);Me.h===!0&&(N.s=!0),Me.g=0})}}(z))),ee.graphOptionXref&&(de={valueNumber:ee.type===1?v[de]:0,valueBoolean:ee.type===0&&v[de],valueString:ee.type===2?v[de]:""},ee=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),ee.graphOptionXref),de),W.push(ee))))}k.length===0&&W.length===0||(this.s=!0,this.B=(this.B===void 0?[]:this.B).concat(W),this.A=(this.A===void 0?[]:this.A).concat(k))}},n.initialize=function(){var v=this;return F(function(S){return S.g==1?p(S,Qt(v),2):S.g!=3?p(S,function(N){var k,W,z,j,ee,de,Ie,Me;return F(function(We){if(We.g==1)return N.g.graph&&N.g.graph.url&&N.Y===N.g.graph.url?We.return():(N.s=!0,N.g.graph&&N.g.graph.url?(N.Y=N.g.graph.url,p(We,fn(N,N.g.graph.url),3)):void(We.g=2));for(We.g!=2&&(k=We.h,N.i.loadGraph(k)),W=a(Object.keys(N.C)),z=W.next();!z.done;z=W.next())j=z.value,N.i.overrideFile(j,N.C[j]);if(N.C={},N.g.listeners)for(ee=a(N.g.listeners),de=ee.next();!de.done;de=ee.next())Ie=de.value,Gt(N,Ie);Me=N.j,N.j={},N.setOptions(Me),We.g=0})}(v),3):p(S,function(N){var k,W,z,j,ee,de;return F(function(Ie){switch(Ie.g){case 1:if(!N.s)return Ie.return();if(!N.A){Ie.g=2;break}k=a(N.A),W=k.next();case 3:if(W.done){Ie.g=5;break}return p(Ie,(0,W.value)(),4);case 4:W=k.next(),Ie.g=3;break;case 5:N.A=void 0;case 2:if(N.B){for(z=new N.h.GraphOptionChangeRequestList,j=a(N.B),ee=j.next();!ee.done;ee=j.next())de=ee.value,z.push_back(de);N.i.changeOptions(z),z.delete(),N.B=void 0}N.s=!1,Ie.g=0}})}(v),0)})},n.overrideFile=function(v,S){this.i?this.i.overrideFile(v,S):this.C[v]=S},n.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},n.send=function(v,S){var N,k,W,z,j,ee,de,Ie,Me,We=this;return F(function(Xe){switch(Xe.g){case 1:return We.g.inputs?(N=1e3*(S==null?performance.now():S),p(Xe,We.D,2)):Xe.return();case 2:return p(Xe,We.initialize(),3);case 3:for(k=new We.h.PacketDataList,W=a(Object.keys(v)),z=W.next();!z.done;z=W.next())if(j=z.value,ee=We.g.inputs[j]){e:{var rt=v[j];switch(ee.type){case"video":var Vt=We.o[ee.stream];if(Vt||(Vt=new X(We.h,We.G),We.o[ee.stream]=Vt),Vt.l===0&&(Vt.l=Vt.h.createTexture()),typeof HTMLVideoElement<"u"&&rt instanceof HTMLVideoElement)var Xt=rt.videoWidth,En=rt.videoHeight;
9392else typeof HTMLImageElement<"u"&&rt instanceof HTMLImageElement?(Xt=rt.naturalWidth,En=rt.naturalHeight):(Xt=rt.width,En=rt.height);En={glName:Vt.l,width:Xt,height:En},(Xt=Vt.g).canvas.width=En.width,Xt.canvas.height=En.height,Xt.activeTexture(Xt.TEXTURE0),Vt.h.bindTexture2d(Vt.l),Xt.texImage2D(Xt.TEXTURE_2D,0,Xt.RGBA,Xt.RGBA,Xt.UNSIGNED_BYTE,rt),Vt.h.bindTexture2d(0),Vt=En;break e;case"detections":for((Vt=We.o[ee.stream])||(Vt=new Se(We.h),We.o[ee.stream]=Vt),Vt.data||(Vt.data=new Vt.g.DetectionListData),Vt.data.reset(rt.length),En=0;En<rt.length;++En){Xt=rt[En];var y=Vt.data,_=y.setBoundingBox,M=En,P=Xt.boundingBox,K=new ur;if(Ge(K,1,P.xCenter),Ge(K,2,P.yCenter),Ge(K,3,P.height),Ge(K,4,P.width),Ge(K,5,P.rotation),Ge(K,6,P.rectId),P=Ze(K,Yn),_.call(y,M,P),Xt.landmarks)for(y=0;y<Xt.landmarks.length;++y){var ie=!!(K=Xt.landmarks[y]).visibility;M=(_=Vt.data).addNormalizedLandmark,P=En,K=Object.assign(Object.assign({},K),{visibility:ie?K.visibility:0}),Ge(ie=new lr,1,K.x),Ge(ie,2,K.y),Ge(ie,3,K.z),K.visibility&&Ge(ie,4,K.visibility),K=Ze(ie,Ii),M.call(_,P,K)}if(Xt.V)for(y=0;y<Xt.V.length;++y)M=(_=Vt.data).addClassification,P=En,K=Xt.V[y],Ge(ie=new mn,2,K.ga),K.index&&Ge(ie,1,K.index),K.label&&Ge(ie,3,K.label),K.displayName&&Ge(ie,4,K.displayName),K=Ze(ie,An),M.call(_,P,K)}Vt=Vt.data;break e;default:Vt={}}}switch(de=Vt,Ie=ee.stream,ee.type){case"video":k.pushTexture2d(Object.assign(Object.assign({},de),{stream:Ie,timestamp:N}));break;case"detections":(Me=de).stream=Ie,Me.timestamp=N,k.pushDetectionList(Me);break;default:throw Error("Unknown input config type: '"+ee.type+"'")}}return We.i.send(k),p(Xe,We.D,4);case 4:k.delete(),Xe.g=0}})},n.onResults=function(v,S){this.listeners[S||"$"]=v},I("Solution",ot),I("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(n=gt.prototype).close=function(){return this.g.close(),Promise.resolve()},n.onResults=function(v){this.g.onResults(v)},n.initialize=function(){var v=this;return F(function(S){return p(S,v.g.initialize(),0)})},n.reset=function(){this.g.reset()},n.send=function(v){var S=this;return F(function(N){return p(N,S.g.send(v),0)})},n.setOptions=function(v){this.g.setOptions(v)},I("FaceDetection",gt),I("FACEDETECTION_LIPS",qn),I("FACEDETECTION_LEFT_EYE",Jn),I("FACEDETECTION_LEFT_EYEBROW",hs),I("FACEDETECTION_RIGHT_EYE",ti),I("FACEDETECTION_RIGHT_EYEBROW",Os),I("FACEDETECTION_FACE_OVAL",Io),I("FACEDETECTION_CONTOURS",Fo),I("FACEDETECTION_TESSELATION",[
vendor: 24,341 bytes, line 9392
9392[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
9392]),I("VERSION","0.4.1646425229")}).call(up);var Co=function(){return Co=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Co.apply(this,arguments)};function Ia(n,e,t,r){return new(t||(t=Promise))(function(i,s){function a(l){try{A(r.next(l))}catch(c){s(c)}}function o(l){try{A(r.throw(l))}catch(c){s(c)}}function A(l){var c;l.done?i(l.value):(c=l.value,c instanceof t?c:new t(function(u){u(c)})).then(a,o)}A((r=r.apply(n,e||[])).next())})}function Fa(n,e){var t,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(A){return function(l){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(c[0]===6&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(n,a)}catch(u){c=[6,u],r=0}finally{t=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([A,l])}}}var P_=["rightEye","leftEye","noseTip","mouthCenter","rightEarTragion","leftEarTragion"],hp={modelType:"short",runtime:"mediapipe",maxFaces:1},cH=function(){function n(e){var t=this;this.width=0,this.height=0,this.selfieMode=!1,this.faceDetectorSolution=new lH.FaceDetection({locateFile:function(r,i){if(e.solutionPath){var s=e.solutionPath.replace(/\/+$/,"");return"".concat(s,"/").concat(r)}return"".concat(i,"/").concat(r)}}),this.faceDetectorSolution.setOptions({selfieMode:this.selfieMode,model:e.modelType}),this.faceDetectorSolution.onResults(function(r){if(t.height=r.image.height,t.width=r.image.width,t.faces=[],r.detections!==null)for(var i=0,s=r.detections;i<s.length;i++){var a=s[i];t.faces.push(t.normalizedToAbsolute(a.landmarks,{xMin:A=(o=a.boundingBox).xCenter-o.width/2,xMax:A+o.width,yMin:l=o.yCenter-o.height/2,yMax:l+o.height,width:o.width,height:o.height}))}var o,A,l})}return n.prototype.normalizedToAbsolute=function(e,t){var r=this;return{keypoints:e.map(function(i,s){return{x:i.x*r.width,y:i.y*r.height,name:P_[s]}}),box:{xMin:t.xMin*this.width,yMin:t.yMin*this.height,xMax:t.xMax*this.width,yMax:t.yMax*this.height,width:t.width*this.width,height:t.height*this.height}}},n.prototype.estimateFaces=function(e,t){return Ia(this,void 0,void 0,function(){var r,i;return Fa(this,function(s){switch(s.label){case 0:return t&&t.flipHorizontal&&t.flipHorizontal!==this.selfieMode&&(this.selfieMode=t.flipHorizontal,this.faceDetectorSolution.setOptions({selfieMode:this.selfieMode})),e instanceof ar?(i=ImageData.bind,[4,NC(e)]):[3,2];case 1:return r=new(i.apply(ImageData,[void 0,s.sent(),e.shape[1],e.shape[0]])),[3,3];case 2:r=e,s.label=3;case 3:return e=r,[4,this.faceDetectorSolution.send({image:e})];case 4:return s.sent(),[2,this.faces]}})})},n.prototype.dispose=function(){this.faceDetectorSolution.close()},n.prototype.reset=function(){this.faceDetectorSolution.reset(),this.width=0,this.height=0,this.faces=null,this.selfieMode=!1},n.prototype.initialize=function(){return this.faceDetectorSolution.initialize()},n}();function uH(n){return Ia(this,void 0,void 0,function(){var e,t;return Fa(this,function(r){switch(r.label){case 0:return e=function(i){if(i==null)return Co({},hp);var s=Co({},i);return s.runtime="mediapipe",s.modelType==null&&(s.modelType=hp.modelType),s.maxFaces==null&&(s.maxFaces=hp.maxFaces),s}(n),[4,(t=new cH(e)).initialize()];case 1:return r.sent(),[2,t]}})})}function k_(n){return n instanceof ar?{height:n.shape[0],width:n.shape[1]}:{height:n.height,width:n.width}}function $_(n){return n instanceof ar?n:DC(n)}function fp(n,e){H(n.width!==0,function(){return"".concat(e," width cannot be 0.")}),H(n.height!==0,function(){return"".concat(e," height cannot be 0.")})}function hH(n,e,t){var r=e.outputTensorSize,i=e.keepAspectRatio,s=e.borderMode,a=e.outputTensorFloatRange,o=k_(n),A=function(h,f){return f?{xCenter:f.xCenter*h.width,yCenter:f.yCenter*h.height,width:f.width*h.width,height:f.height*h.height,rotation:f.rotation}:{xCenter:.5*h.width,yCenter:.5*h.height,width:h.width,height:h.height,rotation:0}}(o,t),l=function(h,f,d){if(d===void 0&&(d=!1),!d)return{top:0,left:0,right:0,bottom:0};var g=f.height,m=f.width;fp(f,"targetSize"),fp(h,"roi");var p,w,C=g/m,b=h.height/h.width,U=0,F=0;return C>b?(p=h.width,w=h.width*C,F=(1-b/C)/2):(p=h.height/C,w=h.height,U=(1-C/b)/2),h.width=p,h.height=w,{top:F,left
9392:U,right:U,bottom:F}}(A,r,i),c=function(h,f,d,g){var m=h.width,p=h.height,w=g?-1:1,C=Math.cos(h.rotation),b=Math.sin(h.rotation),U=h.xCenter,F=h.yCenter,D=1/f,O=1/d,I=new Array(16);return I[0]=m*C*w*D,I[1]=-p*b*D,I[2]=0,I[3]=(-.5*m*C*w+.5*p*b+U)*D,I[4]=m*b*w*O,I[5]=p*C*O,I[6]=0,I[7]=(-.5*p*C-.5*m*b*w+F)*O,I[8]=0,I[9]=0,I[10]=m*D,I[11]=0,I[12]=0,I[13]=0,I[14]=0,I[15]=1,function(R){if(R.length!==16)throw new Error("Array length must be 16 but got ".concat(R.length));return[[R[0],R[1],R[2],R[3]],[R[4],R[5],R[6],R[7]],[R[8],R[9],R[10],R[11]],[R[12],R[13],R[14],R[15]]]}(I)}(A,o.width,o.height,!1),u=Jt(function(){var h=$_(n),f=po(function(m,p,w){return fp(w,"inputResolution"),[1/w.width*m[0][0]*p.width,1/w.height*m[0][1]*p.width,m[0][3]*p.width,1/w.width*m[1][0]*p.height,1/w.height*m[1][1]*p.height,m[1][3]*p.height,0,0]}(c,o,r),[1,8]),d=s==="zero"?"constant":"nearest",g=zl.transform(qi(Kn(h,"float32")),f,"bilinear",d,0,[r.height,r.width]);return a!=null?function(m,p){var w=function(C,b,U,F){var D=(F-U)/255;return{scale:D,offset:U-0*D}}(0,0,p[0],p[1]);return Jt(function(){return Ut(Ye(m,w.scale),w.offset)})}(g,a):g});return{imageTensor:u,padding:l,transformationMatrix:c}}function _3(n){n.reduceBoxesInLowestLayer==null&&(n.reduceBoxesInLowestLayer=!1),n.interpolatedScaleAspectRatio==null&&(n.interpolatedScaleAspectRatio=1),n.fixedAnchorSize==null&&(n.fixedAnchorSize=!1);for(var e=[],t=0;t<n.numLayers;){for(var r=[],i=[],s=[],a=[],o=t;o<n.strides.length&&n.strides[o]===n.strides[t];){var A=B3(n.minScale,n.maxScale,o,n.strides.length);if(o===0&&n.reduceBoxesInLowestLayer)s.push(1),s.push(2),s.push(.5),a.push(.1),a.push(A),a.push(A);else{for(var l=0;l<n.aspectRatios.length;++l)s.push(n.aspectRatios[l]),a.push(A);if(n.interpolatedScaleAspectRatio>0){var c=o===n.strides.length-1?1:B3(n.minScale,n.maxScale,o+1,n.strides.length);a.push(Math.sqrt(A*c)),s.push(n.interpolatedScaleAspectRatio)}}o++}for(var u=0;u<s.length;++u){var h=Math.sqrt(s[u]);r.push(a[u]/h),i.push(a[u]*h)}var f=0,d=0;if(n.featureMapHeight.length>0)f=n.featureMapHeight[t],d=n.featureMapWidth[t];else{var g=n.strides[t];f=Math.ceil(n.inputSizeHeight/g),d=Math.ceil(n.inputSizeWidth/g)}for(var m=0;m<f;++m)for(var p=0;p<d;++p)for(var w=0;w<r.length;++w){var C={xCenter:(p+n.anchorOffsetX)/d,yCenter:(m+n.anchorOffsetY)/f,width:0,height:0};n.fixedAnchorSize?(C.width=1,C.height=1):(C.width=i[w],C.height=r[w]),e.push(C)}t=o}return e}function B3(n,e,t,r){return r===1?.5*(n+e):n+(e-n)*t/(r-1)}function E3(n,e){var t=e[0],r=e[1];return[t*n[0]+r*n[1]+n[3],t*n[4]+r*n[5]+n[7]]}function fH(n,e,t,r){return Ia(this,void 0,void 0,function(){var i,s,a,o,A;return Fa(this,function(l){switch(l.label){case 0:return n.sort(function(c,u){return Math.max.apply(Math,u.score)-Math.max.apply(Math,c.score)}),i=po(n.map(function(c){return[c.locationData.relativeBoundingBox.yMin,c.locationData.relativeBoundingBox.xMin,c.locationData.relativeBoundingBox.yMax,c.locationData.relativeBoundingBox.xMax]})),s=Qr(n.map(function(c){return c.score[0]})),[4,zl.nonMaxSuppressionAsync(i,s,e,t)];case 1:return[4,(a=l.sent()).array()];case 2:return o=l.sent(),A=n.filter(function(c,u){return o.indexOf(u)>-1}),nr([i,s,a]),[2,A]}})})}function dH(n,e,t){return Ia(this,void 0,void 0,function(){var r,i,s,a,o;return Fa(this,function(A){switch(A.label){case 0:return r=n[0],i=n[1],s=function(l,c,u){return Jt(function(){var h,f,d,g;u.reverseOutputOrder?(f=vr(rn(l,[0,u.boxCoordOffset+0],[-1,1])),h=vr(rn(l,[0,u.boxCoordOffset+1],[-1,1])),g=vr(rn(l,[0,u.boxCoordOffset+2],[-1,1])),d=vr(rn(l,[0,u.boxCoordOffset+3],[-1,1]))):(h=vr(rn(l,[0,u.boxCoordOffset+0],[-1,1])),f=vr(rn(l,[0,u.boxCoordOffset+1],[-1,1])),d=vr(rn(l,[0,u.boxCoordOffset+2],[-1,1])),g=vr(rn(l,[0,u.boxCoordOffset+3],[-1,1]))),f=Ut(Ye(dn(f,u.xScale),c.w),c.x),h=Ut(Ye(dn(h,u.yScale),c.h),c.y),u.a
vendor: 3,899 bytes, line 9392
9392pplyExponentialOnBoxSize?(d=Ye(Ea(dn(d,u.hScale)),c.h),g=Ye(Ea(dn(g,u.wScale)),c.w)):(d=Ye(dn(d,u.hScale),c.h),g=Ye(dn(g,u.wScale),c.h));var m=sn(h,dn(d,2)),p=sn(f,dn(g,2)),w=Ut(h,dn(d,2)),C=Ut(f,dn(g,2)),b=Nr([Re(m,[u.numBoxes,1]),Re(p,[u.numBoxes,1]),Re(w,[u.numBoxes,1]),Re(C,[u.numBoxes,1])],1);if(u.numKeypoints)for(var U=0;U<u.numKeypoints;++U){var F=u.keypointCoordOffset+U*u.numValuesPerKeypoint,D=void 0,O=void 0;u.reverseOutputOrder?(D=vr(rn(l,[0,F],[-1,1])),O=vr(rn(l,[0,F+1],[-1,1]))):(O=vr(rn(l,[0,F],[-1,1])),D=vr(rn(l,[0,F+1],[-1,1])));var I=Ut(Ye(dn(D,u.xScale),c.w),c.x),R=Ut(Ye(dn(O,u.yScale),c.h),c.y);b=Nr([b,Re(I,[u.numBoxes,1]),Re(R,[u.numBoxes,1])],1)}return b})}(i,e,t),a=Jt(function(){var l=r;return t.sigmoidScore?(t.scoreClippingThresh!=null&&(l=Lb(r,-t.scoreClippingThresh,t.scoreClippingThresh)),l=rA(l)):l}),[4,pH(s,a,t)];case 1:return o=A.sent(),nr([s,a]),[2,o]}})})}function pH(n,e,t){return Ia(this,void 0,void 0,function(){var r,i,s,a,o,A,l,c,u,h,f,d;return Fa(this,function(g){switch(g.label){case 0:return r=[],[4,n.data()];case 1:return i=g.sent(),[4,e.data()];case 2:for(s=g.sent(),a=0;a<t.numBoxes;++a)if(!(t.minScoreThresh!=null&&s[a]<t.minScoreThresh||(o=a*t.numCoords,A=mH(i[o+0],i[o+1],i[o+2],i[o+3],s[a],t.flipVertically,a),(l=A.locationData.relativeBoundingBox).width<0||l.height<0))){if(t.numKeypoints>0)for((c=A.locationData).relativeKeypoints=[],u=t.numKeypoints*t.numValuesPerKeypoint,h=0;h<u;h+=t.numValuesPerKeypoint)f=o+t.keypointCoordOffset+h,d={x:i[f+0],y:t.flipVertically?1-i[f+1]:i[f+1]},c.relativeKeypoints.push(d);r.push(A)}return[2,r]}})})}function mH(n,e,t,r,i,s,a){return{score:[i],ind:a,locationData:{relativeBoundingBox:{xMin:e,yMin:s?1-t:n,xMax:r,yMax:s?1-n:t,width:r-e,height:t-n}}}}var bf,gH={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:1,featureMapHeight:[],featureMapWidth:[],numLayers:4,minScale:.1484375,maxScale:.75,inputSizeHeight:128,inputSizeWidth:128,anchorOffsetX:.5,anchorOffsetY:.5,strides:[8,16,16,16],aspectRatios:[1],fixedAnchorSize:!0},yH={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:0,featureMapHeight:[],featureMapWidth:[],numLayers:1,minScale:.1484375,maxScale:.75,inputSizeHeight:192,inputSizeWidth:192,anchorOffsetX:.5,anchorOffsetY:.5,strides:[4],aspectRatios:[1],fixedAnchorSize:!0},dp={runtime:"tfjs",modelType:"short",maxFaces:1,detectorModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/face_detection/short/1"},vH={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:896,numCoords:16,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:6,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:128,yScale:128,hScale:128,wScale:128,minScoreThresh:.5},wH={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:2304,numCoords:16,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:6,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:192,yScale:192,hScale:192,wScale:192,minScoreThresh:.6},xH={outputTensorSize:{width:128,height:128},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},bH={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},CH=function(){function n(e,t,r){this.detectorModel=t,this.maxFaces=r,e==="full"?(this.imageToTensorConfig=bH,this.tensorsToDetectionConfig=wH,this.anchors=_3(yH)):(this.imageToTensorConfig=xH,this.tensorsToDetectionConfig=vH,this.anchors=_3(gH));var i=Qr(this.anchors.map(function(A){return A.width})),s=Qr(this.anchors.map(function(A){return A.height})),a=Qr(this.anchors.map(function(A){return A.xCenter})),o=Qr(this.anchors.map(function(A){return A.yCenter}));this.anchorTensor={x:a,y:o,w:i,h:s}}return n.prototype.dispose=function(){this.detectorModel.dispose(),nr([this.anchorTensor.x,this.anchorTensor.y,this.anchorTensor.
9392w,this.anchorTensor.h])},n.prototype.reset=function(){},n.prototype.detectFaces=function(e,t){return t===void 0&&(t=!1),Ia(this,void 0,void 0,function(){var r,i,s,a,o,A,l,c,u,h,f;return Fa(this,function(d){switch(d.label){case 0:return e==null?(this.reset(),[2,[]]):(r=Jt(function(){var g=Kn($_(e),"float32");return t&&(g=vr(zl.flipLeftRight(qi(g,0)),[0])),g}),i=hH(r,this.imageToTensorConfig),s=i.imageTensor,a=i.transformationMatrix,o=this.detectorModel.execute(s,"Identity:0"),A=function(g){return Jt(function(){var m=function(C){return Jt(function(){return[rn(C,[0,0,0],[1,-1,1]),rn(C,[0,0,1],[1,-1,-1])]})}(g),p=m[0],w=m[1];return{boxes:vr(w),logits:vr(p)}})}(o),l=A.boxes,[4,dH([c=A.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return(u=d.sent()).length===0?(nr([r,s,o,c,l]),[2,u]):[4,fH(u,this.maxFaces,.3)];case 2:return h=d.sent(),f=function(g,m){g===void 0&&(g=[]);var p,w=(p=m,[].concat.apply([],p));return g.forEach(function(C){var b=C.locationData;b.relativeKeypoints.forEach(function(R){var V=E3(w,[R.x,R.y]),re=V[0],Y=V[1];R.x=re,R.y=Y});var U=b.relativeBoundingBox,F=Number.MAX_VALUE,D=Number.MAX_VALUE,O=Number.MIN_VALUE,I=Number.MIN_VALUE;[[U.xMin,U.yMin],[U.xMin+U.width,U.yMin],[U.xMin+U.width,U.yMin+U.height],[U.xMin,U.yMin+U.height]].forEach(function(R){var V=E3(w,R),re=V[0],Y=V[1];F=Math.min(F,re),O=Math.max(O,re),D=Math.min(D,Y),I=Math.max(I,Y)}),b.relativeBoundingBox={xMin:F,xMax:O,yMin:D,yMax:I,width:O-F,height:I-D}}),g}(h,a),nr([r,s,o,c,l]),[2,f]}})})},n.prototype.estimateFaces=function(e,t){return Ia(this,void 0,void 0,function(){var r,i;return Fa(this,function(s){return r=k_(e),i=!!t&&t.flipHorizontal,[2,this.detectFaces(e,i).then(function(a){return a.map(function(o){for(var A=o.locationData.relativeKeypoints.map(function(d,g){return Co(Co({},d),{x:d.x*r.width,y:d.y*r.height,name:P_[g]})}),l=o.locationData.relativeBoundingBox,c=0,u=["width","xMax","xMin"];c<u.length;c++)l[u[c]]*=r.width;for(var h=0,f=["height","yMax","yMin"];h<f.length;h++)l[f[h]]*=r.height;return{keypoints:A,box:l}})})]})})},n}();function _H(n){return Ia(this,void 0,void 0,function(){var e,t,r;return Fa(this,function(i){switch(i.label){case 0:return e=function(s){if(s==null)return Co({},dp);var a=Co({},s);return a.modelType==null&&(a.modelType=dp.modelType),a.maxFaces==null&&(a.maxFaces=dp.maxFaces),a.detectorModelUrl==null&&(a.modelType==="full"?a.detectorModelUrl="https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1":a.detectorModelUrl="https://tfhub.dev/mediapipe/tfjs-model/face_detection/short/1"),a}(n),t=typeof e.detectorModelUrl=="string"&&e.detectorModelUrl.indexOf("https://tfhub.dev")>-1,[4,D_(e.detectorModelUrl,{fromTFHub:t})];case 1:return r=i.sent(),[2,new CH(e.modelType,r,e.maxFaces)]}})})}function BH(n,e){return Ia(this,void 0,void 0,function(){var t,r;return Fa(this,function(i){if(n===bf.MediaPipeFaceDetector){if(r=void 0,(t=e)!=null){if(t.runtime==="tfjs")return[2,_H(t)];if(t.runtime==="mediapipe")return[2,uH(t)];r=t.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' "+"or 'mediapipe', but got ".concat(r))}throw new Error("".concat(n," is not a supported model name."))})})}function pp(n){return n.width*n.height}function S3(n){var e=n.xCenter-n.width/2,t=e+n.width,r=n.yCenter-n.height/2;return{xMin:e,xMax:t,yMin:r,yMax:r+n.height,width:n.width,height:n.height}}function EH(n,e){var t=S3(n),r=S3(e);if(!function(a,o){return!(a.xMax<o.xMin||o.xMax<a.xMin||a.yMax<o.yMin||o.yMax<a.yMin)}(t,r))return 0;var i=pp(function(a,o){var A=Math.max(a.xMin,o.xMin),l=Math.min(a.xMax,o.xMax),c=Math.max(a.yMin,o.yMin),u=Math.min(a.yMax,o.yMax);return{xMin:A,xMax:l,yMin:c,yMax:u,width:Math.max(l-A,0),height:Math.max(u-c,0)}}(t,r)),s=pp(t)+pp(r)-i;return s>0?i/s:0}function SH(n,e,t,r){var i=n.width,s=n.height,a=r?-1:1,o=Math.cos(n.rotation),A=Math.sin(n.rotation),l=n.xCenter,c=n.yCenter,u=1/e,h=1/t,f=new Array(16);return f[0]=i*o*a*u,f[1]=-s*A*u,f[2]=0,f[3]=(-.5*i*o*a+.5*s*A+l)*u,f[4]=i*A*a*h,f[5]=s*o*h,f[6]=0,f[7]=(-.5*s*o-.5*i*A*a+c)*h,f[8]=0,f[9]=0,f[10]=i*u,f[11]=0,f[12]=0,f[13]=0,f[14]=0,f[15]=1,function(d){if(d.length!==16)throw new Error("Array length must be 16 but got "+d.length);return[[d[0],d[1],d[2],d[3]],[d[4],d[5],d[6],d[7]],[d[8],d[9],d[10],d[11]],[d[12],d[13],d[14],d[15]]]}(f)}function Q_(n){return n instanceof ar?{height:n.shape[0],width:n.shape[1]}:{height:n.height,width:n.width}}function H_(n){return n-2*Math.PI*Math.floor((n+Math.PI)/(2*Math.PI))}function V_(n){return n instanceof ar?n:DC(n)}function mp(n,e){H(n.width!==0,function(){return e+" width cannot be 0."}),H(n.height!==0,function(){return e+" height cannot be 0."})}function TH(n,e){var t=function(r,i,s,a){var o=i-r,A=a-s;if(o===0)throw new Error("Original min and max are both "+r+", range cannot be 0.");var l=A/o;return{scale:l,offset:s-r*l}}(0,255,e[0],e[1]);return Jt(function(){return Ut(Ye(n,t.scale),t.offset)})}function IH(n,e,t){var r=e.outputTensorSize,i=e.keepAspectRatio,s=e.borderMode,a=e.outputTensorFloatRange,o=Q_(n),A=function(h,f){return f?{xCenter:f.xCenter*h.width,yCenter:f.yCenter*h.height,width:f.width*h.width,height:f.height*h.height,rotation:f.rotation}:{xCenter:.5*h.width,yCenter:.5*h.height,width:h.width,height:h.height,rotation:0}}(o,t),l=function(h,f,d){if(d===void 0&&(d=!1),!d)return{top:0,left:0,right:0,bottom:0};var g=f.height,m=f.width;mp(f,"targetSize"),mp(h,"roi");var p,w,C=g/m,b=h.height/h.width,U=0,F=0;return C>b?(p=h.width,w=h.width*C,F=(1-b/C)/2):(p=h.height/C,w=h.height,U=(1-C/b)/2),h.width=p,h.height=w,{top:F,left
9392:U,right:U,bottom:F}}(A,r,i),c=SH(A,o.width,o.height,!1),u=Jt(function(){var h=V_(n),f=po(function(m,p,w){return mp(w,"inputResolution"),[1/w.width*m[0][0]*p.width,1/w.height*m[0][1]*p.width,m[0][3]*p.width,1/w.width*m[1][0]*p.height,1/w.height*m[1][1]*p.height,m[1][3]*p.height,0,0]}(c,o,r),[1,8]),d=s==="zero"?"constant":"nearest",g=zl.transform(qi(Kn(h,"float32")),f,"bilinear",d,0,[r.height,r.width]);return a!=null?TH(g,a):g});return{imageTensor:u,padding:l,transformationMatrix:c}}function T3(n){return{xCenter:n.xMin+n.width/2,yCenter:n.yMin+n.height/2,width:n.width,height:n.height}}function I3(n){var e=n.relativeKeypoints;if(e.length<=1)throw new Error("2 or more keypoints required to calculate a rect.");var t=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,s=Number.MIN_VALUE;return e.forEach(function(a){t=Math.min(t,a.x),i=Math.max(i,a.x),r=Math.min(r,a.y),s=Math.max(s,a.y)}),{xCenter:(t+i)/2,yCenter:(r+s)/2,width:i-t,height:s-r}}function F3(n,e,t,r,i){var s=t==="rect"?function(a,o,A){var l,c=a.locationData;if(o==="boundingbox")l=T3(c.boundingBox);else{l=I3(c);var u=A.width,h=A.height;l.xCenter=Math.round(l.xCenter*u),l.yCenter=Math.round(l.yCenter*h),l.width=Math.round(l.width*u),l.height=Math.round(l.height*h)}return l}(n,e,r):function(a,o){var A=a.locationData;return o==="boundingbox"?T3(A.relativeBoundingBox):I3(A)}(n,e);return i&&(s.rotation=function(a,o,A){var l,c=a.locationData,u=A.rotationVectorStartKeypointIndex,h=A.rotationVectorEndKeypointIndex;l=A.rotationVectorTargetAngle?A.rotationVectorTargetAngle:Math.PI*A.rotationVectorTargetAngleDegree/180;var f=c.relativeKeypoints[u].x*o.width,d=c.relativeKeypoints[u].y*o.height,g=c.relativeKeypoints[h].x*o.width,m=c.relativeKeypoints[h].y*o.height;return H_(l-Math.atan2(-(m-d),g-f))}(n,r,i)),s}function FH(n,e,t){for(var r=0;r<e.length;++r){var i=e[r],s=t[n[r]];s.x=i.x,s.y=i.y}}function RH(n,e,t,r){if(typeof e=="string"){if(e==="copy")for(var i=0;i<t.length;++i)r[n[i]].z=t[i].z}else{var s=function(a,o){for(var A=0,l=0;l<o.length;++l)A+=a[o[l]].z;return A/o.length}(r,e);for(i=0;i<n.length;++i)r[n[i]].z=s}}function UH(n,e){for(var t=function(o){var A=[].concat.apply([],o.map(function(f){return f.indexesMapping}));if(A.length===0)throw new Error("There should be at least one landmark in indexes mapping");var l=A[0],c=A[0],u=new Set(A);u.forEach(function(f){l=Math.min(l,f),c=Math.max(c,f)});var h=u.size;if(l!==0)throw new Error("Indexes are expected to start with 0 instead of "+l);if(c+1!==h)throw new Error("Indexes should have no gaps but "+(c-h+1)+" indexes are missing");return h}(e),r=new Array(t).fill(null).map(Object),i=0;i<n.length;++i){var s=n[i],a=e[i];if(s.length!==a.indexesMapping.length)throw new Error("There are "+s.length+" refinement landmarks while mapping has "+a.indexesMapping.length);FH(a.indexesMapping,s,r),RH(a.indexesMapping,a.zRefinement,s,r)}return r}function MH(n,e){return n.map(function(t){var r=Ss(Ss({},t),{x:t.x*e.width,y:t.y*e.height});return t.z!=null&&(r.z=t.z*e.width),r})}function NH(n,e){return n==="none"?e:function(t){return 1/(1+Math.exp(-t))}(e)}function ko(n,e,t,r){return wa(this,void 0,void 0,function(){var i,s,a,o,A,l,c,u;return xa(this,function(h){switch(h.label){case 0:return t=t||e.flipHorizontally||!1,r=r||e.flipVertically||!1,i=n.size,s=i/e.numLandmarks,[4,n.data()];case 1:for(a=h.sent(),o=[],A=0;A<e.numLandmarks;++A)l=A*s,(u={x:0,y:0}).x=t?e.inputImageWidth-a[l]:a[l],s>1&&(u.y=r?e.inputImageHeight-a[l+1]:a[l+1]),s>2&&(u.z=a[l+2]),s>3&&(u.score=NH(e.visibilityActivation,a[l+3])),o.push(u);for(c=0;c<o.length;++c)(u=o[c]).x=u.x/e.inputImageWidth,u.y=u.y/e.inputImageHeight,u.z=u.z/e.inputImageWidth/(e.normalizeZ||1);return[2,o]}})})}function R3(n,e,t){var r=n.width,i=n.height,s=n.rotation;if(t.rotation==null&&t.rotationDegree==null||(s=function(c,u){return u.rotation!=null?c+=u.rotation:u.rotationDegree!=null&&(c+=Math.PI*u.rotationDegree/180),H_(c)}
9392(s,t)),s===0)n.xCenter=n.xCenter+r*t.shiftX,n.yCenter=n.yCenter+i*t.shiftY;else{var a=(e.width*r*t.shiftX*Math.cos(s)-e.height*i*t.shiftY*Math.sin(s))/e.width,o=(e.width*r*t.shiftX*Math.sin(s)+e.height*i*t.shiftY*Math.cos(s))/e.height;n.xCenter=n.xCenter+a,n.yCenter=n.yCenter+o}if(t.squareLong){var A=Math.max(r*e.width,i*e.height);r=A/e.width,i=A/e.height}else if(t.squareShort){var l=Math.min(r*e.width,i*e.height);r=l/e.width,i=l/e.height}return n.width=r*t.scaleX,n.height=i*t.scaleY,n}(bf||(bf={})).MediaPipeFaceDetector="MediaPipeFaceDetector";var gp={runtime:"tfjs",maxFaces:1,refineLandmarks:!1,landmarkModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/face_landmarks_detection/face_mesh/1"},yp={flipHorizontal:!1,staticImageMode:!1},U3={shiftX:0,shiftY:0,scaleX:1.5,scaleY:1.5,squareLong:!0},DH={outputTensorSize:{width:192,height:192},outputTensorFloatRange:[0,1],borderMode:"replicate"},M3={numLandmarks:468,inputImageWidth:192,inputImageHeight:192,visibilityActivation:"none",flipHorizontally:!1,flipVertically:!1},LH={numLandmarks:80,inputImageWidth:192,inputImageHeight:192,visibilityActivation:"none",flipHorizontally:!1,flipVertically:!1},N3={numLandmarks:71,inputImageWidth:192,inputImageHeight:192,visibilityActivation:"none",flipHorizontally:!1,flipVertically:!1},D3={numLandmarks:5,inputImageWidth:192,inputImageHeight:192,visibilityActivation:"none",flipHorizontally:!1,flipVertically:!1},OH={indexesMapping:Array.from(Array(468).keys()),zRefinement:"copy"},PH={indexesMapping:[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],zRefinement:"none"},kH={indexesMapping:[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],zRefinement:"none"},$H={indexesMapping:[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417],zRefinement:"none"},QH={indexesMapping:[468,469,470,471,472],zRefinement:[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173]},HH={indexesMapping:[473,474,475,476,477],zRefinement:[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398]},Ml,VH=function(){function n(e,t,r,i){this.detector=e,this.landmarkModel=t,this.maxFaces=r,this.withAttention=i,this.prevFaceRectsFromLandmarks=null}return n.prototype.estimateFaces=function(e,t){return wa(this,void 0,void 0,function(){var r,i,s,a,o,A,l,c,u,h,f,d,g,m=this;return xa(this,function(p){switch(p.label){case 0:return r=function(b){if(b==null)return Ss({},yp);var U=Ss({},b);return U.flipHorizontal==null&&(U.flipHorizontal=yp.flipHorizontal),U.staticImageMode==null&&(U.staticImageMode=yp.staticImageMode),U}(t),e==null?(this.reset(),[2,[]]):(i=Q_(e),s=Jt(function(){var b=Kn(V_(e),"float32");return r.flipHorizontal&&(b=vr(zl.flipLeftRight(qi(b,0)),[0])),b}),a=this.prevFaceRectsFromLandmarks,r.staticImageMode||a==null||a.length<this.maxFaces?[4,this.detector.detectFaces(s,!1)]:[3,2]);case 1:return(A=p.sent()).length===0?(this.reset(),s.dispose(),[2,[]]):(o=A.map(function(b){return m.faceDetectionFrontDetectionToRoi(b,i)}),[3,3]);case 2:o=[],p.label=3;case 3:return w=.5,C=[],[o,a||[]].forEach(function(b){return b.forEach(function(U){(C=C.filter(function(F){return EH(U,F)<=w})).push(U)})}),l=C,[4,Promise.all(l.map(function(b){return m.faceLandmark(b,s)}))];case 4:for(c=p.sent(),u=[],this.prevFaceRectsFromLandmarks=[],h=0;h<c.length;++h)(f=c[h])!=null&&(this.prevFaceRectsFromLandmarks.push(this.faceLandmarksToRoi(f,i)),(d=MH(f,i))!=null&&d.forEach(function(b,U){var F=O_.get(U);F!=null&&(b.name=F)}),g=E1(d),u.push({keypoints:d,box:g.locationData.relativeBoundingBox}));return s.dispose(),[2,u]}var w,C})})},n.prototype.dispose=function(){this.detector.dispose(),this.landmarkModel.dispose()},n.prototype.reset=function(){this.detector.reset(),this.prevFaceRectsFromLandmarks=null},n.prototype.faceDetectionFrontDetectionToRoi=function(e,t){return R3(F3(e,"boundingbox","normRect",t,{rotationVectorStartKeypointIndex:0,rotationVectorEndKeypointIndex:1,rotationVectorTargetAngleDegree:0}),t,U3)},n.prototype.faceLandmark=function(e,t){return wa(this,void 0,void 0,function(){var r,i,s,a,o,A,l;return xa(this,function(c){switch(c.label){case 0:return r=IH(t,DH,e).imageTensor,i=["output_faceflag"].concat(this.withAttention?["output_mesh_identity","output_lips","Identity_6:0","Identity_1:0","Identity_2:0","Identity_5:0"]:["output_mesh"]),s=this.landmarkModel.execute(r,i),a=s[0],o=s.slice(1),[4,a.data()];case 1:return c.sent()[0]<.5?(nr(s),nr(r),[2,null]):this.withAttention?[4,this.tensorsToFaceLandmarksWithAttention(o)]:[3,3];case 2:return A=c.sent(),[3,5];case 3:return[4,this.tensorsToFaceLandmarks(o)];case 4:A=c.sent(),c.label=5;case 5:return l=function(u,h,f){f===void 0&&(f={ignoreRotation:!1});for(var d=[],g=0,m=u;g<m.length;g++){var p=m[g],w=p.x-.5,C=p.y-.5,b=f.ignoreRotation?0:h.rotation,U=Math.cos(b)*w-Math.sin(b)*C,F=Math.sin(b)*w+Math.cos(b)*C;U=U*h.width+h.xCenter,F=F*h.height+h.yCenter;var D=p.z*h.width,O=Ss({},p);O.x=U,O.y=F,O.z=D,d.push(O)}return d}(A,e),nr(s),nr(r),[2,l]}})})},n.prototype.tensorsToFaceLandmarks=function(e){return wa(this,void 0,void 0,function(){return xa(this,function(t){return[2,ko(e[0],M3)]})})},n.prototype.tensorsToFaceLandmarksWithAttention=function(e){return wa(this,void 0,void 0,function(){var t,r,i,s,a,o;return xa(this,function(A){switch(A.label){case 0:return[4,ko(e[0],M3)];case 1:return t=A.sent(),[4,ko(e[1],LH)];case 2:return r=A.sent(),[4,ko(e[3],N3)];case 3:return i=A.sent(),[4,ko(e[5],N3)];case 4:return s=A.sent(),[4,ko(e[4],D3)];case 5:return a=A.sent(),[4,ko(e[2],D3)];case 6:return o=A.sent(),[2,UH([t,r,i,s,a,o],[OH,PH,kH,$H,QH,HH])]}})})},n.prototype.faceLandmarksToRoi=function(e,t){return R3(F3(E1(e),"boundingbox","normRect",t,{rotationVectorStartKeypointIndex:33,rotationVectorEndKeypointIndex:263,rotationVectorTargetAngleDegree:0}),t,U3)},n}();function GH(n){return wa(this,void 0,void 0,function(){var e,t,r,i;return xa(this,function(s){switch(s.label){case 0:return e=function(a){if
vendor: 4,573 bytes, line 9392
9392(a==null)return Ss({},gp);var o=Ss({},a);return o.runtime="tfjs",o.maxFaces==null&&(o.maxFaces=gp.maxFaces),o.refineLandmarks==null&&(o.refineLandmarks=gp.refineLandmarks),o.landmarkModelUrl==null&&(o.landmarkModelUrl=o.refineLandmarks?"https://tfhub.dev/mediapipe/tfjs-model/face_landmarks_detection/attention_mesh/1":"https://tfhub.dev/mediapipe/tfjs-model/face_landmarks_detection/face_mesh/1"),o}(n),t=typeof e.landmarkModelUrl=="string"&&e.landmarkModelUrl.indexOf("https://tfhub.dev")>-1,[4,D_(e.landmarkModelUrl,{fromTFHub:t})];case 1:return r=s.sent(),[4,BH(bf.MediaPipeFaceDetector,{modelType:"short",maxFaces:e.maxFaces,detectorModelUrl:e.detectorModelUrl,runtime:e.runtime})];case 2:return i=s.sent(),[2,new VH(i,r,e.maxFaces,e.refineLandmarks)]}})})}function zH(n,e){return wa(this,void 0,void 0,function(){var t,r;return xa(this,function(i){if(n===Ml.MediaPipeFaceMesh){if(r=void 0,(t=e)!=null){if(t.runtime==="tfjs")return[2,GH(t)];if(t.runtime==="mediapipe")return[2,AH(t)];r=t.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+r)}throw new Error(n+" is not a supported model name.")})})}(function(n){n.MediaPipeFaceMesh="MediaPipeFaceMesh"})(Ml||(Ml={}));Object.freeze({__proto__:null,getKeypointIndexByContour:function(n){if(n===Ml.MediaPipeFaceMesh)return L_;throw new Error("Model "+n+" is not supported.")},getAdjacentPairs:function(n){if(n===Ml.MediaPipeFaceMesh)return sH;throw new Error("Model "+n+" is not supported.")}});(function(){var n;function e(y){var _=0;return function(){return _<y.length?{done:!1,value:y[_++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(y,_,M){return y==Array.prototype||y==Object.prototype||(y[_]=M.value),y};function r(y){y=[typeof globalThis=="object"&&globalThis,y,typeof window=="object"&&window,typeof self=="object"&&self,typeof Li=="object"&&Li];for(var _=0;_<y.length;++_){var M=y[_];if(M&&M.Math==Math)return M}throw Error("Cannot find global object")}var i=r(this);function s(y,_){if(_)e:{var M=i;y=y.split(".");for(var P=0;P<y.length-1;P++){var K=y[P];if(!(K in M))break e;M=M[K]}y=y[y.length-1],P=M[y],_=_(P),_!=P&&_!=null&&t(M,y,{configurable:!0,writable:!0,value:_})}}s("Symbol",function(y){function _(ie){if(this instanceof _)throw new TypeError("Symbol is not a constructor");return new M(P+(ie||"")+"_"+K++,ie)}function M(ie,J){this.g=ie,t(this,"description",{configurable:!0,writable:!0,value:J})}if(y)return y;M.prototype.toString=function(){return this.g};var P="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",K=0;return _}),s("Symbol.iterator",function(y){if(y)return y;y=Symbol("Symbol.iterator");for(var _="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),M=0;M<_.length;M++){var P=i[_[M]];typeof P=="function"&&typeof P.prototype[y]!="function"&&t(P.prototype,y,{configurable:!0,writable:!0,value:function(){return a(e(this))}})}return y});function a(y){return y={next:y},y[Symbol.iterator]=function(){return this},y}function o(y){var _=typeof Symbol<"u"&&Symbol.iterator&&y[Symbol.iterator];return _?_.call(y):{next:e(y)}}function A(y){if(!(y instanceof Array)){y=o(y);for(var _,M=[];!(_=y.next()).done;)M.push(_.value);y=M}return y}var l=typeof Object.create=="function"?Object.create:function(y){function _(){}return _.prototype=y,new _},c;if(typeof Object.setPrototypeOf=="function")c=Object.setPrototypeOf;else{var u;e:{var h={a:!0},f={};try{f.__proto__=h,u=f.a;break e}catch{}u=!1}c=u?function(y,_){if(y.__proto__=_,y.__proto__!==_)throw new TypeError(y+" is not extensible");return y}:null}var d=c;function g(y,_){if(y.prototype=l(_.prototype),y.prototype.constructor=y,d)d(y,_);else for(var M in _)if(M!="prototype")if(Object.defineProperties){var P=Object.getOwnPropertyDescriptor(_,M);P&&Object.defineProperty(y,M,P)}else y[M]=_[M];y.na=_.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function p(y){if(y.l)throw new TypeError("Generator is already running");y.l=!0}m.prototype.s=function(y){this.h=y};function w(y,_){y.j={da:_,ea:!0},y.g=y.o||y.u}m.prototype.return=function(y){this.j={return:y},this.g=this.u};function C(y,_,M){return y.g=M,{value:_}}function b(y){this.g=new m,this.h=y}function U(y,_){p(y.g);var M=y.g.i;return M?F(y,"return"in M?M.return:function(P){return{value:P,done:!0}},_,y.g.return):(y.g.return(_),D(y))}function F(y,_,M,P){try{var K=_.call(y.g.i,M);if(!(K instanceof Object))throw new TypeError("Iterator result "+K+" is not an object");
vendor: 4,406 bytes, line 9392
9392if(!K.done)return y.g.l=!1,K;var ie=K.value}catch(J){return y.g.i=null,w(y.g,J),D(y)}return y.g.i=null,P.call(y.g,ie),D(y)}function D(y){for(;y.g.g;)try{var _=y.h(y.g);if(_)return y.g.l=!1,{value:_.value,done:!1}}catch(M){y.g.h=void 0,w(y.g,M)}if(y.g.l=!1,y.g.j){if(_=y.g.j,y.g.j=null,_.ea)throw _.da;return{value:_.return,done:!0}}return{value:void 0,done:!0}}function O(y){this.next=function(_){return p(y.g),y.g.i?_=F(y,y.g.i.next,_,y.g.s):(y.g.s(_),_=D(y)),_},this.throw=function(_){return p(y.g),y.g.i?_=F(y,y.g.i.throw,_,y.g.s):(w(y.g,_),_=D(y)),_},this.return=function(_){return U(y,_)},this[Symbol.iterator]=function(){return this}}function I(y){function _(P){return y.next(P)}function M(P){return y.throw(P)}return new Promise(function(P,K){function ie(J){J.done?P(J.value):Promise.resolve(J.value).then(_,M).then(ie,K)}ie(y.next())})}function R(y){return I(new O(new b(y)))}s("Promise",function(y){function _(J){this.h=0,this.i=void 0,this.g=[],this.s=!1;var me=this.j();try{J(me.resolve,me.reject)}catch(_e){me.reject(_e)}}function M(){this.g=null}function P(J){return J instanceof _?J:new _(function(me){me(J)})}if(y)return y;M.prototype.h=function(J){if(this.g==null){this.g=[];var me=this;this.i(function(){me.l()})}this.g.push(J)};var K=i.setTimeout;M.prototype.i=function(J){K(J,0)},M.prototype.l=function(){for(;this.g&&this.g.length;){var J=this.g;this.g=[];for(var me=0;me<J.length;++me){var _e=J[me];J[me]=null;try{_e()}catch(He){this.j(He)}}}this.g=null},M.prototype.j=function(J){this.i(function(){throw J})},_.prototype.j=function(){function J(He){return function(mt){_e||(_e=!0,He.call(me,mt))}}var me=this,_e=!1;return{resolve:J(this.D),reject:J(this.l)}},_.prototype.D=function(J){if(J===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(J instanceof _)this.H(J);else{e:switch(typeof J){case"object":var me=J!=null;break e;case"function":me=!0;break e;default:me=!1}me?this.A(J):this.o(J)}},_.prototype.A=function(J){var me=void 0;try{me=J.then}catch(_e){this.l(_e);return}typeof me=="function"?this.I(me,J):this.o(J)},_.prototype.l=function(J){this.u(2,J)},_.prototype.o=function(J){this.u(1,J)},_.prototype.u=function(J,me){if(this.h!=0)throw Error("Cannot settle("+J+", "+me+"): Promise already settled in state"+this.h);this.h=J,this.i=me,this.h===2&&this.G(),this.B()},_.prototype.G=function(){var J=this;K(function(){if(J.C()){var me=i.console;typeof me<"u"&&me.error(J.i)}},1)},_.prototype.C=function(){if(this.s)return!1;var J=i.CustomEvent,me=i.Event,_e=i.dispatchEvent;return typeof _e>"u"?!0:(typeof J=="function"?J=new J("unhandledrejection",{cancelable:!0}):typeof me=="function"?J=new me("unhandledrejection",{cancelable:!0}):(J=i.document.createEvent("CustomEvent"),J.initCustomEvent("unhandledrejection",!1,!0,J)),J.promise=this,J.reason=this.i,_e(J))},_.prototype.B=function(){if(this.g!=null){for(var J=0;J<this.g.length;++J)ie.h(this.g[J]);this.g=null}};var ie=new M;return _.prototype.H=function(J){var me=this.j();J.M(me.resolve,me.reject)},_.prototype.I=function(J,me){var _e=this.j();try{J.call(me,_e.resolve,_e.reject)}catch(He){_e.reject(He)}},_.prototype.then=function(J,me){function _e(Wt,St){return typeof Wt=="function"?function(tn){try{He(Wt(tn))}catch(_n){mt(_n)}}:St}var He,mt,$t=new _(function(Wt,St){He=Wt,mt=St});return this.M(_e(J,He),_e(me,mt)),$t},_.prototype.catch=function(J){return this.then(void 0,J)},_.prototype.M=function(J,me){function _e(){switch(He.h){case 1:J(He.i);break;case 2:me(He.i);break;default:throw Error("Unexpected state: "+He.h)}}var He=this;this.g==null?ie.h(_e):this.g.push(_e),this.s=!0},_.resolve=P,_.reject=function(J){return new _(function(me,_e){_e(J)})},_.race=function(J){return new _(function(me,_e){for(var He=o(J),mt=He.next();!mt.done;mt=He.next())P(mt.value).M(me,_e)})},_.all=function(J){var me=o(J),_e=me.next();return _e.done?P([]):new _(function(He,mt){function $t(tn){return function(_n){Wt[tn]=_n,St--,St==0&&He(Wt)}}var Wt=[],St=0;do Wt.push(void 0),St++,P(_e.value).M($t(Wt.length-1),mt),_e=me.next();while(!_e.done)})},_});function V(y,_){y instanceof String&&(y+="");var M=0,P=!1,K={next:function(){if(!P&&M<y.length){var ie=M++;return{value:_(ie,y[ie]),done:!1}}return P=!0,{done:!0,value:void 0}}};return K[Symbol.iterator]=function(){return K},K}var re=typeof Object.assign=="function"?Object.assign:function(y,_){for(var M=1;M<arguments.length;M++){var P=arguments[M];
vendor: 4,791 bytes, line 9392
9392if(P)for(var K in P)Object.prototype.hasOwnProperty.call(P,K)&&(y[K]=P[K])}return y};s("Object.assign",function(y){return y||re}),s("Object.is",function(y){return y||function(_,M){return _===M?_!==0||1/_===1/M:_!==_&&M!==M}}),s("Array.prototype.includes",function(y){return y||function(_,M){var P=this;P instanceof String&&(P=String(P));var K=P.length;for(M=M||0,0>M&&(M=Math.max(M+K,0));M<K;M++){var ie=P[M];if(ie===_||Object.is(ie,_))return!0}return!1}}),s("String.prototype.includes",function(y){return y||function(_,M){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(_ instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(_,M||0)!==-1}}),s("Array.prototype.keys",function(y){return y||function(){return V(this,function(_){return _})}});var Y=this||self;function se(y,_){y=y.split(".");var M=Y;y[0]in M||typeof M.execScript>"u"||M.execScript("var "+y[0]);for(var P;y.length&&(P=y.shift());)y.length||_===void 0?M[P]&&M[P]!==Object.prototype[P]?M=M[P]:M=M[P]={}:M[P]=_}function ge(){throw Error("Invalid UTF8")}function ue(y,_){return _=String.fromCharCode.apply(null,_),y==null?_:y+_}var Ce,ae=typeof TextDecoder<"u",we,Pe=typeof TextEncoder<"u",$e={},yt=null;function Dt(y){var _;_===void 0&&(_=0),je(),_=$e[_];for(var M=Array(Math.floor(y.length/3)),P=_[64]||"",K=0,ie=0;K<y.length-2;K+=3){var J=y[K],me=y[K+1],_e=y[K+2],He=_[J>>2];J=_[(J&3)<<4|me>>4],me=_[(me&15)<<2|_e>>6],_e=_[_e&63],M[ie++]=He+J+me+_e}switch(He=0,_e=P,y.length-K){case 2:He=y[K+1],_e=_[(He&15)<<2]||P;case 1:y=y[K],M[ie]=_[y>>2]+_[(y&3)<<4|He>>4]+_e+P}return M.join("")}function Be(y){var _=y.length,M=3*_/4;M%3?M=Math.floor(M):"=.".indexOf(y[_-1])!=-1&&(M="=.".indexOf(y[_-2])!=-1?M-2:M-1);var P=new Uint8Array(M),K=0;return De(y,function(ie){P[K++]=ie}),K!==M?P.subarray(0,K):P}function De(y,_){function M(_e){for(;P<y.length;){var He=y.charAt(P++),mt=yt[He];if(mt!=null)return mt;if(!/^[\s\xa0]*$/.test(He))throw Error("Unknown base64 encoding at char: "+He)}return _e}je();for(var P=0;;){var K=M(-1),ie=M(0),J=M(64),me=M(64);if(me===64&&K===-1)break;_(K<<2|ie>>4),J!=64&&(_(ie<<4&240|J>>2),me!=64&&_(J<<6&192|me))}}function je(){if(!yt){yt={};for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),_=["+/=","+/","-_=","-_.","-_"],M=0;5>M;M++){var P=y.concat(_[M].split(""));$e[M]=P;for(var K=0;K<P.length;K++){var ie=P[K];yt[ie]===void 0&&(yt[ie]=K)}}}}var Ke=typeof Uint8Array=="function";function xt(y){return Ke&&y!=null&&y instanceof Uint8Array}var It;function ht(y){if(this.L=y,y!==null&&y.length===0)throw Error("ByteString should be constructed with non-empty values")}var pt=typeof Uint8Array.prototype.slice=="function",Pt=0,bt=0;function Z(y,_){if(y.constructor===Uint8Array)return y;if(y.constructor===ArrayBuffer)return new Uint8Array(y);if(y.constructor===Array)return new Uint8Array(y);if(y.constructor===String)return Be(y);if(y.constructor===ht)return!_&&(_=y.L)&&_.constructor===Uint8Array?_:(_=y.L,_=_==null||xt(_)?_:typeof _=="string"?Be(_):null,(y=y.L=_)?new Uint8Array(y):It||(It=new Uint8Array(0)));if(y instanceof Uint8Array)return new Uint8Array(y.buffer,y.byteOffset,y.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}function cn(y,_){return Error("Invalid wire type: "+y+" (at position "+_+")")}function Rt(){return Error("Failed to read varint, encoding is invalid.")}function kt(y,_){_=_===void 0?{}:_,_=_.v===void 0?!1:_.v,this.h=null,this.g=this.i=this.j=0,this.v=_,y&&st(this,y)}function st(y,_){y.h=Z(_,y.v),y.j=0,y.i=y.h.length,y.g=y.j}kt.prototype.reset=function(){this.g=this.j};function Tt(y){if(y.g>y.i)throw Error("Tried to read past the end of the data "+y.g+" > "+y.i)}function lt(y){var _=y.h,M=_[y.g],P=M&127;if(128>M)return y.g+=1,Tt(y),P;if(M=_[y.g+1],P|=(M&127)<<7,128>M)return y.g+=2,Tt(y),P;if(M=_[y.g+2],P|=(M&127)<<14,128>M)return y.g+=3,Tt(y),P;if(M=_[y.g+3],P|=(M&127)<<21,128>M)return y.g+=4,Tt(y),P;if(M=_[y.g+4],y.g+=5,P|=(M&15)<<28,128>M)return Tt(y),P;if(128<=_[y.g++]&&128<=_[y.g++]&&128<=_[y.g++]&&128<=_[y.g++]&&128<=_[y.g++])throw Rt();return Tt(y),P}var G=[];function L(){this.g=[]}L.prototype.length=function(){return this.g.length},L.prototype.end=function(){var y=this.g;return this.g=[],y};function he(y,_){for(;127<_;)y.g.push(_&127|128),_>>>=7;y.g.push(_)}function Te(y){var _={},M=_.W===void 0?!1:_.W;this.l={v:_.v===void 0?!1:_.v},this.W=M,_=this.l,G.length?(M=G.pop(),_&&(M.v=_.v),y&&st(M,y),y=M):y=new kt(y,_),this.g=y,this.j=this.g.g,this.h=this.i=-1}Te.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};function Ne(y){var _=y.g;
9392if(_.g==_.i)return!1;y.j=y.g.g;var M=lt(y.g)>>>0;if(_=M>>>3,M&=7,!(0<=M&&5>=M))throw cn(M,y.j);if(1>_)throw Error("Invalid field number: "+_+" (at position "+y.j+")");return y.i=_,y.h=M,!0}function xe(y){switch(y.h){case 0:if(y.h!=0)xe(y);else e:{y=y.g;for(var _=y.g,M=_+10;_<M;)if((y.h[_++]&128)===0){y.g=_,Tt(y);break e}throw Rt()}break;case 1:y=y.g,y.g+=8,Tt(y);break;case 2:y.h!=2?xe(y):(_=lt(y.g)>>>0,y=y.g,y.g+=_,Tt(y));break;case 5:y=y.g,y.g+=4,Tt(y);break;case 3:_=y.i;do{if(!Ne(y))throw Error("Unmatched start-group tag: stream EOF");if(y.h==4){if(y.i!=_)throw Error("Unmatched end-group tag");break}xe(y)}while(1);break;default:throw cn(y.h,y.j)}}var qe=[];function Ve(){this.i=[],this.h=0,this.g=new L}function vt(y,_){_.length!==0&&(y.i.push(_),y.h+=_.length)}function Mt(y,_){if(_=_.ba){vt(y,y.g.end());for(var M=0;M<_.length;M++)vt(y,_[M])}}var Oe=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol(void 0):void 0;function ut(y,_){Object.isFrozen(y)||(Oe?y[Oe]|=_:y.N!==void 0?y.N|=_:Object.defineProperties(y,{N:{value:_,configurable:!0,writable:!0,enumerable:!1}}))}function Nt(y){var _;return Oe?_=y[Oe]:_=y.N,_==null?0:_}function ft(y){return ut(y,1),y}function Ge(y){return Array.isArray(y)?!!(Nt(y)&2):!1}function _t(y){if(!Array.isArray(y))throw Error("cannot mark non-array as immutable");ut(y,2)}function Bt(y){return y!==null&&typeof y=="object"&&!Array.isArray(y)&&y.constructor===Object}var un=Object.freeze(ft([]));function te(y){if(Ge(y.m))throw Error("Cannot mutate an immutable Message")}var Je=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function be(y){return{value:y,configurable:!1,writable:!1,enumerable:!1}}function Ee(y,_,M){return _===-1?null:_>=y.i?y.g?y.g[_]:void 0:(M===void 0?0:M)&&y.g&&(M=y.g[_],M!=null)?M:y.m[_+y.h]}function Le(y,_,M,P){P=P===void 0?!1:P,te(y),_<y.i&&!P?y.m[_+y.h]=M:(y.g||(y.g=y.m[y.i+y.h]={}))[_]=M}function Ue(y,_,M,P){M=M===void 0?!0:M,P=P===void 0?!1:P;var K=Ee(y,_,P);return K==null&&(K=un),Ge(y.m)?M&&(_t(K),Object.freeze(K)):(K===un||Ge(K))&&(K=ft(K.slice()),Le(y,_,K,P)),K}function Ft(y,_,M){return y=Ee(y,_),y=y==null?y:+y,y==null?M===void 0?0:M:y}function wn(y,_,M,P){y.j||(y.j={});var K=Ge(y.m),ie=y.j[M];if(!ie){P=Ue(y,M,!0,P===void 0?!1:P),ie=[],K=K||Ge(P);for(var J=0;J<P.length;J++)ie[J]=new _(P[J]),K&&_t(ie[J].m);K&&(_t(ie),Object.freeze(ie)),y.j[M]=ie}return ie}function Pn(y,_,M,P,K){var ie=ie===void 0?!1:ie;return te(y),ie=wn(y,M,_,ie),M=P||new M,y=Ue(y,_),K!=null?(ie.splice(K,0,M),y.splice(K,0,M.m)):(ie.push(M),y.push(M.m)),M}function on(y,_){return y=Ee(y,_),y==null?0:y}function Xn(y,_){return y=Ee(y,_),y==null?"":y}function Er(y){switch(typeof y){case"number":return isFinite(y)?y:String(y);case"object":if(y&&!Array.isArray(y)){if(xt(y))return Dt(y);if(y instanceof ht){var _=y.L;return _=_==null||typeof _=="string"?_:Ke&&_ instanceof Uint8Array?Dt(_):null,(y.L=_)||""}}}return y}function mr(y){var _=na;return _=_===void 0?sr:_,ei(y,_)}function Gr(y,_){if(y!=null){if(Array.isArray(y))y=ei(y,_);else if(Bt(y)){var M={},P;for(P in y)M[P]=Gr(y[P],_);y=M}else y=_(y);return y}}function ei(y,_){for(var M=y.slice(),P=0;P<M.length;P++)M[P]=Gr(M[P],_);return Array.isArray(y)&&Nt(y)&1&&ft(M),M}function na(y){return y&&typeof y=="object"&&y.toJSON?y.toJSON():(y=Er(y),Array.isArray(y)?mr(y):y)}function sr(y){return xt(y)?new Uint8Array(y):y}function Sr(y,_,M){y||(y=Hi),Hi=null;var P=this.constructor.h;y||(y=P?[P]:[]),this.h=(P?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=y;e:{if(P=this.m.length,y=P-1,P&&(P=this.m[y],Bt(P))){this.i=y-this.h,this.g=P;break e}_!==void 0&&-1<_?(this.i=Math.max(_,y+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE}if(M)for(_=0;_<M.length;_++)if(y=M[_],y<this.i)y+=this.h,(P=this.m[y])?Array.isArray(P)&&ft(P):this.m[y]=un;else{P=this.g||(this.g=this.m[this.i+this.h]={});var K=P[y];K?Array.isArray(K)&&ft(K):P[y]=un}}Sr.prototype.toJSON=function(){return mr(this.m)},Sr.prototype.toString=function(){return this.m.toString()};var Hi;function di(){Sr.apply(this,arguments)}if(g(di,Sr),Je){var Vi={};Object.defineProperties(di,(Vi[Symbol.hasInstance]=be(function(){throw Error("Cannot perform instanceof checks for MutableMessage")}),Vi))}
9392function pi(y,_,M){if(M){var P={},K;for(K in M){var ie=M[K],J=ie.ha;J||(P.F=ie.la||ie.fa.P,ie.aa?(P.U=Q(ie.aa),J=function(me){return function(_e,He,mt){return me.F(_e,He,mt,me.U)}}(P)):ie.ca?(P.T=oe(ie.X.g,ie.ca),J=function(me){return function(_e,He,mt){return me.F(_e,He,mt,me.T)}}(P)):J=P.F,ie.ha=J),J(_,y,ie.X),P={F:P.F,U:P.U,T:P.T}}}Mt(_,y)}var us=Symbol();function ra(y,_,M){return y[us]||(y[us]=function(P,K){return _(P,K,M)})}function ia(y){var _=y[us];if(!_){var M=Ht(y);_=function(P,K){return Nn(P,K,M)},y[us]=_}return _}function La(y){var _=y.aa;if(_)return ia(_);if(_=y.ka)return ra(y.X.g,_,y.ca)}function Ds(y){var _=La(y),M=y.X,P=y.fa.O;return _?function(K,ie){return P(K,ie,M,_)}:function(K,ie){return P(K,ie,M)}}function mi(y,_,M,P,K,ie){y=y();var J=0;for(y.length&&typeof y[0]!="number"&&(M(_,y[0]),J++);J<y.length;){M=y[J++];for(var me=J+1;me<y.length&&typeof y[me]!="number";)me++;var _e=y[J++];switch(me-=J,me){case 0:P(_,M,_e);break;case 1:P(_,M,_e,y[J++]);break;case 2:K(_,M,_e,y[J++],y[J++]);break;case 3:me=y[J++];var He=y[J++],mt=y[J++];Array.isArray(mt)?K(_,M,_e,me,He,mt):ie(_,M,_e,me,He,mt);break;case 4:ie(_,M,_e,y[J++],y[J++],y[J++],y[J++]);break;default:throw Error("unexpected number of binary field arguments: "+me)}}return _}var Ls=Symbol();function Q(y){var _=y[Ls];if(!_){var M=it(y);_=function(P,K){return An(P,K,M)},y[Ls]=_}return _}function oe(y,_){var M=y[Ls];return M||(M=function(P,K){return pi(P,K,_)},y[Ls]=M),M}var ye=Symbol();function ve(y,_){y.push(_)}function le(y,_,M){y.push(_,M.P)}function ke(y,_,M,P,K){var ie=Q(K),J=M.P;y.push(_,function(me,_e,He){return J(me,_e,He,P,ie)})}function Ze(y,_,M,P,K,ie){var J=oe(P,ie),me=M.P;y.push(_,function(_e,He,mt){return me(_e,He,mt,P,J)})}function it(y){var _=y[ye];return _||mi(y,y[ye]=[],ve,le,ke,Ze)}var tt=Symbol();function Ot(y,_){y[0]=_}function Lt(y,_,M,P){var K=M.O;y[_]=P?function(ie,J,me){return K(ie,J,me,P)}:K}function Et(y,_,M,P,K,ie){var J=M.O,me=ia(K);y[_]=function(_e,He,mt){return J(_e,He,mt,P,me,ie)}}function Zt(y,_,M,P,K,ie,J){var me=M.O,_e=ra(P,K,ie);y[_]=function(He,mt,$t){return me(He,mt,$t,P,_e,J)}}function Ht(y){var _=y[tt];return _||mi(y,y[tt]={},Ot,Lt,Et,Zt)}function Nn(y,_,M){for(;Ne(_)&&_.h!=4;){var P=_.i,K=M[P];if(!K){var ie=M[0];ie&&(ie=ie[P])&&(K=M[P]=Ds(ie))}if((!K||!K(_,y,P))&&(K=_,P=y,ie=K.j,xe(K),!K.W)){var J=K.g.h;K=K.g.g,K=ie===K?It||(It=new Uint8Array(0)):pt?J.slice(ie,K):new Uint8Array(J.subarray(ie,K)),(ie=P.ba)?ie.push(K):P.ba=[K]}}return y}function mn(y,_,M){if(qe.length){var P=qe.pop();y&&(st(P.g,y),P.i=-1,P.h=-1),y=P}else y=new Te(y);try{return Nn(new _,y,Ht(M))}finally{_=y.g,_.h=null,_.j=0,_.i=0,_.g=0,_.v=!1,y.i=-1,y.h=-1,100>qe.length&&qe.push(y)}}function An(y,_,M){for(var P=M.length,K=P%2==1,ie=K?1:0;ie<P;ie+=2)(0,M[ie+1])(_,y,M[ie]);pi(y,_,K?M[0]:void 0)}function Ct(y,_){var M=new Ve;An(y,M,it(_)),vt(M,M.g.end()),y=new Uint8Array(M.h),_=M.i;for(var P=_.length,K=0,ie=0;ie<P;ie++){var J=_[ie];y.set(J,K),K+=J.length}return M.i=[y],y}function kn(y,_){return{O:y,P:_}}var zt=kn(function(y,_,M){if(y.h!==5)return!1;y=y.g;var P=y.h[y.g],K=y.h[y.g+1],ie=y.h[y.g+2],J=y.h[y.g+3];return y.g+=4,Tt(y),K=(P<<0|K<<8|ie<<16|J<<24)>>>0,y=2*(K>>31)+1,P=K>>>23&255,K&=8388607,Le(_,M,P==255?K?NaN:1/0*y:P==0?y*Math.pow(2,-149)*K:y*Math.pow(2,P-150)*(K+Math.pow(2,23))),!0},function(y,_,M){if(_=Ee(_,M),_!=null){he(y.g,8*M+5),y=y.g;var P=_;P=(M=0>P?1:0)?-P:P,P===0?0<1/P?Pt=bt=0:(bt=0,Pt=2147483648):isNaN(P)?(bt=0,Pt=2147483647):34028234663852886e22<P?(bt=0,Pt=(M<<31|2139095040)>>>0):11754943508222875e-54>P?(P=Math.round(P/Math.pow(2,-149)),bt=0,Pt=(M<<31|P)>>>0):(_=Math.floor(Math.log(P)/Math.LN2),P*=Math.pow(2,-_),P=Math.round(8388608*P),16777216<=P&&++_,bt=0,Pt=(M<<31|_+127<<23|P&8388607)>>>0),M=Pt,y.g.push(M>>>0&255),y.g.push(M>>>8&255),y.g.push(M>>>16&255),y.g.push(M>>>24&255)}}),lr=kn(function(y,_,M){if(y.h!==0)return!1;for(var P=y.g,K=128,ie=0,J=y=0;4>J&&128<=K;J++)K=P.h[P.g++],Tt(P),ie|=(K&127)<<7*J;if(128<=K&&(K=P.h[P.g++],Tt(P),ie|=(K&127)<<28,y|=(K&127)>>4),128<=K)for(J=0;5>J&&128<=K;J++)K=P.h[P.g++],Tt(P),y|=(K&127)<<7*J+3;if(128>K)P=ie>>>0,K=y>>>
93920,(y=K&2147483648)&&(P=~P+1>>>0,K=~K>>>0,P==0&&(K=K+1>>>0)),P=4294967296*K+(P>>>0);else throw Rt();return Le(_,M,y?-P:P),!0},function(y,_,M){if(_=Ee(_,M),_!=null&&_!=null){he(y.g,8*M),y=y.g;var P=_;for(M=0>P,P=Math.abs(P),_=P>>>0,P=Math.floor((P-_)/4294967296),P>>>=0,M&&(P=~P>>>0,_=(~_>>>0)+1,4294967295<_&&(_=0,P++,4294967295<P&&(P=0))),Pt=_,bt=P,M=Pt,_=bt;0<_||127<M;)y.g.push(M&127|128),M=(M>>>7|_<<25)>>>0,_>>>=7;y.g.push(M)}}),Ii=kn(function(y,_,M){return y.h!==0?!1:(Le(_,M,lt(y.g)),!0)},function(y,_,M){if(_=Ee(_,M),_!=null&&_!=null)if(he(y.g,8*M),y=y.g,M=_,0<=M)he(y,M);else{for(_=0;9>_;_++)y.g.push(M&127|128),M>>=7;y.g.push(1)}}),cr=kn(function(y,_,M){if(y.h!==2)return!1;var P=lt(y.g)>>>0;y=y.g;var K=y.g;y.g+=P,Tt(y),y=y.h;var ie;if(ae)(ie=Ce)||(ie=Ce=new TextDecoder("utf-8",{fatal:!0})),ie=ie.decode(y.subarray(K,K+P));else{P=K+P;for(var J=[],me=null,_e,He,mt;K<P;)_e=y[K++],128>_e?J.push(_e):224>_e?K>=P?ge():(He=y[K++],194>_e||(He&192)!==128?(K--,ge()):J.push((_e&31)<<6|He&63)):240>_e?K>=P-1?ge():(He=y[K++],(He&192)!==128||_e===224&&160>He||_e===237&&160<=He||((ie=y[K++])&192)!==128?(K--,ge()):J.push((_e&15)<<12|(He&63)<<6|ie&63)):244>=_e?K>=P-2?ge():(He=y[K++],(He&192)!==128||(_e<<28)+(He-144)>>30!==0||((ie=y[K++])&192)!==128||((mt=y[K++])&192)!==128?(K--,ge()):(_e=(_e&7)<<18|(He&63)<<12|(ie&63)<<6|mt&63,_e-=65536,J.push((_e>>10&1023)+55296,(_e&1023)+56320))):ge(),8192<=J.length&&(me=ue(me,J),J.length=0);ie=ue(me,J)}return Le(_,M,ie),!0},function(y,_,M){if(_=Ee(_,M),_!=null){var P=!1;if(P=P===void 0?!1:P,Pe){if(P&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(_))throw Error("Found an unpaired surrogate");_=(we||(we=new TextEncoder)).encode(_)}else{for(var K=0,ie=new Uint8Array(3*_.length),J=0;J<_.length;J++){var me=_.charCodeAt(J);if(128>me)ie[K++]=me;else{if(2048>me)ie[K++]=me>>6|192;else{if(55296<=me&&57343>=me){if(56319>=me&&J<_.length){var _e=_.charCodeAt(++J);if(56320<=_e&&57343>=_e){me=1024*(me-55296)+_e-56320+65536,ie[K++]=me>>18|240,ie[K++]=me>>12&63|128,ie[K++]=me>>6&63|128,ie[K++]=me&63|128;continue}else J--}if(P)throw Error("Found an unpaired surrogate");me=65533}ie[K++]=me>>12|224,ie[K++]=me>>6&63|128}ie[K++]=me&63|128}}_=ie.subarray(0,K)}he(y.g,8*M+2),he(y.g,_.length),vt(y,y.g.end()),vt(y,_)}}),Gi=kn(function(y,_,M,P,K){if(y.h!==2)return!1;_=Pn(_,M,P),M=y.g.i,P=lt(y.g)>>>0;var ie=y.g.g+P,J=ie-M;if(0>=J&&(y.g.i=ie,K(_,y),J=ie-y.g.g),J)throw Error("Message parsing ended unexpectedly. Expected to read "+(P+" bytes, instead read "+(P-J)+" bytes, either the data ended unexpectedly or the message misreported its own length"));return y.g.g=ie,y.g.i=M,!0},function(y,_,M,P,K){if(_=wn(_,P,M),_!=null)for(P=0;P<_.length;P++){var ie=y;he(ie.g,8*M+2);var J=ie.g.end();vt(ie,J),J.push(ie.h),ie=J,K(_[P],y),J=y;var me=ie.pop();for(me=J.h+J.g.length()-me;127<me;)ie.push(me&127|128),me>>>=7,J.h++;ie.push(me),J.h++}});function en(){di.apply(this,arguments)}if(g(en,di),Je){var ur={};Object.defineProperties(en,(ur[Symbol.hasInstance]=be(Object[Symbol.hasInstance]),ur))}function Yn(y){en.call(this,y)}g(Yn,en);function qn(){return[1,Ii,2,zt,3,cr,4,cr]}function Jn(y){en.call(this,y,-1,ti)}g(Jn,en),Jn.prototype.addClassification=function(y,_){return Pn(this,1,Yn,y,_),this};function hs(){return[1,Gi,Yn,qn]}var ti=[1];function Os(y){en.call(this,y)}g(Os,en);function Io(){return[1,zt,2,zt,3,zt,4,zt,5,zt]}function Fo(y){en.call(this,y,-1,E)}g(Fo,en);function x(){return[1,Gi,Os,Io]}var E=[1];function T(y){en.call(this,y)}g(T,en);function X(){return[1,zt,2,zt,3,zt,4,zt,5,zt,6,lr]}var ce=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Se=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],fe=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Fe=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Qe=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ot=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,3
vendor: 14,388 bytes, lines 9392-9409
939261],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Qt=[].concat(A(ce),A(Se),A(fe),A(Fe),A(Qe),A(ot));function fn(y,_,M){if(M=y.createShader(M===0?y.VERTEX_SHADER:y.FRAGMENT_SHADER),y.shaderSource(M,_),y.compileShader(M),!y.getShaderParameter(M,y.COMPILE_STATUS))throw Error(`Could not compile WebGL shader. 9393 9394`+y.getShaderInfoLog(M));return M}function qt(y){return wn(y,Yn,1).map(function(_){return{index:on(_,1),ga:Ft(_,2),label:Ee(_,3)!=null?Xn(_,3):void 0,displayName:Ee(_,4)!=null?Xn(_,4):void 0}})}function Gt(y){return{x:Ft(y,1),y:Ft(y,2),z:Ft(y,3),visibility:Ee(y,4)!=null?Ft(y,4):void 0}}function gt(y,_){this.h=y,this.g=_,this.l=0}function v(y,_,M){return S(y,_),typeof y.g.canvas.transferToImageBitmap=="function"?Promise.resolve(y.g.canvas.transferToImageBitmap()):M?Promise.resolve(y.g.canvas):typeof createImageBitmap=="function"?createImageBitmap(y.g.canvas):(y.i===void 0&&(y.i=document.createElement("canvas")),new Promise(function(P){y.i.height=y.g.canvas.height,y.i.width=y.g.canvas.width,y.i.getContext("2d",{}).drawImage(y.g.canvas,0,0,y.g.canvas.width,y.g.canvas.height),P(y.i)}))}function S(y,_){var M=y.g;if(y.o===void 0){var P=fn(M,` 9395 attribute vec2 aVertex; 9396 attribute vec2 aTex; 9397 varying vec2 vTex; 9398 void main(void) { 9399 gl_Position = vec4(aVertex, 0.0, 1.0); 9400 vTex = aTex; 9401 }`,0),K=fn(M,` 9402 precision mediump float; 9403 varying vec2 vTex; 9404 uniform sampler2D sampler0; 9405 void main(){ 9406 gl_FragColor = texture2D(sampler0, vTex); 9407 }`,1),ie=M.createProgram();if(M.attachShader(ie,P),M.attachShader(ie,K),M.linkProgram(ie),!M.getProgramParameter(ie,M.LINK_STATUS))throw Error(`Could not compile WebGL program. 9408 9409`+M.getProgramInfoLog(ie));P=y.o=ie,M.useProgram(P),K=M.getUniformLocation(P,"sampler0"),y.j={K:M.getAttribLocation(P,"aVertex"),J:M.getAttribLocation(P,"aTex"),ma:K},y.u=M.createBuffer(),M.bindBuffer(M.ARRAY_BUFFER,y.u),M.enableVertexAttribArray(y.j.K),M.vertexAttribPointer(y.j.K,2,M.FLOAT,!1,0,0),M.bufferData(M.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),M.STATIC_DRAW),M.bindBuffer(M.ARRAY_BUFFER,null),y.s=M.createBuffer(),M.bindBuffer(M.ARRAY_BUFFER,y.s),M.enableVertexAttribArray(y.j.J),M.vertexAttribPointer(y.j.J,2,M.FLOAT,!1,0,0),M.bufferData(M.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),M.STATIC_DRAW),M.bindBuffer(M.ARRAY_BUFFER,null),M.uniform1i(K,0)}P=y.j,M.useProgram(y.o),M.canvas.width=_.width,M.canvas.height=_.height,M.viewport(0,0,_.width,_.height),M.activeTexture(M.TEXTURE0),y.h.bindTexture2d(_.glName),M.enableVertexAttribArray(P.K),M.bindBuffer(M.ARRAY_BUFFER,y.u),M.vertexAttribPointer(P.K,2,M.FLOAT,!1,0,0),M.enableVertexAttribArray(P.J),M.bindBuffer(M.ARRAY_BUFFER,y.s),M.vertexAttribPointer(P.J,2,M.FLOAT,!1,0,0),M.bindFramebuffer(M.DRAW_FRAMEBUFFER?M.DRAW_FRAMEBUFFER:M.FRAMEBUFFER,null),M.clearColor(0,0,0,0),M.clear(M.COLOR_BUFFER_BIT),M.colorMask(!0,!0,!0,!0),M.drawArrays(M.TRIANGLE_FAN,0,4),M.disableVertexAttribArray(P.K),M.disableVertexAttribArray(P.J),M.bindBuffer(M.ARRAY_BUFFER,null),y.h.bindTexture2d(0)}function N(y){this.g=y}var k=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function W(y,_){return _+y}function z(y,_){window[y]=_}function j(y){var _=document.createElement("script");return _.setAttribute("src",y),_.setAttribute("crossorigin","anonymous"),new Promise(function(M){_.addEventListener("load",function(){M()},!1),_.addEventListener("error",function(){M()},!1),document.body.appendChild(_)})}function ee(){return R(function(y){switch(y.g){case 1:return y.o=2,C(y,WebAssembly.instantiate(k),4);case 4:y.g=3,y.o=0;break;case 2:return y.o=0,y.j=null,y.return(!1);case 3:return y.return(!0)}})}function de(y){if(this.g=y,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=y&&y.locateFile||W,typeof window=="object")var _=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if(typeof location<"u")_=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.$=_,y.options){_=o(Object.keys(y.options));for(var M=_.next();!M.done;M=_.next()){M=M.value;var P=y.options[M].default;P!==void 0&&(this.j[M]=typeof P=="function"?P():P)}}}n=de.prototype,n.close=function(){return this.i&&this.i.delete(),Promise.resolve()};function Ie(y){var _,M,P,K,ie,J,me,_e,He,mt,$t;return R(function(Wt){switch(Wt.g){case 1:return y.Z?(_=y.g.files===void 0?[]:typeof y.g.files=="function"?y.g.files(y.j):y.g.files,C(Wt,ee(),2)):Wt.return();case 2:if(M=Wt.h,typeof window=="object")return z("createMediapipeSolutionsWasm",{locateFile:y.locateFile}),z("createMediapipeSolutionsPackedAssets",{locateFile:y.locateFile}),J=_.filter(function(St){return St.data!==void 0}),me=_.filter(function(St){return St.data===void 0}),_e=Promise.all(J.map(function(St){var tn=Xe(y,St.url);if(St.path!==void 0){var _n=St.path;tn=tn.then(function(jn){return y.overrideFile(_n,jn),Promise.resolve(jn)})}return tn})),He=Promise.all(me.map(function(St){return St.simd===void 0||St.simd&&M||!St.simd&&!M?j(y.locateFile(St.url,y.$)):Promise.resolve()})).then(function(){var St,tn,_n;return R(function(jn){if(jn.g==1)return St=window.createMediapipeSolutionsWasm,tn=window.createMediapipeSolutionsPackedAssets,_n=y,C(jn,St(tn),2);_n.h=jn.h,jn.g=0})}),mt=function(){return R(function(St){return y.g.graph&&y.g.graph.url?St=C(St,Xe(y,y.g.graph.url),0):(St.g=0,St=void 0),St})}(),C(Wt,Promise.all([He,_e,mt]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return P=_.filter(function(St){return St.simd===void 0||St.simd&&M||!St.simd&&!M}).map(function(St){return y.locateFile(St.url,y.$)}),importScripts.apply(null,A(P)),K=y,C(Wt,createMediapipeSolutionsWasm(Module),6);case 6:K.h=Wt.h,y.l=new OffscreenCanvas(1,1),y.h.canvas=y.l,ie=y.h.GL.createContext(y.l,{antialias:!1,alpha:!1,ja:typeof WebGL2RenderingContext<"u"?2:1}),y.h.GL.makeContextCurrent(ie),Wt.g=4;break;case 7:if(y.l=document.createElement("canvas"),$t=y.l.getContext("webgl2",{}),!$t&&($t=y.l.getContext("webgl",{}),!$t))return alert("Failed to create WebGL canvas context when passing video frame."),Wt.return();y.G=$t,y.h.canvas=y.l,y.h.createContext(y.l,!0,!0,{});case 4:y.i=new y.h.SolutionWasm,y.Z=!1,Wt.g=0}})}function Me(y){var _,M,P,K,ie,J,me,_e;return R(function(He){if(He.g==1){if(y.g.graph&&y.g.graph.url&&y.Y===y.g.graph.url)return He.return();if(y.s=!0,!y.g.graph||!y.g.graph.url){He.g=2;return}return y.Y=y.g.graph.url,C(He,Xe(y,y.g.graph.url),3)}for(He.g!=2&&(_=He.h,y.i.loadGraph(_)),M=o(Object.keys(y.C)),P=M.next();!P.done;P=M.next())K=P.value,y.i.overrideFile(K,y.C[K]);if(y.C={},y.g.listeners)for(ie=o(y.g.listeners),J=ie.next();!J.done;J=ie.next())me=J.value,Xt(y,me);_e=y.j,y.j={},y.setOptions(_e),He.g=0})}n.reset=function(){var y=this;return R(function(_){y.i&&(y.i.reset(),y.o={},y.u={}),_.g=0})},n.setOptions=function(y,_){var M=this;if(_=_||this.g.options){for(var P=[],K=[],ie={},J=o(Object.keys(y)),me=J.next();!me.done;ie={R:ie.R,S:ie.S},me=J.next()){var _e=me.value;_e in this.j&&this.j[_e]===y[_e]||(this.j[_e]=y[_e],me=_[_e],me!==void 0&&(me.onChange&&(ie.R=me.onChange,ie.S=y[_e],P.push(function(He){return function(){var mt;return R(function($t){if($t.g==1)return C($t,He.R(He.S),2);mt=$t.h,mt===!0&&(M.s=!0),$t.g=0})}}(ie))),me.graphOptionXref&&(_e={valueNumber:me.type===1?y[_e]:0,valueBoolean:me.type===0?y[_e]:!1,valueString:me.type===2?y[_e]:""},me=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),me.graphOptionXref),_e),K.push(me))))}(P.length!==0||K.length!==0)&&(this.s=!0,this.B=(this.B===void 0?[]:this.B).concat(K),this.A=(this.A===void 0?[]:this.A).concat(P))}};function We(y){var _,M,P,K,ie,J,me;return R(function(_e){switch(_e.g){case 1:if(!y.s)return _e.return();if(!y.A){_e.g=2;break}_=o(y.A),M=_.next();case 3:if(M.done){_e.g=5;break}return P=M.value,C(_e,P(),4);case 4:M=_.next(),_e.g=3;break;case 5:y.A=void 0;case 2:if(y.B){for(K=new y.h.GraphOptionChangeRequestList,ie=o(y.B),J=ie.next();!J.done;J=ie.next())me=J.value,K.push_back(me);y.i.changeOptions(K),K.delete(),y.B=void 0}y.s=!1,_e.g=0}})}n.initialize=function(){var y=this;return R(function(_){return _.g==1?C(_,Ie(y),2):_.g!=3?C(_,Me(y),3):C(_,We(y),0)})};function Xe(y,_){var M,P;return R(function(K){return _ in y.H?K.return(y.H[_]):(M=y.locateFile(_,""),P=fetch(M).then(function(ie){return ie.arrayBuffer()}),y.H[_]=P,K.return(P))})}n.overrideFile=function(y,_){this.i?this.i.overrideFile(y,_):this.C[y]=_},n.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},n.send=function(y,_){var M=this,P,K,ie,J,me,_e,He,mt,$t;return R(function(Wt){switch(Wt.g){case 1:return M.g.inputs?(P=1e3*(_==null?performance.now():_),C(Wt,M.D,2)):Wt.return();case 2:return C(Wt,M.initialize(),3);case 3:for(K=new M.h.PacketDataList,ie=o(Object.keys(y)),J=ie.next();!J.done;J=ie.next())if(me=J.value,_e=M.g.inputs[me]){e:{var St=y[me];switch(_e.type){case"video":var tn=M.o[_e.stream];if(tn||(tn=new gt(M.h,M.G),M.o[_e.stream]=tn),tn.l===0&&(tn.l=tn.h.createTexture()),typeof HTMLVideoElement<"u"&&St instanceof HTMLVideoElement)var _n=St.videoWidth,jn=St.videoHeight;else typeof HTMLImageElement<"u"&&St instanceof HTMLImageElement?(_n=St.naturalWidth,jn=St.naturalHeight):(_n=St.width,jn=St.height);jn={glName:tn.l,width:_n,height:jn},_n=tn.g,_n.canvas.width=jn.width,_n.canvas.height=jn.height,_n.activeTexture(_n.TEXTURE0),tn.h.bindTexture2d(tn.l),_n.texImage2D(_n.TEXTURE_2D,0,_n.RGBA,_n.RGBA,_n.UNSIGNED_BYTE,St),tn.h.bindTexture2d(0),tn=jn;break e;case"detections":for(tn=M.o[_e.stream],tn||(tn=new N(M.h),M.o[_e.stream]=tn),tn.data||(tn.data=new tn.g.DetectionListData),tn.data.reset(St.length),jn=0;jn<St.length;++jn){_n=St[jn];var Qn=tn.data,Or=Qn.setBoundingBox,zi=jn,gi=_n.boundingBox,Bn=new T;if(Le(Bn,1,gi.xCenter),Le(Bn,2,gi.yCenter),Le(Bn,3,gi.height),Le(Bn,4,gi.width),Le(Bn,5,gi.rotation),Le(Bn,6,gi.rectId),gi=Ct(Bn,X),Or.call(Qn,zi,gi),_n.landmarks)for(Qn=0;Qn<_n.landmarks.length;++Qn){Bn=_n.landmarks[Qn];var gr=!!Bn.visibility;Or=tn.data,zi=Or.addNormalizedLandmark,gi=jn,Bn=Object.assign(Object.assign({},Bn),{visibility:gr?Bn.visibility:0}),gr=new Os,Le(gr,1,Bn.x),Le(gr,2,Bn.y),Le(gr,3,Bn.z),Bn.visibility&&Le(gr,4,Bn.visibility),Bn=Ct(gr,Io),zi.call(Or,gi,Bn)}if(_n.V)for(Qn=0;Qn<_n.V.length;++Qn)Or=tn.data,zi=Or.addClassification,gi=jn,Bn=_n.V[Qn],gr=new Yn,Le(gr,2,Bn.ga),Bn.index&&Le(gr,1,Bn.index),Bn.label&&Le(gr,3,Bn.label),Bn.displayName&&Le(gr,4,Bn.displayName),Bn=Ct(gr,qn),zi.call(Or,gi,Bn)}tn=tn.data;break e;default:tn={}}}switch(He=tn,mt=_e.stream,_e.type){case"video":K.pushTexture2d(Object.assign(Object.assign({},He),{stream:mt,timestamp:P}));break;case"detections":$t=He,$t.stream=mt,$t.timestamp=P,K.pushDetectionList($t);break;default:throw Error("Unknown input config type: '"+_e.type+"'")}}return M.i.send(K),C(Wt,M.D,4);case 4:K.delete(),Wt.g=0}})};function rt(y,_,M){var P,K,ie,J,me,_e,He,mt,$t,Wt,St,tn,_n,jn;return R(function(Qn){switch(Qn.g){case 1:if(!M)return Qn.return(_);for(P={},K=0,ie=o(Object.keys(M)),J=ie.next();!J.done;J=ie.next())me=J.value,_e=M[me],typeof _e!="string"&&_e.type==="texture"&&_[_e.stream]!==void 0&&++K;1<K&&(y.I=!1),He=o(Object.keys(M)),J=He.next();case 2:if(J.done){Qn.g=4;break}if(mt=J.value,$t=M[mt],typeof $t=="string")return _n=P,jn=mt,C(Qn,Vt(y,mt,_[$t]),14);if(Wt=_[$t.stream],$t.type==="detection_list"){if(Wt){for(var Or=Wt.getRectList(),zi=Wt.getLandmarksList(),gi=Wt.getClassificationsList(),Bn=[],gr=0;gr<Or.size();++gr){var Oa=mn(Or.get(gr),T,X);Oa={boundingBox:{xCenter:Ft(Oa,1),yCenter:Ft(Oa,2),height:Ft(Oa,3),width:Ft(Oa,4),rotation:Ft(Oa,5,0),rectId:on(Oa,6)},landmarks:wn(mn(zi.get(gr),Fo,x),Os,1).map(Gt),V:qt(mn(gi.get(gr),Jn,hs))},Bn.push(Oa)}Or=Bn}else Or=[];P[mt]=Or,Qn.g=7;break}if($t.type==="proto_list"){if(Wt){for(Or=Array(Wt.size()),zi=0;zi<Wt.size();zi++)Or[zi]=Wt.get(zi);Wt.delete()}else Or=[];P[mt]=Or,Qn.g=7;break}if(Wt===void 0){Qn.g=3;break}if($t.type==="float_list"){P[mt]=Wt,Qn.g=7;break}if($t.type==="proto"){P[mt]=Wt,Qn.g=7;break}if($t.type!=="texture")throw Error("Unknown output config type: '"+$t.type+"'");return St=y.u[mt],St||(St=new gt(y.h,y.G),y.u[mt]=St),C(Qn,v(St,Wt,y.I),13);case 13:tn=Qn.h,P[mt]=tn;case 7:$t.transform&&P[mt]&&(P[mt]=$t.transform(P[mt])),Qn.g=3;break;case 14:_n[jn]=Qn.h;case 3:J=He.next(),Qn.g=2;break;case 4:return Qn.return(P)}})}function Vt(y,_,M){var P;return R(function(K){return typeof M=="number"||M instanceof Uint8Array||M instanceof y.h.Uint8BlobList?K.return(M):M instanceof y.h.Texture2dDataOut?(P=y.u[_],P||(P=new gt(y.h,y.G),y.u[_]=P),K.return(v(P,M,y.I))):K.return(void 0)})}function Xt(y,_){for(var M=_.name||"$",P=[].concat(A(_.wants)),K=new y.h.StringList,ie=o(_.wants),J=ie.next();!J.done;J=ie.next())K.push_back(J.value);ie=y.h.PacketListener.implement({onResults:function(me){for(var _e={},He=0;He<_.wants.length;++He)_e[P[He]]=me.get(He);var mt=y.listeners[M];mt&&(y.D=rt(y,_e,_.outs).then(function($t){$t=mt($t);for(var Wt=0;Wt<_.wants.length;++Wt){var St=_e[P[Wt]];typeof St=="object"&&St.hasOwnProperty&&St.hasOwnProperty("delete")&&St.delete()}$t&&(y.D=$t)}))}}),y.i.attachMultiListener(K,ie),K.delete()}n.onResults=function(y,_){this.listeners[_||"$"]=y},se("Solution",de),se("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"});function En(y){var _=this;y=y||{};var M={url:"face_detection_short.binarypb"},P={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new de({locateFile:y.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:M,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}
9409],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:typeof window!="object"||window.navigator===void 0?!1:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(K){var ie,J,me,_e,He,mt;return R(function($t){switch($t.g){case 1:ie=K==="short"?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"],J=o(ie),me=J.next();case 2:if(me.done){$t.g=4;break}return _e=me.value,He="third_party/mediapipe/modules/face_detection/"+_e,C($t,Xe(_.g,_e),5);case 5:mt=$t.h,_.g.overrideFile(He,mt),me=J.next(),$t.g=2;break;case 4:return M.url=K==="short"?"face_detection_short.binarypb":"face_detection_full.binarypb",P.graphOptionXref.calculatorName=K==="short"?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",$t.return(!0)}})}},minDetectionConfidence:P}})}n=En.prototype,n.close=function(){return this.g.close(),Promise.resolve()},n.onResults=function(y){this.g.onResults(y)},n.initialize=function(){var y=this;return R(function(_){return C(_,y.g.initialize(),0)})},n.reset=function(){this.g.reset()},n.send=function(y){var _=this;return R(function(M){return C(M,_.g.send(y),0)})},n.setOptions=function(y){this.g.setOptions(y)},se("FaceDetection",En),se("FACEDETECTION_LIPS",ce),se("FACEDETECTION_LEFT_EYE",Se),se("FACEDETECTION_LEFT_EYEBROW",fe),se("FACEDETECTION_RIGHT_EYE",Fe),se("FACEDETECTION_RIGHT_EYEBROW",Qe),se("FACEDETECTION_FACE_OVAL",ot),se("FACEDETECTION_CONTOURS",Qt),se("FACEDETECTION_TESSELATION",[
vendor: 24,341 bytes, line 9409
9409[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
9409]),se("VERSION","0.4.1646425229")}).call(Li);/** 9410 * @license 9411 * Copyright 2024 Google LLC. All Rights Reserved. 9412 * Licensed under the Apache License, Version 2.0 (the "License"); 9413 * you may not use this file except in compliance with the License. 9414 * You may obtain a copy of the License at 9415 * 9416 * http://www.apache.org/licenses/LICENSE-2.0 9417 * 9418 * Unless required by applicable law or agreed to in writing, software 9419 * distributed under the License is distributed on an "AS IS" BASIS, 9420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9421 * See the License for the specific language governing permissions and 9422 * limitations under the License. 9423 * ============================================================================= 9424 */var L3;(function(n){n.MediaPipeFaceDetector="MediaPipeFaceDetector"})(L3||(L3={}));/** 9425 * @license 9426 * Copyright 2018 Google LLC. All Rights Reserved. 9427 * Licensed under the Apache License, Version 2.0 (the "License"); 9428 * you may not use this file except in compliance with the License. 9429 * You may obtain a copy of the License at 9430 * 9431 * http://www.apache.org/licenses/LICENSE-2.0 9432 * 9433 * Unless required by applicable law or agreed to in writing, software 9434 * distributed under the License is distributed on an "AS IS" BASIS, 9435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9436 * See the License for the specific language governing permissions and 9437 * limitations under the License. 9438 * ============================================================================= 9439 */const jo={},sh={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function WH(n,e){jo[n]=e}function Ts(n,e){if(!(n in jo)||e!=null){const r=XH(n,e);if(r!==null)jo[n]=r;else return console.log("Could not get context for WebGL version",n),null}const t=jo[n];return t==null||t.isContextLost()?(delete jo[n],Ts(n)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),jo[n])}function KH(n){if(!pe().getBool("IS_SAFARI")&&typeof OffscreenCanvas<"u"&&n===2)return new OffscreenCanvas(300,150);if(typeof document<"u")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function XH(n,e){if(n!==1&&n!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const t=e==null?KH(n):e;return t.addEventListener("webglcontextlost",r=>{r.preventDefault(),delete jo[n]},!1),pe().getBool("SOFTWARE_WEBGL_ENABLED")&&(sh.failIfMajorPerformanceCaveat=!1),n===1?t.getContext("webgl",sh)||t.getContext("experimental-webgl",sh):t.getContext("webgl2",sh)}/** 9440 * @license 9441 * Copyright 2017 Google LLC. All Rights Reserved. 9442 * Licensed under the Apache License, Version 2.0 (the "License"); 9443 * you may not use this file except in compliance with the License. 9444 * You may obtain a copy of the License at 9445 * 9446 * http://www.apache.org/licenses/LICENSE-2.0 9447 * 9448 * Unless required by applicable law or agreed to in writing, software 9449 * distributed under the License is distributed on an "AS IS" BASIS, 9450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9451 * See the License for the specific language governing permissions and 9452 * limitations under the License. 9453 * ============================================================================= 9454 */var tu;(function(n){n[n.DENSE=0]="DENSE",n[n.SHARED_BATCH=1]="SHARED_BATCH"})(tu||(tu={}));var Di;(function(n){n[n.RENDER=0]="RENDER",n[n.UPLOAD=1]="UPLOAD",n[n.PIXELS=2]="PIXELS",n[n.DOWNLOAD=3]="DOWNLOAD"})(Di||(Di={}));var Rr;(function(n){n[n.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",n[n.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",n[n.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",n[n.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",n[n.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(Rr||(Rr={}));function wu(n,e){return[e,n]}function jH(n,e){return n*e}function ah(n){const e=ze(n),t=Math.ceil(e/4);return $m(t)}function Wl(n,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(n/2))]}function YH(n,e){const[t,r]=Wl(n,e);return t*r*4}function t2(n,e){const t=n;let r,i,s,a,o,A,l,c,u,h;return pe().getNumber("WEBGL_VERSION")===2?(r=t.R32F,i=t.R16F,s=t.RGBA16F,a=t.RGBA32F,o=t.RED,l=4,c=1,u=t.HALF_FLOAT,h=t.FLOAT,A=t.RGBA8):(r=n.RGBA,i=n.RGBA,s=n.RGBA,a=t.RGBA,o=n.RGBA,l=4,c=4,u=e!=null?e.HALF_FLOAT_OES:null,h=n.FLOAT,A=n.RGBA),{internalFormatFloat:r,internalFormatHalfFloat:i,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:a,textureFormatFloat:o,downloadTextureFormat:A,downloadUnpackNumChannels:l,defaultNumChannels:c,textureTypeHalfFloat:u,textureTypeFloat:h}}/** 9455 * @license 9456 * Copyright 2017 Google LLC. All Rights Reserved. 9457 * Licensed under the Apache License, Version 2.0 (the "License");
9458 * you may not use this file except in compliance with the License. 9459 * You may obtain a copy of the License at 9460 * 9461 * http://www.apache.org/licenses/LICENSE-2.0 9462 * 9463 * Unless required by applicable law or agreed to in writing, software 9464 * distributed under the License is distributed on an "AS IS" BASIS, 9465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9466 * See the License for the specific language governing permissions and 9467 * limitations under the License. 9468 * ============================================================================= 9469 */function At(n,e){const t=e();return pe().getBool("DEBUG")&&qH(n),t}function qH(n){const e=n.getError();if(e!==n.NO_ERROR)throw new Error("WebGL Error: "+tV(n,e))}const JH=596e-10,ZH=65504;function eV(n){return!!(pe().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||n===0||JH<Math.abs(n)&&Math.abs(n)<ZH)}function tV(n,e){switch(e){case n.NO_ERROR:return"NO_ERROR";case n.INVALID_ENUM:return"INVALID_ENUM";case n.INVALID_VALUE:return"INVALID_VALUE";case n.INVALID_OPERATION:return"INVALID_OPERATION";case n.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case n.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case n.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${e}`}}function oh(n,e){return Na(n,()=>n.getExtension(e),'Extension "'+e+'" not supported on this browser.')}function nV(n,e){const t=Na(n,()=>n.createShader(n.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(At(n,()=>n.shaderSource(t,e)),At(n,()=>n.compileShader(t)),n.getShaderParameter(t,n.COMPILE_STATUS)===!1)throw console.log(n.getShaderInfoLog(t)),new Error("Failed to compile vertex shader.");return t}function rV(n,e){const t=Na(n,()=>n.createShader(n.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(At(n,()=>n.shaderSource(t,e)),At(n,()=>n.compileShader(t)),pe().get("ENGINE_COMPILE_ONLY"))return t;if(n.getShaderParameter(t,n.COMPILE_STATUS)===!1)throw G_(e,n.getShaderInfoLog(t)),new Error("Failed to compile fragment shader.");return t}const iV=/ERROR: [0-9]+:([0-9]+):/g;function G_(n,e){const t=iV.exec(e);if(t==null){console.log(`Couldn't parse line number in error: ${e}`),console.log(n);return}const r=+t[1],i=n.split(` 9470`),s=i.length.toString().length+2,a=i.map((u,h)=>fl((h+1).toString(),s)+u);let o=0;for(let u=0;u<a.length;u++)o=Math.max(a[u].length,o);const A=a.slice(0,r-1),l=a.slice(r-1,r),c=a.slice(r);console.log(A.join(` 9471`)),console.log(e.split(` 9472`)[0]),console.log(`%c ${fl(l[0],o)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(c.join(` 9473`))}function sV(n){return Na(n,()=>n.createProgram(),"Unable to create WebGLProgram.")}function aV(n,e){if(At(n,()=>n.linkProgram(e)),!pe().get("ENGINE_COMPILE_ONLY")&&n.getProgramParameter(e,n.LINK_STATUS)===!1)throw console.log(n.getProgramInfoLog(e)),new Error("Failed to link vertex and fragment shaders.")}function vp(n,e){if(At(n,()=>n.validateProgram(e)),n.getProgramParameter(e,n.VALIDATE_STATUS)===!1)throw console.log(n.getProgramInfoLog(e)),new Error("Shader program validation failed.")}function oV(n,e){const t=Na(n,()=>n.createBuffer(),"Unable to create WebGLBuffer");return At(n,()=>n.bindBuffer(n.ARRAY_BUFFER,t)),At(n,()=>n.bufferData(n.ARRAY_BUFFER,e,n.STATIC_DRAW)),t}function AV(n,e){const t=Na(n,()=>n.createBuffer(),"Unable to create WebGLBuffer");return At(n,()=>n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t)),At(n,()=>n.bufferData(n.ELEMENT_ARRAY_BUFFER,e,n.STATIC_DRAW)),t}function lV(n){return Na(n,()=>n.createTexture(),"Unable to create WebGLTexture.")}function cV(n,e){const t=pe().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(n<=0||e<=0){const r=`[${n}x${e}]`;
vendor: 5,526 bytes, line 9473
9473throw new Error("Requested texture size "+r+" is invalid.")}if(n>t||e>t){const r=`[${n}x${e}]`,i=`[${t}x${t}]`;throw new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU "+i+".")}}function uV(n){return Na(n,()=>n.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function O3(n,e,t,r,i,s,a){const o=n.getAttribLocation(e,t);return o===-1?!1:(At(n,()=>n.bindBuffer(n.ARRAY_BUFFER,r)),At(n,()=>n.vertexAttribPointer(o,i,n.FLOAT,!1,s,a)),At(n,()=>n.enableVertexAttribArray(o)),!0)}function hV(n,e,t){gV(n,t),At(n,()=>n.activeTexture(n.TEXTURE0+t)),At(n,()=>n.bindTexture(n.TEXTURE_2D,e))}function fV(n,e,t){return Na(n,()=>n.getUniformLocation(e,t),'uniform "'+t+'" not present in program.')}function dV(n,e,t){return n.getUniformLocation(e,t)}function pV(n,e,t,r){At(n,()=>hV(n,e,r)),At(n,()=>n.uniform1i(t,r))}function wp(n,e,t){At(n,()=>n.bindFramebuffer(n.FRAMEBUFFER,t)),At(n,()=>n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0))}function P3(n,e){At(n,()=>n.bindFramebuffer(n.FRAMEBUFFER,e)),At(n,()=>n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,null,0))}function Ah(n){const e=n.checkFramebufferStatus(n.FRAMEBUFFER);if(e!==n.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+mV(n,e))}function mV(n,e){switch(e){case n.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case n.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case n.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case n.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${e}`}}function Na(n,e,t){const r=At(n,()=>e());if(r==null)throw new Error(t);return r}function gV(n,e){const t=n.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=e+n.TEXTURE0;if(r<n.TEXTURE0||r>t){const i=`[gl.TEXTURE0, gl.TEXTURE${t}]`;throw new Error(`textureUnit must be in ${i}.`)}}function Nl(n,e=2){return ze(n.slice(0,n.length-e))}function Dl(n){if(n.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[n.length>1?n[n.length-2]:1,n[n.length-1]]}function lh(n){let e=[1,1,1];return n.length===0||n.length===1&&n[0]===1||(e=[Nl(n),...Dl(n)]),e}function yV(n,e=!1){let t=pe().getNumber("WEBGL_MAX_TEXTURE_SIZE"),r=pe().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");r===1/0&&pe().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(r=t/2),e&&(t=t*2,r=r*2,n=n.map((o,A)=>A>=n.length-2?xg(n[A]):n[A]),n.length===1&&(n=[2,n[0]])),n.length!==2&&(n=Bo(n).newShape);let i=ze(n),s=null;n.length<=1&&i<=t?s=[1,i]:n.length===2&&n[0]<=t&&n[1]<=t?s=n:n.length===3&&n[0]*n[1]<=t&&n[2]<=t?s=[n[0]*n[1],n[2]]:n.length===3&&n[0]<=t&&n[1]*n[2]<=t?s=[n[0],n[1]*n[2]]:n.length===4&&n[0]*n[1]*n[2]<=t&&n[3]<=t?s=[n[0]*n[1]*n[2],n[3]]:n.length===4&&n[0]<=t&&n[1]*n[2]*n[3]<=t&&(s=[n[0],n[1]*n[2]*n[3]]);const a=s!=null&&Math.max(...s)>r&&Math.min(...s)<=(e?2:1)&&Math.min(...s)>0;if(s==null||a)if(e){const o=Nl(n);let A=2,l=2;n.length&&([A,l]=Dl(n)),i=o*(A/2)*(l/2),s=$m(i).map(c=>c*2)}else s=$m(i);return s}function ch(n){return n%2===0}function Cf(n,e){if(n=n.slice(-2),e=e.slice(-2),rr(n,e)||!n.length||!e.length||n[0]===0||n[1]===0||e[0]===0||e[1]===0)return!0;if(n.length!==e.length){const t=n[n.length-1],r=e[e.length-1];if(t===r||ch(t)&&ch(r)&&(n[0]===1||e[0]===1))return!0}return n[1]===e[1]&&ch(n[0])&&ch(e[0])}let xp,bp;function vV(n){if(xp==null){const e=Ts(n);xp=e.getParameter(e.MAX_TEXTURE_SIZE)}return xp}function wV(n){if(bp==null){const e=Ts(n);bp=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,bp)}function xV(n){if(n===0)return 0;let e;const t=Ts(n);return rs(t,"EXT_disjoint_timer_query_webgl2")&&n===2?e=2:rs(t,"EXT_disjoint_timer_query")?e=1:e=0,e}function rs(n,e){return n.getExtension(e)!=null}function k3(n){try{if(Ts(n)!=null)return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function bV(n){if(n===0)return!1;const e=Ts(n);if(n===1){if(!rs(e,"OES_texture_float"))return!1}else if(!rs(e,"EXT_color_buffer_float"))return!1;return S1(e)}function CV(n){if(n===0)return!1;const e=Ts(n);if(n===1){if(!rs(e,"OES_texture_float")||!rs(e,"WEBGL_color_buffer_float"))return!1}else{if(rs(e,"EXT_color_buffer_float"))return S1(e);const r="EXT_color_buffer_half_float";if(rs(e,r)){const i=e.getExtension(r);return _V(e,i)}return!1}return S1(e)}function S1(n){const e=t2(n),t=n.createTexture();n.bindTexture(n.TEXTURE_2D,t);const r=1,i=1;n.texImage2D(n.TEXTURE_2D,0,e.internalFormatFloat,r,i,0,e.textureFormatFloat,e.textureTypeFloat,null);const s=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,s),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0);const a=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return n.bindTexture(n.TEXTURE_2D,null),n.bindFramebuffer(n.FRAMEBUFFER,null),n.deleteTexture(t),n.deleteFramebuffer(s),a}function _V(n,e){const t=t2(n,e),r=n.createTexture();n.bindTexture(n.TEXTURE_2D,r);const i=1,s=1;n.texImage2D(n.TEXTURE_2D,0,t.internalFormatHalfFloat,i,s,0,t.textureFormatFloat,t.textureTypeHalfFloat,null);const a=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,a),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,r,0);const o=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return n.bindTexture(n.TEXTURE_2D,null),n.bindFramebuffer(n.FRAMEBUFFER,null),n.deleteTexture(r),n.deleteFramebuffer(a),o}function BV(n){return n!==2?!1:Ts(n).fenceSync!=null}
9473function xu(n,e){Array.isArray(n)||(n=[n]),n.forEach(t=>{t!=null&&H(t.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the WebGL backend.`)})}/** 9474 * @license 9475 * Copyright 2019 Google LLC. All Rights Reserved. 9476 * Licensed under the Apache License, Version 2.0 (the "License"); 9477 * you may not use this file except in compliance with the License. 9478 * You may obtain a copy of the License at 9479 * 9480 * http://www.apache.org/licenses/LICENSE-2.0 9481 * 9482 * Unless required by applicable law or agreed to in writing, software 9483 * distributed under the License is distributed on an "AS IS" BASIS, 9484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9485 * See the License for the specific language governing permissions and 9486 * limitations under the License. 9487 * ============================================================================= 9488 */const wt=pe();wt.registerFlag("HAS_WEBGL",()=>wt.getNumber("WEBGL_VERSION")>0);wt.registerFlag("WEBGL_VERSION",()=>k3(2)?2:k3(1)?1:0);wt.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);wt.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>wt.get("WEBGL_VERSION")===2);wt.registerFlag("WEBGL_CPU_FORWARD",()=>!0);wt.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);wt.registerFlag("WEBGL_PACK",()=>wt.getBool("HAS_WEBGL"));wt.registerFlag("WEBGL_PACK_NORMALIZATION",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_CLIP",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_REDUCE",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_LAZILY_UNPACK",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_CONV_IM2COL",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>wt.getBool("WEBGL_PACK"));wt.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>vV(wt.getNumber("WEBGL_VERSION")));wt.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>wV(wt.getNumber("WEBGL_VERSION")));wt.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const n=wt.getNumber("WEBGL_VERSION");return n===0?0:xV(n)});wt.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>wt.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!db());wt.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>bV(wt.getNumber("WEBGL_VERSION")));wt.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>wt.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:wt.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));wt.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>CV(wt.getNumber("WEBGL_VERSION")));wt.registerFlag("WEBGL_FENCE_API_ENABLED",()=>BV(wt.getNumber("WEBGL_VERSION")));wt.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>wt.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);wt.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,n=>{if(typeof n!="number")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${n}.`);if(n<0&&n!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${n}.`)});wt.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>db()?1:-1,n=>{if(typeof n!="number")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${n}.`);if(n<0&&n!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${n}.`)});wt.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);wt.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1);wt.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5);wt.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);wt.registerFlag("WEBGL_EXP_CONV",()=>!1);wt.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>wt.getBool("IS_TEST"));wt.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0);wt.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1);wt.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1);wt.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);/** 9489 * @license 9490 * Copyright 2018 Google LLC. All Rights Reserved. 9491 * Licensed under the Apache License, Version 2.0 (the "License");
9492 * you may not use this file except in compliance with the License. 9493 * You may obtain a copy of the License at 9494 * 9495 * http://www.apache.org/licenses/LICENSE-2.0 9496 * 9497 * Unless required by applicable law or agreed to in writing, software 9498 * distributed under the License is distributed on an "AS IS" BASIS, 9499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9500 * See the License for the specific language governing permissions and 9501 * limitations under the License. 9502 * ============================================================================= 9503 */function Zr(){let n,e,t,r,i,s,a,o,A,l;return pe().getNumber("WEBGL_VERSION")===2?(n="#version 300 es",e="in",t="out",r="in",i="texture",s="outputColor",a="out vec4 outputColor;",o=pe().getBool("WEBGL2_ISNAN_CUSTOM")?` 9504 bool isnan_custom(float val) { 9505 uint floatToUint = floatBitsToUint(val); 9506 return (floatToUint & 0x7fffffffu) > 0x7f800000u; 9507 } 9508 9509 bvec4 isnan_custom(vec4 val) { 9510 return bvec4(isnan_custom(val.x), 9511 isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w)); 9512 } 9513 9514 #define isnan(value) isnan_custom(value) 9515 `:"",A="",l=` 9516 #define round(value) newRound(value) 9517 int newRound(float value) { 9518 return int(floor(value + 0.5)); 9519 } 9520 9521 ivec4 newRound(vec4 value) { 9522 return ivec4(floor(value + vec4(0.5))); 9523 } 9524 `):(n="",e="attribute",t="varying",r="varying",i="texture2D",s="gl_FragColor",a="",o=` 9525 #define isnan(value) isnan_custom(value) 9526 bool isnan_custom(float val) { 9527 return (val > 0. || val < 1. || val == 0.) ? false : true; 9528 } 9529 bvec4 isnan_custom(vec4 val) { 9530 return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w)); 9531 } 9532 `,A=` 9533 uniform float INFINITY; 9534 9535 bool isinf(float val) { 9536 return abs(val) == INFINITY; 9537 } 9538 bvec4 isinf(vec4 val) { 9539 return equal(abs(val), vec4(INFINITY)); 9540 } 9541 `,l=` 9542 int round(float value) { 9543 return int(floor(value + 0.5)); 9544 } 9545 9546 ivec4 round(vec4 value) { 9547 return ivec4(floor(value + vec4(0.5))); 9548 } 9549 `),{version:n,attribute:e,varyingVs:t,varyingFs:r,texture2D:i,output:s,defineOutput:a,defineSpecialNaN:o,defineSpecialInf:A,defineRound:l}}/** 9550 * @license 9551 * Copyright 2018 Google LLC. All Rights Reserved. 9552 * Licensed under the Apache License, Version 2.0 (the "License"); 9553 * you may not use this file except in compliance with the License. 9554 * You may obtain a copy of the License at 9555 * 9556 * http://www.apache.org/licenses/LICENSE-2.0 9557 * 9558 * Unless required by applicable law or agreed to in writing, software 9559 * distributed under the License is distributed on an "AS IS" BASIS, 9560 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9561 * See the License for the specific language governing permissions and 9562 * limitations under the License. 9563 * ============================================================================= 9564 */function SA(n,e,t="index"){const r=Mr(e);return r.map((i,s)=>{const a=`int ${n[s]} = ${t} / ${i}`,o=s===r.length-1?`int ${n[s+1]} = ${t} - ${n[s]} * ${i}`:`index -= ${n[s]} * ${i}`;return`${a}; ${o};`}).join("")}function id(n,e,t="index"){const r=Mr(e);return r.map((i,s)=>{const a=`int ${n[s]} = ${t} / outShapeStrides[${s}]`,o=s===r.length-1?`int ${n[s+1]} = ${t} - ${n[s]} * outShapeStrides[${s}]`:`index -= ${n[s]} * outShapeStrides[${s}]`;return`${a}; ${o};`}).join("")}function EV(n,e){const t=n.length,r=n.map(s=>`${e}[${s}]`),i=new Array(t-1);i[t-2]=r[t-1];for(let s=t-3;s>=0;--s)i[s]=`(${i[s+1]} * ${r[s+1]})`;return i}function SV(n,e,t="index"){const r=n.map((s,a)=>a),i=EV(r,e);return i.map((s,a)=>{const o=`int ${n[a]} = ${t} / ${i[a]}`,A=a===i.length-1?`int ${n[a+1]} = ${t} - ${n[a]} * ${i[a]}`:`index -= ${n[a]} * ${i[a]}`;return`${o}; ${A};`}).join("")}function n2(n){const e=Mr(n).map(t=>t.toString());return` 9565 int getFlatIndex(ivec3 coords) { 9566 return coords.x * ${e[0]} + coords.y * ${e[1]} + coords.z; 9567 } 9568`}function r2(){return` 9569 int getFlatIndex(ivec3 coords) { 9570 return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; 9571 } 9572`}const z_=` 9573 const float FLOAT_MAX = 1.70141184e38; 9574 const float FLOAT_MIN = 1.17549435e-38; 9575 9576 lowp vec4 encode_float(highp float v) { 9577 if (isnan(v)) { 9578 return vec4(255, 255, 255, 255); 9579 } 9580 9581 highp float av = abs(v); 9582 9583 if(av < FLOAT_MIN) { 9584 return vec4(0.0, 0.0, 0.0, 0.0); 9585 } else if(v > FLOAT_MAX) { 9586 return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; 9587 } else if(v < -FLOAT_MAX) { 9588 return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; 9589 } 9590 9591 highp vec4 c = vec4(0,0,0,0); 9592 9593 highp float e = floor(log2(av)); 9594 highp float m = exp2(fract(log2(av))) - 1.0; 9595 9596 c[2] = floor(128.0 * m); 9597 m -= c[2] / 128.0; 9598 c[1] = floor(32768.0 * m); 9599 m -= c[1] / 32768.0; 9600 c[0] = floor(8388608.0 * m); 9601 9602 highp float ebias = e + 127.0; 9603 c[3] = floor(ebias / 2.0); 9604 ebias -= c[3] * 2.0; 9605 c[2] += floor(ebias) * 128.0; 9606 9607 c[3] += 128.0 * step(0.0, -v); 9608 9609 return c / 255.0; 9610 } 9611`;/** 9612 * @license 9613 * Copyright 2017 Google LLC. All Rights Reserved. 9614 * Licensed under the Apache License, Version 2.0 (the "License");
9615 * you may not use this file except in compliance with the License. 9616 * You may obtain a copy of the License at 9617 * 9618 * http://www.apache.org/licenses/LICENSE-2.0 9619 * 9620 * Unless required by applicable law or agreed to in writing, software 9621 * distributed under the License is distributed on an "AS IS" BASIS, 9622 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9623 * See the License for the specific language governing permissions and 9624 * limitations under the License. 9625 * ============================================================================= 9626 */const{getBroadcastDims:W_}=F$;function TV(n,e,t){const r=[];if(n.forEach(f=>{const d=ze(f.shapeInfo.logicalShape);if(f.shapeInfo.isUniform?r.push(`uniform float ${f.name}${d>1?`[${d}]`:""};`):(r.push(`uniform sampler2D ${f.name};`),r.push(`uniform int offset${f.name};`)),t.enableShapeUniforms){const{uniformShape:g}=i2(t.packedInputs,f.shapeInfo.logicalShape,f.shapeInfo.texShape);switch(g.length){case 1:r.push(`uniform int ${f.name}Shape;`);break;case 2:r.push(`uniform ivec2 ${f.name}Shape;`);break;case 3:r.push(`uniform ivec3 ${f.name}Shape;`);break;case 4:r.push(`uniform ivec4 ${f.name}Shape;`);break}r.push(`uniform ivec2 ${f.name}TexShape;`)}}),t.enableShapeUniforms){switch(e.logicalShape.length){case 1:r.push("uniform int outShape;");break;case 2:r.push("uniform ivec2 outShape;"),r.push("uniform int outShapeStrides;");break;case 3:r.push("uniform ivec3 outShape;"),r.push("uniform ivec2 outShapeStrides;");break;case 4:r.push("uniform ivec4 outShape;"),r.push("uniform ivec3 outShapeStrides;");break}r.push("uniform ivec2 outTexShape;")}
vendor: 5,104 bytes, lines 9626-9761
9626t.customUniforms&&t.customUniforms.forEach(f=>{r.push(`uniform ${f.type} ${f.name}${f.arrayIndex?`[${f.arrayIndex}]`:""};`)});const i=r.join(` 9627`),s=n.map(f=>IV(f,e,t.packedInputs,t.enableShapeUniforms)).join(` 9628`),a=e.texShape,o=Zr(),A=UV(o);let l,c,u=DV(o);return e.isPacked?(l=FV(e.logicalShape,a,t.enableShapeUniforms),c=NV(o)):(l=RV(e.logicalShape,a,t.enableShapeUniforms),c=MV(o)),t.packedInputs&&(u+=kV),[u,A,c,i,l,s,t.userCode].join(` 9629`)}function Kl(n,e=!1){const t=n.shapeInfo.logicalShape;switch(t.length){case 0:return qV(n,e);case 1:return ZV(n,e);case 2:return tG(n,e);case 3:return rG(n,e);case 4:return sG(n,e);case 5:return aG(n);case 6:return oG(n);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function K_(n,e){switch(n.shapeInfo.logicalShape.length){case 0:return YV(n);case 1:return JV(n,e);case 2:return eG(n,e);case 3:return nG(n,e);default:return iG(n,e)}}function IV(n,e,t=!1,r){let i="";t?i+=K_(n,r):i+=Kl(n,r);const s=n.shapeInfo.logicalShape,a=e.logicalShape;return s.length<=a.length&&(t?i+=AG(n,e):i+=lG(n,e)),i}function FV(n,e,t){switch(n.length){case 0:return X_();case 1:return $V(n,e,t);case 2:return XV(n,e,t);case 3:return HV(n,e,t);default:return GV(n,e,t)}}function RV(n,e,t){switch(n.length){case 0:return X_();case 1:return QV(n,e,t);case 2:return jV(n,e,t);case 3:return VV(n,e,t);case 4:return zV(n,e,t);case 5:return WV(n,e);case 6:return KV(n,e);default:throw new Error(`${n.length}-D output sampling is not yet supported`)}}function UV(n){return` 9630 float sampleTexture(sampler2D textureSampler, vec2 uv) { 9631 return ${n.texture2D}(textureSampler, uv).r; 9632 } 9633 `}function MV(n){return` 9634 void setOutput(float val) { 9635 ${n.output} = vec4(val, 0, 0, 0); 9636 } 9637 `}function NV(n){return` 9638 void setOutput(vec4 val) { 9639 ${n.output} = val; 9640 } 9641 `}function DV(n){return`${n.version} 9642 precision highp float; 9643 precision highp int; 9644 precision highp sampler2D; 9645 ${n.varyingFs} vec2 resultUV; 9646 ${n.defineOutput} 9647 const vec2 halfCR = vec2(0.5, 0.5); 9648 9649 struct ivec5 9650 { 9651 int x; 9652 int y; 9653 int z; 9654 int w; 9655 int u; 9656 }; 9657 9658 struct ivec6 9659 { 9660 int x; 9661 int y; 9662 int z; 9663 int w; 9664 int u; 9665 int v; 9666 }; 9667 9668 uniform float NAN; 9669 ${n.defineSpecialNaN} 9670 ${n.defineSpecialInf} 9671 ${n.defineRound} 9672 9673 int imod(int x, int y) { 9674 return x - y * (x / y); 9675 } 9676 9677 int idiv(int a, int b, float sign) { 9678 int res = a / b; 9679 int mod = imod(a, b); 9680 if (sign < 0. && mod != 0) { 9681 res -= 1; 9682 } 9683 return res; 9684 } 9685 9686 //Based on the work of Dave Hoskins 9687 //https://www.shadertoy.com/view/4djSRW 9688 #define HASHSCALE1 443.8975 9689 float random(float seed){ 9690 vec2 p = resultUV * seed; 9691 vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); 9692 p3 += dot(p3, p3.yzx + 19.19); 9693 return fract((p3.x + p3.y) * p3.z); 9694 } 9695 9696 ${LV} 9697 ${OV} 9698 ${PV} 9699 `}const LV=` 9700vec2 uvFromFlat(int texNumR, int texNumC, int index) { 9701 int texR = index / texNumC; 9702 int texC = index - texR * texNumC; 9703 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 9704} 9705vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { 9706 int texelIndex = index / 2; 9707 int texR = texelIndex / texNumC; 9708 int texC = texelIndex - texR * texNumC; 9709 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 9710} 9711`,OV=` 9712vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, 9713 int texNumC, int row, int col) { 9714 int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); 9715 int texR = texelIndex / texNumC; 9716 int texC = texelIndex - texR * texNumC; 9717 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 9718} 9719`,PV=` 9720vec2 packedUVfrom3D(int texNumR, int texNumC, 9721 int texelsInBatch, int texelsInLogicalRow, int b, 9722 int row, int col) { 9723 int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); 9724 int texR = index / texNumC; 9725 int texC = index - texR * texNumC; 9726 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 9727} 9728`,kV=` 9729 float getChannel(vec4 frag, vec2 innerDims) { 9730 vec2 modCoord = mod(innerDims, 2.); 9731 return modCoord.x == 0. ? 9732 (modCoord.y == 0. ? frag.r : frag.g) : 9733 (modCoord.y == 0. ? frag.b : frag.a); 9734 } 9735 float getChannel(vec4 frag, int dim) { 9736 float modCoord = mod(float(dim), 2.); 9737 return modCoord == 0. ? frag.r : frag.g; 9738 } 9739`;function X_(){return` 9740 int getOutputCoords() { 9741 return 0; 9742 } 9743 `}function $V(n,e,t){const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];return r[0]===1?t?` 9744 int getOutputCoords() { 9745 return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); 9746 } 9747 `:` 9748 int getOutputCoords() { 9749 return 2 * int(resultUV.x * ${r[1]}.0); 9750 } 9751 `:r[1]===1?t?` 9752 int getOutputCoords() { 9753 return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0)); 9754 } 9755 `:` 9756 int getOutputCoords() { 9757 return 2 * int(resultUV.y * ${r[0]}.0); 9758 } 9759 `:t?` 9760 int getOutputCoords() { 9761 ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));
9762 ivec2 resTexRC = ivec2(resultUV.yx * 9763 vec2(packedTexShape[0], packedTexShape[1])); 9764 return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y); 9765 } 9766 `:` 9767 int getOutputCoords() { 9768 ivec2 resTexRC = ivec2(resultUV.yx * 9769 vec2(${r[0]}, ${r[1]})); 9770 return 2 * (resTexRC.x * ${r[1]} + resTexRC.y); 9771 } 9772 `}function QV(n,e,t){return e[0]===1?t?` 9773 int getOutputCoords() { 9774 return int(resultUV.x * float(outTexShape[1])); 9775 } 9776 `:` 9777 int getOutputCoords() { 9778 return int(resultUV.x * ${e[1]}.0); 9779 } 9780 `:e[1]===1?t?` 9781 int getOutputCoords() { 9782 return int(resultUV.y * float(outTexShape[0])); 9783 } 9784 `:` 9785 int getOutputCoords() { 9786 return int(resultUV.y * ${e[0]}.0); 9787 } 9788 `:t?` 9789 int getOutputCoords() { 9790 ivec2 resTexRC = ivec2(resultUV.yx * 9791 vec2(outTexShape[0], outTexShape[1])); 9792 return resTexRC.x * outTexShape[1] + resTexRC.y; 9793 } 9794 `:` 9795 int getOutputCoords() { 9796 ivec2 resTexRC = ivec2(resultUV.yx * 9797 vec2(${e[0]}, ${e[1]})); 9798 return resTexRC.x * ${e[1]} + resTexRC.y; 9799 } 9800 `}function HV(n,e,t){if(t)return` 9801 ivec3 getOutputCoords() { 9802 ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); 9803 int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0)); 9804 int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0)); 9805 ivec2 resTexRC = ivec2(resultUV.yx * 9806 vec2(packedTexShape[0], packedTexShape[1])); 9807 int index = resTexRC.x * packedTexShape[1] + resTexRC.y; 9808 9809 int b = index / texelsInBatch; 9810 index -= b * texelsInBatch; 9811 9812 int r = 2 * (index / texelsInLogicalRow); 9813 int c = imod(index, texelsInLogicalRow) * 2; 9814 9815 return ivec3(b, r, c); 9816 } 9817 `;const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],i=Math.ceil(n[2]/2),s=i*Math.ceil(n[1]/2);return` 9818 ivec3 getOutputCoords() { 9819 ivec2 resTexRC = ivec2(resultUV.yx * 9820 vec2(${r[0]}, ${r[1]})); 9821 int index = resTexRC.x * ${r[1]} + resTexRC.y; 9822 9823 int b = index / ${s}; 9824 index -= b * ${s}; 9825 9826 int r = 2 * (index / ${i}); 9827 int c = imod(index, ${i}) * 2; 9828 9829 return ivec3(b, r, c); 9830 } 9831 `}function VV(n,e,t){if(t)return` 9832 ivec3 getOutputCoords() { 9833 ivec2 resTexRC = ivec2(resultUV.yx * 9834 vec2(outTexShape[0], outTexShape[1])); 9835 int index = resTexRC.x * outTexShape[1] + resTexRC.y; 9836 ${id(["r","c","d"],n)} 9837 return ivec3(r, c, d); 9838 } 9839`;const r=SA(["r","c","d"],n);return` 9840 ivec3 getOutputCoords() { 9841 ivec2 resTexRC = ivec2(resultUV.yx * 9842 vec2(${e[0]}, ${e[1]})); 9843 int index = resTexRC.x * ${e[1]} + resTexRC.y; 9844 ${r} 9845 return ivec3(r, c, d); 9846 } 9847 `}function GV(n,e,t){if(t)return` 9848 ivec4 getOutputCoords() { 9849 ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); 9850 ivec2 resTexRC = ivec2(resultUV.yx * 9851 vec2(packedTexShape[0], packedTexShape[1])); 9852 int index = resTexRC.x * packedTexShape[1] + resTexRC.y; 9853 9854 int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0)); 9855 int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0)); 9856 int texelsInBatchN = texelsInBatch * outShape[1]; 9857 9858 int b2 = index / texelsInBatchN; 9859 index -= b2 * texelsInBatchN; 9860 9861 int b = index / texelsInBatch; 9862 index -= b * texelsInBatch; 9863 9864 int r = 2 * (index / texelsInLogicalRow); 9865 int c = imod(index, texelsInLogicalRow) * 2; 9866 9867 return ivec4(b2, b, r, c); 9868 } 9869 `;const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],i=Math.ceil(n[n.length-1]/2),s=i*Math.ceil(n[n.length-2]/2);let a=s,o="",A="b, r, c";for(let l=2;l<n.length-1;l++)a*=n[n.length-l-1],o=` 9870 int b${l} = index / ${a}; 9871 index -= b${l} * ${a}; 9872 `+o,A=`b${l}, `+A;return` 9873 ivec${n.length} getOutputCoords() {
9874 ivec2 resTexRC = ivec2(resultUV.yx * 9875 vec2(${r[0]}, ${r[1]})); 9876 int index = resTexRC.x * ${r[1]} + resTexRC.y; 9877 9878 ${o} 9879 9880 int b = index / ${s}; 9881 index -= b * ${s}; 9882 9883 int r = 2 * (index / ${i}); 9884 int c = imod(index, ${i}) * 2; 9885 9886 return ivec${n.length}(${A}); 9887 } 9888 `}function zV(n,e,t){if(t)return` 9889 ivec4 getOutputCoords() { 9890 ivec2 resTexRC = ivec2(resultUV.yx * 9891 vec2(outTexShape[0], outTexShape[1])); 9892 int index = resTexRC.x * outTexShape[1] + resTexRC.y; 9893 ${id(["r","c","d","d2"],n)} 9894 return ivec4(r, c, d, d2); 9895 } 9896 `;const r=SA(["r","c","d","d2"],n);return` 9897 ivec4 getOutputCoords() { 9898 ivec2 resTexRC = ivec2(resultUV.yx * 9899 vec2(${e[0]}, ${e[1]})); 9900 int index = resTexRC.x * ${e[1]} + resTexRC.y; 9901 ${r} 9902 return ivec4(r, c, d, d2); 9903 } 9904 `}function WV(n,e){const t=SA(["r","c","d","d2","d3"],n);return` 9905 ivec5 getOutputCoords() { 9906 ivec2 resTexRC = ivec2(resultUV.yx * vec2(${e[0]}, 9907 ${e[1]})); 9908 9909 int index = resTexRC.x * ${e[1]} + resTexRC.y; 9910 9911 ${t} 9912 9913 ivec5 outShape = ivec5(r, c, d, d2, d3); 9914 return outShape; 9915 } 9916 `}function KV(n,e){const t=SA(["r","c","d","d2","d3","d4"],n);return` 9917 ivec6 getOutputCoords() { 9918 ivec2 resTexRC = ivec2(resultUV.yx * 9919 vec2(${e[0]}, ${e[1]})); 9920 int index = resTexRC.x * ${e[1]} + resTexRC.y; 9921 9922 ${t} 9923 9924 ivec6 result = ivec6(r, c, d, d2, d3, d4); 9925 return result; 9926 } 9927 `}function XV(n,e,t){const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];if(rr(n,e))return t?` 9928 ivec2 getOutputCoords() { 9929 ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); 9930 return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); 9931 } 9932 `:` 9933 ivec2 getOutputCoords() { 9934 return 2 * ivec2(resultUV.yx * vec2(${r[0]}, ${r[1]})); 9935 } 9936 `;const i=Math.ceil(n[1]/2);return t?` 9937 ivec2 getOutputCoords() { 9938 ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); 9939 int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0)); 9940 ivec2 resTexRC = ivec2(resultUV.yx * 9941 vec2(packedTexShape[0], packedTexShape[1])); 9942 9943 int index = resTexRC.x * packedTexShape[1] + resTexRC.y; 9944 int r = 2 * (index / texelsInLogicalRow); 9945 int c = imod(index, texelsInLogicalRow) * 2; 9946 9947 return ivec2(r, c); 9948 } 9949 `:` 9950 ivec2 getOutputCoords() { 9951 ivec2 resTexRC = ivec2(resultUV.yx * 9952 vec2(${r[0]}, ${r[1]})); 9953 9954 int index = resTexRC.x * ${r[1]} + resTexRC.y; 9955 int r = 2 * (index / ${i}); 9956 int c = imod(index, ${i}) * 2; 9957 9958 return ivec2(r, c); 9959 } 9960 `}function jV(n,e,t){return rr(n,e)?t?` 9961 ivec2 getOutputCoords() { 9962 return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); 9963 } 9964 `:` 9965 ivec2 getOutputCoords() { 9966 return ivec2(resultUV.yx * vec2(${e[0]}, ${e[1]})); 9967 } 9968 `:n[1]===1?t?` 9969 ivec2 getOutputCoords() { 9970 ivec2 resTexRC = ivec2(resultUV.yx * 9971 vec2(outTexShape[0], outTexShape[1])); 9972 int index = resTexRC.x * outTexShape[1] + resTexRC.y; 9973 return ivec2(index, 0); 9974 } 9975 `:` 9976 ivec2 getOutputCoords() { 9977 ivec2 resTexRC = ivec2(resultUV.yx * 9978 vec2(${e[0]}, ${e[1]})); 9979 int index = resTexRC.x * ${e[1]} + resTexRC.y; 9980 return ivec2(index, 0); 9981 } 9982 `:n[0]===1?t?` 9983 ivec2 getOutputCoords() { 9984 ivec2 resTexRC = ivec2(resultUV.yx * 9985 vec2(outTexShape[0], outTexShape[1])); 9986 int index = resTexRC.x * outTexShape[1] + resTexRC.y; 9987 return ivec2(0, index); 9988 } 9989 `:` 9990 ivec2 getOutputCoords() { 9991 ivec2 resTexRC = ivec2(resultUV.yx * 9992 vec2(${e[0]}, ${e[1]})); 9993 int index = resTexRC.x * ${e[1]} + resTexRC.y; 9994 return ivec2(0, index); 9995 } 9996 `:t?` 9997 ivec2 getOutputCoords() {
9998 ivec2 resTexRC = ivec2(resultUV.yx * 9999 vec2(outTexShape[0], outTexShape[1])); 10000 int index = resTexRC.x * outTexShape[1] + resTexRC.y; 10001 int r = index / outShape[1]; 10002 int c = index - r * outShape[1]; 10003 return ivec2(r, c); 10004 } 10005 `:` 10006 ivec2 getOutputCoords() { 10007 ivec2 resTexRC = ivec2(resultUV.yx * 10008 vec2(${e[0]}, ${e[1]})); 10009 int index = resTexRC.x * ${e[1]} + resTexRC.y; 10010 int r = index / ${n[1]}; 10011 int c = index - r * ${n[1]}; 10012 return ivec2(r, c); 10013 } 10014 `}function TA(n){return`offset${n}`}function YV(n){const e=n.name,t="get"+e.charAt(0).toUpperCase()+e.slice(1),r=Zr();return` 10015 vec4 ${t}() { 10016 return ${r.texture2D}(${e}, halfCR); 10017 } 10018 `}function qV(n,e){const t=n.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1);if(n.shapeInfo.isUniform)return`float ${r}() {return ${t};}`;const[i,s]=n.shapeInfo.texShape;if(i===1&&s===1)return` 10019 float ${r}() { 10020 return sampleTexture(${t}, halfCR); 10021 } 10022 `;const a=TA(t);if(e)return` 10023 float ${r}() { 10024 vec2 uv = uvFromFlat(${t}TexShape[0], ${t}TexShape[1], ${a}); 10025 return sampleTexture(${t}, uv); 10026 } 10027 `;const[o,A]=n.shapeInfo.texShape;return` 10028 float ${r}() { 10029 vec2 uv = uvFromFlat(${o}, ${A}, ${a}); 10030 return sampleTexture(${t}, uv); 10031 } 10032 `}function JV(n,e){const t=n.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1),i=n.shapeInfo.texShape,s=Zr();if(e)return` 10033 vec4 ${r}(int index) { 10034 ivec2 packedTexShape = ivec2(ceil(float(${t}TexShape[0]) / 2.0), ceil(float(${t}TexShape[1]) / 2.0)); 10035 vec2 uv = packedUVfrom1D( 10036 packedTexShape[0], packedTexShape[1], index); 10037 return ${s.texture2D}(${t}, uv); 10038 } 10039 `;const a=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];return` 10040 vec4 ${r}(int index) { 10041 vec2 uv = packedUVfrom1D( 10042 ${a[0]}, ${a[1]}, index); 10043 return ${s.texture2D}(${t}, uv); 10044 } 10045 `}function ZV(n,e){const t=n.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1);if(n.shapeInfo.isUniform)return` 10046 float ${r}(int index) { 10047 ${Xl(n)} 10048 } 10049 `;const i=n.shapeInfo.texShape,s=i[0],a=i[1];if(a===1&&s===1)return` 10050 float ${r}(int index) { 10051 return sampleTexture(${t}, halfCR); 10052 } 10053 `;const o=TA(t);return a===1?e?` 10054 float ${r}(int index) { 10055 vec2 uv = vec2(0.5, (float(index + ${o}) + 0.5) / float(${t}TexShape[0])); 10056 return sampleTexture(${t}, uv); 10057 } 10058 `:` 10059 float ${r}(int index) { 10060 vec2 uv = vec2(0.5, (float(index + ${o}) + 0.5) / ${s}.0); 10061 return sampleTexture(${t}, uv); 10062 } 10063 `:s===1?e?` 10064 float ${r}(int index) { 10065 vec2 uv = vec2((float(index + ${o}) + 0.5) / float(${t}TexShape[1]), 0.5); 10066 return sampleTexture(${t}, uv); 10067 } 10068 `:` 10069 float ${r}(int index) { 10070 vec2 uv = vec2((float(index + ${o}) + 0.5) / ${a}.0, 0.5); 10071 return sampleTexture(${t}, uv); 10072 } 10073 `:e?` 10074 float ${r}(int index) { 10075 vec2 uv = uvFromFlat(${t}TexShape[0], ${t}TexShape[1], index + ${o}); 10076 return sampleTexture(${t}, uv); 10077 } 10078 `:` 10079 float ${r}(int index) { 10080 vec2 uv = uvFromFlat(${s}, ${a}, index + ${o}); 10081 return sampleTexture(${t}, uv); 10082 } 10083 `}function eG(n,e){const t=n.shapeInfo.logicalShape,r=n.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),s=n.shapeInfo.texShape,a=s[0],o=s[1],A=Zr();if(s!=null&&rr(t,s))return e?` 10084 vec4 ${i}(int row, int col) { 10085 vec2 uv = (vec2(col, row) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]); 10086 10087 return ${A.texture2D}(${r}, uv); 10088 } 10089 `:` 10090 vec4 ${i}(int row, int col) { 10091 vec2 uv = (vec2(col, row) + halfCR) / vec2(${o}.0, ${a}.0); 10092 10093 return ${A.texture2D}(${r}, uv); 10094 } 10095 `;if(e)return` 10096 vec4 ${i}(int row, int col) { 10097 ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0)); 10098 int valuesPerRow = int(ceil(float(${r}Shape[1]) / 2.0)); 10099 vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col); 10100 return ${A.texture2D}(${r}, uv); 10101 } 10102 `;const l=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],c=Math.ceil(t[1]/2);return` 10103 vec4 ${i}(int row, int col) { 10104 vec2 uv = packedUVfrom2D(${c}, ${l[0]}, ${l[1]}
10104, row, col); 10105 return ${A.texture2D}(${r}, uv); 10106 } 10107 `}function tG(n,e){const t=n.shapeInfo.logicalShape,r=n.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),s=n.shapeInfo.texShape;if(s!=null&&rr(t,s)){if(e)return` 10108 float ${i}(int row, int col) { 10109 vec2 uv = (vec2(col, row) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]); 10110 return sampleTexture(${r}, uv); 10111 } 10112 `;const h=s[0],f=s[1];return` 10113 float ${i}(int row, int col) { 10114 vec2 uv = (vec2(col, row) + halfCR) / vec2(${f}.0, ${h}.0); 10115 return sampleTexture(${r}, uv); 10116 } 10117 `}const{newShape:a,keptDims:o}=Bo(t),A=a;if(A.length<t.length){const h=jl(n,A),f=["row","col"];return` 10118 ${Kl(h,e)} 10119 float ${i}(int row, int col) { 10120 return ${i}(${Yl(f,o)}); 10121 } 10122 `}if(n.shapeInfo.isUniform)return` 10123 float ${i}(int row, int col) { 10124 int index = round(dot(vec2(row, col), vec2(${t[1]}, 1))); 10125 ${Xl(n)} 10126 } 10127 `;const l=s[0],c=s[1],u=TA(r);return c===1?e?` 10128 float ${i}(int row, int col) { 10129 float index = dot(vec3(row, col, ${u}), vec3(${r}Shape[1], 1, 1)); 10130 vec2 uv = vec2(0.5, (index + 0.5) / float(${r}TexShape[0])); 10131 return sampleTexture(${r}, uv); 10132 } 10133 `:` 10134 float ${i}(int row, int col) { 10135 float index = dot(vec3(row, col, ${u}), vec3(${t[1]}, 1, 1)); 10136 vec2 uv = vec2(0.5, (index + 0.5) / ${l}.0); 10137 return sampleTexture(${r}, uv); 10138 } 10139 `:l===1?e?` 10140 float ${i}(int row, int col) { 10141 float index = dot(vec3(row, col, ${u}), vec3(${r}Shape[1], 1, 1)); 10142 vec2 uv = vec2((index + 0.5) / float(${r}TexShape[1]), 0.5); 10143 return sampleTexture(${r}, uv); 10144 } 10145 `:` 10146 float ${i}(int row, int col) { 10147 float index = dot(vec3(row, col, ${u}), vec3(${t[1]}, 1, 1)); 10148 vec2 uv = vec2((index + 0.5) / ${c}.0, 0.5); 10149 return sampleTexture(${r}, uv); 10150 } 10151 `:e?` 10152 float ${i}(int row, int col) { 10153 // Explicitly use integer operations as dot() only works on floats. 10154 int index = row * ${r}Shape[1] + col + ${u}; 10155 vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index); 10156 return sampleTexture(${r}, uv); 10157 } 10158 `:` 10159 float ${i}(int row, int col) { 10160 // Explicitly use integer operations as dot() only works on floats. 10161 int index = row * ${t[1]} + col + ${u}; 10162 vec2 uv = uvFromFlat(${l}, ${c}, index); 10163 return sampleTexture(${r}, uv); 10164 } 10165`}function nG(n,e){const t=n.shapeInfo.logicalShape,r=n.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),s=n.shapeInfo.texShape,a=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)];if(t[0]===1){const h=t.slice(1),f=[1,2],d=jl(n,h),g=["b","row","col"];return` 10166 ${K_(d,e)} 10167 vec4 ${i}(int b, int row, int col) { 10168 return ${i}(${Yl(g,f)}); 10169 } 10170 `}const o=Zr();if(e)return` 10171 vec4 ${i}(int b, int row, int col) { 10172 ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0)); 10173 int valuesPerRow = int(ceil(float(${r}Shape[2]) / 2.0)); 10174 int texelsInBatch = valuesPerRow * int(ceil(float(${r}Shape[1]) / 2.0)); 10175 vec2 uv = packedUVfrom3D( 10176 packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col); 10177 return ${o.texture2D}(${r}, uv); 10178 } 10179 `;const A=a[0],l=a[1],c=Math.ceil(t[2]/2),u=c*Math.ceil(t[1]/2);return` 10180 vec4 ${i}(int b, int row, int col) { 10181 vec2 uv = packedUVfrom3D( 10182 ${A}, ${l}, ${u}, ${c}, b, row, col); 10183 return ${o.texture2D}(${r}, uv); 10184 } 10185 `}function rG(n,e){const t=n.shapeInfo.logicalShape,r=n.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),s=t[1]*t[2],a=t[2],{newShape:o,keptDims:A}=Bo(t),l=o;if(l.length<t.length){const g=jl(n,l),m=["row","col","depth"];return` 10186 ${Kl(g,e)} 10187 float ${i}(int row, int col, int depth) { 10188 return ${i}(${Yl(m,A)}); 10189 } 10190 `}if(n.shapeInfo.isUniform)return` 10191 float ${i}(int row, int col, int depth) { 10192 int index = round(dot(vec3(row, col, depth), 10193 vec3(${s}, ${a}, 1))); 10194 ${Xl(n)} 10195 } 10196 `;const c=n.shapeInfo.texShape,u=c[0],h=c[1],f=n.shapeInfo.flatOffset;if(h===s&&f==null)return e?` 10197 float ${i}(int row, int col, int depth) {
10198 int stride1 = ${r}Shape[2]; 10199 float texR = float(row); 10200 float texC = dot(vec2(col, depth), vec2(stride1, 1)); 10201 vec2 uv = (vec2(texC, texR) + halfCR) / 10202 vec2(${r}TexShape[1], ${r}TexShape[0]); 10203 return sampleTexture(${r}, uv); 10204 } 10205 `:` 10206 float ${i}(int row, int col, int depth) { 10207 float texR = float(row); 10208 float texC = dot(vec2(col, depth), vec2(${a}, 1)); 10209 vec2 uv = (vec2(texC, texR) + halfCR) / 10210 vec2(${h}.0, ${u}.0); 10211 return sampleTexture(${r}, uv); 10212 } 10213 `;if(h===a&&f==null)return e?` 10214 float ${i}(int row, int col, int depth) { 10215 float texR = dot(vec2(row, col), vec2(${r}Shape[1], 1)); 10216 float texC = float(depth); 10217 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]); 10218 return sampleTexture(${r}, uv); 10219 } 10220 `:` 10221 float ${i}(int row, int col, int depth) { 10222 float texR = dot(vec2(row, col), vec2(${t[1]}, 1)); 10223 float texC = float(depth); 10224 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${h}.0, ${u}.0); 10225 return sampleTexture(${r}, uv); 10226 } 10227 `;const d=TA(r);return e?` 10228 float ${i}(int row, int col, int depth) { 10229 // Explicitly use integer operations as dot() only works on floats. 10230 int stride0 = ${r}Shape[1] * ${r}Shape[2]; 10231 int stride1 = ${r}Shape[2]; 10232 int index = row * stride0 + col * stride1 + depth + ${d}; 10233 vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index); 10234 return sampleTexture(${r}, uv); 10235 } 10236 `:` 10237 float ${i}(int row, int col, int depth) { 10238 // Explicitly use integer operations as dot() only works on floats. 10239 int index = row * ${s} + col * ${a} + depth + ${d}; 10240 vec2 uv = uvFromFlat(${u}, ${h}, index); 10241 return sampleTexture(${r}, uv); 10242 } 10243 `}function iG(n,e){const t=n.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1),i=Zr();if(e)return` 10244 vec4 ${r}(int b2, int b, int row, int col) { 10245 int valuesPerRow = int(ceil(float(${t}Shape[3]) / 2.0)); 10246 int texelsInBatch = valuesPerRow * int(ceil(float(${t}Shape[2]) / 2.0)); 10247 int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2); 10248 texelsInBatch *= ${t}Shape[1]; 10249 index = b2 * texelsInBatch + index; 10250 ivec2 packedTexShape = ivec2(ceil(float(${t}TexShape[0]) / 2.0), ceil(float(${t}TexShape[1]) / 2.0)); 10251 int texR = index / packedTexShape[1]; 10252 int texC = index - texR * packedTexShape[1]; 10253 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${i.texture2D}(${t}, uv); 10254 } 10255 `;const s=n.shapeInfo.logicalShape,a=s.length,o=n.shapeInfo.texShape,A=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],l=A[0],c=A[1],u=Math.ceil(s[a-1]/2);let h=u*Math.ceil(s[a-2]/2),f="int b, int row, int col",d=`b * ${h} + (row / 2) * ${u} + (col / 2)`;for(let g=2;g<a-1;g++)f=`int b${g}, `+f,h*=s[a-g-1],d=`b${g} * ${h} + `+d;return` 10256 vec4 ${r}(${f}) { 10257 int index = ${d}; 10258 int texR = index / ${c}; 10259 int texC = index - texR * ${c}; 10260 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${c}, ${l}); 10261 return ${i.texture2D}(${t}, uv); 10262 } 10263 `}function sG(n,e){const t=n.shapeInfo.logicalShape,r=n.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),s=t[3],a=t[2]*s,o=t[1]*a,{newShape:A,keptDims:l}=Bo(t);if(A.length<t.length){const w=jl(n,A),C=["row","col","depth","depth2"];return` 10264 ${Kl(w,e)} 10265 float ${i}(int row, int col, int depth, int depth2) { 10266 return ${i}(${Yl(C,l)}); 10267 } 10268 `}if(n.shapeInfo.isUniform)return` 10269 float ${i}(int row, int col, int depth, int depth2) { 10270 int index = round(dot(vec4(row, col, depth, depth2), 10271 vec4(${o}, ${a}, ${s}, 1))); 10272 ${Xl(n)} 10273 } 10274 `;const c=n.shapeInfo.flatOffset,u=n.shapeInfo.texShape,h=u[0],f=u[1],d=`int stride2 = ${r}Shape[3];`,g=`int stride1 = ${r}Shape[2] * stride2;`,m=`int stride0 = ${r}Shape[1] * stride1;`;if(f===o&&c==null)return e?` 10275 float ${i}(int row, int col, int depth, int depth2) { 10276 ${d} 10277 ${g} 10278 float texR = float(row); 10279 float texC = 10280 dot(vec3(col, depth, depth2),
10281 vec3(stride1, stride2, 1)); 10282 vec2 uv = (vec2(texC, texR) + halfCR) / 10283 vec2(${r}TexShape[1], ${r}TexShape[0]); 10284 return sampleTexture(${r}, uv); 10285 } 10286 `:` 10287 float ${i}(int row, int col, int depth, int depth2) { 10288 float texR = float(row); 10289 float texC = 10290 dot(vec3(col, depth, depth2), 10291 vec3(${a}, ${s}, 1)); 10292 vec2 uv = (vec2(texC, texR) + halfCR) / 10293 vec2(${f}.0, ${h}.0); 10294 return sampleTexture(${r}, uv); 10295 } 10296 `;if(f===s&&c==null)return e?` 10297 float ${i}(int row, int col, int depth, int depth2) { 10298 float texR = dot(vec3(row, col, depth), 10299 vec3(${r}Shape[1] * ${r}Shape[2], ${r}Shape[2], 1)); 10300 float texC = float(depth2); 10301 vec2 uv = (vec2(texC, texR) + halfCR) / 10302 vec2(${r}TexShape[1], ${r}TexShape[0]); 10303 return sampleTexture(${r}, uv); 10304 } 10305 `:` 10306 float ${i}(int row, int col, int depth, int depth2) { 10307 float texR = dot(vec3(row, col, depth), 10308 vec3(${t[1]*t[2]}, ${t[2]}, 1)); 10309 float texC = float(depth2); 10310 vec2 uv = (vec2(texC, texR) + halfCR) / 10311 vec2(${f}.0, ${h}.0); 10312 return sampleTexture(${r}, uv); 10313 } 10314 `;const p=TA(r);return e?` 10315 float ${i}(int row, int col, int depth, int depth2) { 10316 // Explicitly use integer operations as dot() only works on floats. 10317 ${d} 10318 ${g} 10319 ${m} 10320 int index = row * stride0 + col * stride1 + 10321 depth * stride2 + depth2; 10322 vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index + ${p}); 10323 return sampleTexture(${r}, uv); 10324 } 10325 `:` 10326 float ${i}(int row, int col, int depth, int depth2) { 10327 // Explicitly use integer operations as dot() only works on floats. 10328 int index = row * ${o} + col * ${a} + 10329 depth * ${s} + depth2; 10330 vec2 uv = uvFromFlat(${h}, ${f}, index + ${p}); 10331 return sampleTexture(${r}, uv); 10332 } 10333 `}function aG(n){const e=n.shapeInfo.logicalShape,t=n.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1),i=e[4],s=e[3]*i,a=e[2]*s,o=e[1]*a,{newShape:A,keptDims:l}=Bo(e);if(A.length<e.length){const g=jl(n,A),m=["row","col","depth","depth2","depth3"];return` 10334 ${Kl(g)} 10335 float ${r}(int row, int col, int depth, int depth2, int depth3) { 10336 return ${r}(${Yl(m,l)}); 10337 } 10338 `}if(n.shapeInfo.isUniform)return` 10339 float ${r}(int row, int col, int depth, int depth2, int depth3) { 10340 float index = dot( 10341 vec4(row, col, depth, depth2), 10342 vec4(${o}, ${a}, ${s}, ${i})) + 10343 depth3; 10344 ${Xl(n)} 10345 } 10346 `;const c=n.shapeInfo.flatOffset,u=n.shapeInfo.texShape,h=u[0],f=u[1];if(f===o&&c==null)return` 10347 float ${r}(int row, int col, int depth, int depth2, int depth3) { 10348 int texR = row; 10349 float texC = dot(vec4(col, depth, depth2, depth3), 10350 vec4(${a}, ${s}, ${i}, 1)); 10351 vec2 uv = (vec2(texC, texR) + halfCR) / 10352 vec2(${f}.0, ${h}.0); 10353 return sampleTexture(${t}, uv); 10354 } 10355 `;if(f===i&&c==null)return` 10356 float ${r}(int row, int col, int depth, int depth2, int depth3) { 10357 float texR = dot( 10358 vec4(row, col, depth, depth2), 10359 vec4(${e[1]*e[2]*e[3]}, 10360 ${e[2]*e[3]}, ${e[3]}, 1)); 10361 int texC = depth3; 10362 vec2 uv = (vec2(texC, texR) + halfCR) / 10363 vec2(${f}.0, ${h}.0); 10364 return sampleTexture(${t}, uv); 10365 } 10366 `;const d=TA(t);return` 10367 float ${r}(int row, int col, int depth, int depth2, int depth3) { 10368 // Explicitly use integer operations as dot() only works on floats. 10369 int index = row * ${o} + col * ${a} + depth * ${s} + 10370 depth2 * ${i} + depth3 + ${d}; 10371 vec2 uv = uvFromFlat(${h}, ${f}, index); 10372 return sampleTexture(${t}, uv); 10373 } 10374 `}function oG(n){const e=n.shapeInfo.logicalShape,t=n.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1),{newShape:i,keptDims:s}=Bo(e);if(i.length<e.length){const m=jl(n,i),p=["row","col","depth","depth2","depth3","depth4"];return` 10375 ${Kl(m)} 10376 float ${r}(int row, int col, int depth, 10377 int depth2, int depth3, int depth4) { 10378 return ${r}(${Yl(p,s)}); 10379 } 10380 `}const a=e[5],o=e[4]*a,A=e[3]*o,l=e[2]*A,c=e[1]*l;if(n.shapeInfo.isUniform)return` 10381 float ${r}(int row, int col, int depth, 10382 int depth2, int depth3, int depth4) { 10383 int index = round(dot( 10384 vec4(row, col, depth, depth2), 10385 vec4(${c}, ${l}, ${A}, ${o})) + 10386 dot( 10387 vec2(depth3, depth4), 10388 vec2(${a}, 1))); 10389 ${Xl(n)} 10390 } 10391 `;const u=n.shapeInfo.flatOffset,h=n.shapeInfo.texShape,f=h[0],d=h[1];if(d===c&&u==null)return` 10392 float ${r}(int row, int col, int depth, 10393 int depth2, int depth3, int depth4) { 10394 int texR = row; 10395 float texC = dot(vec4(col, depth, depth2, depth3), 10396 vec4(${l}, ${A}, ${o}, ${a})) + 10397 float(depth4); 10398 vec2 uv = (vec2(texC, texR) + halfCR) / 10399 vec2(${d}.0, ${f}.0); 10400 return sampleTexture(${t}, uv); 10401 } 10402 `;if(d===a&&u==null)return` 10403 float ${r}(int row, int col, int depth, 10404 int depth2, int depth3, int depth4) {
10405 float texR = dot(vec4(row, col, depth, depth2), 10406 vec4(${e[1]*e[2]*e[3]*e[4]}, 10407 ${e[2]*e[3]*e[4]}, 10408 ${e[3]*e[4]}, 10409 ${e[4]})) + float(depth3); 10410 int texC = depth4; 10411 vec2 uv = (vec2(texC, texR) + halfCR) / 10412 vec2(${d}.0, ${f}.0); 10413 return sampleTexture(${t}, uv); 10414 } 10415 `;const g=TA(t);return` 10416 float ${r}(int row, int col, int depth, 10417 int depth2, int depth3, int depth4) { 10418 // Explicitly use integer operations as dot() only works on floats. 10419 int index = row * ${c} + col * ${l} + depth * ${A} + 10420 depth2 * ${o} + depth3 * ${a} + depth4 + ${g}; 10421 vec2 uv = uvFromFlat(${f}, ${d}, index); 10422 return sampleTexture(${t}, uv); 10423 } 10424 `}function Xl(n){const e=n.name,t=ze(n.shapeInfo.logicalShape);return t<2?`return ${e};`:` 10425 for (int i = 0; i < ${t}; i++) { 10426 if (i == index) { 10427 return ${e}[i]; 10428 } 10429 } 10430 `}function AG(n,e){const t=n.name,r=t.charAt(0).toUpperCase()+t.slice(1),i="get"+r+"AtOutCoords",s=n.shapeInfo.logicalShape.length,a=e.logicalShape.length,o=W_(n.shapeInfo.logicalShape,e.logicalShape),A=Mn(a),l=a-s;let c;const u=["x","y","z","w","u","v"];s===0?c="":a<2&&o.length>=1?c="coords = 0;":c=o.map(w=>`coords.${u[w+l]} = 0;`).join(` 10431`);let h="";a<2&&s>0?h="coords":h=n.shapeInfo.logicalShape.map((w,C)=>`coords.${u[C+l]}`).join(", ");let f="return outputValue;";const g=ze(n.shapeInfo.logicalShape)===1,p=ze(e.logicalShape)===1;if(s===1&&!g&&!p)f=` 10432 return vec4(outputValue.xy, outputValue.xy); 10433 `;else if(g&&!p)a===1?f=` 10434 return vec4(outputValue.x, outputValue.x, 0., 0.); 10435 `:f=` 10436 return vec4(outputValue.x); 10437 `;else if(o.length){const w=s-2,C=s-1;o.indexOf(w)>-1&&o.indexOf(C)>-1?f="return vec4(outputValue.x);":o.indexOf(w)>-1?f="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(C)>-1&&(f="return vec4(outputValue.xx, outputValue.zz);")}return` 10438 vec4 ${i}() { 10439 ${A} coords = getOutputCoords(); 10440 ${c} 10441 vec4 outputValue = get${r}(${h}); 10442 ${f} 10443 } 10444 `}function lG(n,e){const t=n.name,r=t.charAt(0).toUpperCase()+t.slice(1),i="get"+r+"AtOutCoords",s=e.texShape,a=n.shapeInfo.texShape,o=n.shapeInfo.logicalShape.length,A=e.logicalShape.length;if(!n.shapeInfo.isUniform&&o===A&&n.shapeInfo.flatOffset==null&&rr(a,s))return` 10445 float ${i}() { 10446 return sampleTexture(${t}, resultUV); 10447 } 10448 `;const l=Mn(A),c=W_(n.shapeInfo.logicalShape,e.logicalShape),u=A-o;let h;const f=["x","y","z","w","u","v"];o===0?h="":A<2&&c.length>=1?h="coords = 0;":h=c.map(g=>`coords.${f[g+u]} = 0;`).join(` 10449`);let d="";return A<2&&o>0?d="coords":d=n.shapeInfo.logicalShape.map((g,m)=>`coords.${f[m+u]}`).join(", "),` 10450 float ${i}() { 10451 ${l} coords = getOutputCoords(); 10452 ${h} 10453 return get${r}(${d}); 10454 } 10455 `}function Mn(n){if(n<=1)return"int";if(n===2)return"ivec2";if(n===3)return"ivec3";if(n===4)return"ivec4";if(n===5)return"ivec5";if(n===6)return"ivec6";throw Error(`GPU for rank ${n} is not yet supported`)}function i2(n,e,t){const{newShape:r,keptDims:i}=Bo(e),s=e.length,a=n&&s===3&&e[0]===1,o=a?e.slice(1):r,A=!n&&s>1&&!rr(e,t)&&r.length<s||a;return{useSqueezeShape:A,uniformShape:A?o:e,keptDims:i}}function jl(n,e){const t=JSON.parse(JSON.stringify(n));return t.shapeInfo.logicalShape=e,t}function Yl(n,e){return e.map(t=>n[t]).join(", ")}/** 10456 * @license 10457 * Copyright 2017 Google LLC. All Rights Reserved. 10458 * Licensed under the Apache License, Version 2.0 (the "License"); 10459 * you may not use this file except in compliance with the License. 10460 * You may obtain a copy of the License at 10461 * 10462 * http://www.apache.org/licenses/LICENSE-2.0 10463 * 10464 * Unless required by applicable law or agreed to in writing, software 10465 * distributed under the License is distributed on an "AS IS" BASIS, 10466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10467 * See the License for the specific language governing permissions and 10468 * limitations under the License. 10469 * ============================================================================= 10470 */function cG(n,e,t,r){const i=t.map((c,u)=>{const h={logicalShape:c.shape,texShape:c.isUniform?null:c.texData.texShape,isUniform:c.isUniform,isPacked:c.isUniform?!1:c.texData.isPacked,flatOffset:null};return c.texData!=null&&c.texData.slice!=null&&c.texData.slice.flatOffset>0&&(h.flatOffset=c.texData.slice.flatOffset),{name:e.variableNames[u],shapeInfo:h}}),s=i.map(c=>c.shapeInfo),a={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},o=TV(i,a,e),A=rV(n.gl,o),l=n.createProgram(A);return pe().get("ENGINE_COMPILE_ONLY")?{program:e,fragmentShader:A,source:o,webGLProgram:l,inShapeInfos:s,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(n.buildVao(l),Object.assign({program:e,fragmentShader:A,source:o,webGLProgram:l,inShapeInfos:s,outShapeInfo:a},j_(n,e,l)))}function j_(n,e,t){const r=[],i=[];let s,a,o,A=null,l=null;l=n.getUniformLocation(t,"NAN",!1),pe().getNumber("WEBGL_VERSION")===1&&(A=n.getUniformLocation(t,"INFINITY",!1));const c=!1;for(const u of e.variableNames){const h={name:u,uniform:n.getUniformLocation(t,u,c),offset:n.getUniformLocation(t,`offset${u}`,c)};e.enableShapeUniforms&&(h.shape=n.getUniformLocation(t,`${u}Shape`,c),h.texShape=n.getUniformLocation(t,`${u}TexShape`,c)),r.push(h)}if(e.enableShapeUniforms&&(s=n.getUniformLocation(t,"outShape",c),o=n.getUniformLocation(t,"outShapeStrides",c),a=n.getUniformLocation(t,"outTexShape",c)),e.customUniforms)for(const u of e.customUniforms)i.push(n.getUniformLocation(t,u.name,c));return{variablesLocations:r,customUniformLocations:i,infLoc:A,nanLoc:l,outShapeLocation:s,outShapeStridesLocation:o,outTexShapeLocation:a}}function $3(n,e){if(n.length!==e.length)throw Error(`Binary was compiled with ${n.length}
10470 inputs, but was executed with ${e.length} inputs`);n.forEach((t,r)=>{const i=t.logicalShape,s=e[r],a=s.shape;if(!rr(i,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${i} and ${a} must match`);if(t.isUniform&&s.isUniform)return;const o=t.texShape,A=s.isUniform?null:s.texData.texShape;if(!rr(o,A))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${A} must match`)})}function uG(n,e,t,r,i){e.program.enableShapeUniforms||($3(e.inShapeInfos,t),$3([e.outShapeInfo],[r]));const s=r.texData.texture,a=r.texData.texShape;r.texData.isPacked?n.setOutputPackedMatrixTexture(s.texture,a[0],a[1]):n.setOutputMatrixTexture(s.texture,a[0],a[1]),n.setProgram(e.webGLProgram),n.bindVertexArray(e.webGLProgram.vao),pe().getNumber("WEBGL_VERSION")===1&&e.infLoc!==null&&n.gl.uniform1f(e.infLoc,1/0),e.nanLoc!==null&&n.gl.uniform1f(e.nanLoc,NaN);for(let A=0;A<t.length;++A){const l=t[A],{uniform:c,offset:u,shape:h,texShape:f}=e.variablesLocations[A];if(h){const{uniformShape:d}=i2(e.program.packedInputs,l.shape,l.texData.texShape);switch(d.length){case 1:n.gl.uniform1iv(h,new Int32Array(d));break;case 2:n.gl.uniform2iv(h,new Int32Array(d));break;case 3:n.gl.uniform3iv(h,new Int32Array(d));break;case 4:n.gl.uniform4iv(h,new Int32Array(d));break}}if(f&&n.gl.uniform2i(f,l.texData.texShape[0],l.texData.texShape[1]),c!=null){if(l.isUniform){if(ze(l.shape)<2)n.gl.uniform1f(c,l.uniformValues[0]);else{let d=l.uniformValues;d instanceof Float32Array||(d=new Float32Array(d)),n.gl.uniform1fv(c,d)}continue}l.texData.slice!=null&&u!=null&&n.gl.uniform1i(u,l.texData.slice.flatOffset),n.setInputMatrixTexture(l.texData.texture.texture,c,A)}}const o=e.outShapeLocation;if(o)switch(r.shape.length){case 1:n.gl.uniform1iv(o,new Int32Array(r.shape));break;case 2:n.gl.uniform2iv(o,new Int32Array(r.shape));break;case 3:n.gl.uniform3iv(o,new Int32Array(r.shape));break;case 4:n.gl.uniform4iv(o,new Int32Array(r.shape));break}if(e.outShapeStridesLocation){const A=Mr(r.shape);switch(r.shape.length){case 2:n.gl.uniform1iv(e.outShapeStridesLocation,new Int32Array(A));break;case 3:n.gl.uniform2iv(e.outShapeStridesLocation,new Int32Array(A));break;case 4:n.gl.uniform3iv(e.outShapeStridesLocation,new Int32Array(A));break}}if(e.outTexShapeLocation&&n.gl.uniform2i(e.outTexShapeLocation,r.texData.texShape[0],r.texData.texShape[1]),e.program.customUniforms&&i)for(let A=0;A<e.program.customUniforms.length;++A){const l=e.program.customUniforms[A],c=e.customUniformLocations[A],u=i[A];if(l.type==="float")n.gl.uniform1fv(c,u);else if(l.type==="vec2")n.gl.uniform2fv(c,u);else if(l.type==="vec3")n.gl.uniform3fv(c,u);else if(l.type==="vec4")n.gl.uniform4fv(c,u);else if(l.type==="int")n.gl.uniform1iv(c,u);else if(l.type==="ivec2")n.gl.uniform2iv(c,u);else if(l.type==="ivec3")n.gl.uniform3iv(c,u);else if(l.type==="ivec4")n.gl.uniform4iv(c,u);else throw Error(`uniform type ${l.type} is not supported yet.`)}n.executeProgram()}function hG(n,e,t){let r="";e.concat(t).forEach(a=>{const o=a.texData!=null&&a.texData.slice!=null&&a.texData.slice.flatOffset>0;if(n.enableShapeUniforms&&!a.isUniform){const A=a.texData.texShape,{useSqueezeShape:l,uniformShape:c,keptDims:u}=i2(n.packedInputs,a.shape,A);let h="",f="",d="";if(c.length===1&&n.packedInputs){const U=[Math.ceil(A[0]/2),Math.ceil(A[1]/2)];h=`${U[0]>1}_${U[1]>1}`}else if(c.length===2&&!n.packedInputs)f=`${c[0]>1}_${c[1]>1}`;else if(c.length>2&&!n.packedInputs){const U=Mr(c);d=`${U[0]===A[1]}_${U[U.length-1]===A[1]}`}const g=a.shape.length,m=c.length===2&&rr(a.shape,A),p=ze(a.shape)===1,w=pf(a.shape,t.shape),C=!n.packedInputs&&g===t.shape.length&&rr(A,t.texData.texShape),b=n.packedInputs||c.length>2?"":`${A[0]>1}_${A[1]>1}`;r+=`${g}_${C}_${l?u:""}_${c.length}_${p}_${w}_${m}_${h}_${f}_${d}_${b}_${o}`}else{const A=a.isUniform?"uniform":a.texData.texShape;r+=`${a.shape}_${A}_${o}`}});const i=n.userCode;let s=n.constructor.name;return s+="_"+r+"_"+i+`${pe().getNumber("WEBGL_VERSION")}`,s}function Vr(n){return pe().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&n<=4}/** 10471 * @license 10472 * Copyright 2019 Google LLC. All Rights Reserved. 10473 * Licensed under the Apache License, Version 2.0 (the "License");
10474 * you may not use this file except in compliance with the License. 10475 * You may obtain a copy of the License at 10476 * 10477 * http://www.apache.org/licenses/LICENSE-2.0 10478 * 10479 * Unless required by applicable law or agreed to in writing, software 10480 * distributed under the License is distributed on an "AS IS" BASIS, 10481 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10482 * See the License for the specific language governing permissions and 10483 * limitations under the License. 10484 * ============================================================================= 10485 */class fG{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=tu.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=Zr();this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length),this.userCode=` 10486 ivec3 outCoordsFromFlatIndex(int index) { 10487 ${this.enableShapeUniforms?id(["r","c","d"],e):SA(["r","c","d"],e)} 10488 return ivec3(r, c, d); 10489 } 10490 10491 void main() { 10492 ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); 10493 int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); 10494 10495 vec4 result = vec4(0.); 10496 10497 for (int i=0; i<4; i++) { 10498 int flatIndex = index + i; 10499 ivec3 rc = outCoordsFromFlatIndex(flatIndex); 10500 result[i] = getA(rc.x, rc.y, rc.z); 10501 } 10502 10503 ${t.output} = result; 10504 } 10505 `}}/** 10506 * @license 10507 * Copyright 2019 Google LLC. All Rights Reserved. 10508 * Licensed under the Apache License, Version 2.0 (the "License"); 10509 * you may not use this file except in compliance with the License. 10510 * You may obtain a copy of the License at 10511 * 10512 * http://www.apache.org/licenses/LICENSE-2.0 10513 * 10514 * Unless required by applicable law or agreed to in writing, software 10515 * distributed under the License is distributed on an "AS IS" BASIS, 10516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10517 * See the License for the specific language governing permissions and 10518 * limitations under the License. 10519 * ============================================================================= 10520 */class dG{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=tu.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=Zr();this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length),this.userCode=` 10521 ivec3 outCoordsFromFlatIndex(int index) { 10522 ${this.enableShapeUniforms?id(["r","c","d"],e):SA(["r","c","d"],e)} 10523 return ivec3(r, c, d); 10524 } 10525 10526 void main() { 10527 ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); 10528 int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); 10529 10530 vec4 result = vec4(0.); 10531 10532 for (int i=0; i<4; i++) { 10533 int flatIndex = index + i; 10534 ivec3 rc = outCoordsFromFlatIndex(flatIndex); 10535 result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); 10536 } 10537 10538 ${t.output} = result; 10539 } 10540 `}}/** 10541 * @license 10542 * Copyright 2018 Google LLC. All Rights Reserved. 10543 * Licensed under the Apache License, Version 2.0 (the "License"); 10544 * you may not use this file except in compliance with the License. 10545 * You may obtain a copy of the License at 10546 * 10547 * http://www.apache.org/licenses/LICENSE-2.0 10548 * 10549 * Unless required by applicable law or agreed to in writing, software 10550 * distributed under the License is distributed on an "AS IS" BASIS, 10551 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10552 * See the License for the specific language governing permissions and 10553 * limitations under the License. 10554 * ============================================================================= 10555 */class pG{constructor(e){this.variableNames=["A"],this.outTexUsage=Di.DOWNLOAD;const t=Zr();this.outputShape=e,this.userCode=` 10556 ${z_} 10557 10558 void main() { 10559 float x = getAAtOutCoords(); 10560 ${t.output} = encode_float(x); 10561 } 10562 `}}/** 10563 * @license 10564 * Copyright 2018 Google LLC. All Rights Reserved. 10565 * Licensed under the Apache License, Version 2.0 (the "License");
10566 * you may not use this file except in compliance with the License. 10567 * You may obtain a copy of the License at 10568 * 10569 * http://www.apache.org/licenses/LICENSE-2.0 10570 * 10571 * Unless required by applicable law or agreed to in writing, software 10572 * distributed under the License is distributed on an "AS IS" BASIS, 10573 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10574 * See the License for the specific language governing permissions and 10575 * limitations under the License. 10576 * ============================================================================= 10577 */class mG{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Di.DOWNLOAD;const t=Zr();this.outputShape=e,this.userCode=` 10578 ${z_} 10579 10580 void main() { 10581 ivec3 coords = getOutputCoords(); 10582 float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); 10583 ${t.output} = encode_float(x); 10584 } 10585 `}}/** 10586 * @license 10587 * Copyright 2018 Google LLC. All Rights Reserved. 10588 * Licensed under the Apache License, Version 2.0 (the "License"); 10589 * you may not use this file except in compliance with the License. 10590 * You may obtain a copy of the License at 10591 * 10592 * http://www.apache.org/licenses/LICENSE-2.0 10593 * 10594 * Unless required by applicable law or agreed to in writing, software 10595 * distributed under the License is distributed on an "AS IS" BASIS, 10596 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10597 * See the License for the specific language governing permissions and 10598 * limitations under the License. 10599 * ============================================================================= 10600 */const gG={R:0,G:1,B:2,A:3};class Q3{constructor(e,t=!1,r="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const i=Zr();this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length);let s="result";t&&(s="floor(result * 255. + 0.5)");let a="";for(let o=0;o<r.length;o++){const A=r[o];a+=` 10601 if(offset == ${o}) { 10602 result = values[${gG[A]}]; 10603 }`}this.userCode=` 10604 ${this.enableShapeUniforms?r2():n2(e)} 10605 10606 void main() { 10607 ivec3 coords = getOutputCoords(); 10608 int flatIndex = getFlatIndex(coords); 10609 float result = 0.; 10610 int offset = imod(flatIndex, ${r.length}); 10611 10612 flatIndex = idiv(flatIndex, ${r.length}, 1.); 10613 10614 int r = flatIndex / texShape[1]; 10615 if (r < texShape[0]) { 10616 int c = imod(flatIndex, texShape[1]); 10617 vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]); 10618 vec4 values = ${i.texture2D}(A, uv); 10619 ${a} 10620 } 10621 ${i.output} = vec4(${s}, 0., 0., 0.); 10622 } 10623 `}}/** 10624 * @license 10625 * Copyright 2018 Google LLC. All Rights Reserved. 10626 * Licensed under the Apache License, Version 2.0 (the "License"); 10627 * you may not use this file except in compliance with the License. 10628 * You may obtain a copy of the License at 10629 * 10630 * http://www.apache.org/licenses/LICENSE-2.0 10631 * 10632 * Unless required by applicable law or agreed to in writing, software 10633 * distributed under the License is distributed on an "AS IS" BASIS, 10634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10635 * See the License for the specific language governing permissions and 10636 * limitations under the License. 10637 * ============================================================================= 10638 */class yG{constructor(e,t=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.customUniforms=[{name:"texShape",type:"ivec2"}];const r=Zr();this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length);let i="",s="result";t&&(s="floor(result * 255. + 0.5)");for(let a=0;a<=1;a++)for(let o=0;o<=1;o++){const A=a*2+o;i+=` 10639 localCoords = coords; 10640 if(localCoords[2] + ${o} < ${this.enableShapeUniforms?"outShape[2]":`${e[2]}`}) { 10641 localCoords[2] += ${o}; 10642 if (localCoords[1] + ${a} < ${this.enableShapeUniforms?"outShape[1]":`${e[1]}`}) { 10643 localCoords[1] += ${a}; 10644 10645 flatIndex = getFlatIndex(localCoords); 10646 offset = imod(flatIndex, 4); 10647 10648 flatIndex = idiv(flatIndex, 4, 1.); 10649 10650 int r = flatIndex / texShape[1]; 10651 int c = imod(flatIndex, texShape[1]); 10652 vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]); 10653 values = ${r.texture2D}(A, uv); 10654 10655 if (offset == 0) { 10656 result[${A}] = values[0]; 10657 } else if (offset == 1) { 10658 result[${A}] = values[1]; 10659 } else if (offset == 2) { 10660 result[${A}] = values[2]; 10661 } else { 10662 result[${A}] = values[3]; 10663 } 10664 } 10665 } 10666 `}this.userCode=` 10667 ${this.enableShapeUniforms?r2():n2(e)} 10668 10669 void main() { 10670 ivec3 coords = getOutputCoords(); 10671 10672 vec4 result = vec4(0.); 10673 int flatIndex, r, c, offset; 10674 ivec3 localCoords; 10675 vec2 uv; 10676 vec4 values; 10677 10678 ${i} 10679 10680 ${r.output} = ${s}; 10681 } 10682 `}}/** 10683 * @license 10684 * Copyright 2017 Google LLC. All Rights Reserved. 10685 * Licensed under the Apache License, Version 2.0 (the "License");
10686 * you may not use this file except in compliance with the License. 10687 * You may obtain a copy of the License at 10688 * 10689 * http://www.apache.org/licenses/LICENSE-2.0 10690 * 10691 * Unless required by applicable law or agreed to in writing, software 10692 * distributed under the License is distributed on an "AS IS" BASIS, 10693 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10694 * See the License for the specific language governing permissions and 10695 * limitations under the License. 10696 * ============================================================================= 10697 */function vG(n){const e=Zr(),t=`${e.version} 10698 precision highp float; 10699 ${e.attribute} vec3 clipSpacePos; 10700 ${e.attribute} vec2 uv; 10701 ${e.varyingVs} vec2 resultUV; 10702 10703 void main() { 10704 gl_Position = vec4(clipSpacePos, 1); 10705 resultUV = uv; 10706 }`;return nV(n,t)}function wG(n){const e=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return oV(n,e)}function xG(n){const e=new Uint16Array([0,1,2,2,1,3]);return AV(n,e)}function bu(n,e,t,r,i,s){cV(e,t);const a=lV(n),o=n.TEXTURE_2D;return At(n,()=>n.bindTexture(o,a)),At(n,()=>n.texParameteri(o,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE)),At(n,()=>n.texParameteri(o,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE)),At(n,()=>n.texParameteri(o,n.TEXTURE_MIN_FILTER,n.NEAREST)),At(n,()=>n.texParameteri(o,n.TEXTURE_MAG_FILTER,n.NEAREST)),pe().getNumber("WEBGL_VERSION")===1?At(n,()=>n.texImage2D(o,0,r,e,t,0,i,s,null)):At(n,()=>n.texStorage2D(o,1,r,e,t)),At(n,()=>n.bindTexture(n.TEXTURE_2D,null)),{texture:a,texShape:[t,e]}}function Y_(n){return n.internalFormatFloat}function bG(n,e,t,r){const[i,s]=wu(e,t);return bu(n,i,s,Y_(r),r.textureFormatFloat,n.FLOAT)}function q_(n){return n.internalFormatHalfFloat}function CG(n,e,t,r){const[i,s]=wu(e,t);return bu(n,i,s,q_(r),r.textureFormatFloat,r.textureTypeHalfFloat)}function J_(n){return n.downloadTextureFormat}function _G(n,e,t,r){const[i,s]=wu(e,t);return bu(n,i,s,J_(r),n.RGBA,n.UNSIGNED_BYTE)}function Z_(n){return n.internalFormatPackedFloat}function BG(n,e,t,r){const[i,s]=Wl(e,t);return bu(n,i,s,Z_(r),n.RGBA,n.FLOAT)}function eB(n){return n.internalFormatPackedHalfFloat}function EG(n,e,t,r){const[i,s]=Wl(e,t);return bu(n,i,s,eB(r),n.RGBA,r.textureTypeHalfFloat)}function SG(n,e,t){return At(n,()=>n.bindBuffer(n.ARRAY_BUFFER,t)),O3(n,e,"clipSpacePos",t,3,20,0)&&O3(n,e,"uv",t,2,20,12)}function TG(n,e,t,r,i,s){At(n,()=>n.bindTexture(n.TEXTURE_2D,e));let a,o,A;i instanceof Uint8Array?(a=new Uint8Array(t*r*4),o=n.UNSIGNED_BYTE,A=n.RGBA):(a=new Float32Array(t*r*4),o=n.FLOAT,A=s.internalFormatPackedFloat),a.set(i),pe().getNumber("WEBGL_VERSION")===2?At(n,()=>n.texSubImage2D(n.TEXTURE_2D,0,0,0,t,r,n.RGBA,o,a)):At(n,()=>n.texImage2D(n.TEXTURE_2D,0,A,t,r,0,n.RGBA,o,a)),At(n,()=>n.bindTexture(n.TEXTURE_2D,null))}function IG(n,e,t){At(n,()=>n.bindTexture(n.TEXTURE_2D,e)),t.data instanceof Uint8Array?pe().getNumber("WEBGL_VERSION")===2?At(n,()=>n.texSubImage2D(n.TEXTURE_2D,0,0,0,t.width,t.height,n.RGBA,n.UNSIGNED_BYTE,t.data)):At(n,()=>n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t.width,t.height,0,n.RGBA,n.UNSIGNED_BYTE,t.data)):pe().getNumber("WEBGL_VERSION")===2?At(n,()=>n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,t)):At(n,()=>n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)),At(n,()=>n.bindTexture(n.TEXTURE_2D,null))}function FG(n,e,t,r){const i=n.createBuffer();At(n,()=>n.bindBuffer(n.PIXEL_PACK_BUFFER,i));const o=4*4*e*t;return At(n,()=>n.bufferData(n.PIXEL_PACK_BUFFER,o,n.STREAM_READ)),At(n,()=>n.readPixels(0,0,t,e,n.RGBA,n.FLOAT,0)),At(n,()=>n.bindBuffer(n.PIXEL_PACK_BUFFER,null)),i}function RG(n,e,t){const r=n,i=new Float32Array(t);return r.bindBuffer(r.PIXEL_PACK_BUFFER,e),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,i),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),i}function UG(n,e,t,r){const[i,s]=wu(e,t),a=4,o=new Uint8Array(jH(e*t,a));return At(n,()=>n.readPixels(0,0,i,s,r.downloadTextureFormat,n.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function MG(n,e,t,r,i,s,a,o){const A=n,l=new Float32Array(YH(s,a));return A.bindBuffer(A.PIXEL_PACK_BUFFER,e),A.getBufferSubData(A.PIXEL_PACK_BUFFER,0,l),A.bindBuffer(A.PIXEL_PACK_BUFFER,null),l}function NG(n,e,t){const r=new Float32Array(e*t*4);return At(n,()=>n.readPixels(0,0,t,e,n.RGBA,n.FLOAT,r)),r}/** 10707 * @license 10708 * Copyright 2017 Google LLC. All Rights Reserved. 10709 * Licensed under the Apache License, Version 2.0 (the "License");
10710 * you may not use this file except in compliance with the License. 10711 * You may obtain a copy of the License at 10712 * 10713 * http://www.apache.org/licenses/LICENSE-2.0 10714 * 10715 * Unless required by applicable law or agreed to in writing, software 10716 * distributed under the License is distributed on an "AS IS" BASIS, 10717 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10718 * See the License for the specific language governing permissions and 10719 * limitations under the License. 10720 * ============================================================================= 10721 */class Cp{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=pe().getNumber("WEBGL_VERSION");if(e!=null?(this.gl=e,WH(t,e)):this.gl=Ts(t),e=this.gl,pe().getNumber("WEBGL_VERSION")===2){const s=e;this.createVertexArray=()=>At(s,()=>s.createVertexArray()),this.bindVertexArray=a=>At(s,()=>s.bindVertexArray(a)),this.deleteVertexArray=a=>At(s,()=>s.deleteVertexArray(a)),this.getVertexArray=()=>At(s,()=>s.getParameter(s.VERTEX_ARRAY_BINDING))}else if(e!=null){const s=e.getExtension("OES_vertex_array_object");if(s==null)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>At(e,()=>s.createVertexArrayOES()),this.bindVertexArray=a=>At(e,()=>s.bindVertexArrayOES(a)),this.deleteVertexArray=a=>At(e,()=>s.deleteVertexArrayOES(a)),this.getVertexArray=()=>At(e,()=>e.getParameter(s.VERTEX_ARRAY_BINDING_OES))}let r="WEBGL_color_buffer_float";const i="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),pe().getNumber("WEBGL_VERSION")===1){const s="OES_texture_float",a="OES_texture_half_float";if(this.textureFloatExtension=oh(this.gl,s),rs(this.gl,a))this.textureHalfFloatExtension=oh(this.gl,a);else if(pe().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(r),rs(this.gl,i))this.colorBufferHalfFloatExtension=oh(this.gl,i);else if(pe().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(r="EXT_color_buffer_float",rs(this.gl,r))this.colorBufferFloatExtension=this.gl.getExtension(r);else if(rs(this.gl,i))this.colorBufferHalfFloatExtension=this.gl.getExtension(i);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=wG(this.gl),this.indexBuffer=xG(this.gl),this.framebuffer=uV(this.gl),this.textureConfig=t2(this.gl,this.textureHalfFloatExtension)}get debug(){return pe().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;At(e,()=>e.finish()),At(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),At(e,()=>e.deleteFramebuffer(this.framebuffer)),At(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),At(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),At(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),bG(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),CG(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),_G(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),IG(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,r,i){this.throwIfDisposed(),TG(this.gl,e,t,r,i,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),EG(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),BG(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(P3(this.gl,this.framebuffer),this.outputTexture=null),At(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,r){return this.downloadMatrixDriver(e,()=>UG(this.gl,t,r,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,r,i,s,a){return MG(this.gl,e,t,r,i,s,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return RG(this.gl,e,t)}createBufferFromTexture(e,t,r){this.bindTextureToFrameBuffer(e);const i=FG(this.gl,t,r,this.textureConfig);return this.unbindTextureToFrameBuffer(),i}createAndWaitForFence(){const e=this.createFence(this.gl);
vendor: 12,361 bytes, lines 10721-10829
10721return this.pollFence(e)}createFence(e){let t,r;if(pe().getBool("WEBGL_FENCE_API_ENABLED")){const i=e,s=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),r=()=>{const a=i.clientWaitSync(s,0,0);return a===i.ALREADY_SIGNALED||a===i.CONDITION_SATISFIED},t=s}else pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),r=()=>this.isQueryAvailable(t,pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):r=()=>!0;return{query:t,isFencePassed:r}}downloadMatrixFromPackedTexture(e,t,r){return this.downloadMatrixDriver(e,()=>NG(this.gl,t,r))}createProgram(e){this.throwIfDisposed();const t=this.gl;this.vertexShader==null&&(this.vertexShader=vG(t));const r=sV(t);At(t,()=>t.attachShader(r,this.vertexShader)),At(t,()=>t.attachShader(r,e)),aV(t,r);const i=Object.assign(r,{vao:this.createVertexArray()});return this.debug&&vp(t,i),i}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;At(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),SG(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&(At(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&vp(this.gl,this.program),At(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,r=!0){return this.throwIfDisposed(),r?fV(this.gl,e,t):dV(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),At(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,r){this.throwIfDisposed(),this.throwIfNoProgram(),pV(this.gl,e,t,r)}setOutputMatrixTexture(e,t,r){this.setOutputMatrixTextureDriver(e,r,t)}setOutputPackedMatrixTexture(e,t,r){this.throwIfDisposed();const[i,s]=Wl(t,r);this.setOutputMatrixTextureDriver(e,i,s)}setOutputMatrixWriteRegion(e,t,r,i){this.setOutputMatrixWriteRegionDriver(r,e,i,t)}setOutputPackedMatrixWriteRegion(e,t,r,i){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&vp(this.gl,this.program),Ah(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){const t=this.getVertexArray();console.assert(t===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}At(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),At(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=oh(this.gl,pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){const r=this.gl,i=this.getQueryTimerExtensionWebGL2(),s=r.createQuery();return r.beginQuery(i.TIME_ELAPSED_EXT,s),s}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){const t=this.gl,r=this.getQueryTimerExtensionWebGL2();t.endQuery(r.TIME_ELAPSED_EXT);return}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await G0(()=>this.disposed||this.isQueryAvailable(e,pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){const r=this.gl;return r.getQueryParameter(e,r.QUERY_RESULT)/1e6}else{const r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){const r=this.gl,i=this.getQueryTimerExtensionWebGL2(),s=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(i.GPU_DISJOINT_EXT)),s&&!this.disjoint}else{const r=this.getQueryTimerExtensionWebGL1(),i=r.getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=DG(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){const{resolveFn:r}=this.itemsToPoll[t];r()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let r;"setTimeoutCustom"in pe().platform&&(r=pe().platform.setTimeoutCustom.bind(pe().platform)),G0(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,r)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),wp(this.gl,e,this.framebuffer),this.debug&&Ah(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(wp(this.gl,this.outputTexture,this.framebuffer),this.debug&&Ah(this.gl)):P3(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const r=t();return this.unbindTextureToFrameBuffer(),r}setOutputMatrixTextureDriver(e,t,r){this.throwIfDisposed();const i=this.gl;wp(i,e,this.framebuffer),this.debug&&Ah(i),this.outputTexture=e,At(i,()=>i.viewport(0,0,t,r)),At(i,()=>i.scissor(0,0,t,r))}setOutputMatrixWriteRegionDriver(e,t,r,i){this.throwIfDisposed(),At(this.gl,()=>this.gl.scissor(e,t,r,i))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(this.program==null)throw new Error("No GPU program is currently set.")}}function DG(n){let e=0;for(;e<n.length&&n[e]();++e);return e-1}/** 10722 * @license 10723 * Copyright 2020 Google LLC. All Rights Reserved. 10724 * Licensed under the Apache License, Version 2.0 (the License); 10725 * you may not use this file except in compliance with the License. 10726 * You may obtain a copy of the License at 10727 * 10728 * http://www.apache.org/licenses/LICENSE-2.0 10729 * 10730 * Unless required by applicable law or agreed to in writing, software 10731 * distributed under the License is distributed on an AS IS BASIS, 10732 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10733 * See the License for the specific language governing permissions and 10734 * limitations under the License. 10735 * ============================================================================= 10736 */function LG(n){const e=new Float32Array(n.length);for(let t=0;t<n.length;++t)e[t]=Math.abs(n[t]);return e}/** 10737 * @license 10738 * Copyright 2020 Google LLC. All Rights Reserved. 10739 * Licensed under the Apache License, Version 2.0 (the "License"); 10740 * you may not use this file except in compliance with the License. 10741 * You may obtain a copy of the License at 10742 * 10743 * http://www.apache.org/licenses/LICENSE-2.0 10744 * 10745 * Unless required by applicable law or agreed to in writing, software 10746 * distributed under the License is distributed on an "AS IS" BASIS, 10747 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10748 * See the License for the specific language governing permissions and 10749 * limitations under the License. 10750 * ============================================================================= 10751 */function fi(n){return(e,t,r,i,s)=>{const a=Cn(e,t),o=a.length,A=Mr(a),l=ze(a),c=vo(s,l),u=e.length,h=t.length,f=Mr(e),d=Mr(t),g=pf(e,a),m=pf(t,a);if(g.length+m.length===0)for(let p=0;p<c.length;++p)c[p]=n(r[p%r.length],i[p%i.length]);else for(let p=0;p<c.length;++p){const w=bg(p,o,A),C=w.slice(-u);g.forEach(D=>C[D]=0);const b=Gm(C,u,f),U=w.slice(-h);m.forEach(D=>U[D]=0);const F=Gm(U,h,d);c[p]=n(r[b],i[F])}return[c,a]}}/** 10752 * @license 10753 * Copyright 2020 Google LLC. All Rights Reserved. 10754 * Licensed under the Apache License, Version 2.0 (the "License"); 10755 * you may not use this file except in compliance with the License. 10756 * You may obtain a copy of the License at 10757 * 10758 * http://www.apache.org/licenses/LICENSE-2.0 10759 * 10760 * Unless required by applicable law or agreed to in writing, software 10761 * distributed under the License is distributed on an "AS IS" BASIS, 10762 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10763 * See the License for the specific language governing permissions and 10764 * limitations under the License. 10765 * ============================================================================= 10766 */function OG(n,e,t,r){if(r==="int32"){const i=Int32Array.from(n);return[e,"int32",i]}if(r==="bool"){const i=zf([0],t),[s,a]=fi((o,A)=>o!==A?1:0)(e,[],n,i,"bool");return[a,"bool",s]}throw new Error(`Error in Cast: failed to cast ${t} to ${r}`)}/** 10767 * @license 10768 * Copyright 2020 Google LLC. All Rights Reserved. 10769 * Licensed under the Apache License, Version 2.0 (the "License"); 10770 * you may not use this file except in compliance with the License. 10771 * You may obtain a copy of the License at 10772 * 10773 * http://www.apache.org/licenses/LICENSE-2.0 10774 * 10775 * Unless required by applicable law or agreed to in writing, software 10776 * distributed under the License is distributed on an "AS IS" BASIS, 10777 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10778 * See the License for the specific language governing permissions and 10779 * limitations under the License. 10780 * ============================================================================= 10781 */const PG=fi((n,e)=>n+e);/** 10782 * @license 10783 * Copyright 2020 Google LLC. All Rights Reserved. 10784 * Licensed under the Apache License, Version 2.0 (the "License"); 10785 * you may not use this file except in compliance with the License. 10786 * You may obtain a copy of the License at 10787 * 10788 * http://www.apache.org/licenses/LICENSE-2.0 10789 * 10790 * Unless required by applicable law or agreed to in writing, software 10791 * distributed under the License is distributed on an "AS IS" BASIS, 10792 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10793 * See the License for the specific language governing permissions and 10794 * limitations under the License. 10795 * ============================================================================= 10796 */function kG(n,e,t,r,i){const s=ze(r),a=wo(i,t);for(let o=0;o<n.length;o++){const A=n[o];if(A<0)throw new Error("Input x must be non-negative!");A>=i||(s>0?a[A]+=e[o]:a[A]+=1)}return a}function $G(n,e,t,r=!1){const i=n.shape[0],s=n.shape[1],a=ir([i,t],e.dtype);for(let o=0;o<i;o++)for(let A=0;A<s;A++){const l=n.get(o,A);if(l<0)throw new Error("Input x must be non-negative!");l>=t||(r?a.set(1,o,l):e.size>0?a.set(a.get(o,l)+e.get(o,A),o,l):a.set(a.get(o,l)+1,o,l))}return a}/** 10797 * @license 10798 * Copyright 2023 Google LLC. 10799 * Licensed under the Apache License, Version 2.0 (the "License"); 10800 * you may not use this file except in compliance with the License. 10801 * You may obtain a copy of the License at 10802 * 10803 * http://www.apache.org/licenses/LICENSE-2.0 10804 * 10805 * Unless required by applicable law or agreed to in writing, software 10806 * distributed under the License is distributed on an "AS IS" BASIS, 10807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10808 * See the License for the specific language governing permissions and 10809 * limitations under the License. 10810 * ============================================================================= 10811 */const QG=fi((n,e)=>n&e);/** 10812 * @license 10813 * Copyright 2020 Google LLC. All Rights Reserved. 10814 * Licensed under the Apache License, Version 2.0 (the "License"); 10815 * you may not use this file except in compliance with the License. 10816 * You may obtain a copy of the License at 10817 * 10818 * http://www.apache.org/licenses/LICENSE-2.0 10819 * 10820 * Unless required by applicable law or agreed to in writing, software 10821 * distributed under the License is distributed on an "AS IS" BASIS, 10822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10823 * See the License for the specific language governing permissions and 10824 * limitations under the License. 10825 * ============================================================================= 10826 */function Da(n){return(e,t,r)=>{const i=br(t,e.length);for(let s=0;s<e.length;++s)i[s]=n(e[s],r);return i}}/** 10827 * @license 10828 * Copyright 2020 Google LLC. All Rights Reserved. 10829 * Licensed under the Apache License, Version 2.0 (the License);
10830 * you may not use this file except in compliance with the License. 10831 * You may obtain a copy of the License at 10832 * 10833 * http://www.apache.org/licenses/LICENSE-2.0 10834 * 10835 * Unless required by applicable law or agreed to in writing, software 10836 * distributed under the License is distributed on an AS IS BASIS, 10837 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10838 * See the License for the specific language governing permissions and 10839 * limitations under the License. 10840 * ============================================================================= 10841 */const HG=Da(n=>Math.ceil(n));/** 10842 * @license 10843 * Copyright 2020 Google LLC. All Rights Reserved. 10844 * Licensed under the Apache License, Version 2.0 (the "License"); 10845 * you may not use this file except in compliance with the License. 10846 * You may obtain a copy of the License at 10847 * 10848 * http://www.apache.org/licenses/LICENSE-2.0 10849 * 10850 * Unless required by applicable law or agreed to in writing, software 10851 * distributed under the License is distributed on an "AS IS" BASIS, 10852 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10853 * See the License for the specific language governing permissions and 10854 * limitations under the License. 10855 * ============================================================================= 10856 */function VG(n,e,t,r){const i=br(t,ze(e));if(r&&t!=="string"){let s=0;n.forEach(a=>{const o=ze(a.shape);i.set(a.vals,s),s+=o})}else{let s=0;n.forEach(a=>{const o=t==="string"?Ul(a.vals):a.vals;let A=0;for(let l=0;l<a.shape[0];++l){const c=l*e[1]+s;for(let u=0;u<a.shape[1];++u)i[c+u]=o[A++]}s+=a.shape[1]})}return i}/** 10857 * @license 10858 * Copyright 2020 Google LLC. All Rights Reserved. 10859 * Licensed under the Apache License, Version 2.0 (the "License"); 10860 * you may not use this file except in compliance with the License. 10861 * You may obtain a copy of the License at 10862 * 10863 * http://www.apache.org/licenses/LICENSE-2.0 10864 * 10865 * Unless required by applicable law or agreed to in writing, software 10866 * distributed under the License is distributed on an "AS IS" BASIS, 10867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10868 * See the License for the specific language governing permissions and 10869 * limitations under the License. 10870 * ============================================================================= 10871 */const GG=fi((n,e)=>n===e?1:0);/** 10872 * @license 10873 * Copyright 2020 Google LLC. All Rights Reserved. 10874 * Licensed under the Apache License, Version 2.0 (the License); 10875 * you may not use this file except in compliance with the License. 10876 * You may obtain a copy of the License at 10877 * 10878 * http://www.apache.org/licenses/LICENSE-2.0 10879 * 10880 * Unless required by applicable law or agreed to in writing, software 10881 * distributed under the License is distributed on an AS IS BASIS, 10882 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10883 * See the License for the specific language governing permissions and 10884 * limitations under the License. 10885 * ============================================================================= 10886 */const zG=Da(n=>Math.exp(n));/** 10887 * @license 10888 * Copyright 2020 Google LLC. All Rights Reserved. 10889 * Licensed under the Apache License, Version 2.0 (the License); 10890 * you may not use this file except in compliance with the License. 10891 * You may obtain a copy of the License at 10892 * 10893 * http://www.apache.org/licenses/LICENSE-2.0 10894 * 10895 * Unless required by applicable law or agreed to in writing, software 10896 * distributed under the License is distributed on an AS IS BASIS, 10897 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10898 * See the License for the specific language governing permissions and 10899 * limitations under the License. 10900 * ============================================================================= 10901 */const WG=Da(n=>Math.expm1(n));/** 10902 * @license 10903 * Copyright 2020 Google LLC. All Rights Reserved. 10904 * Licensed under the Apache License, Version 2.0 (the License); 10905 * you may not use this file except in compliance with the License. 10906 * You may obtain a copy of the License at 10907 * 10908 * http://www.apache.org/licenses/LICENSE-2.0 10909 * 10910 * Unless required by applicable law or agreed to in writing, softw
10910are 10911 * distributed under the License is distributed on an AS IS BASIS, 10912 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10913 * See the License for the specific language governing permissions and 10914 * limitations under the License. 10915 * ============================================================================= 10916 */const KG=Da(n=>Math.floor(n));/** 10917 * @license 10918 * Copyright 2020 Google LLC. All Rights Reserved. 10919 * Licensed under the Apache License, Version 2.0 (the "License"); 10920 * you may not use this file except in compliance with the License. 10921 * You may obtain a copy of the License at 10922 * 10923 * http://www.apache.org/licenses/LICENSE-2.0 10924 * 10925 * Unless required by applicable law or agreed to in writing, software 10926 * distributed under the License is distributed on an "AS IS" BASIS, 10927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10928 * See the License for the specific language governing permissions and 10929 * limitations under the License. 10930 * ============================================================================= 10931 */const XG=fi((n,e)=>Math.floor(n/e));/** 10932 * @license 10933 * Copyright 2021 Google LLC. All Rights Reserved. 10934 * Licensed under the Apache License, Version 2.0 (the "License"); 10935 * you may not use this file except in compliance with the License. 10936 * You may obtain a copy of the License at 10937 * 10938 * http://www.apache.org/licenses/LICENSE-2.0 10939 * 10940 * Unless required by applicable law or agreed to in writing, software 10941 * distributed under the License is distributed on an "AS IS" BASIS, 10942 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10943 * See the License for the specific language governing permissions and 10944 * limitations under the License. 10945 * ============================================================================= 10946 */function jG(n,e,t,r,i,s,a,o,A){const l=ir([r,s],t);for(let c=0;c<r;c++){const u=[];let h=0;for(let f=0;f<i;f++){const d=n[c*i+f];h+=d*a[f],u.push(d)}if(h<0||h>=A/s)throw new Error(`Invalid indices: ${u} does not index into ${o}`);for(let f=0;f<s;f++)l.values[c*s+f]=e.get(...e.indexToLoc(h*s+f))}return l}/** 10947 * @license 10948 * Copyright 2020 Google LLC. All Rights Reserved. 10949 * Licensed under the Apache License, Version 2.0 (the "License"); 10950 * you may not use this file except in compliance with the License. 10951 * You may obtain a copy of the License at 10952 * 10953 * http://www.apache.org/licenses/LICENSE-2.0 10954 * 10955 * Unless required by applicable law or agreed to in writing, software 10956 * distributed under the License is distributed on an "AS IS" BASIS, 10957 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10958 * See the License for the specific language governing permissions and 10959 * limitations under the License. 10960 * ============================================================================= 10961 */function YG(n,e,t){const r=ir(t,n.dtype);for(let i=0;i<r.size;++i){const a=r.indexToLoc(i).slice(),o=a[0],A=a[2],l=e.locToIndex([o,A]);a[2]=e.values[l];const c=n.locToIndex(a);0<=c&&c<n.values.length&&(r.values[i]=n.values[c])}return r}/** 10962 * @license 10963 * Copyright 2020 Google LLC. All Rights Reserved. 10964 * Licensed under the Apache License, Version 2.0 (the "License"); 10965 * you may not use this file except in compliance with the License. 10966 * You may obtain a copy of the License at 10967 * 10968 * http://www.apache.org/licenses/LICENSE-2.0 10969 * 10970 * Unless required by applicable law or agreed to in writing, software 10971 * distributed under the License is distributed on an "AS IS" BASIS, 10972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10973 * See the License for the specific language governing permissions and 10974 * limitations under the License. 10975 * ============================================================================= 10976 */const qG=fi((n,e)=>n>e?1:0);/** 10977 * @license 10978 * Copyright 2020 Google LLC. All Rights Reserved. 10979 * Licensed under the Apache License, Version 2.0 (the "License"); 10980 * you may not use this file except in compliance with the License. 10981 * You may obtain a copy of the License at 10982 * 10983 * http://www.apache.org/licenses/LICENSE-2.0 10984 * 10985 * Unless required by applicable law or agreed to in writing, softw
10985are 10986 * distributed under the License is distributed on an "AS IS" BASIS, 10987 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10988 * See the License for the specific language governing permissions and 10989 * limitations under the License. 10990 * ============================================================================= 10991 */const JG=fi((n,e)=>n>=e?1:0);/** 10992 * @license 10993 * Copyright 2020 Google LLC. All Rights Reserved. 10994 * Licensed under the Apache License, Version 2.0 (the "License"); 10995 * you may not use this file except in compliance with the License. 10996 * You may obtain a copy of the License at 10997 * 10998 * http://www.apache.org/licenses/LICENSE-2.0 10999 * 11000 * Unless required by applicable law or agreed to in writing, software 11001 * distributed under the License is distributed on an "AS IS" BASIS, 11002 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11003 * See the License for the specific language governing permissions and 11004 * limitations under the License. 11005 * ============================================================================= 11006 */const ZG=fi((n,e)=>n<e?1:0);/** 11007 * @license 11008 * Copyright 2020 Google LLC. All Rights Reserved. 11009 * Licensed under the Apache License, Version 2.0 (the "License"); 11010 * you may not use this file except in compliance with the License. 11011 * You may obtain a copy of the License at 11012 * 11013 * http://www.apache.org/licenses/LICENSE-2.0 11014 * 11015 * Unless required by applicable law or agreed to in writing, software 11016 * distributed under the License is distributed on an "AS IS" BASIS, 11017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11018 * See the License for the specific language governing permissions and 11019 * limitations under the License. 11020 * ============================================================================= 11021 */const ez=fi((n,e)=>n<=e?1:0);/** 11022 * @license 11023 * Copyright 2020 Google LLC. All Rights Reserved. 11024 * Licensed under the Apache License, Version 2.0 (the "License"); 11025 * you may not use this file except in compliance with the License. 11026 * You may obtain a copy of the License at 11027 * 11028 * http://www.apache.org/licenses/LICENSE-2.0 11029 * 11030 * Unless required by applicable law or agreed to in writing, software 11031 * distributed under the License is distributed on an "AS IS" BASIS, 11032 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11033 * See the License for the specific language governing permissions and 11034 * limitations under the License. 11035 * ============================================================================= 11036 */function tz(n,e,t){const r=(e-n)/(t-1),i=wo(t,"float32");i[0]=n;for(let s=1;s<i.length;s++)i[s]=i[s-1]+r;return i}/** 11037 * @license 11038 * Copyright 2020 Google LLC. All Rights Reserved. 11039 * Licensed under the Apache License, Version 2.0 (the License); 11040 * you may not use this file except in compliance with the License. 11041 * You may obtain a copy of the License at 11042 * 11043 * http://www.apache.org/licenses/LICENSE-2.0 11044 * 11045 * Unless required by applicable law or agreed to in writing, software 11046 * distributed under the License is distributed on an AS IS BASIS, 11047 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11048 * See the License for the specific language governing permissions and 11049 * limitations under the License. 11050 * ============================================================================= 11051 */const nz=Da(n=>Math.log(n));/** 11052 * @license 11053 * Copyright 2020 Google LLC. All Rights Reserved. 11054 * Licensed under the Apache License, Version 2.0 (the "License"); 11055 * you may not use this file except in compliance with the License. 11056 * You may obtain a copy of the License at 11057 * 11058 * http://www.apache.org/licenses/LICENSE-2.0 11059 * 11060 * Unless required by applicable law or agreed to in writing, software 11061 * distributed under the License is distributed on an "AS IS" BASIS, 11062 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11063 * See the License for the specific language governing permissions and 11064 * limitations under the License. 11065 * ============================================================================= 11066 */function rz(n,e,t,r){const i=vo(r,ze(t));for(let s=0;s<i.length;++s){const a=s*e;let o=n[a];for(let A=0;A<e;++A){const l=n[a+A];(Number.isNaN(l)||l>o)&&(o=l)}i[s]=o}return i}/** 11067 * @license 11068 * Copyright 2020 Google LLC. All Rights Reserved. 11069 * Licensed under the Apache License, Version 2.0 (the "License");
11070 * you may not use this file except in compliance with the License. 11071 * You may obtain a copy of the License at 11072 * 11073 * http://www.apache.org/licenses/LICENSE-2.0 11074 * 11075 * Unless required by applicable law or agreed to in writing, software 11076 * distributed under the License is distributed on an "AS IS" BASIS, 11077 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11078 * See the License for the specific language governing permissions and 11079 * limitations under the License. 11080 * ============================================================================= 11081 */const iz=fi((n,e)=>Math.max(n,e));/** 11082 * @license 11083 * Copyright 2020 Google LLC. All Rights Reserved. 11084 * Licensed under the Apache License, Version 2.0 (the "License"); 11085 * you may not use this file except in compliance with the License. 11086 * You may obtain a copy of the License at 11087 * 11088 * http://www.apache.org/licenses/LICENSE-2.0 11089 * 11090 * Unless required by applicable law or agreed to in writing, software 11091 * distributed under the License is distributed on an "AS IS" BASIS, 11092 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11093 * See the License for the specific language governing permissions and 11094 * limitations under the License. 11095 * ============================================================================= 11096 */const sz=fi((n,e)=>Math.min(n,e));/** 11097 * @license 11098 * Copyright 2020 Google LLC. All Rights Reserved. 11099 * Licensed under the Apache License, Version 2.0 (the "License"); 11100 * you may not use this file except in compliance with the License. 11101 * You may obtain a copy of the License at 11102 * 11103 * http://www.apache.org/licenses/LICENSE-2.0 11104 * 11105 * Unless required by applicable law or agreed to in writing, software 11106 * distributed under the License is distributed on an "AS IS" BASIS, 11107 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11108 * See the License for the specific language governing permissions and 11109 * limitations under the License. 11110 * ============================================================================= 11111 */const tB=fi((n,e)=>n*e);/** 11112 * @license 11113 * Copyright 2020 Google LLC. All Rights Reserved. 11114 * Licensed under the Apache License, Version 2.0 (the "License"); 11115 * you may not use this file except in compliance with the License. 11116 * You may obtain a copy of the License at 11117 * 11118 * http://www.apache.org/licenses/LICENSE-2.0 11119 * 11120 * Unless required by applicable law or agreed to in writing, software 11121 * distributed under the License is distributed on an "AS IS" BASIS, 11122 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11123 * See the License for the specific language governing permissions and 11124 * limitations under the License. 11125 * ============================================================================= 11126 */function az(n,e,t){const r=Hl(-1,t);return tB([],e,r,n,t)}/** 11127 * @license 11128 * Copyright 2020 Google LLC. All Rights Reserved. 11129 * Licensed under the Apache License, Version 2.0 (the "License"); 11130 * you may not use this file except in compliance with the License. 11131 * You may obtain a copy of the License at 11132 * 11133 * http://www.apache.org/licenses/LICENSE-2.0 11134 * 11135 * Unless required by applicable law or agreed to in writing, software 11136 * distributed under the License is distributed on an "AS IS" BASIS, 11137 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11138 * See the License for the specific language governing permissions and 11139 * limitations under the License. 11140 * ============================================================================= 11141 */const oz=fi((n,e)=>n!==e?1:0);/** 11142 * @license 11143 * Copyright 2020 Google LLC. All Rights Reserved. 11144 * Licensed under the Apache License, Version 2.0 (the "License"); 11145 * you may not use this file except in compliance with the License. 11146 * You may obtain a copy of the License at 11147 * 11148 * http://www.apache.org/licenses/LICENSE-2.0 11149 * 11150 * Unless required by applicable law or agreed to in writing, software 11151 * distributed under the License is distributed on an "AS IS" BASIS, 11152 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11153 * See the License for the specific language governing permissions and 11154 * limitations under the License. 11155 * ============================================================================= 11156 */function Az(n,e,t,r,i){const s=e.length,a=ze(e),o=Mr(e),A=Mr(i),l=vo(t,ze(i));for(let c=0;c<a;++c){const u=bg(c,s,o),h=new Array(u.length);for(let d=0;d<h.length;d++)h[d]=u[r[d]];const f=Gm(h,s,A);l[f]=n[c]}return l}/** 11157 * @license 11158 * Copyright 2020 Google LLC. All Rights Reserved. 11159 * Licensed under the Apache License, Version 2.0 (the "License");
11160 * you may not use this file except in compliance with the License. 11161 * You may obtain a copy of the License at 11162 * 11163 * http://www.apache.org/licenses/LICENSE-2.0 11164 * 11165 * Unless required by applicable law or agreed to in writing, software 11166 * distributed under the License is distributed on an "AS IS" BASIS, 11167 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11168 * See the License for the specific language governing permissions and 11169 * limitations under the License. 11170 * ============================================================================= 11171 */function lz(n,e,t,r){const[i,s]=Zs(n,r),a=Ys(e,"int32"),o=wo(ze(i),a),A=ze(s);for(let l=0;l<o.length;++l){const c=l*A;let u=1;for(let h=0;h<A;++h)u*=t[c+h];o[l]=u}return{outVals:o,outShape:i,outDtype:a}}/** 11172 * @license 11173 * Copyright 2022 Google LLC. All Rights Reserved. 11174 * Licensed under the Apache License, Version 2.0 (the "License"); 11175 * you may not use this file except in compliance with the License. 11176 * You may obtain a copy of the License at 11177 * 11178 * http://www.apache.org/licenses/LICENSE-2.0 11179 * 11180 * Unless required by applicable law or agreed to in writing, software 11181 * distributed under the License is distributed on an "AS IS" BASIS, 11182 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11183 * See the License for the specific language governing permissions and 11184 * limitations under the License. 11185 * ============================================================================= 11186 */function cz(n,e,t){n.forEach((r,i)=>{if(r<0||r>=t){const s=bg(i,e.length,Mr(e)).join(",");throw new Error(`indices[${s}] = ${r} is not in [0, ${t})`)}})}function uz(n,e){for(let t=0;t<n.length;++t){const r=n[t],i=t===n.length-1?e:n[t+1].length;if(r.length===0)throw new Error("Ragged splits may not be empty");if(r[0]<0)throw new Error("Ragged splits must be non-negative");if(r[r.length-1]>i)throw new Error("Ragged splits must not point past values");for(let s=1;s<r.length;++s)if(r[s-1]>r[s])throw new Error("Ragged splits must be sorted in ascending order")}}function hz(n,e,t,r){const i=[];let s=0;const a=e.length-1+t.length,o=new Array(a).fill(null).map(()=>[0]);uz(t,r);let A=1;for(let l=0;l<e.length-1;++l){A*=e[l];const c=e[l+1];for(let u=1;u<A+1;++u)o[l].push(u*c)}for(let l=0;l<n.length;++l){let c=n[l],u=n[l]+1;for(let h=0;h<t.length;++h){const f=t[h],d=h+e.length-1;if(d>=0){const g=o[d],m=g[g.length-1]-f[c];for(let p=c;p<u;++p)o[d].push(f[p+1]+m)}c=f[c],u=f[u]}u!==c&&(i.push([c,u]),s+=u-c)}return{outSplits:o,valueSlices:i,numValues:s}}function fz(n){const e=[];for(let t=0;t<n.length;++t){const r=n[t].length,i=br("int32",r);e.push(i),n[t].forEach((s,a)=>i[a]=s)}return e}function H3(n,e){const t=n.slice(0,e);for(;t.length<e;)t.push(1);for(let r=e;r<n.length;r++)t[e-1]*=n[r];return t}function dz(n,e,t,r,i,s){const a=H3(e,2)[1],o=H3(s,2)[1];let A=0;for(const l of t)for(let c=l[0];c<l[1];++c){for(let u=0;u<r;++u)i[A*o+u]=n[c*a+u];++A}}function pz(n,e,t,r,i){const s=e.slice();s[0]=i;const a=br(t,ze(s)),o=n.length,A=o===0?0:o/e[0];return dz(n,e,r,A,a,s),[a,s]}function mz(n,e,t,r,i,s,a,o){if(n.length===0)throw new Error("paramsNestedSplits must be non empty");if(e[0].length===0)throw new Error("Split tensors must not be scalars");const A=e[0][0]-1;if(cz(s,a,A),r.length===0)throw new Error("params.rank must be nonzero");const l=r[0],{outSplits:c,valueSlices:u,numValues:h}=hz(s,a,n,l),f=fz(c),d=pz(t,r,i,u,h);return[f,d[0],d[1]]}/** 11187 * @license 11188 * Copyright 2022 Google LLC. 11189 * Licensed under the Apache License, Version 2.0 (the "License"); 11190 * you may not use this file except in compliance with the License. 11191 * You may obtain a copy of the License at 11192 * 11193 * http://www.apache.org/licenses/LICENSE-2.0 11194 * 11195 * Unless required by applicable law or agreed to in writing, software 11196 * distributed under the License is distributed on an "AS IS" BASIS, 11197 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11198 * See the License for the specific language governing permissions and 11199 * limitations under the License. 11200 * ============================================================================= 11201 */const V3=2147483647;function gz(n,e,t,r,i,s,a){if(e.length>1)throw new Error("starts must be a scalar or vector");if(i.length>1)throw new Error("limits must be a scalar or vector");if(a.length>1)throw new Error("deltas must be a scalar or vector");const o=e.length===0,A=i.length===0,l=a.length===0,c=[];o||c.push(e[0]),A||c.push(i[0]),l||c.push(a[0]);for(let m=1;m<c.length;++m)if(c[m]!==c[m-1])throw new Error("starts, limits, and deltas must have the same shape");const u=c.length===0?1:c[0],h=br("int32",u+1);h[0]=0;for(let m=0;m<u;++m){const p=o?n[0]:n[m],w=A?r[0]:r[m],C=l?s[0]:s[m];if(C===0)throw new Error("Requires delta != 0");let b;if(C>0&&w<p||C<0&&w>p)b=0;else if(b=Math.ceil(Math.abs((w-p)/C)),b>V3)throw new Error(`Requires ((limit - start) / delta) <= ${V3}`);h[m+1]=h[m]+b}const f=h[u],d=br(t,f);let g=0;for(let m=0;m<u;++m){const p=h[m+1]-h[m];let w=o?n[0]:n[m];const C=l?s[0]:s[m];for(let b=0;b<p;++b)d[g++]=w,w+=C}return[h,d]}/** 11202 * @license 11203 * Copyright 2022 Google LLC. All Rights Reserved. 11204 * Licensed under the Apache License, Version 2.0 (the "License");
11205 * you may not use this file except in compliance with the License. 11206 * You may obtain a copy of the License at 11207 * 11208 * http://www.apache.org/licenses/LICENSE-2.0 11209 * 11210 * Unless required by applicable law or agreed to in writing, software 11211 * distributed under the License is distributed on an "AS IS" BASIS, 11212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11213 * See the License for the specific language governing permissions and 11214 * limitations under the License. 11215 * ============================================================================= 11216 */var Ki=vs;class _f{constructor(e,t,r,i,s,a,o,A,l,c){this.shape=e,this.shapeShape=t,this.values=r,this.valuesShape=i,this.valuesDType=s,this.defaultValue=a,this.defaultValueShape=o,this.rowPartitionValues=A,this.rowPartitionValuesShapes=l,this.rowPartitionTypes=qC(c),this.raggedRank=JC(this.rowPartitionTypes)}getRowPartitionTypeByDimension(e){return this.rowPartitionTypes[0]===Ki.FIRST_DIM_SIZE?this.rowPartitionTypes[e+1]:this.rowPartitionTypes[e]}getRowPartitionTensor(e){return this.rowPartitionTypes[0]===Ki.FIRST_DIM_SIZE?this.rowPartitionValues[e+1]:this.rowPartitionValues[e]}getMaxWidth(e){const t=this.getRowPartitionTensor(e-1);switch(this.getRowPartitionTypeByDimension(e-1)){case Ki.VALUE_ROWIDS:return _f.getMaxWidthValueRowID(t);case Ki.ROW_SPLITS:return _f.getMaxWidthRowSplit(t);default:throw new Error(`Cannot handle partition type ${Ki[this.getRowPartitionTypeByDimension(e-1)]}`)}}static getMaxWidthRowSplit(e){const t=e.length;if(t===0||t===1)return 0;let r=0;for(let i=0;i<t-1;++i){const s=e[i+1]-e[i];s>r&&(r=s)}return r}static getMaxWidthValueRowID(e){const t=e.length;if(t===0)return 0;let r=0,i=e[0],s=0;for(let a=1;a<t;++a){const o=e[a];o!==i&&(i=o,s=Math.max(a-r,s),r=a)}return Math.max(t-r,s)}tensorShapeFromTensor(e,t,r=!0){if(t.length===0){if(e[0]===-1)return[];throw new Error("The only valid scalar shape tensor is the fully unknown shape specified as -1.")}return z3(e,r)}calculateOutputSize(e){const t=this.valuesShape,r=this.defaultValueShape;ZC(r,t);const i=this.tensorShapeFromTensor(this.shape,this.shapeShape),a=YC(this.raggedRank,i,t);a[0]<0&&(a[0]=e);for(let o=1;o<=this.raggedRank;++o)a[o]<0&&(a[o]=this.getMaxWidth(o));return a}calculateFirstParentOutputIndex(e,t,r){const i=Math.min(e,r),s=[];let a=0;for(let o=0;o<i;++o,a+=t)s.push(a);for(let o=i;o<e;++o)s.push(-1);return H(s.length===e,()=>"Final length of result must be equal to firstDimension."),s}
vendor: 4,162 bytes, lines 11216-11234
11216calculateOutputIndexRowSplit(e,t,r,i){const s=e.length,a=[];for(let o=0;o<s-1;++o){const A=e[o+1]-e[o];let l=Math.min(i,A),c=t[o];c===-1&&(l=0);for(let u=0;u<l;++u)a.push(c),c+=r;for(let u=0;u<A-l;++u)a.push(-1)}if(s>0&&a.length!==e[s-1])throw new Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(e,t,r,i){const s=e.length,a=[];if(s===0)return[];let o=0,A=e[0];if(A>=t.length)throw new Error(`Got currentValueRowId=${A}, which is not less than ${t.length}`);let l=t[A];a.push(l);for(let c=1;c<s;++c){const u=e[c];if(u===A)l>=0&&(++o,o<i?l+=r:l=-1);else{if(o=0,A=u,u>=t.length)throw new Error(`Got nextValueRowId=${u} which is not less than ${t.length}`);l=t[u]}a.push(l)}if(a.length!==e.length)throw new Error("Invalid row ids.");return a}calculateOutputIndex(e,t,r,i){const s=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case Ki.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,t,r,i);case Ki.ROW_SPLITS:if(s.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(s,t,r,i);default:throw new Error(`Unsupported partition type: ${Ki[a]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case Ki.FIRST_DIM_SIZE:return e[0];case Ki.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case Ki.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${Ki[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const t=this.getFirstDimensionSize(),r=this.calculateOutputSize(t),i=new Array(this.raggedRank+1);i[i.length-1]=1;for(let A=i.length-2;A>=0;--A)i[A]=i[A+1]*r[A+1];const s=z3(r,!1),a=br(this.valuesDType,ze(s));if(i[0]*r[0]>0){let A=this.calculateFirstParentOutputIndex(t,i[0],r[0]);for(let l=1;l<=this.raggedRank;++l)A=this.calculateOutputIndex(l-1,A,i[l],r[l]);this.setOutput(this.raggedRank,A,a,s)}return[s,a]}setOutput(e,t,r,i){if(r.length===0)return;const s=this.values,a=r;let o=i.slice();o=o.slice(e+1);const A=ze(o),l=t.length;let c=this.defaultValue;if(c.length!==A&&c.length!==1){const d=this.defaultValueShape;Jt(()=>{const g=Re(c,d);c=Mc(g,o).dataSync()})}let u=0,h=0,f=0;for(let d=0;d<=l;++d){let g=d<l?t[d]:-1;if(g===f){++f;continue}if(h<f){const m=s.subarray(u*A),p=a.subarray(h*A),w=(f-h)*A;G3(p,m,w)}if(d>=l){const m=r.length;g=Math.floor(m/A)}if(g>f)if(this.defaultValue.length===1)a.subarray(f*A,g*A).fill(this.defaultValue[0]),f=g;else for(;g>f;){const m=a.slice(f*A);G3(m,c,A),++f}g<0?(u=d+1,h=f):(u=d,h=f,f=h+1)}}}function G3(n,e,t){for(let r=0;r<t;r++)n[r]=e[r]}function z3(n,e){const t=[];for(let r of n){if(r<0){if(!e)throw new Error(`Dimension ${r} must be >= 0`);if(r<-1)throw new Error(`Dimension ${r} must be >= -1`);r=-1}t.push(r)}return t}function yz(n,e,t,r,i,s,a,o,A,l){return new _f(n,e,t,r,i,s,a,o,A,l).compute()}/** 11217 * @license 11218 * Copyright 2020 Google LLC. All Rights Reserved. 11219 * Licensed under the Apache License, Version 2.0 (the "License"); 11220 * you may not use this file except in compliance with the License. 11221 * You may obtain a copy of the License at 11222 * 11223 * http://www.apache.org/licenses/LICENSE-2.0 11224 * 11225 * Unless required by applicable law or agreed to in writing, software 11226 * distributed under the License is distributed on an "AS IS" BASIS, 11227 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11228 * See the License for the specific language governing permissions and 11229 * limitations under the License. 11230 * ============================================================================= 11231 */function vz(n,e,t,r){const i=n===e,s=n<e&&t<0,a=e<n&&t>1;if(i||s||a)return wo(0,r);const o=Math.abs(Math.ceil((e-n)/t)),A=wo(o,r);e<n&&t===1&&(t=-1),A[0]=n;for(let l=1;l<A.length;l++)A[l]=A[l-1]+t;return A}/** 11232 * @license 11233 * Copyright 2020 Google LLC. All Rights Reserved. 11234 * Licensed under the Apache License, Version 2.0 (the License);
11235 * you may not use this file except in compliance with the License. 11236 * You may obtain a copy of the License at 11237 * 11238 * http://www.apache.org/licenses/LICENSE-2.0 11239 * 11240 * Unless required by applicable law or agreed to in writing, software 11241 * distributed under the License is distributed on an AS IS BASIS, 11242 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11243 * See the License for the specific language governing permissions and 11244 * limitations under the License. 11245 * ============================================================================= 11246 */const wz=Da(n=>1/Math.sqrt(n));/** 11247 * @license 11248 * Copyright 2020 Google LLC. All Rights Reserved. 11249 * Licensed under the Apache License, Version 2.0 (the "License"); 11250 * you may not use this file except in compliance with the License. 11251 * You may obtain a copy of the License at 11252 * 11253 * http://www.apache.org/licenses/LICENSE-2.0 11254 * 11255 * Unless required by applicable law or agreed to in writing, software 11256 * distributed under the License is distributed on an "AS IS" BASIS, 11257 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11258 * See the License for the specific language governing permissions and 11259 * limitations under the License. 11260 * ============================================================================= 11261 */function xz(n,e,t,r,i,s,a,o,A,l){const c=[r/i,i],u=n.values,h=e.values;if(r===0)return ir(t,e.dtype);const f=A instanceof Fl?A:ir(c,e.dtype);typeof A=="string"||typeof A=="number"?f.values.fill(A):typeof A=="boolean"&&f.values.fill(+A);for(let d=0;d<s;d++){const g=[];let m=0;for(let p=0;p<a;p++){const w=u[d*a+p];g.push(w),m+=w*o[p]}if(m<0||m>=r/i)throw new Error(`Invalid indices: ${g} does not index into ${t}`);for(let p=0;p<i;p++)l?f.values[m*i+p]+=h[d*i+p]:f.values[m*i+p]=e.rank===0?h[0]:h[d*i+p]}return f}/** 11262 * @license 11263 * Copyright 2020 Google LLC. All Rights Reserved. 11264 * Licensed under the Apache License, Version 2.0 (the License); 11265 * you may not use this file except in compliance with the License. 11266 * You may obtain a copy of the License at 11267 * 11268 * http://www.apache.org/licenses/LICENSE-2.0 11269 * 11270 * Unless required by applicable law or agreed to in writing, software 11271 * distributed under the License is distributed on an AS IS BASIS, 11272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11273 * See the License for the specific language governing permissions and 11274 * limitations under the License. 11275 * ============================================================================= 11276 */const bz=Da(n=>1/(1+Math.exp(-n)));/** 11277 * @license 11278 * Copyright 2020 Google LLC. All Rights Reserved. 11279 * Licensed under the Apache License, Version 2.0 (the "License"); 11280 * you may not use this file except in compliance with the License. 11281 * You may obtain a copy of the License at 11282 * 11283 * http://www.apache.org/licenses/LICENSE-2.0 11284 * 11285 * Unless required by applicable law or agreed to in writing, software 11286 * distributed under the License is distributed on an "AS IS" BASIS, 11287 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11288 * See the License for the specific language governing permissions and 11289 * limitations under the License. 11290 * ============================================================================= 11291 */function Cz(n,e,t,r,i){const s=Xg(r,e,t),a=ze(t),o=Mr(r);if(s){const u=jg(e,o);return i==="string"?n.slice(u,u+a):n.subarray(u,u+a)}const A=i==="string"?Ul(n):n,l=ir(r,i,A),c=ir(t,i);for(let u=0;u<c.size;++u){const h=c.indexToLoc(u),f=h.map((d,g)=>d+e[g]);c.set(l.get(...f),...h)}return i==="string"?R_(c.values):c.values}/** 11292 * @license 11293 * Copyright 2021 Google LLC. All Rights Reserved. 11294 * Licensed under the Apache License, Version 2.0 (the "License"); 11295 * you may not use this file except in compliance with the License. 11296 * You may obtain a copy of the License at 11297 * 11298 * http://www.apache.org/licenses/LICENSE-2.0 11299 * 11300 * Unless required by applicable law or agreed to in writing, software 11301 * distributed under the License is distributed on an "AS IS" BASIS, 11302 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11303 * See the License for the specific language governing permissions and 11304 * limitations under the License. 11305 * ============================================================================= 11306 */function _z(n,e,t,r,i,s,a){const o=e[0],A=s[0],l=new Array(A),c=new Array(o),u=e[1];if(A===0){if(o!==0)throw new Error(g_(o));const m=br(t,0),p=br(i,0);return[m,[0,u],p,l,c]}let h=!0,f=0;const d=new Array(A).fill(0);for(let m=0;m<o;++m){const p=n[m*u];if(p<0)throw new Error(y_(m,p));if(p>=A)throw new Error(v_(m,p,A));++d[p],h=h&&p>=f,f=p}let g=!0;for(let m=0;m<A;++m){const p=d[m]===0;l[m]=p,g=g&&!p,d[m]=Math.max(d[m],1),m>0&&(d[m]+=d[m-1])}if(g&&h){const m=n,p=r;for(let w=0;w<o;++w)c[w]=w;return[m,[o,u],p,l,c]}else{const m=d[A-1],p=br(t,m*u),w=br(i,m),C=new Array(A).fill(0);for(let b=0;b<o;++b){const U=n[b*u],F=C[U],D=(U===0?0:d[U-1])+F;C[U]++;for(let O=0;O<u;++O)p[D*u+O]=n[b*u+O];w[D]=r[b],c[b]=D}for(let b=0;b<A;++b)if(C[b]===0){const F=b===0?0:d[b-1];p[F*u+0]=b;for(let D=1;D<u;++D)p[F*u+D]=0;w[F]=a}return[p,[m,u],w,l,c]}}/** 11307 * @license 11308 * Copyright 2021 Google LLC. All Rights Reserved. 11309 * Licensed under the Apache License, Version 2.0 (the "License");
11310 * you may not use this file except in compliance with the License. 11311 * You may obtain a copy of the License at 11312 * 11313 * http://www.apache.org/licenses/LICENSE-2.0 11314 * 11315 * Unless required by applicable law or agreed to in writing, software 11316 * distributed under the License is distributed on an "AS IS" BASIS, 11317 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11318 * See the License for the specific language governing permissions and 11319 * limitations under the License. 11320 * ============================================================================= 11321 */function Bz(n,e,t,r,i){const s=ze(r),a=e[0],o=i.length,A=[];let l=1,c=-1;for(let m=0;m<o;++m){const p=i[m];if(p===-1){if(c!==-1)throw new Error(w_(c,m));c=m,A.push(1)}else{if(p<0)throw new Error(x_(m,p));l*=p,A.push(p)}}if(c!==-1){if(l<=0)throw new Error(b_());const m=Math.trunc(s/l);if(l*m!==s)throw new Error(C_(r,A));A[c]=m}if(ze(A)!==s)throw new Error(__(r,A));const h=r.length,f=[];if(h>0){f[h-1]=1;for(let m=h-2;m>=0;--m)f[m]=f[m+1]*r[m+1]}const d=[];if(o>0){d[o-1]=1;for(let m=o-2;m>=0;--m)d[m]=d[m+1]*A[m+1]}const g=br(t,a*o);for(let m=0;m<a;++m){let p=0;for(let w=0;w<h;++w)p+=n[m*h+w]*f[w];for(let w=0;w<o;++w)g[m*o+w]=Math.trunc(p/d[w]),p%=d[w]}return[g,[a,o],A]}/** 11322 * @license 11323 * Copyright 2021 Google LLC. All Rights Reserved. 11324 * Licensed under the Apache License, Version 2.0 (the "License"); 11325 * you may not use this file except in compliance with the License. 11326 * You may obtain a copy of the License at 11327 * 11328 * http://www.apache.org/licenses/LICENSE-2.0 11329 * 11330 * Unless required by applicable law or agreed to in writing, software 11331 * distributed under the License is distributed on an "AS IS" BASIS, 11332 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11333 * See the License for the specific language governing permissions and 11334 * limitations under the License. 11335 * ============================================================================= 11336 */function Ez(n,e,t,r,i,s=!1,a=0){const o=r.length,A=[e[0],n.length/e[0]],l=A[1],u=o>0?i[o-1]+1:0;if(u<0)throw new Error(d1());const h=e.slice();h[0]=u;const f=h.reduce((C,b)=>C*b,1),d=br(t,f);if(o===0)return u>0&&d.fill(a),[d,h];if(u<=0)throw new Error(d1());let g=0,m=1,p=0,w=i[g];for(;;){let C=0;if(m<o){if(C=i[m],w===C){++m;continue}if(w>=C)throw new Error(B_())}if(w<0||w>=u)throw new Error(E_(w,u));w>p&&d.fill(a,p*l,w*l);for(let b=g;b<m;++b){const U=r[b];if(U<0||U>=A[0])throw new Error(S_(b,r[b],A[0]));for(let F=0;F<l;F++)d[w*l+F]+=n[U*l+F]}if(s)for(let b=0;b<l;b++)d[w*l+b]/=m-g;if(g=m,++m,p=w+1,w=C,m>o)break}return p<u&&d.fill(a,p*l,u*l),[d,h]}/** 11337 * @license 11338 * Copyright 2020 Google LLC. All Rights Reserved. 11339 * Licensed under the Apache License, Version 2.0 (the License); 11340 * you may not use this file except in compliance with the License. 11341 * You may obtain a copy of the License at 11342 * 11343 * http://www.apache.org/licenses/LICENSE-2.0 11344 * 11345 * Unless required by applicable law or agreed to in writing, software 11346 * distributed under the License is distributed on an AS IS BASIS, 11347 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11348 * See the License for the specific language governing permissions and 11349 * limitations under the License. 11350 * ============================================================================= 11351 */const Sz=Da(n=>Math.sqrt(n));/** 11352 * @license 11353 * Copyright 2020 Google LLC. All Rights Reserved. 11354 * Licensed under the Apache License, Version 2.0 (the "License"); 11355 * you may not use this file except in compliance with the License. 11356 * You may obtain a copy of the License at 11357 * 11358 * http://www.apache.org/licenses/LICENSE-2.0 11359 * 11360 * Unless required by applicable law or agreed to in writing, software 11361 * distributed under the License is distributed on an "AS IS" BASIS, 11362 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11363 * See the License for the specific language governing permissions and 11364 * limitations under the License. 11365 * ============================================================================= 11366 */const Tz=fi((n,e)=>{const t=n-e;return t*t});/** 11367 * @license 11368 * Copyright 2023 Google LLC. 11369 * Licensed under the Apache License, Version 2.0 (the "License");
11370 * you may not use this file except in compliance with the License. 11371 * You may obtain a copy of the License at 11372 * 11373 * http://www.apache.org/licenses/LICENSE-2.0 11374 * 11375 * Unless required by applicable law or agreed to in writing, software 11376 * distributed under the License is distributed on an "AS IS" BASIS, 11377 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11378 * See the License for the specific language governing permissions and 11379 * limitations under the License. 11380 * ============================================================================= 11381 */const Iz=Da((n,e)=>{const{pattern:t,replaceGlobal:r,rewrite:i}=e;return n.replace(new RegExp(t,r?"g":""),i)});/** 11382 * @license 11383 * Copyright 2020 Google LLC. All Rights Reserved. 11384 * Licensed under the Apache License, Version 2.0 (the "License"); 11385 * you may not use this file except in compliance with the License. 11386 * You may obtain a copy of the License at 11387 * 11388 * http://www.apache.org/licenses/LICENSE-2.0 11389 * 11390 * Unless required by applicable law or agreed to in writing, software 11391 * distributed under the License is distributed on an "AS IS" BASIS, 11392 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11393 * See the License for the specific language governing permissions and 11394 * limitations under the License. 11395 * ============================================================================= 11396 */function Fz(n,e,t,r){const i=ir(n,e.dtype);for(let s=0;s<i.size;s++){const a=i.indexToLoc(s),o=new Array(a.length);for(let A=0;A<o.length;A++)o[A]=a[A]*t[A]+r[A];i.set(e.get(...o),...a)}return i}/** 11397 * @license 11398 * Copyright 2021 Google LLC. All Rights Reserved. 11399 * Licensed under the Apache License, Version 2.0 (the "License"); 11400 * you may not use this file except in compliance with the License. 11401 * You may obtain a copy of the License at 11402 * 11403 * http://www.apache.org/licenses/LICENSE-2.0 11404 * 11405 * Unless required by applicable law or agreed to in writing, software 11406 * distributed under the License is distributed on an "AS IS" BASIS, 11407 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11408 * See the License for the specific language governing permissions and 11409 * limitations under the License. 11410 * ============================================================================= 11411 */class Rz{constructor(e,t,r,i,s,a){this.separator=nA(e),this.nGramWidths=t,this.leftPad=nA(r),this.rightPad=nA(i),this.padWidth=s,this.preserveShort=
vendor: 5,940 bytes, lines 11411-11474
11411a}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const r=this.getPadWidth(t);return Math.max(0,e+2*r-t+1)}createNGrams(e,t,r,i,s,a){for(let o=0;o<s;++o){const A=this.getPadWidth(a),l=Math.max(0,A-o),c=Math.max(0,A-(s-(o+1))),u=a-(l+c),h=t+(l>0?0:o-A);let f=0;f+=l*this.leftPad.length;for(let w=0;w<u;++w)f+=e[h+w].length;f+=c*this.rightPad.length;const d=l+c+u-1;f+=d*this.separator.length,r[i+o]=new Uint8Array(f);const g=r[i+o];let m=0;const p=w=>w.forEach(C=>g[m++]=C);for(let w=0;w<l;++w)p(this.leftPad),p(this.separator);for(let w=0;w<u-1;++w)p(e[h+w]),p(this.separator);if(u>0){p(e[h+u-1]);for(let w=0;w<c;++w)p(this.separator),p(this.rightPad)}else{for(let w=0;w<c-1;++w)p(this.rightPad),p(this.separator);p(this.rightPad)}}}compute(e,t){const r=e.length,i=t.length;if(i>0){let A=t[0];if(A!==0)throw new Error(`First split value must be 0, got ${A}`);for(let l=1;l<i;++l){let c=t[l]>=A;if(c=c&&t[l]<=r,!c)throw new Error(`Invalid split value ${t[l]}, must be in [${A}, ${r}]`);A=t[l]}if(A!==r)throw new Error(`Last split value must be data size. Expected ${r}, got ${A}`)}const s=i-1,a=br("int32",i);if(r===0||i===0){const A=new Array(r);for(let l=0;l<=s;++l)a[l]=0;return[A,a]}a[0]=0;for(let A=1;A<=s;++A){const l=t[A]-t[A-1];let c=0;this.nGramWidths.forEach(u=>{c+=this.getNumNGrams(l,u)}),this.preserveShort&&l>0&&c===0&&(c=1),a[A]=a[A-1]+c}const o=new Array(a[s]);for(let A=0;A<s;++A){const l=t[A];let c=a[A];if(this.nGramWidths.forEach(u=>{const h=t[A+1]-t[A],f=this.getNumNGrams(h,u);this.createNGrams(e,l,o,c,f,u),c+=f}),this.preserveShort&&c===a[A]){const u=t[A+1]-t[A];if(u===0)continue;const h=u+2*this.padWidth,f=1;this.createNGrams(e,l,o,c,f,h)}}return[o,a]}}function Uz(n,e,t,r,i,s,a,o){return new Rz(t,r,i,s,a,o).compute(n,e)}/** 11412 * @license 11413 * Copyright 2021 Google LLC. All Rights Reserved. 11414 * Licensed under the Apache License, Version 2.0 (the "License"); 11415 * you may not use this file except in compliance with the License. 11416 * You may obtain a copy of the License at 11417 * 11418 * http://www.apache.org/licenses/LICENSE-2.0 11419 * 11420 * Unless required by applicable law or agreed to in writing, software 11421 * distributed under the License is distributed on an "AS IS" BASIS, 11422 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11423 * See the License for the specific language governing permissions and 11424 * limitations under the License. 11425 * ============================================================================= 11426 */function Mz(n,e,t,r){if(!n.length)return;if(e.length===0){for(let s=0;s<n.length;++s)r.push(n.subarray(s,s+1));return}if(e.length===1){const s=e[0];let a=n.indexOf(s);for(;a!==-1;){const o=n.subarray(0,a);(!t||o.length!==0)&&r.push(o),n=n.subarray(a+1),a=n.indexOf(s)}(!t||n.length!==0)&&r.push(n);return}let i=0;for(let s=0;s<n.length+1;s++)if(s===n.length||e.indexOf(n[s])!==-1){const a=n.subarray(i,s);(!t||a.length!==0)&&r.push(a),i=s+1}}function Nz(n,e,t){const r=n.length,i=[];let s=0,a=0;const o=new Array(r);for(let h=0;h<r;++h){const f=i.length;Mz(n[h],e,t,i);const d=i.length-f;o[h]=d,s+=d,a=Math.max(a,d)}const A=br("int32",s*2),l=new Array(s),c=[r,a];let u=0;for(let h=0;h<r;++h)for(let f=0;f<o[h];++f)A[u*2]=h,A[u*2+1]=f,l[u]=i[u],++u;return[A,l,c]}/** 11427 * @license 11428 * Copyright 2021 Google LLC. All Rights Reserved. 11429 * Licensed under the Apache License, Version 2.0 (the "License"); 11430 * you may not use this file except in compliance with the License. 11431 * You may obtain a copy of the License at 11432 * 11433 * http://www.apache.org/licenses/LICENSE-2.0 11434 * 11435 * Unless required by applicable law or agreed to in writing, software 11436 * distributed under the License is distributed on an "AS IS" BASIS, 11437 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11438 * See the License for the specific language governing permissions and 11439 * limitations under the License. 11440 * ============================================================================= 11441 */function Dz(n,e){const t=br("int32",n.length);for(let r=0;r<n.length;++r)t[r]=WM(n[r]).modulo(e).getLowBitsUnsigned();return t}/** 11442 * @license 11443 * Copyright 2020 Google LLC. All Rights Reserved. 11444 * Licensed under the Apache License, Version 2.0 (the "License"); 11445 * you may not use this file except in compliance with the License. 11446 * You may obtain a copy of the License at 11447 * 11448 * http://www.apache.org/licenses/LICENSE-2.0 11449 * 11450 * Unless required by applicable law or agreed to in writing, software 11451 * distributed under the License is distributed on an "AS IS" BASIS, 11452 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11453 * See the License for the specific language governing permissions and 11454 * limitations under the License. 11455 * ============================================================================= 11456 */const Lz=fi((n,e)=>n-e);/** 11457 * @license 11458 * Copyright 2019 Google LLC. All Rights Reserved. 11459 * Licensed under the Apache License, Version 2.0 (the "License"); 11460 * you may not use this file except in compliance with the License. 11461 * You may obtain a copy of the License at 11462 * 11463 * http://www.apache.org/licenses/LICENSE-2.0 11464 * 11465 * Unless required by applicable law or agreed to in writing, software 11466 * distributed under the License is distributed on an "AS IS" BASIS, 11467 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11468 * See the License for the specific language governing permissions and 11469 * limitations under the License. 11470 * ============================================================================= 11471 */function Oz(n,e){const t=new Array(n.rank);for(let i=0;i<t.length;i++)t[i]=n.shape[i]*e[i];const r=ir(t,n.dtype);for(let i=0;i<r.values.length;++i){const s=r.indexToLoc(i),a=new Array(n.rank);for(let A=0;A<a.length;A++)a[A]=s[A]%n.shape[A];const o=n.locToIndex(a);r.values[i]=n.values[o]}return r}/** 11472 * @license 11473 * Copyright 2020 Google LLC. All Rights Reserved. 11474 * Licensed under the Apache License, Version 2.0 (the "License");
11475 * you may not use this file except in compliance with the License. 11476 * You may obtain a copy of the License at 11477 * 11478 * http://www.apache.org/licenses/LICENSE-2.0 11479 * 11480 * Unless required by applicable law or agreed to in writing, software 11481 * distributed under the License is distributed on an "AS IS" BASIS, 11482 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11483 * See the License for the specific language governing permissions and 11484 * limitations under the License. 11485 * ============================================================================= 11486 */const xc=(n,e)=>{const t=e.value-n.value;return t===0?n.index-e.index:t};function nB(n,e,t=0,r=n.length-1){for(;r>t;){if(r-t>600){const o=r-t+1,A=e-t+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*Math.sign(A-o/2),h=Math.max(t,Math.floor(e-A*c/o+u)),f=Math.min(r,Math.floor(e+(o-A)*c/o+u));nB(n,e,h,f)}const i=n[e];let s=t,a=r;for(cc(n,t,e),xc(n[r],i)>0&&cc(n,t,r);s<a;){for(cc(n,s,a),s++,a--;xc(n[s],i)<0;)s=s+1;for(;xc(n[a],i)>0;)a=a-1}xc(n[t],i)===0?cc(n,t,a):(a=a+1,cc(n,a,r)),a<=e&&(t=a+1),e<=a&&(r=a-1)}}function Pz(n,e,t,r,i){const s=e[e.length-1],[a,o]=[n.length/s,s],A=vo(t,a*r),l=vo("int32",a*r);for(let u=0;u<a;u++){const h=u*o,f=n.subarray(h,h+o);let d=new Array(f.length);f.forEach((w,C)=>d[C]={value:w,index:C}),r<d.length&&(nB(d,r),d=d.slice(0,r)),i&&d.sort(xc);const g=u*r,m=A.subarray(g,g+r),p=l.subarray(g,g+r);for(let w=0;w<r;w++)m[w]=d[w].value,p[w]=d[w].index}const c=e.slice();return c[c.length-1]=r,[ir(c,t,A),ir(c,"int32",l)]}/** 11487 * @license 11488 * Copyright 2020 Google LLC. All Rights Reserved. 11489 * Licensed under the Apache License, Version 2.0 (the "License"); 11490 * you may not use this file except in compliance with the License. 11491 * You may obtain a copy of the License at 11492 * 11493 * http://www.apache.org/licenses/LICENSE-2.0 11494 * 11495 * Unless required by applicable law or agreed to in writing, software 11496 * distributed under the License is distributed on an "AS IS" BASIS, 11497 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11498 * See the License for the specific language governing permissions and 11499 * limitations under the License. 11500 * ============================================================================= 11501 */function kz(n,e,t,r){const i=Br(e,t)[0],s=[1,t[0],1];for(let d=0;d<i;d++)s[0]*=t[d];s[1]=t[i];for(let d=i+1;d<t.length;d++)s[2]*=t[d];const a=new Map,o=new Int32Array(t[i]),A=new Fl(s,r,n),l=[],c=s[0]===1&&s[2]===1;for(let d=0;d<t[i];d++){let g;if(c)g=n[d].toString();else{const p=[];for(let w=0;w<s[0];w++)for(let C=0;C<s[2];C++)p.push(A.get(w,d,C));g=p.join(",")}const m=a.get(g);if(m!=null)o[d]=m;else{const p=a.size;a.set(g,p),o[d]=p,l.push(d)}}const u=s.slice();u[1]=a.size;const h=new Fl(u,r);l.forEach((d,g)=>{for(let m=0;m<s[0];m++)for(let p=0;p<s[2];p++)h.set(A.get(m,d,p),m,g,p)});const f=t.slice();return f[i]=u[1],{outputValues:h.values,outputShape:f,indices:o}}/** 11502 * @license 11503 * Copyright 2020 Google LLC. All Rights Reserved. 11504 * Licensed under the Apache License, Version 2.0 (the "License"); 11505 * you may not use this file except in compliance with the License. 11506 * You may obtain a copy of the License at 11507 * 11508 * http://www.apache.org/licenses/LICENSE-2.0 11509 * 11510 * Unless required by applicable law or agreed to in writing, software 11511 * distributed under the License is distributed on an "AS IS" BASIS, 11512 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11513 * See the License for the specific language governing permissions and 11514 * limitations under the License. 11515 * ============================================================================= 11516 */const $z=Object.freeze(Object.defineProperty({__proto__:null,simpleAbsImpl:LG,addImpl:PG,bincountImpl:kG,bincountReduceImpl:$G,bitwiseAndImpl:QG,castImpl:OG,ceilImpl:HG,concatImpl:VG,equalImpl:GG,expImpl:zG,expm1Impl:WG,floorImpl:KG,floorDivImpl:XG,gatherNdImpl:jG,gatherV2Impl:YG,greaterImpl:qG,greaterEqualImpl:JG,lessImpl:ZG,lessEqualImpl:ez,linSpaceImpl:tz,logImpl:nz,maxImpl:rz,maximumImpl:iz,minimumImpl:sz,multiplyImpl:tB,negImpl:az,notEqualImpl:oz,prodImpl:lz,raggedGatherImpl:mz,raggedRangeImpl:gz,raggedTensorToTensorImpl:yz,rangeImpl:vz,rsqrtImpl:wz,scatterImpl:xz,sigmoid
vendor: 5,257 bytes, lines 11516-11586
11516Impl:bz,sliceImpl:Cz,sparseFillEmptyRowsImpl:_z,sparseReshapeImpl:Bz,sparseSegmentReductionImpl:Ez,sqrtImpl:Sz,squaredDifferenceImpl:Tz,staticRegexReplaceImpl:Iz,stridedSliceImpl:Fz,stringNGramsImpl:Uz,stringSplitImpl:Nz,stringToHashBucketFastImpl:Dz,subImpl:Lz,tileImpl:Oz,topKImpl:Pz,transposeImpl:Az,uniqueImpl:kz},Symbol.toStringTag,{value:"Module"}));/** 11517 * @license 11518 * Copyright 2020 Google LLC. All Rights Reserved. 11519 * Licensed under the Apache License, Version 2.0 (the "License"); 11520 * you may not use this file except in compliance with the License. 11521 * You may obtain a copy of the License at 11522 * 11523 * http://www.apache.org/licenses/LICENSE-2.0 11524 * 11525 * Unless required by applicable law or agreed to in writing, software 11526 * distributed under the License is distributed on an "AS IS" BASIS, 11527 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11528 * See the License for the specific language governing permissions and 11529 * limitations under the License. 11530 * ============================================================================= 11531 */const{addImpl:Qz,bincountImpl:rB,bincountReduceImpl:Hz,bitwiseAndImpl:Vz,castImpl:Gz,ceilImpl:zz,concatImpl:Wz,equalImpl:Kz,expImpl:Xz,expm1Impl:jz,floorImpl:Yz,gatherNdImpl:qz,gatherV2Impl:Jz,greaterImpl:Zz,greaterEqualImpl:eW,lessImpl:tW,lessEqualImpl:nW,linSpaceImpl:rW,logImpl:iW,maxImpl:sW,maximumImpl:aW,minimumImpl:oW,multiplyImpl:AW,negImpl:lW,notEqualImpl:cW,prodImpl:uW,raggedGatherImpl:hW,raggedRangeImpl:fW,raggedTensorToTensorImpl:dW,rangeImpl:pW,rsqrtImpl:mW,scatterImpl:gW,sigmoidImpl:yW,simpleAbsImpl:iB,sliceImpl:vW,sparseFillEmptyRowsImpl:wW,sparseReshapeImpl:xW,sparseSegmentReductionImpl:sB,sqrtImpl:bW,staticRegexReplaceImpl:CW,stridedSliceImpl:_W,stringNGramsImpl:BW,stringSplitImpl:EW,stringToHashBucketFastImpl:SW,subImpl:TW,tileImpl:IW,topKImpl:FW,transposeImpl:s2,uniqueImpl:RW}=$z;/** 11532 * @license 11533 * Copyright 2018 Google LLC. All Rights Reserved. 11534 * Licensed under the Apache License, Version 2.0 (the "License"); 11535 * you may not use this file except in compliance with the License. 11536 * You may obtain a copy of the License at 11537 * 11538 * http://www.apache.org/licenses/LICENSE-2.0 11539 * 11540 * Unless required by applicable law or agreed to in writing, software 11541 * distributed under the License is distributed on an "AS IS" BASIS, 11542 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11543 * See the License for the specific language governing permissions and 11544 * limitations under the License. 11545 * ============================================================================= 11546 */function aB(n,e){return["x","y","z","w","u","v"].slice(0,e).map(t=>`${n}.${t}`)}function qr(n,e){return e===1?[n]:aB(n,e)}function UW(n,e){if(n===1)return"rc";let t="";for(let r=0;r<n;r++)t+=e[r],r<n-1&&(t+=",");return t}/** 11547 * @license 11548 * Copyright 2018 Google LLC. All Rights Reserved. 11549 * Licensed under the Apache License, Version 2.0 (the "License"); 11550 * you may not use this file except in compliance with the License. 11551 * You may obtain a copy of the License at 11552 * 11553 * http://www.apache.org/licenses/LICENSE-2.0 11554 * 11555 * Unless required by applicable law or agreed to in writing, software 11556 * distributed under the License is distributed on an "AS IS" BASIS, 11557 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11558 * See the License for the specific language governing permissions and 11559 * limitations under the License. 11560 * ============================================================================= 11561 */class MW{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=Vr(this.outputShape.length),this.rank===0)this.userCode=` 11562 void main() { 11563 setOutput(vec4(getA(), 0., 0., 0.)); 11564 } 11565 `;else{const t=qr("rc",this.rank),r=Mn(this.rank),i=this.getOutOfBoundsCondition(t),s=this.getSetup(t),a=this.getOutput(t);this.userCode=` 11566 void main() { 11567 ${r} rc = getOutputCoords(); 11568 11569 if(${i}) { 11570 setOutput(vec4(0)); 11571 } else { 11572 ${s} 11573 11574 setOutput(vec4(${a})); 11575 } 11576 } 11577 `}}getSourceCoordsArr(e){const t=[];for(let r=0;r<=1;r++)for(let i=0;i<=1;i++){let s=`${r===0?"r":"rp1"}, ${i===0?"c":"cp1"}`;for(let a=2;a<this.rank;a++)s=`${e[e.length-1-a]},`+s;t.push(s)}return t}getOutOfBoundsCondition(e){if(this.rank===1)return`rc > ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let r=this.rank-2;r<this.rank;r++)t+=`${e[r]} >= ${this.enableShapeUniforms?`outShape[${r}]`:this.outputShape[r]}`,r<this.rank-1&&(t+="||");return t}getSetup(e){if(this.rank===1)return"";const t=e.slice(-2),r=this.enableShapeUniforms?`outShape[${this.rank} - 1]`:this.outputShape[this.rank-1],i=this.enableShapeUniforms?`outShape[${this.rank} - 2]`:this.outputShape[this.rank-2];return` 11578 int r = ${t[0]}; 11579 int c = ${t[1]}; 11580 int rp1 = r + 1; 11581 int cp1 = c + 1; 11582 11583 bool cEdge = cp1 >= ${r}; 11584 bool rEdge = rp1 >= ${i}; 11585 `}getOutput(e){const t=this.getSourceCoordsArr(e);return this.rank===1?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${t[0]}), 11586 cEdge ? 0. : getA(${t[1]}),
11587 rEdge ? 0. : getA(${t[2]}), 11588 rEdge || cEdge ? 0. : getA(${t[3]})`}}/** 11589 * @license 11590 * Copyright 2018 Google LLC. All Rights Reserved. 11591 * Licensed under the Apache License, Version 2.0 (the "License"); 11592 * you may not use this file except in compliance with the License. 11593 * You may obtain a copy of the License at 11594 * 11595 * http://www.apache.org/licenses/LICENSE-2.0 11596 * 11597 * Unless required by applicable law or agreed to in writing, software 11598 * distributed under the License is distributed on an "AS IS" BASIS, 11599 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11600 * See the License for the specific language governing permissions and 11601 * limitations under the License. 11602 * ============================================================================= 11603 */class oB{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length);let r="";for(let i=0;i<4;i++){let s="thisRC = rc;";i%2===1&&(s+="thisRC.z += 1;"),i>1&&(s+="thisRC.y += 1;"),r+=` 11604 ${s} 11605 ${i>0?"if(thisRC.y < rows && thisRC.z < cols){":""} 11606 int flatIndex = getFlatIndex(thisRC); 11607 11608 ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); 11609 vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); 11610 11611 result[${i}] = 11612 getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); 11613 ${i>0?"}":""} 11614 `}this.userCode=` 11615 ${NW(t,this.enableShapeUniforms)} 11616 ${this.enableShapeUniforms?r2():n2(e)} 11617 11618 void main() { 11619 ivec3 rc = getOutputCoords(); 11620 11621 vec4 result = vec4(0.); 11622 11623 ivec3 thisRC; 11624 int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]}; 11625 int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]}; 11626 11627 ${r} 11628 11629 setOutput(result); 11630 } 11631 `}}function NW(n,e){return` 11632 ivec3 inputCoordsFromReshapedOutCoords(int index) { 11633 ${e?SV(["r","c","d"],"inputShape"):SA(["r","c","d"],n)} 11634 return ivec3(r, c, d); 11635 } 11636 `}/** 11637 * @license 11638 * Copyright 2017 Google LLC. All Rights Reserved. 11639 * Licensed under the Apache License, Version 2.0 (the "License"); 11640 * you may not use this file except in compliance with the License. 11641 * You may obtain a copy of the License at 11642 * 11643 * http://www.apache.org/licenses/LICENSE-2.0 11644 * 11645 * Unless required by applicable law or agreed to in writing, software 11646 * distributed under the License is distributed on an "AS IS" BASIS, 11647 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11648 * See the License for the specific language governing permissions and 11649 * limitations under the License. 11650 * ============================================================================= 11651 */class DW{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,r){const i=K3(t,r),s=X3(e,i,r);s in this.freeTextures||(this.freeTextures[s]=[]),s in this.usedTextures||(this.usedTextures[s]=[]);const a=W3(e,i,this.gpgpu.gl,this.gpgpu.textureConfig,r);if(this.freeTextures[s].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();const A=this.freeTextures[s].pop();return this.usedTextures[s].push(A),A}let o;return i===Rr.PACKED_2X2_FLOAT32?o=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):i===Rr.PACKED_2X2_FLOAT16?o=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):i===Rr.UNPACKED_FLOAT32?o=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):i===Rr.UNPACKED_FLOAT16?o=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):i===Rr.PACKED_4X1_UNSIGNED_BYTE&&(o=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[s].push(o),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),o}releaseTexture(e,t,r,i){if(this.freeTextures==null)return;const s=K3(r,i),a=X3(t,s,i);a in this.freeTextures||(this.freeTextures[a]=[]);const o=W3(t,s,this.gpgpu.gl,this.gpgpu.textureConfig,i),A=pe().getNumber("WEBGL_DELET
11651E_TEXTURE_THRESHOLD");A!==-1&&this._numBytesAllocated>A?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=o):(this.freeTextures[a].push(e),this.numFreeTextures++,this._numBytesFree+=o),this.numUsedTextures--;const l=this.usedTextures[a],c=l&&l.indexOf(e);if(c==null||c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[c]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(this.freeTextures!=null){for(const e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});for(const e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function LW(n,e){const t=n;if(e===t.R32F)return 4;if(e===t.R16F)return 2;if(e===t.RGBA32F)return 16;if(e===n.RGBA)return 16;if(e===t.RGBA16F)return 8;if(e===t.RGBA8)return 4;throw new Error(`Unknown internal format ${e}`)}function W3(n,e,t,r,i){const s=OW(e,r);let a;if(i){const[A,l]=Wl(n[0],n[1]);a=A*l}else{const[A,l]=wu(n[0],n[1]);a=A*l}const o=LW(t,s);return a*o}function OW(n,e){switch(n){case Rr.PACKED_2X2_FLOAT32:return Z_(e);case Rr.PACKED_2X2_FLOAT16:return eB(e);case Rr.UNPACKED_FLOAT32:return Y_(e);case Rr.UNPACKED_FLOAT16:return q_(e);case Rr.PACKED_4X1_UNSIGNED_BYTE:return J_(e);default:throw new Error(`Unknown physical texture type ${n}`)}}function PW(n){return pe().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?n?Rr.PACKED_2X2_FLOAT32:Rr.UNPACKED_FLOAT32:n?Rr.PACKED_2X2_FLOAT16:Rr.UNPACKED_FLOAT16}function K3(n,e){if(n===Di.UPLOAD)return Rr.PACKED_2X2_FLOAT32;if(n===Di.RENDER||n==null)return PW(e);if(n===Di.DOWNLOAD||n===Di.PIXELS)return Rr.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${n}`)}function X3(n,e,t){return`${n[0]}_${n[1]}_${e}_${t}`}/** 11652 * @license 11653 * Copyright 2017 Google LLC. All Rights Reserved. 11654 * Licensed under the Apache License, Version 2.0 (the "License"); 11655 * you may not use this file except in compliance with the License. 11656 * You may obtain a copy of the License at 11657 * 11658 * http://www.apache.org/licenses/LICENSE-2.0 11659 * 11660 * Unless required by applicable law or agreed to in writing, software 11661 * distributed under the License is distributed on an "AS IS" BASIS, 11662 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11663 * See the License for the specific language governing permissions and 11664 * limitations under the License. 11665 * ============================================================================= 11666 */class Hs{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length),this.userCode=` 11667 float unaryOperation(float x) { 11668 ${t} 11669 } 11670 11671 void main() { 11672 float x = getAAtOutCoords(); 11673 float y = unaryOperation(x); 11674 11675 setOutput(y); 11676 } 11677 `}}const cs="if (isnan(x)) return x;",kW="return x;",j3="return abs(x);",$W="return (x >= 0.0) ? x : (exp(x) - 1.0);",QW=cs+` 11678 return (x < 0.0) ? 0.0 : x; 11679`,HW=cs+` 11680 return (x < 0.0) ? 0.0 : min(6.0, x); 11681`,Ja="return x;",VW="return 1.0 / (1.0 + exp(-1.0 * x));";/** 11682 * @license 11683 * Copyright 2018 Google LLC. All Rights Reserved. 11684 * Licensed under the Apache License, Version 2.0 (the "License"); 11685 * you may not use this file except in compliance with the License. 11686 * You may obtain a copy of the License at 11687 * 11688 * http://www.apache.org/licenses/LICENSE-2.0 11689 * 11690 * Unless required by applicable law or agreed to in writing, softw
vendor: 20,246 bytes, lines 11690-11773
11690are 11691 * distributed under the License is distributed on an "AS IS" BASIS, 11692 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11693 * See the License for the specific language governing permissions and 11694 * limitations under the License. 11695 * ============================================================================= 11696 */const GW="return x;",zW=` 11697 vec4 result; 11698 11699 result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); 11700 result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); 11701 result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); 11702 result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); 11703 11704 return result; 11705`,WW=` 11706 vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); 11707 bvec4 isNaN = isnan(x); 11708 11709 result.r = isNaN.r ? x.r : result.r; 11710 result.g = isNaN.g ? x.g : result.g; 11711 result.b = isNaN.b ? x.b : result.b; 11712 result.a = isNaN.a ? x.a : result.a; 11713 11714 return result; 11715`,KW=` 11716 vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); 11717 bvec4 isNaN = isnan(x); 11718 11719 result.r = isNaN.r ? x.r : result.r; 11720 result.g = isNaN.g ? x.g : result.g; 11721 result.b = isNaN.b ? x.b : result.b; 11722 result.a = isNaN.a ? x.a : result.a; 11723 11724 return result; 11725`,XW="return 1.0 / (1.0 + exp(-1.0 * x));";class so{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length),this.userCode=` 11726 vec4 unaryOperation(vec4 x) { 11727 ${t} 11728 } 11729 11730 void main() { 11731 vec4 x = getAAtOutCoords(); 11732 vec4 y = unaryOperation(x); 11733 11734 setOutput(y); 11735 } 11736 `}}/** 11737 * @license 11738 * Copyright 2018 Google LLC. All Rights Reserved. 11739 * Licensed under the Apache License, Version 2.0 (the "License"); 11740 * you may not use this file except in compliance with the License. 11741 * You may obtain a copy of the License at 11742 * 11743 * http://www.apache.org/licenses/LICENSE-2.0 11744 * 11745 * Unless required by applicable law or agreed to in writing, software 11746 * distributed under the License is distributed on an "AS IS" BASIS, 11747 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11748 * See the License for the specific language governing permissions and 11749 * limitations under the License. 11750 * ============================================================================= 11751 */class jW{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length);const t=e.length,r=qr("rc",t),i=Mn(t),s=UW(t,r),a=r.slice(-2),o=t<=1?"rc":`vec2(${a.join(",")})`;this.userCode=` 11752 void main() { 11753 ${i} rc = getOutputCoords(); 11754 vec4 packedInput = getA(${s}); 11755 11756 setOutput(getChannel(packedInput, ${o})); 11757 } 11758 `}}/** 11759 * @license 11760 * Copyright 2017 Google LLC. All Rights Reserved. 11761 * Licensed under the Apache License, Version 2.0 (the "License"); 11762 * you may not use this file except in compliance with the License. 11763 * You may obtain a copy of the License at 11764 * 11765 * http://www.apache.org/licenses/LICENSE-2.0 11766 * 11767 * Unless required by applicable law or agreed to in writing, software 11768 * distributed under the License is distributed on an "AS IS" BASIS, 11769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11770 * See the License for the specific language governing permissions and 11771 * limitations under the License. 11772 * ============================================================================= 11773 */const YW=vC,qW=1e-7,JW=1e-4,uh={};function ZW(n){return n in uh||(uh[n]={}),uh[n]}const eK=pe().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),tK=600;function nK(){return pe().global.screen==null?1024:pe().global.screen.height*pe().global.screen.width*window.devicePixelRatio*tK/1024/1024}class sd extends sv{nextDataId(){return sd.nextDataId++}constructor(e){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!pe().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let t;if(e!=null){if(e instanceof Cp)t=e;else{const r=Ts(pe().getNumber("WEBGL_VERSION"),e);t=new Cp(r)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{const r=Ts(pe().getNumber("WEBGL_VERSION"));t=new Cp(r),this.binaryCache=ZW(pe().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new DW(this.gpgpu),this.numMBBeforeWarning=nK(),this.texData=new cM(this,Wa())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,t,r,i,s,a){const o=this.makeTensorInfo(t,r),A=this.texData.get(o.dataId);A.isPacked=!1,A.texture={texture:e,texShape:[i,s]},A.texShape=[i,s];const l=lh(t),c=new Q3(l,!1,a),u=this.runWebGLProgram(c,[o],r,[[i,s]]);return u.shape=t,A.texture=null,this.disposeIntermediateTensorInfo(o),u.dataId}write(e,t,r){if((pe().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||pe().getBool("DEBUG"))&&this.checkNumericalProblems(e),r==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const i={id:this.nextDataId()};return this.texData.set(i,{shape:t,dtype:r,values:e,usage:Di.UPLOAD,refCount:1}),i}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){const t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){const t=this.texData.get(e);t.refCount--}}move(e,t,r,i,s){if(pe().getBool("DEBUG")&&this.checkNumericalProblems(t),i==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:r,dtype:i,values:t,usage:Di.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){const t=this.texData.get(e),{values:r,dtype:i,complexTensorInfos:s,slice:a,shape:o,isPacked:A}=t;if(a!=null){let h;A?h=new so(o,Ja):h=new Hs(o,Ja);const f=this.runWebGLProgram(h,[{dataId:e,shape:o,dtype:i}],i),d=this.readSync(f.dataId);return this.disposeIntermediateTensorInfo(f),d}if(r!=null)return this.convertAndCacheOnCPU(e);if(i==="string")return r;const l=this.activeTimers!=null;let c;l&&(c=gs());let u;if(i==="complex64"){const h=this.readSync(s.real.dataId),f=this.readSync(s.imag.dataId);u=f1(h,f)}else u=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=gs()-c),this.convertAndCacheOnCPU(e,u)}async read(e){if(this.pendingRead.has(e)){const d=this.pendingRead.get(e);return new Promise(g=>d.push(g))}const t=this.texData.get(e),{values:r,shape:i,slice:s,dtype:a,complexTensorInfos:o,isPacked:A}=t;if(s!=null){let d;A?d=new so(i,Ja):d=new Hs(i,Ja);const g=this.runWebGLProgram(d,[{dataId:e,shape:i,dtype:a}],a),m=this.read(g.dataId);return this.disposeIntermediateTensorInfo(g),m}if(r!=null)return this.convertAndCacheOnCPU(e);if(pe().getBool("DEBUG")&&!pe().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&pe().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l=null,c;if(a!=="complex64"&&pe().get("WEBGL_BUFFER_SUPPORTED")){c=this.decode(e);const d=this.texData.get(c.dataId);l=this.gpgpu.createBufferFromTexture(d.texture.texture,...ah(i))}this.pendingRead.set(e,[]),a!=="complex64"&&await this.gpgpu.createAndWaitForFence();let u;if(a==="complex64"){const d=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]),g=d[0],m=d[1];u=f1(g,m)}else if(l==null)u=this.getValuesFromTexture(e);else{const d=ze(i);u=this.gpgpu.downloadFloat32MatrixFromBuffer(l,d)}if(c!=null&&this.disposeIntermediateTensorInfo(c),l!=null){const d=this.gpgpu.gl;At(d,()=>d.deleteBuffer(l))}const h=this.convertAndCacheOnCPU(e,u),f=this.pendingRead.get(e);return this.pendingRead.delete(e),f.forEach(d=>d(h)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&Wa().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const r=this.texData.get(e),{values:i,shape:s,slice:a,dtype:o,isPacked:A,texture:l}=r;if(o==="complex64")throw new Error("Does not support reading texture for complex64 dtype.");if(a!=null){let f;A?f=new so(s,Ja):f=new Hs(s,Ja);const d=this.runWebGLProgram(f,[{dataId:e,shape:s,dtype:o}],o),g=this.readToGPU(d,t);return this.disposeIntermediateTensorInfo(d),g}if(l==null)throw i!=null?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const c=this.decode(e,t.customTexShape),u=Wa().makeTensorFromTensorInfo(c),h=this.texData.get(c.dataId);return Object.assign({tensorRef:u},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if(e.dtype==="string")try{const r=t.map(i=>Il(i));return ir(e.shape,e.dtype,r)}catch{throw new Error("Failed to decode encoded string bytes into utf-8")}return ir(e.shape,e.dtype,t)}checkNumericalProblems(e){if(e!=null)for(let t=0;t<e.length;t++){const r=e[t];if(!eV(r))throw pe().getBool("WEBGL_RENDER_FLOAT32_CAPABLE")?Error(`The value ${r} cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'`):Error(`The value ${r} cannot be represented on this device.`)}}getValuesFromTexture(e){const{shape:t,dtype:r,isPacked:i}=this.texData.get(e),s=ze(t);if(pe().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){const h=this.decode(e),f=this.texData.get(h.dataId),d=this.gpgpu.downloadMatrixFromPackedTexture(f.texture.texture,...ah(t)).subarray(0,s);return this.disposeIntermediateTensorInfo(h),d}const a=pe().getBool("WEBGL_PACK")&&i===!0,o=a?lh(t):t,A=a?new mG(o):new pG(o),l=this.runWebGLProgram(A,[{shape:o,dtype:r,dataId:e}],"float32"),c=this.texData.get(l.dataId),u=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(c.texture.texture,c.texShape[0],c.texShape[1]).subarray(0,s);return this.disposeIntermediateTensorInfo(l),u}timerAvailable(){return pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0}time(e){const t=this.activeTimers,r=[];let i=!1;this.programTimersStack==null?(this.programTimersStack=r,i=!0):this.activeTimers.push(r),this.activeTimers=r,e();const s=cA(this.activeTimers.map(A=>A.query)).filter(A=>A!=null),a=cA(this.activeTimers.map(A=>A.name)).filter(A=>A!=null);this.activeTimers=t,i&&(this.programTimersStack=null);const o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const A=await Promise.all(s);o.kernelMs=uM(A),o.getExtraProfileInfo=()=>A.map((l,c)=>({name:a[c],ms:l})).map(l=>`${l.name}: ${l.ms}`).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:gs(),endMs:null}}endTimer(e){return pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=gs(),e)}async getQueryTime(e){if(pe().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:r}=this.texData.get(e);return r!=null&&(this.disposeData(r.real.dataId,t),this.disposeData(r.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:r,texShape:i,usage:s,isPacked:a,slice:o}=this.texData.get(e),A=o&&o.origDataId||e,l=this.dataRefCount.get(A);l>1?this.dataRefCount.set(A,l-1):(this.dataRefCount.delete(A),t!=null&&(this.numBytesInGPU-=this.computeBytes(i,r),this.textureManager.releaseTexture(t,i,s,a)));const c=this.texData.get(e);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=eK){return pe().getBool("WEBGL_CPU_FORWARD")&&e.every(r=>this.texData.get(r.dataId).texture==null&&ze(r.shape)<t)}getGPGPUContext(){return this.gpgpu}where(e){Cs("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");const t=e.dataSync();return YW(e.shape,t)}packedUnaryOp(e,t,r){const i=new so(e.shape,t),s=this.compileAndRun(i,[e],r);return Wa().makeTensorFromTensorInfo(s)}abs(e){if(this.shouldExecuteOnCPU([e])&&e.dtype!=="complex64"){const i=iB(this.texData.get(e.dataId).values);return this.makeOutput(e.shape,e.dtype,i)}if(pe().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,j3,e.dtype);const t=new Hs(e.shape,j3),r=this.compileAndRun(t,[e]);return Wa().makeTensorFromTensorInfo(r)}makeTensorInfo(e,t,r){let i;if(t==="string"&&r!=null&&r.length>0&&Vf(r[0])){const s=r.map(a=>nA(a));i=this.write(s,e,t)}else i=this.write(r,e,t);return this.texData.get(i).usage=null,{dataId:i,shape:e,dtype:t}}makeOutput(e,t,r){return Wa().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,r),this)}unpackTensor(e){const t=new jW(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new MW(e.shape),r=!0;return this.runWebGLProgram(t,[e],e.dtype,null,r)}packedReshape(e,t){const r=[Nl(e.shape),...Dl(e.shape)],i={dtype:e.dtype,shape:r,dataId:e.dataId},s=[Nl(t),...Dl(t)],a=new oB(s,r),o=!0,A=[r],l=this.runWebGLProgram(a,[i],e.dtype,A,o);return{dataId:l.dataId,shape:t,dtype:l.dtype}}decode(e,t){const r=this.texData.get(e),{isPacked:i,shape:s,dtype:a}=r;if(t!=null){const h=ze(s),f=t[0]*t[1]*4;H(h<=f,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}const o=lh(s);let A;i?A=new dG(o):A=new fG(o);const l=!0,c=[t!=null?t:ah(o)],u=this.runWebGLProgram(A,[{shape:o,dtype:a,dataId:e}],a,c,l,t);return{dtype:a,shape:s,dataId:u.dataId}}runWebGLProgram(e,t,r,i,s=!1,a){const o=this.makeTensorInfo(e.outputShape,r),A=this.texData.get(o.dataId);if(e.packedOutput&&(A.isPacked=!0),e.outPackingScheme===tu.DENSE){const p=a!=null?a:ah(e.outputShape);A.texShape=p.map(w=>w*2)}if(e.outTexUsage!=null&&(A.usage=e.outTexUsage),ze(o.shape)===0)return A.values=vo(o.dtype,0),o;const l=[],c=t.map(p=>{if(p.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let w=this.texData.get(p.dataId);if(w.texture==null){if(!e.packedInputs&&ze(p.shape)<=pe().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:p.shape,texData:null,isUniform:!0,uniformValues:w.values};e.packedInputs&&(w.isPacked=!0,w.shape=p.shape)}if(this.uploadToGPU(p.dataId),!!w.isPacked!=!!e.packedInputs)p=w.isPacked?this.unpackTensor(p):this.packTensor(p),l.push(p),w=this.texData.get(p.dataId);else if(w.isPacked&&!Cf(w.shape,p.shape)){const C=p,b=p.shape;p.shape=w.shape,p=this.packedReshape(p,b),l.push(p),w=this.texData.get(p.dataId),C.shape=b}return{shape:p.shape,texData:w,isUniform:!1}});this.uploadToGPU(o.dataId);const u={shape:o.shape,texData:A,isUniform:!1},h=hG(e,c,u),f=this.getAndSaveBinary(h,()=>cG(this.gpgpu,e,c,u)),d=this.activeTimers!=null;let g;d&&(g=this.startTimer()),pe().get("ENGINE_COMPILE_ONLY")||uG(this.gpgpu,f,c,u,i),l.forEach(p=>this.disposeIntermediateTensorInfo(p)),d&&(g=this.endTimer(g),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(g)}));const m=pe().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const p=gs();p-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=p)}if(!pe().getBool("WEBGL_LAZILY_UNPACK")&&A.isPacked&&s===!1){const p=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),p}return o}compileAndRun(e,t,r,i,s=!1){return r=r||t[0].dtype,this.runWebGLProgram(e,t,r,i,s)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(pe().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(t=>{this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram),delete this.binaryCache[t]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement<"u"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=Jt(()=>{if(!pe().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=pe().getBool("DEBUG");pe().set("DEBUG",!1);const t=this.abs(yn(1e-8)).dataSync()[0];if(pe().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?qW:JW}uploadToGPU(e){const t=this.texData.get(e),{shape:r,dtype:i,values:s,texture:a,usage:o,isPacked:A}=t;if(a!=null)return;const l=this.activeTimers!=null;let c;l&&(c=gs());let u=t.texShape;if(u==null&&(u=yV(r,A),t.texShape=u),s!=null){const h=lh(r);let f,d=u[1],g=u[0];const m=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(A||!m)&&([d,g]=Wl(u[0],u[1])),A?f=new yG(h,m):f=new Q3(h,m);const p=m?[g,d]:u,w=this.makeTensorInfo(p,i),C=this.texData.get(w.dataId);m?C.usage=Di.PIXELS:C.usage=Di.UPLOAD,C.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(w.dataId),d,g,s);const b=[[g,d]],U=!0,F=this.runWebGLProgram(f,[w],i,b,U),D=this.texData.get(F.dataId);t.texShape=D.texShape,t.isPacked=D.isPacked,t.usage=D.usage,pe().get("ENGINE_COMPILE_ONLY")?this.disposeData(F.dataId):(t.texture=D.texture,t.values=null,this.texData.delete(F.dataId)),this.disposeIntermediateTensorInfo(w),l&&(this.uploadWaitMs+=gs()-c)}else{const h=this.acquireTexture(u,o,i,A);t.texture=h}}convertAndCacheOnCPU(e,t){const r=this.texData.get(e),{dtype:i}=r;return t!=null&&(r.values=rK(t,i)),r.values}acquireTexture(e,t,r,i){if(this.numBytesInGPU+=this.computeBytes(e,r),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){const s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,i)}computeBytes(e,t){return e[0]*e[1]*lf(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}else{for(const[,t]of Object.entries(this.binaryCache)){const r=new Promise(i=>{try{this.checkCompletion_(t),i(!0)}catch(s){throw s}});e.push(r)}return Promise.all(e)}}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await v$(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(G_(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.")):new Error("Failed to link vertex and fragment shaders.");return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:r,infLoc:i,nanLoc:s,outShapeLocation:a,outShapeStridesLocation:o,outTexShapeLocation:A}=j_(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=r,e.infLoc=i,e.nanLoc=s,e.outShapeLocation=a,e.outShapeStridesLocation=o,e.outTexShapeLocation=A}}createTensorFromGPUData(e,t,r){e.channels=e.channels||"RGBA";const{texture:i,height:s,width:a,channels:o}=e,A=Wa().backend;if(!A.gpgpu.gl.isTexture(i))throw new Error("The texture is invali
11773d. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=A.writeTexture(i,t,r,s,a,o);return Wa().makeTensorFromDataId(l,t,r,A)}}sd.nextDataId=0;function rK(n,e){if(e==="float32"||e==="complex64")return n;if(e==="int32"||e==="bool"){const t=e==="int32"?new Int32Array(n.length):new Uint8Array(n.length);for(let r=0;r<t.length;++r)t[r]=Math.round(n[r]);return t}else throw new Error(`Unknown dtype ${e}`)}/** 11774 * @license 11775 * Copyright 2020 Google Inc. All Rights Reserved. 11776 * Licensed under the Apache License, Version 2.0 (the "License"); 11777 * you may not use this file except in compliance with the License. 11778 * You may obtain a copy of the License at 11779 * 11780 * http://www.apache.org/licenses/LICENSE-2.0 11781 * 11782 * Unless required by applicable law or agreed to in writing, software 11783 * distributed under the License is distributed on an "AS IS" BASIS, 11784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11785 * See the License for the specific language governing permissions and 11786 * limitations under the License. 11787 * ============================================================================= 11788 */pb()&&hN("webgl",()=>new sd,2);/** 11789 * @license 11790 * Copyright 2017 Google LLC. All Rights Reserved. 11791 * Licensed under the Apache License, Version 2.0 (the "License"); 11792 * you may not use this file except in compliance with the License. 11793 * You may obtain a copy of the License at 11794 * 11795 * http://www.apache.org/licenses/LICENSE-2.0 11796 * 11797 * Unless required by applicable law or agreed to in writing, software 11798 * distributed under the License is distributed on an "AS IS" BASIS, 11799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11800 * See the License for the specific language governing permissions and 11801 * limitations under the License. 11802 * ============================================================================= 11803 */const a2=` 11804 if (isnan(a)) return a; 11805 if (isnan(b)) return b; 11806`;class wA{constructor(e,t,r){this.variableNames=["A","B"],this.outputShape=Cn(t,r),this.enableShapeUniforms=Vr(this.outputShape.length),this.userCode=` 11807 float binaryOperation(float a, float b) { 11808 ${e} 11809 } 11810 11811 void main() { 11812 float a = getAAtOutCoords(); 11813 float b = getBAtOutCoords(); 11814 setOutput(binaryOperation(a, b)); 11815 } 11816 `}}/** 11817 * @license 11818 * Copyright 2018 Google LLC. All Rights Reserved. 11819 * Licensed under the Apache License, Version 2.0 (the "License"); 11820 * you may not use this file except in compliance with the License. 11821 * You may obtain a copy of the License at 11822 * 11823 * http://www.apache.org/licenses/LICENSE-2.0 11824 * 11825 * Unless required by applicable law or agreed to in writing, software 11826 * distributed under the License is distributed on an "AS IS" BASIS, 11827 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11828 * See the License for the specific language governing permissions and 11829 * limitations under the License. 11830 * ============================================================================= 11831 */const IA=` 11832 result.r = isNaN.r ? NAN : result.r; 11833 result.g = isNaN.g ? NAN : result.g; 11834 result.b = isNaN.b ? NAN : result.b; 11835 result.a = isNaN.a ? NAN : result.a; 11836`;class ql{constructor(e,t,r,i=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Cn(t,r);const s=this.outputShape.length;this.enableShapeUniforms=Vr(s);let a="";if(i)if(s===0||ze(this.outputShape)===1)a=` 11837 result.y = 0.; 11838 result.z = 0.; 11839 result.w = 0.; 11840 `;else if(a=` 11841 ${Mn(s)} coords = getOutputCoords(); 11842 `,s===1)this.enableShapeUniforms?a+=` 11843 result.y = (coords + 1) >= outShape ? 0. : result.y; 11844 result.z = 0.; 11845 result.w = 0.; 11846 `:a+=` 11847 result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; 11848 result.z = 0.; 11849 result.w = 0.; 11850 `;else{const A=qr("coords",s);this.enableShapeUniforms?a+=` 11851 bool nextRowOutOfBounds = 11852 (${A[s-2]} + 1) >= outShape[${s} - 2]; 11853 bool nextColOutOfBounds = 11854 (${A[s-1]} + 1) >= outShape[${s} - 1]; 11855 result.y = nextColOutOfBounds ? 0. : result.y; 11856 result.z = nextRowOutOfBounds ? 0. : result.z; 11857 result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; 11858 `:a+=` 11859 bool nextRowOutOfBounds = 11860 (${A[s-2]} + 1) >= ${this.outputShape[s-2]}; 11861 bool nextColOutOfBounds = 11862 (${A[s-1]} + 1) >= ${this.outputShape[s-1]}; 11863 result.y = nextColOutOfBounds ? 0. : result.y; 11864 result.z = nextRowOutOfBounds ? 0. : result.z; 11865 result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; 11866 `}this.userCode=` 11867 vec4 binaryOperation(vec4 a, vec4 b) { 11868 ${e} 11869 } 11870 11871 void main() { 11872 vec4 a = getAAtOutCoords(); 11873 vec4 b = getBAtOutCoords(); 11874 11875 vec4 result = binaryOperation(a, b); 11876 ${a} 11877 11878 setOutput(result); 11879 } 11880 `}}/** 11881 * @license 11882 * Copyright 2020 Google LLC. All Rights Reserved. 11883 * Licensed under the Apache License, Version 2.0 (the "License");
11884 * you may not use this file except in compliance with the License. 11885 * You may obtain a copy of the License at 11886 * 11887 * http://www.apache.org/licenses/LICENSE-2.0 11888 * 11889 * Unless required by applicable law or agreed to in writing, software 11890 * distributed under the License is distributed on an "AS IS" BASIS, 11891 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11892 * See the License for the specific language governing permissions and 11893 * limitations under the License. 11894 * ============================================================================= 11895 */function Ei(n){const{inputs:e,backend:t}=n,{x:r}=e;return t.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}const iK={kernelName:Eg,backendName:"webgl",kernelFunc:Ei};/** 11896 * @license 11897 * Copyright 2020 Google LLC. All Rights Reserved. 11898 * Licensed under the Apache License, Version 2.0 (the "License"); 11899 * you may not use this file except in compliance with the License. 11900 * You may obtain a copy of the License at 11901 * 11902 * http://www.apache.org/licenses/LICENSE-2.0 11903 * 11904 * Unless required by applicable law or agreed to in writing, software 11905 * distributed under the License is distributed on an "AS IS" BASIS, 11906 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11907 * See the License for the specific language governing permissions and 11908 * limitations under the License. 11909 * ============================================================================= 11910 */function To(n){const{inputs:e,backend:t}=n,{real:r,imag:i}=e,s=t.makeTensorInfo(r.shape,"complex64"),a=t.texData.get(s.dataId),o=Ei({inputs:{x:r},backend:t}),A=Ei({inputs:{x:i},backend:t});return a.complexTensorInfos={real:o,imag:A},s}const sK={kernelName:Uv,backendName:"webgl",kernelFunc:To};/** 11911 * @license 11912 * Copyright 2020 Google LLC. All Rights Reserved. 11913 * Licensed under the Apache License, Version 2.0 (the "License"); 11914 * you may not use this file except in compliance with the License. 11915 * You may obtain a copy of the License at 11916 * 11917 * http://www.apache.org/licenses/LICENSE-2.0 11918 * 11919 * Unless required by applicable law or agreed to in writing, software 11920 * distributed under the License is distributed on an "AS IS" BASIS, 11921 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11922 * See the License for the specific language governing permissions and 11923 * limitations under the License. 11924 * ============================================================================= 11925 */const AB="return (a < 0.) ? b * a : a;",lB=` 11926 vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));
11927 return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); 11928`;function aK(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{alpha:s}=r,a=t.makeTensorInfo([],"float32",Hl(s,"float32")),o=pe().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ql(lB,i.shape,a.shape):new wA(AB,i.shape,a.shape),A=t.runWebGLProgram(o,[i,a],"float32");return t.disposeIntermediateTensorInfo(a),A}const oK={kernelName:xw,backendName:"webgl",kernelFunc:aK};/** 11929 * @license 11930 * Copyright 2020 Google LLC. All Rights Reserved. 11931 * Licensed under the Apache License, Version 2.0 (the "License"); 11932 * you may not use this file except in compliance with the License. 11933 * You may obtain a copy of the License at 11934 * 11935 * http://www.apache.org/licenses/LICENSE-2.0 11936 * 11937 * Unless required by applicable law or agreed to in writing, software 11938 * distributed under the License is distributed on an "AS IS" BASIS, 11939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11940 * See the License for the specific language governing permissions and 11941 * limitations under the License. 11942 * ============================================================================= 11943 */const cB="return (a < 0.) ? b * a : a;",uB=` 11944 vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));
11945 return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); 11946`;function AK(n){const{inputs:e,backend:t}=n,{x:r,alpha:i}=e,s=pe().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ql(uB,r.shape,i.shape):new wA(cB,r.shape,i.shape);return t.runWebGLProgram(s,[r,i],"float32")}const lK={kernelName:Zw,backendName:"webgl",kernelFunc:AK};/** 11947 * @license 11948 * Copyright 2020 Google LLC. All Rights Reserved. 11949 * Licensed under the Apache License, Version 2.0 (the "License"); 11950 * you may not use this file except in compliance with the License. 11951 * You may obtain a copy of the License at 11952 * 11953 * http://www.apache.org/licenses/LICENSE-2.0 11954 * 11955 * Unless required by applicable law or agreed to in writing, software 11956 * distributed under the License is distributed on an "AS IS" BASIS, 11957 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11958 * See the License for the specific language governing permissions and 11959 * limitations under the License. 11960 * ============================================================================= 11961 */const Jl="if (isnan(x)) return x;";function vn({opSnippet:n,packedOpSnippet:e,cpuKernelImpl:t,dtype:r}){return({inputs:i,backend:s})=>{const{x:a}=i,o=s,A=r||a.dtype;if(o.shouldExecuteOnCPU([a])&&t!=null){const u=o.texData.get(a.dataId),h=t(u.values,A);return o.makeTensorInfo(a.shape,A,h)}const l=pe().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&e!=null;let c;return l?c=new so(a.shape,e):c=new Hs(a.shape,n),o.runWebGLProgram(c,[a],A)}}function Lr({opSnippet:n,packedOpSnippet:e,checkOutOfBounds:t=!1,supportsComplex:r=!1,cpuKernelImpl:i,dtype:s}){return({inputs:a,backend:o})=>{const{a:A,b:l}=a,c=o;if(r&&A.dtype==="complex64"){const d=c.texData.get(A.dataId),g=c.texData.get(l.dataId),[m,p]=[[d.complexTensorInfos.real,g.complexTensorInfos.real],[d.complexTensorInfos.imag,g.complexTensorInfos.imag]].map(C=>{const[b,U]=C,F={dataId:b.dataId,dtype:b.dtype,shape:A.shape},D={dataId:U.dataId,dtype:U.dtype,shape:l.shape},O=new wA(n,A.shape,l.shape);return c.runWebGLProgram(O,[F,D],Ys(b.dtype,U.dtype))}),w=To({inputs:{real:m,imag:p},backend:c});return c.disposeIntermediateTensorInfo(m),c.disposeIntermediateTensorInfo(p),w}const u=s||Ys(A.dtype,l.dtype);if((A.dtype==="string"||l.dtype==="string"||c.shouldExecuteOnCPU([A,l]))&&i!=null){const d=c.texData.get(A.dataId).values,g=c.texData.get(l.dataId).values,m=A.dtype==="string"?Ul(d):d,p=A.dtype==="string"?Ul(g):g,[w,C]=i(A.shape,l.shape,m,p,u),b=c.makeTensorInfo(C,u),U=c.texData.get(b.dataId);return U.values=w,b}const h=pe().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&e!=null;let f;return h?f=new ql(e,A.shape,l.shape,t):f=new wA(n,A.shape,l.shape),c.runWebGLProgram(f,[A,l],u)}}function nu(n,e=!1){if(n==="linear")return e?GW:kW;if(n==="relu")return e?WW:QW;if(n==="elu")return e?zW:$W;if(n==="relu6")return e?KW:HW;if(n==="prelu")return e?uB:cB;if(n==="leakyrelu")return e?lB:AB;if(n==="sigmoid")return e?XW:VW;throw new Error(`Activation ${n} has not been implemented for the WebGL backend.`)}/** 11962 * @license 11963 * Copyright 2018 Google LLC. All Rights Reserved. 11964 * Licensed under the Apache License, Version 2.0 (the "License"); 11965 * you may not use this file except in compliance with the License. 11966 * You may obtain a copy of the License at 11967 * 11968 * http://www.apache.org/licenses/LICENSE-2.0 11969 * 11970 * Unless required by applicable law or agreed to in writing, software 11971 * distributed under the License is distributed on an "AS IS" BASIS, 11972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11973 * See the License for the specific language governing permissions and 11974 * limitations under the License. 11975 * ============================================================================= 11976 */class hB{constructor(e,t,r,i=!1,s=!1,a=!1,o=null,A=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=r,this.enableShapeUniforms=Vr(this.outputShape.length);const c=i?e[1]:e[2],u=Math.ceil(c/2),h=i?"i * 2, rc.y":"rc.y, i * 2",f=s?"rc.z, i * 2":"i * 2, rc.z",d=i?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],g=s?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",p="";o&&(A?m=`vec4 activation(vec4 a) { 11977 vec4 b = getPreluActivationWeightsAtOutCoords(); 11978 ${o} 11979 }`:l?m=`vec4 activation(vec4 a) { 11980 vec4 b = getLeakyreluAlphaAtOutCoords(); 11981 ${o} 11982 }`:m=`vec4 activation(vec4 x) { 11983 ${o} 11984 }`,p="result = activation(result);");const w=a?"result += getBiasAtOutCoords();":"";a&&this.variableNames.push("bias"),A&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let C="rc.x",b="rc.x";e[0]<t[0]?C=`imod(rc.x, ${e[0]})`:t[0]<e[0]&&(b=`imod(rc.x, ${t[0]})`),this.userCode=` 11985 ${m} 11986 // Don't use uniform for sharedDimensionPacked for performance. 11987 const float sharedDimension = ${u}.0; 11988 11989 vec4 dot2x2ARowBCol(ivec3 rc) { 11990 vec4 result = vec4(0); 11991 int batchA = ${C}; 11992 int batchB = ${b}; 11993 for (int i = 0; i < ${u}; i++) { 11994 vec4 a = getMatrixA(batchA, ${h}); 11995 vec4 b = getMatrixB(batchB, ${f}); 11996 11997 // These swizzled products need to be separately added.
11998 // See: https://github.com/tensorflow/tfjs/issues/1735 11999 result += (${d[0]} * ${g[0]}); 12000 result += (${d[1]} * ${g[1]}); 12001 } 12002 return result; 12003 } 12004 12005 void main() { 12006 ivec3 rc = getOutputCoords(); 12007 vec4 result = dot2x2ARowBCol(rc); 12008 12009 ${w} 12010 12011 ${p} 12012 12013 setOutput(result); 12014 } 12015 `}}/** 12016 * @license 12017 * Copyright 2018 Google LLC. All Rights Reserved. 12018 * Licensed under the Apache License, Version 2.0 (the "License"); 12019 * you may not use this file except in compliance with the License. 12020 * You may obtain a copy of the License at 12021 * 12022 * http://www.apache.org/licenses/LICENSE-2.0 12023 * 12024 * Unless required by applicable law or agreed to in writing, software 12025 * distributed under the License is distributed on an "AS IS" BASIS, 12026 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12027 * See the License for the specific language governing permissions and 12028 * limitations under the License. 12029 * ============================================================================= 12030 */const Y3={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"};class q3{constructor(e,t,r){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=Cn(t,r),this.userCode=` 12031 float binaryOpComplex( 12032 float areal, float aimag, float breal, float bimag) { 12033 ${e} 12034 } 12035 12036 void main() { 12037 float areal = getARealAtOutCoords(); 12038 float aimag = getAImagAtOutCoords(); 12039 float breal = getBRealAtOutCoords(); 12040 float bimag = getBImagAtOutCoords(); 12041 setOutput(binaryOpComplex(areal, aimag, breal, bimag)); 12042 } 12043 `}}/** 12044 * @license 12045 * Copyright 2020 Google LLC. All Rights Reserved. 12046 * Licensed under the Apache License, Version 2.0 (the "License"); 12047 * you may not use this file except in compliance with the License. 12048 * You may obtain a copy of the License at 12049 * 12050 * http://www.apache.org/licenses/LICENSE-2.0 12051 * 12052 * Unless required by applicable law or agreed to in writing, software 12053 * distributed under the License is distributed on an "AS IS" BASIS, 12054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12055 * See the License for the specific language governing permissions and 12056 * limitations under the License. 12057 * ============================================================================= 12058 */const J3="return a * b;";function o2(n){const{inputs:e,backend:t}=n,{a:r,b:i}=e,s=Ys(r.dtype,i.dtype);if(r.dtype==="complex64"){const o=t.texData.get(r.dataId),A=t.texData.get(i.dataId),l=new q3(Y3.REAL,r.shape,i.shape),c=new q3(Y3.IMAG,r.shape,i.shape),u=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:r.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:r.shape},{dataId:A.complexTensorInfos.real.dataId,dtype:A.complexTensorInfos.real.dtype,shape:i.shape},{dataId:A.complexTensorInfos.imag.dataId,dtype:A.complexTensorInfos.imag.dtype,shape:i.shape}],h=t.runWebGLProgram(l,u,"float32"),f=t.runWebGLProgram(c,u,"float32"),d=To({input
vendor: 9,024 bytes, lines 12058-12266
12058s:{real:h,imag:f},backend:t});return t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(f),d}if(t.shouldExecuteOnCPU([r,i])){const o=t.texData.get(r.dataId),A=t.texData.get(i.dataId),[l,c]=AW(r.shape,i.shape,o.values,A.values,s),u=t.makeTensorInfo(c,s),h=t.texData.get(u.dataId);return h.values=l,u}let a;return pe().getBool("WEBGL_PACK_BINARY_OPERATIONS")?a=new ql(J3,r.shape,i.shape):a=new wA(J3,r.shape,i.shape),t.runWebGLProgram(a,[r,i],s)}const cK={kernelName:Hw,backendName:"webgl",kernelFunc:o2};/** 12059 * @license 12060 * Copyright 2020 Google LLC. All Rights Reserved. 12061 * Licensed under the Apache License, Version 2.0 (the "License"); 12062 * you may not use this file except in compliance with the License. 12063 * You may obtain a copy of the License at 12064 * 12065 * http://www.apache.org/licenses/LICENSE-2.0 12066 * 12067 * Unless required by applicable law or agreed to in writing, software 12068 * distributed under the License is distributed on an "AS IS" BASIS, 12069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12070 * See the License for the specific language governing permissions and 12071 * limitations under the License. 12072 * ============================================================================= 12073 */function uK(n,e,t){const r=[Nl(n.shape),...Dl(n.shape)],i={dtype:n.dtype,shape:r,dataId:n.dataId},s=[Nl(e),...Dl(e)],a=new oB(s,r),o=!0,A=[r],l=t.runWebGLProgram(a,[i],n.dtype,A,o);return{dataId:l.dataId,shape:e,dtype:l.dtype}}/** 12074 * @license 12075 * Copyright 2020 Google LLC. All Rights Reserved. 12076 * Licensed under the Apache License, Version 2.0 (the "License"); 12077 * you may not use this file except in compliance with the License. 12078 * You may obtain a copy of the License at 12079 * 12080 * http://www.apache.org/licenses/LICENSE-2.0 12081 * 12082 * Unless required by applicable law or agreed to in writing, software 12083 * distributed under the License is distributed on an "AS IS" BASIS, 12084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12085 * See the License for the specific language governing permissions and 12086 * limitations under the License. 12087 * ============================================================================= 12088 */function et(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{shape:s}=r,a=t,o=ze(i.shape),A=fM(s,o),l=ze(A);H(o===l,()=>`The new shape (${A}) has ${l} elements and the old shape (${i.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);const c=a.texData.get(i.dataId);return c.isPacked&&!Cf(i.shape,A)&&!(c.texture!==null&&Cf(c.shape,A))?uK(i,A,a):(a.incRef(i.dataId),{dataId:i.dataId,shape:A,dtype:i.dtype})}const hK={kernelName:Ax,backendName:"webgl",kernelFunc:et};/** 12089 * @license 12090 * Copyright 2020 Google LLC. All Rights Reserved. 12091 * Licensed under the Apache License, Version 2.0 (the "License"); 12092 * you may not use this file except in compliance with the License. 12093 * You may obtain a copy of the License at 12094 * 12095 * http://www.apache.org/licenses/LICENSE-2.0 12096 * 12097 * Unless required by applicable law or agreed to in writing, software 12098 * distributed under the License is distributed on an "AS IS" BASIS, 12099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12100 * See the License for the specific language governing permissions and 12101 * limitations under the License. 12102 * ============================================================================= 12103 */class Z3{constructor(e,t){this.variableNames=["x"];const{windowSize:r,batchSize:i,inSize:s,outSize:a}=e;this.outputShape=[i,a];const o=Math.floor(r/4)*4,A=r%4;let l="sumValue += dot(values, ones);";if(t!=null){const u=1/t;l=`sumValue += dot(values * ${Sl(u)?u.toPrecision(2):u}, ones);`}let c="";s%r>0&&(c=` 12104 if (inIdx < 0 || inIdx >= ${s}) { 12105 return 0.0; 12106 } 12107 `),this.userCode=` 12108 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 12109 12110 float getValue(int batch, int inIdx) { 12111 ${c} 12112 return getX(batch, inIdx); 12113 } 12114 12115 void main() { 12116 ivec2 coords = getOutputCoords(); 12117 int batch = coords[0]; 12118 int outIdx = coords[1]; 12119 int inOffset = outIdx * ${r}; 12120 12121 float sumValue = 0.0; 12122 12123 for (int i = 0; i < ${o}; i += 4) { 12124 int inIdx = inOffset + i; 12125 vec4 values = vec4( 12126 getValue(batch, inIdx), 12127 getValue(batch, inIdx + 1), 12128 getValue(batch, inIdx + 2), 12129 getValue(batch, inIdx + 3) 12130 ); 12131 12132 ${l} 12133 } 12134 12135 int inIdx = inOffset + ${o}; 12136 if (${A===1}) { 12137 vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0); 12138 12139 ${l} 12140 } else if (${A===2}) { 12141 vec4 values = vec4( 12142 getValue(batch, inIdx), 12143 getValue(batch, inIdx + 1), 0.0, 0.0); 12144 12145 ${l} 12146 } else if (${A===3}) { 12147 vec4 values = vec4( 12148 getValue(batch, inIdx), 12149 getValue(batch, inIdx + 1), 12150 getValue(batch, inIdx + 2), 0.0); 12151 12152 ${l} 12153 } 12154 setOutput(sumValue); 12155 } 12156 `}}/** 12157 * @license 12158 * Copyright 2017 Google LLC. All Rights Reserved. 12159 * Licensed under the Apache License, Version 2.0 (the "License"); 12160 * you may not use this file except in compliance with the License. 12161 * You may obtain a copy of the License at 12162 * 12163 * http://www.apache.org/licenses/LICENSE-2.0 12164 * 12165 * Unless required by applicable law or agreed to in writing, software 12166 * distributed under the License is distributed on an "AS IS" BASIS, 12167 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12168 * See the License for the specific language governing permissions and 12169 * limitations under the License. 12170 * ============================================================================= 12171 */class fK{constructor(e,t){this.variableNames=["x"];const{windowSize:r,batchSize:i,inSize:s,outSize:a}=e;this.outputShape=[i,a];let o="0.0",A="";t==="prod"?o="1.0":t==="min"?(o="1.0 / 1e-20",A="min"):t==="max"&&(o="-1.0 / 1e-20",A="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?l="sumValue":t==="prod"?l="prodValue":t==="all"?l="allValue":t==="any"&&(l="anyValue");const c=Math.floor(r/4)*4,u=r%4;let h=` 12172 if (${t==="sum"}) { 12173 sumValue += dot(values, ones); 12174 } else if (${t==="prod"}) { 12175 vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); 12176 prodValue *= tmp[0] * tmp[1]; 12177 } else { 12178 minMaxValue = ${A}(values, minMaxValue); 12179 if (${t==="min"} || ${t==="max"}) { 12180 minMaxValue = ${A}(values, minMaxValue); 12181 bvec4 isNaN = isnan(values); 12182 if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) { 12183 minMaxValue = vec4(NAN); 12184 } 12185 } 12186 } 12187 `,f="vec4";t==="all"?(o="1.0",h=` 12188 bool reducedAllValue = all(values); 12189 float floatedReducedAllValue = float(reducedAllValue); 12190 allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); 12191 `,f="bvec4"):t==="any"&&(o="0.0",h=` 12192 bool reducedAnyValue = any(values); 12193 float floatedReducedAnyValue = float(reducedAnyValue); 12194 anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); 12195 `,f="bvec4");let d="";s%r>0&&(d=` 12196 if (inIdx < 0 || inIdx >= ${s}) { 12197 return initializationValue; 12198 } 12199 `),this.userCode=` 12200 const float initializationValue = ${o}; 12201 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 12202 12203 float getValue(int batch, int inIdx) { 12204 ${d} 12205 return getX(batch, inIdx); 12206 } 12207 12208 void main() { 12209 ivec2 coords = getOutputCoords(); 12210 int batch = coords[0]; 12211 int outIdx = coords[1]; 12212 int inOffset = outIdx * ${r}; 12213 12214 vec4 minMaxValue = vec4(${o}); 12215 float prodValue = 1.0; 12216 float sumValue = 0.0; 12217 float allValue = 1.0; 12218 float anyValue = 0.0; 12219 12220 for (int i = 0; i < ${c}; i += 4) { 12221 int inIdx = inOffset + i; 12222 ${f} values = ${f}( 12223 getValue(batch, inIdx), 12224 getValue(batch, inIdx + 1), 12225 getValue(batch, inIdx + 2), 12226 getValue(batch, inIdx + 3) 12227 ); 12228 12229 ${h} 12230 } 12231 12232 int inIdx = inOffset + ${c}; 12233 if (${u===1}) { 12234 ${f} values = ${f}( 12235 getValue(batch, inIdx), 12236 initializationValue, 12237 initializationValue, 12238 initializationValue 12239 ); 12240 12241 ${h} 12242 } else if (${u===2}) { 12243 ${f} values = ${f}( 12244 getValue(batch, inIdx), 12245 getValue(batch, inIdx + 1), 12246 initializationValue, 12247 initializationValue 12248 ); 12249 12250 ${h} 12251 } else if (${u===3}) { 12252 ${f} values = ${f}( 12253 getValue(batch, inIdx), 12254 getValue(batch, inIdx + 1), 12255 getValue(batch, inIdx + 2), 12256 initializationValue 12257 ); 12258 12259 ${h} 12260 } 12261 setOutput(${l}); 12262 } 12263 `}}/** 12264 * @license 12265 * Copyright 2020 Google LLC. All Rights Reserved. 12266 * Licensed under the Apache License, Version 2.0 (the "License");
12267 * you may not use this file except in compliance with the License. 12268 * You may obtain a copy of the License at 12269 * 12270 * http://www.apache.org/licenses/LICENSE-2.0 12271 * 12272 * Unless required by applicable law or agreed to in writing, software 12273 * distributed under the License is distributed on an "AS IS" BASIS, 12274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12275 * See the License for the specific language governing permissions and 12276 * limitations under the License. 12277 * ============================================================================= 12278 */function dK(n){const e=[];for(;e.length===0||e[e.length-1].outSize!==1;){const t=e.length?e[e.length-1].outSize:n[1],r=rd(t);e.push({inSize:t,windowSize:r,outSize:Math.ceil(t/r)})}return e}function FA(n,e,t,r){const i=dK(n.shape);let s=n;for(let a=0;a<i.length;a++){const{inSize:o,windowSize:A,outSize:l}=i[a];let c,u;t==="mean"?c=a===0?new Z3({windowSize:A,inSize:o,batchSize:n.shape[0],outSize:l},o):new Z3({windowSize:A,inSize:o,batchSize:n.shape[0],outSize:l}):c=new fK({windowSize:A,inSize:o,batchSize:n.shape[0],outSize:l},t),u=s,s=r.runWebGLProgram(c,[s],e),u.dataId!==n.dataId&&r.disposeIntermediateTensorInfo(u)}return s}/** 12279 * @license 12280 * Copyright 2017 Google LLC. All Rights Reserved. 12281 * Licensed under the Apache License, Version 2.0 (the "License"); 12282 * you may not use this file except in compliance with the License. 12283 * You may obtain a copy of the License at 12284 * 12285 * http://www.apache.org/licenses/LICENSE-2.0 12286 * 12287 * Unless required by applicable law or agreed to in writing, software 12288 * distributed under the License is distributed on an "AS IS" BASIS, 12289 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12290 * See the License for the specific language governing permissions and 12291 * limitations under the License. 12292 * ============================================================================= 12293 */class pK{constructor(e,t){this.variableNames=["A"];const r=new Array(e.length);for(let a=0;a<r.length;a++)r[a]=e[t[a]];this.outputShape=r,this.rank=r.length;const i=Mn(this.rank),s=mK(t);this.userCode=` 12294 void main() { 12295 ${i} resRC = getOutputCoords(); 12296 setOutput(getA(${s})); 12297 } 12298 `}}function mK(n){const e=n.length;if(e>6)throw Error(`Transpose for rank ${e} is not yet supported`);const t=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(e);for(let i=0;i<n.length;i++)r[n[i]]=t[i];return r.join()}/** 12299 * @license 12300 * Copyright 2019 Google LLC. All Rights Reserved. 12301 * Licensed under the Apache License, Version 2.0 (the "License"); 12302 * you may not use this file except in compliance with the License. 12303 * You may obtain a copy of the License at 12304 * 12305 * http://www.apache.org/licenses/LICENSE-2.0 12306 * 12307 * Unless required by applicable law or agreed to in writing, software 12308 * distributed under the License is distributed on an "AS IS" BASIS, 12309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12310 * See the License for the specific language governing permissions and 12311 * limitations under the License. 12312 * ============================================================================= 12313 */class gK{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;const r=new Array(e.length);for(let c=0;c<r.length;c++)r[c]=e[t[c]];if(this.outputShape=r,this.rank=r.length,this.rank>6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const i=Mn(this.rank),s=aB("rc",this.rank),a=new Array(this.rank);for(let c=0;c<t.length;c++)a[t[c]]=s[c];const o=`vec2(${a.slice(-2).join()})`,A=`++${s[this.rank-1]} < ${r[this.rank-1]}`,l=`getChannel(getA(${a.join()}), ${o})`;this.userCode=` 12314 void main() { 12315 ${i} rc = getOutputCoords(); 12316 vec4 result = vec4(0.); 12317 result[0] = ${l}; 12318 if(${A}) { 12319 result[1] = ${l}; 12320 } 12321 --${s[this.rank-1]}; 12322 if(++${s[this.rank-2]} < ${r[this.rank-2]}) { 12323 result[2] = ${l}; 12324 if(${A}) { 12325 result[3] = ${l}; 12326 } 12327 } 12328 setOutput(result); 12329 } 12330 `}}/** 12331 * @license 12332 * Copyright 2020 Google LLC. All Rights Reserved. 12333 * Licensed under the Apache License, Version 2.0 (the "License");
12334 * you may not use this file except in compliance with the License. 12335 * You may obtain a copy of the License at 12336 * 12337 * http://www.apache.org/licenses/LICENSE-2.0 12338 * 12339 * Unless required by applicable law or agreed to in writing, software 12340 * distributed under the License is distributed on an "AS IS" BASIS, 12341 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12342 * See the License for the specific language governing permissions and 12343 * limitations under the License. 12344 * ============================================================================= 12345 */function ad(n,e,t){const r=pe().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new gK(n.shape,e):new pK(n.shape,e);return t.runWebGLProgram(r,[n],n.dtype)}/** 12346 * @license 12347 * Copyright 2020 Google LLC. All Rights Reserved. 12348 * Licensed under the Apache License, Version 2.0 (the "License"); 12349 * you may not use this file except in compliance with the License. 12350 * You may obtain a copy of the License at 12351 * 12352 * http://www.apache.org/licenses/LICENSE-2.0 12353 * 12354 * Unless required by applicable law or agreed to in writing, software 12355 * distributed under the License is distributed on an "AS IS" BASIS, 12356 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12357 * See the License for the specific language governing permissions and 12358 * limitations under the License. 12359 * ============================================================================= 12360 */function yK(n,e,t,r){const i=e,s=n.shape.length,a=Br(i,n.shape);let o=a;const A=As(o,s),l=A!=null;let c=n;l&&(c=ad(n,A,r),o=ls(o.length,s)),Ms("sum",o,s);const[u,h]=Zs(c.shape,o);let f=u;t&&(f=Qi(u,a));const d=ze(h),m=ze(n.shape)/d,p=et({inputs:{x:c},attrs:{shape:[m,d]},backend:r}),w=Ig(n.dtype),C=FA(p,w,"sum",r),b=et({inputs:{x:C},attrs:{shape:f},backend:r});return r.disposeIntermediateTensorInfo(p),r.disposeIntermediateTensorInfo(C),l&&r.disposeIntermediateTensorInfo(c),b}/** 12361 * @license 12362 * Copyright 2020 Google LLC. All Rights Reserved. 12363 * Licensed under the Apache License, Version 2.0 (the "License"); 12364 * you may not use this file except in compliance with the License. 12365 * You may obtain a copy of the License at 12366 * 12367 * http://www.apache.org/licenses/LICENSE-2.0 12368 * 12369 * Unless required by applicable law or agreed to in writing, software 12370 * distributed under the License is distributed on an "AS IS" BASIS, 12371 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12372 * See the License for the specific language governing permissions and 12373 * limitations under the License. 12374 * ============================================================================= 12375 */function od(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,keepDims:a}=r;return yK(i,s,a,t)}const vK={kernelName:Sx,backendName:"webgl",kernelFunc:od};/** 12376 * @license 12377 * Copyright 2020 Google LLC. All Rights Reserved. 12378 * Licensed under the Apache License, Version 2.0 (the "License"); 12379 * you may not use this file except in compliance with the License. 12380 * You may obtain a copy of the License at 12381 * 12382 * http://www.apache.org/licenses/LICENSE-2.0 12383 * 12384 * Unless required by applicable law or agreed to in writing, software 12385 * distributed under the License is distributed on an "AS IS" BASIS, 12386 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12387 * See the License for the specific language governing permissions and 12388 * limitations under the License. 12389 * ============================================================================= 12390 */function Jr(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{perm:s}=r,a=t,o=i.shape.length,A=new Array(o);for(let c=0;c<A.length;c++)A[c]=i.shape[s[c]];let l;if(a.shouldExecuteOnCPU([i])){const u=a.texData.get(i.dataId).values,h=s2(u,i.shape,i.dtype,s,A);l=a.makeTensorInfo(A,i.dtype);const f=a.texData.get(l.dataId);f.values=h}else l=ad(i,s,a);return l}const wK={kernelName:Wh,backendName:"webgl",kernelFunc:Jr};/** 12391 * @license 12392 * Copyright 2020 Google LLC. All Rights Reserved. 12393 * Licensed under the Apache License, Version 2.0 (the "License"); 12394 * you may not use this file except in compliance with the License. 12395 * You may obtain a copy of the License at 12396 * 12397 * http://www.apache.org/licenses/LICENSE-2.0 12398 * 12399 * Unless required by applicable law or agreed to in writing, softw
12399are 12400 * distributed under the License is distributed on an "AS IS" BASIS, 12401 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12402 * See the License for the specific language governing permissions and 12403 * limitations under the License. 12404 * ============================================================================= 12405 */const fB=1e3;function Bf({a:n,b:e,transposeA:t,transposeB:r,backend:i,bias:s=null,preluActivationWeights:a=null,leakyreluAlpha:o=0,activation:A=null}){const l=n.shape.length,c=e.shape.length,u=t?n.shape[l-2]:n.shape[l-1],h=r?e.shape[c-1]:e.shape[c-2],f=t?n.shape[l-1]:n.shape[l-2],d=r?e.shape[c-2]:e.shape[c-1],g=n.shape.slice(0,-2),m=e.shape.slice(0,-2),p=ze(g),w=ze(m),b=Cn(n.shape.slice(0,-2),e.shape.slice(0,-2)).concat([f,d]);H(u===h,()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${n.shape} and ${e.shape} and transposeA=${t} and transposeB=${r} must match.`);const U=t?[p,u,f]:[p,f,u],F=r?[w,d,h]:[w,h,d],D=et({inputs:{x:n},backend:i,attrs:{shape:U}}),O=et({inputs:{x:e},backend:i,attrs:{shape:F}}),I=[D,O],R=Math.max(p,w),V=t?D.shape[1]:D.shape[2],re=s!=null,Y=a!=null,se=A==="leakyrelu",ge=A!=null?nu(A,!0):null,ue=re||Y||se||ge!=null;let Ce;if((f===1||d===1)&&V>fB&&ue===!1){let we=D,Pe=O;t&&(we=Jr({inputs:{x:D},backend:i,attrs:{perm:[0,2,1]}}),I.push(we)),r&&(Pe=Jr({inputs:{x:O},backend:i,attrs:{perm:[0,2,1]}}),I.push(Pe));const $e=d!==1,yt=d===1;let Dt=we;$e&&(Dt=et({inputs:{x:we},backend:i,attrs:{shape:[R,V,1]}}),I.push(Dt));const Be=d===1?2:1;let De=Pe;yt&&(De=et({inputs:{x:Pe},backend:i,attrs:{shape:[R,1,V]}}),I.push(De));const je=o2({inputs:{a:Dt,b:De},backend:i});Ce=od({inputs:{x:je},backend:i,attrs:{axis:Be,keepDims:!0}}),I.push(je)}else{const we=Ys(n.dtype,e.dtype),Pe=new hB(U,F,[R,f,d],t,r,re,ge,Y,se),$e=[D,O];if(s!=null&&$e.push(s),Y&&$e.push(a),se){const yt=i.makeTensorInfo([],"float32",Hl(o,"float32"));$e.push(yt),I.push(yt)}Ce=i.runWebGLProgram(Pe,$e,we)}const ae=et({inputs:{x:Ce},backend:i,attrs:{shape:b}});I.push(Ce);for(const we of I)i.disposeIntermediateTensorInfo(we);return ae}/** 12406 * @license 12407 * Copyright 2020 Google LLC. All Rights Reserved. 12408 * Licensed under the Apache License, Version 2.0 (the License); 12409 * you may not use this file except in compliance with the License. 12410 * You may obtain a copy of the License at 12411 * 12412 * http://www.apache.org/licenses/LICENSE-2.0 12413 * 12414 * Unless required by applicable law or agreed to in writing, software 12415 * distributed under the License is distributed on an AS IS BASIS, 12416 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12417 * See the License for the specific language governing permissions and 12418 * limitations under the License. 12419 * ============================================================================= 12420 */function xK(n){const{inputs:e,backend:t,attrs:r}=n,{a:i,b:s,bias:a,preluActivationWeights:o}=e,{transposeA:A,transposeB:l,activation:c,leakyreluAlpha:u}=r;return Bf({a:i,b:s,transposeA:A,transposeB:l,backend:t,bias:a,preluActivationWeights:o,leakyreluAlpha:u,activation:c})}const bK={kernelName:Wm,backendName:"webgl",kernelFunc:xK};/** 12421 * @license 12422 * Copyright 2020 Google LLC. All Rights Reserved. 12423 * Licensed under the Apache License, Version 2.0 (the "License"); 12424 * you may not use this file except in compliance with the License. 12425 * You may obtain a copy of the License at 12426 * 12427 * http://www.apache.org/licenses/LICENSE-2.0 12428 * 12429 * Unless required by applicable law or agreed to in writing, software 12430 * distributed under the License is distributed on an "AS IS" BASIS, 12431 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12432 * See the License for the specific language governing permissions and 12433 * limitations under the License. 12434 * ============================================================================= 12435 */const e4="return abs(x);";function CK(n){const{inputs:e,backend:t}=n,{x:r}=e;if(t.shouldExecuteOnCPU([r])&&r.dtype!=="complex64"){const s=t.texData.get(r.dataId),a=iB(s.values);return t.makeTensorInfo(r.shape,r.dtype,a)}let i;
vendor: 4,204 bytes, lines 12435-12519
12435return pe().getBool("WEBGL_PACK_UNARY_OPERATIONS")?i=new so(r.shape,e4):i=new Hs(r.shape,e4),t.runWebGLProgram(i,[r],r.dtype)}const _K={kernelName:cv,backendName:"webgl",kernelFunc:CK};/** 12436 * @license 12437 * Copyright 2020 Google LLC. All Rights Reserved. 12438 * Licensed under the Apache License, Version 2.0 (the "License"); 12439 * you may not use this file except in compliance with the License. 12440 * You may obtain a copy of the License at 12441 * 12442 * http://www.apache.org/licenses/LICENSE-2.0 12443 * 12444 * Unless required by applicable law or agreed to in writing, software 12445 * distributed under the License is distributed on an "AS IS" BASIS, 12446 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12447 * See the License for the specific language governing permissions and 12448 * limitations under the License. 12449 * ============================================================================= 12450 */const BK=cs+` 12451 if (abs(x) > 1.) { 12452 return NAN; 12453 } 12454 return acos(x); 12455`,EK=vn({opSnippet:BK}),SK={kernelName:uv,backendName:"webgl",kernelFunc:EK};/** 12456 * @license 12457 * Copyright 2020 Google LLC. All Rights Reserved. 12458 * Licensed under the Apache License, Version 2.0 (the "License"); 12459 * you may not use this file except in compliance with the License. 12460 * You may obtain a copy of the License at 12461 * 12462 * http://www.apache.org/licenses/LICENSE-2.0 12463 * 12464 * Unless required by applicable law or agreed to in writing, software 12465 * distributed under the License is distributed on an "AS IS" BASIS, 12466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12467 * See the License for the specific language governing permissions and 12468 * limitations under the License. 12469 * ============================================================================= 12470 */const TK=cs+` 12471 if (x < 1.0) return NAN; 12472return log(x + sqrt(x * x - 1.0));`,IK=vn({opSnippet:TK}),FK={kernelName:hv,backendName:"webgl",kernelFunc:IK};/** 12473 * @license 12474 * Copyright 2020 Google LLC. All Rights Reserved. 12475 * Licensed under the Apache License, Version 2.0 (the "License"); 12476 * you may not use this file except in compliance with the License. 12477 * You may obtain a copy of the License at 12478 * 12479 * http://www.apache.org/licenses/LICENSE-2.0 12480 * 12481 * Unless required by applicable law or agreed to in writing, software 12482 * distributed under the License is distributed on an "AS IS" BASIS, 12483 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12484 * See the License for the specific language governing permissions and 12485 * limitations under the License. 12486 * ============================================================================= 12487 */const t4="return a + b;",RK=Lr({opSnippet:t4,packedOpSnippet:t4,supportsComplex:!0,cpuKernelImpl:Qz}),UK={kernelName:_g,backendName:"webgl",kernelFunc:RK};/** 12488 * @license 12489 * Copyright 2019 Google LLC. All Rights Reserved. 12490 * Licensed under the Apache License, Version 2.0 (the "License"); 12491 * you may not use this file except in compliance with the License. 12492 * You may obtain a copy of the License at 12493 * 12494 * http://www.apache.org/licenses/LICENSE-2.0 12495 * 12496 * Unless required by applicable law or agreed to in writing, software 12497 * distributed under the License is distributed on an "AS IS" BASIS, 12498 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12499 * See the License for the specific language governing permissions and 12500 * limitations under the License. 12501 * ============================================================================= 12502 */class MK{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((s,a)=>`T${a}`);const r=[];this.variableNames.forEach(s=>{r.push(`float v${s} = get${s}AtOutCoords();`)});const i=this.variableNames.map(s=>`v${s}`).join(" + ");this.userCode=` 12503 void main() { 12504 ${r.join(` 12505 `)} 12506 12507 float result = ${i}; 12508 setOutput(result); 12509 } 12510 `}}/** 12511 * @license 12512 * Copyright 2019 Google LLC. All Rights Reserved. 12513 * Licensed under the Apache License, Version 2.0 (the "License"); 12514 * you may not use this file except in compliance with the License. 12515 * You may obtain a copy of the License at 12516 * 12517 * http://www.apache.org/licenses/LICENSE-2.0 12518 * 12519 * Unless required by applicable law or agreed to in writing, softw
12519are 12520 * distributed under the License is distributed on an "AS IS" BASIS, 12521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12522 * See the License for the specific language governing permissions and 12523 * limitations under the License. 12524 * ============================================================================= 12525 */class NK{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((s,a)=>`T${a}`);const r=[];this.variableNames.forEach(s=>{r.push(`vec4 v${s} = get${s}AtOutCoords();`)});const i=this.variableNames.map(s=>`v${s}`).join(" + ");this.userCode=` 12526 void main() { 12527 ${r.join(` 12528 `)} 12529 12530 vec4 result = ${i}; 12531 setOutput(result); 12532 } 12533 `}}/** 12534 * @license 12535 * Copyright 2020 Google LLC. All Rights Reserved. 12536 * Licensed under the Apache License, Version 2.0 (the "License"); 12537 * you may not use this file except in compliance with the License. 12538 * You may obtain a copy of the License at 12539 * 12540 * http://www.apache.org/licenses/LICENSE-2.0 12541 * 12542 * Unless required by applicable law or agreed to in writing, software 12543 * distributed under the License is distributed on an "AS IS" BASIS, 12544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12545 * See the License for the specific language governing permissions and 12546 * limitations under the License. 12547 * ============================================================================= 12548 */function Yh(n){const{inputs:e,backend:t}=n,r=e;if(r.length===1)return Ei({inputs:{x:r[0]},backend:t});if(r.length>pe().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const A=Math.floor(r.length/2),l=Yh({inputs:r.slice(0,A),backend:t}),c=Yh({inputs:r.slice(A),backend:t});
vendor: 4,631 bytes, lines 12548-12616
12548return Yh({inputs:[l,c],backend:t})}const i=r.map(A=>A.dtype).reduce((A,l)=>Ys(A,l)),s=r.map(A=>A.shape),o=pe().getBool("WEBGL_PACK")?new NK(r[0].shape,s):new MK(r[0].shape,s);return t.runWebGLProgram(o,r,i)}const DK={kernelName:fv,backendName:"webgl",kernelFunc:Yh};/** 12549 * @license 12550 * Copyright 2020 Google LLC. All Rights Reserved. 12551 * Licensed under the Apache License, Version 2.0 (the "License"); 12552 * you may not use this file except in compliance with the License. 12553 * You may obtain a copy of the License at 12554 * 12555 * http://www.apache.org/licenses/LICENSE-2.0 12556 * 12557 * Unless required by applicable law or agreed to in writing, software 12558 * distributed under the License is distributed on an "AS IS" BASIS, 12559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12560 * See the License for the specific language governing permissions and 12561 * limitations under the License. 12562 * ============================================================================= 12563 */function LK(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,keepDims:a}=r,o=i.shape.length,A=Br(s,i.shape);let l=A;const c=As(l,o);let u=i;c!=null&&(u=Jr({inputs:{x:i},backend:t,attrs:{perm:c}}),l=ls(l.length,o)),Ms("all",l,o);const[h,f]=Zs(u.shape,l),d=ze(f),g=et({inputs:{x:u},backend:t,attrs:{shape:[-1,d]}}),m=FA(g,g.dtype,"all",t);let p;if(a){const w=Qi(h,A);p=et({inputs:{x:m},backend:t,attrs:{shape:w}})}else p=et({inputs:{x:m},backend:t,attrs:{shape:h}});return t.disposeIntermediateTensorInfo(g),t.disposeIntermediateTensorInfo(m),c!=null&&t.disposeIntermediateTensorInfo(u),p}const OK={kernelName:dv,backendName:"webgl",kernelFunc:LK};/** 12564 * @license 12565 * Copyright 2020 Google LLC. All Rights Reserved. 12566 * Licensed under the Apache License, Version 2.0 (the "License"); 12567 * you may not use this file except in compliance with the License. 12568 * You may obtain a copy of the License at 12569 * 12570 * http://www.apache.org/licenses/LICENSE-2.0 12571 * 12572 * Unless required by applicable law or agreed to in writing, software 12573 * distributed under the License is distributed on an "AS IS" BASIS, 12574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12575 * See the License for the specific language governing permissions and 12576 * limitations under the License. 12577 * ============================================================================= 12578 */function PK(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,keepDims:a}=r,o=i.shape.length,A=Br(s,i.shape);let l=A;const c=As(l,o);let u=i;c!=null&&(u=Jr({inputs:{x:i},backend:t,attrs:{perm:c}}),l=ls(l.length,o)),Ms("any",l,o);const[h,f]=Zs(u.shape,l),d=ze(f),g=et({inputs:{x:u},backend:t,attrs:{shape:[-1,d]}}),m=FA(g,g.dtype,"any",t);let p;if(a){const w=Qi(h,A);p=et({inputs:{x:m},backend:t,attrs:{shape:w}})}else p=et({inputs:{x:m},backend:t,attrs:{shape:h}});return t.disposeIntermediateTensorInfo(g),t.disposeIntermediateTensorInfo(m),c!=null&&t.disposeIntermediateTensorInfo(u),p}const kK={kernelName:pv,backendName:"webgl",kernelFunc:PK};/** 12579 * @license 12580 * Copyright 2017 Google LLC. All Rights Reserved. 12581 * Licensed under the Apache License, Version 2.0 (the "License"); 12582 * you may not use this file except in compliance with the License. 12583 * You may obtain a copy of the License at 12584 * 12585 * http://www.apache.org/licenses/LICENSE-2.0 12586 * 12587 * Unless required by applicable law or agreed to in writing, software 12588 * distributed under the License is distributed on an "AS IS" BASIS, 12589 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12590 * See the License for the specific language governing permissions and 12591 * limitations under the License. 12592 * ============================================================================= 12593 */class $K{constructor(e,t,r){this.variableNames=["A"];const{windowSize:i,batchSize:s,outSize:a}=e;r||this.variableNames.push("bestIndicesA"),this.outputShape=[s,a];const o=t==="max"?">":"<",A=r?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` 12594 void main() { 12595 ivec2 coords = getOutputCoords(); 12596 int batch = coords[0]; 12597 int outIdx = coords[1]; 12598 int inOffset = outIdx * ${i}; 12599 12600 int bestIndex = inOffset; 12601 float bestValue = getA(batch, bestIndex); 12602 12603 for (int i = 0; i < ${i}; i++) { 12604 int inIdx = ${A}; 12605 float candidate = getA(batch, inIdx); 12606 if (candidate ${o} bestValue) { 12607 bestValue = candidate; 12608 bestIndex = inIdx; 12609 } 12610 } 12611 setOutput(float(bestIndex)); 12612 } 12613 `}}/** 12614 * @license 12615 * Copyright 2019 Google LLC. All Rights Reserved. 12616 * Licensed under the Apache License, Version 2.0 (the "License");
12617 * you may not use this file except in compliance with the License. 12618 * You may obtain a copy of the License at 12619 * 12620 * http://www.apache.org/licenses/LICENSE-2.0 12621 * 12622 * Unless required by applicable law or agreed to in writing, software 12623 * distributed under the License is distributed on an "AS IS" BASIS, 12624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12625 * See the License for the specific language governing permissions and 12626 * limitations under the License. 12627 * ============================================================================= 12628 */class QK{constructor(e,t,r,i){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,H(e.length>2,()=>`Packed arg${r.charAt(0).toUpperCase()+r.slice(1)} supports only inputs with rank above 2.`);const s=e[e.length-1],a=Math.ceil(s/t);this.outputShape=e.slice(0,-1),a>1&&this.outputShape.push(a),i||this.variableNames.push("bestIndicesA");const o=this.outputShape,A=o.length,l=Mn(A),c=qr("coords",A);let u,h;if(a===1){h=A+1;const O=Mn(h);u=` 12629 ${O} sourceLocR = ${O}(${c.join()}, 0); 12630 ++${c[A-1]}; 12631 ${O} sourceLocG = ${O}(${c.join()}, 0); 12632 ++${c[A-2]}; 12633 ${O} sourceLocA = ${O}(${c.join()}, 0); 12634 --${c[A-1]}; 12635 ${O} sourceLocB = ${O}(${c.join()}, 0); 12636 --${c[A-2]};`}else h=A,u=` 12637 ${l} sourceLocR = coords; 12638 ++${c[A-1]}; 12639 ${l} sourceLocG = coords; 12640 ++${c[A-2]}; 12641 ${l} sourceLocA = coords; 12642 --${c[A-1]}; 12643 ${l} sourceLocB = coords; 12644 --${c[A-2]};`;const f=["x","y","z","w","u","v"].slice(0,h),d="."+f[h-1],g=f.map(O=>"int "+O),m=qr("sourceLocR",h-1).concat("inIdx.r"),p=qr("sourceLocG",h-1).concat("inIdx.g"),w=qr("sourceLocB",h-1).concat("inIdx.b"),C=qr("sourceLocA",h-1).concat("inIdx.a"),b=r==="max"?"greaterThan":"lessThan",U=i?"":` 12645 inIdx = round(vec4(getBestIndicesAChannel(${m.join()}), 12646 getBestIndicesAChannel(${p.join()}), 12647 getBestIndicesAChannel(${w.join()}), 12648 getBestIndicesAChannel(${C.join()})));`,F=`vec4( 12649 getAChannel(${m.join()}), 12650 hasNextCol ? getAChannel(${p.join()}) : 0., 12651 hasNextRow ? getAChannel(${w.join()}) : 0., 12652 hasNextRow && hasNextCol ? getAChannel(${C.join()}) : 0.)`,D=i?"":` 12653 float getBestIndicesAChannel(${g.join()}) { 12654 return getChannel(getBestIndicesA(${f.join()}), 12655 vec2(${f.slice(-2).join()})); 12656 }`;this.userCode=` 12657 float getAChannel(${g.join()}) { 12658 return getChannel(getA(${f.join()}), 12659 vec2(${f.slice(-2).join()})); 12660 } 12661 ${D} 12662 void main() { 12663 ${l} coords = getOutputCoords(); 12664 bool hasNextCol = ${c[A-1]} < ${o[A-1]-1}; 12665 bool hasNextRow = ${c[A-2]} < ${o[A-2]-1}; 12666 ${u} 12667 ivec4 srcIdx = ivec4(sourceLocR${d}, sourceLocG${d}, 12668 sourceLocB${d}, sourceLocA${d}) * ${t}; 12669 ivec4 inIdx = srcIdx; 12670 vec4 bestIndex = vec4(inIdx); 12671 vec4 bestValue = ${F}; 12672 12673 for (int i = 0; i < ${t}; i++) { 12674 inIdx = srcIdx; 12675 ${U} 12676 vec4 candidate = ${F}; 12677 bvec4 nan = isnan(candidate); 12678 bvec4 replace = bvec4( 12679 vec4(${b}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); 12680 12681 bestValue = vec4(replace.x ? candidate.x : bestValue.x, 12682 replace.y ? candidate.y : bestValue.y, 12683 replace.z ? candidate.z : bestValue.z, 12684 replace.w ? candidate.w : bestValue.w); 12685 bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace)); 12686 srcIdx++; 12687 } 12688 setOutput(bestIndex); 12689 } 12690 `}}/** 12691 * @license 12692 * Copyright 2020 Google LLC. All Rights Reserved. 12693 * Licensed under the Apache License, Version 2.0 (the "License"); 12694 * you may not use this file except in compliance with the License. 12695 * You may obtain a copy of the License at 12696 * 12697 * http://www.apache.org/licenses/LICENSE-2.0 12698 * 12699 * Unless required by applicable law or agreed to in writing, softw
12699are 12700 * distributed under the License is distributed on an "AS IS" BASIS, 12701 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12702 * See the License for the specific language governing permissions and 12703 * limitations under the License. 12704 * ============================================================================= 12705 */function dB(n,e,t,r=null){let i=e.shape[0],s=e.shape[1];r!=null&&(i=r.shape[0],s=r.shape[1]);const a=rd(s),o={windowSize:a,inSize:s,batchSize:i,outSize:Math.ceil(s/a)},A=new $K(o,t,r==null),l=[e];r!=null&&l.push(r);const c=n.runWebGLProgram(A,l,"int32");if(c.shape[1]===1)return c;const u=dB(n,e,t,c);return n.disposeIntermediateTensorInfo(c),u}function pB(n,e,t,r=null){const i=r!=null?r.shape:e.shape,s=i[i.length-1],a=rd(s),o=new QK(i,a,t,r==null),A=r==null?[e]:[e,r],l=n.runWebGLProgram(o,A,"int32");if(l.shape.length===e.shape.length){const c=pB(n,e,t,l);return n.disposeIntermediateTensorInfo(l),c}return l}function mB(n,e,t,r){const i=[t];if(Ms("arg"+r.charAt(0).toUpperCase()+r.slice(1),i,e.shape.length),!pe().getBool("WEBGL_PACK_REDUCE")||e.shape.length<=2){const s=[],a=n.texData.get(e.dataId),o=a!==null&&a.isPacked;let A=e;o&&(A=n.unpackTensor(e),s.push(A));const[l,c]=Zs(A.shape,i),u=ze(c),h=et({inputs:{x:A},backend:n,attrs:{shape:[-1,u]}});s.push(h);const f=dB(n,h,r);s.push(f);const d=et({inputs:{x:f},backend:n,attrs:{shape:l}});return s.forEach(g=>n.disposeIntermediateTensorInfo(g)),d}return pB(n,e,r)}/** 12706 * @license 12707 * Copyright 2020 Google LLC. All Rights Reserved. 12708 * Licensed under the Apache License, Version 2.0 (the "License"); 12709 * you may not use this file except in compliance with the License. 12710 * You may obtain a copy of the License at 12711 * 12712 * http://www.apache.org/licenses/LICENSE-2.0 12713 * 12714 * Unless required by applicable law or agreed to in writing, software 12715 * distributed under the License is distributed on an "AS IS" BASIS, 12716 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12717 * See the License for the specific language governing permissions and 12718 * limitations under the License. 12719 * ============================================================================= 12720 */function HK(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s}=r;let a=Br(s,i.shape);const o=As(a,i.shape.length);let A=i;const l=[];o!=null&&(A=Jr({inputs:{x:i},backend:t,attrs:{perm:o}}),l.push(A),a=ls(a.length,A.shape.length)),Ms("argMax",[a[0]],A.shape.length);const c=mB(t,A,a[0],"max");return l.forEach(u=>t.disposeIntermediateTensorInfo(u)),c}const VK={kernelName:mv,backendName:"webgl",kernelFunc:HK};/** 12721 * @license 12722 * Copyright 2020 Google LLC. All Rights Reserved. 12723 * Licensed under the Apache License, Version 2.0 (the "License"); 12724 * you may not use this file except in compliance with the License. 12725 * You may obtain a copy of the License at 12726 * 12727 * http://www.apache.org/licenses/LICENSE-2.0 12728 * 12729 * Unless required by applicable law or agreed to in writing, software 12730 * distributed under the License is distributed on an "AS IS" BASIS, 12731 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12732 * See the License for the specific language governing permissions and 12733 * limitations under the License. 12734 * ============================================================================= 12735 */function GK(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s}=r;let a=Br(s,i.shape);const o=As(a,i.shape.length);let A=i;const l=[];o!=null&&(A=Jr({inputs:{x:i},backend:t,attrs:{perm:o}}),l.push(A),a=ls(a.length,A.shape.length)),Ms("argMin",[a[0]],A.shape.length);const c=mB(t,A,a[0],"min");return l.forEach(u=>t.disposeIntermediateTensorInfo(u)),c}const zK={kernelName:gv,backendName:"webgl",kernelFunc:GK};/** 12736 * @license 12737 * Copyright 2020 Google LLC. All Rights Reserved. 12738 * Licensed under the Apache License, Version 2.0 (the "License"); 12739 * you may not use this file except in compliance with the License. 12740 * You may obtain a copy of the License at 12741 * 12742 * http://www.apache.org/licenses/LICENSE-2.0 12743 * 12744 * Unless required by applicable law or agreed to in writing, software 12745 * distributed under the License is distributed on an "AS IS" BASIS, 12746 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12747 * See the License for the specific language governing permissions and 12748 * limitations under the License. 12749 * ============================================================================= 12750 */const WK=cs+` 12751 if (abs(x) > 1.) { 12752 return NAN; 12753 } 12754 return asin(x);
12755`,KK=vn({opSnippet:WK}),XK={kernelName:yv,backendName:"webgl",kernelFunc:KK};/** 12756 * @license 12757 * Copyright 2020 Google LLC. All Rights Reserved. 12758 * Licensed under the Apache License, Version 2.0 (the "License"); 12759 * you may not use this file except in compliance with the License. 12760 * You may obtain a copy of the License at 12761 * 12762 * http://www.apache.org/licenses/LICENSE-2.0 12763 * 12764 * Unless required by applicable law or agreed to in writing, software 12765 * distributed under the License is distributed on an "AS IS" BASIS, 12766 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12767 * See the License for the specific language governing permissions and 12768 * limitations under the License. 12769 * ============================================================================= 12770 */const jK=cs+"return log(x + sqrt(x * x + 1.0));",YK=vn({opSnippet:jK}),qK={kernelName:vv,backendName:"webgl",kernelFunc:YK};/** 12771 * @license 12772 * Copyright 2020 Google LLC. All Rights Reserved. 12773 * Licensed under the Apache License, Version 2.0 (the "License"); 12774 * you may not use this file except in compliance with the License. 12775 * You may obtain a copy of the License at 12776 * 12777 * http://www.apache.org/licenses/LICENSE-2.0 12778 * 12779 * Unless required by applicable law or agreed to in writing, software 12780 * distributed under the License is distributed on an "AS IS" BASIS, 12781 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12782 * See the License for the specific language governing permissions and 12783 * limitations under the License. 12784 * ============================================================================= 12785 */const JK=cs+` 12786 return atan(x); 12787`,ZK=vn({opSnippet:JK}),eX={kernelName:wv,backendName:"webgl",kernelFunc:ZK};/** 12788 * @license 12789 * Copyright 2020 Google LLC. All Rights Reserved. 12790 * Licensed under the Apache License, Version 2.0 (the "License"); 12791 * you may not use this file except in compliance with the License. 12792 * You may obtain a copy of the License at 12793 * 12794 * http://www.apache.org/licenses/LICENSE-2.0 12795 * 12796 * Unless required by applicable law or agreed to in writing, software 12797 * distributed under the License is distributed on an "AS IS" BASIS, 12798 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12799 * See the License for the specific language governing permissions and 12800 * limitations under the License. 12801 * ============================================================================= 12802 */const tX=a2+` 12803 return atan(a, b); 12804`,nX=` 12805 vec4 result = atan(a, b); 12806 bvec4 isNaNA = isnan(a); 12807 bvec4 isNaNB = isnan(b); 12808 bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); 12809 `+IA+` 12810 return result; 12811`,rX=Lr({opSnippet:tX,packedOpSnippet:nX}),iX={kernelName:bv,backendName:"webgl",kernelFunc:rX};/** 12812 * @license 12813 * Copyright 2020 Google LLC. All Rights Reserved. 12814 * Licensed under the Apache License, Version 2.0 (the "License"); 12815 * you may not use this file except in compliance with the License. 12816 * You may obtain a copy of the License at 12817 * 12818 * http://www.apache.org/licenses/LICENSE-2.0 12819 * 12820 * Unless required by applicable law or agreed to in writing, software 12821 * distributed under the License is distributed on an "AS IS" BASIS, 12822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12823 * See the License for the specific language governing permissions and 12824 * limitations under the License. 12825 * ============================================================================= 12826 */const sX=cs+` 12827 if ((x < -1.0) || (x > 1.0)) return NAN; 12828return (log(1.0 + x) - log(1.0 - x)) / 2.0;
12828`,aX=vn({opSnippet:sX}),oX={kernelName:xv,backendName:"webgl",kernelFunc:aX};/** 12829 * @license 12830 * Copyright 2017 Google LLC. All Rights Reserved. 12831 * Licensed under the Apache License, Version 2.0 (the "License"); 12832 * you may not use this file except in compliance with the License. 12833 * You may obtain a copy of the License at 12834 * 12835 * http://www.apache.org/licenses/LICENSE-2.0 12836 * 12837 * Unless required by applicable law or agreed to in writing, software 12838 * distributed under the License is distributed on an "AS IS" BASIS, 12839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12840 * See the License for the specific language governing permissions and 12841 * limitations under the License. 12842 * ============================================================================= 12843 */class ru{constructor(e,t,r,i=!1,s=!1){if(this.variableNames=["x"],t==="avg"&&r)throw new Error("Cannot compute positions for average pool.");const a=e.filterWidth,o=e.strideHeight,A=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterHeight,h=e.effectiveFilterWidth,f=e.padInfo.top,d=e.padInfo.left;this.outputShape=e.outShape;const g=t==="avg",m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,p=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let w="0.0";if(g||(w="-1.0 / 1e-20"),r){const O=">=";this.userCode=` 12844 const ivec2 strides = ivec2(${o}, ${A}); 12845 const ivec2 pads = ivec2(${f}, ${d}); 12846 12847 void main() { 12848 ivec4 coords = getOutputCoords(); 12849 int batch = coords[0]; 12850 int d = coords[3]; 12851 12852 ivec2 xRCCorner = coords.yz * strides - pads; 12853 int xRCorner = xRCCorner.x; 12854 int xCCorner = xRCCorner.y; 12855 12856 // max/min x(?, ?, d) to get y(yR, yC, d). 12857 // ? = to be determined 12858 float minMaxValue = 0.0; 12859 float minMaxValueFound = 0.0; 12860 int minMaxPosition = 0; 12861 float avgValue = 0.0; 12862 12863 for (int wR = 0; wR < ${u}; 12864 wR += ${l}) { 12865 int xR = xRCorner + wR; 12866 12867 if (xR < 0 || xR >= ${e.inHeight}) { 12868 continue; 12869 } 12870 12871 for (int wC = 0; wC < ${h}; 12872 wC += ${c}) { 12873 int xC = xCCorner + wC; 12874 12875 if (xC < 0 || xC >= ${e.inWidth}) { 12876 continue; 12877 } 12878 12879 float value = getX(batch, xR, xC, d); 12880 12881 // If a min / max value has already been found, use it. If not, 12882 // use the current value. 12883 float currMinMaxValue = mix( 12884 value, minMaxValue, minMaxValueFound); 12885 if (value ${O} currMinMaxValue) { 12886 minMaxValue = value; 12887 minMaxValueFound = 1.0; 12888 minMaxPosition = ${i?s?m:p:`wR * ${h} + wC`}; 12889 } 12890 } 12891 } 12892 setOutput(float(minMaxPosition)); 12893 } 12894 `;return}const C="max";let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(b="avgValue / max(count, 1.0)");const U=Math.floor(a/4)*4,F=a%4,D=` 12895 if (${g}) { 12896 avgValue += dot(values, ones); 12897 } else { 12898 minMaxValue = ${C}(values, minMaxValue); 12899 } 12900 `;this.userCode=` 12901 const ivec2 strides = ivec2(${o}, ${A}); 12902 const ivec2 pads = ivec2(${f}, ${d}); 12903 const float initializationValue = ${w}; 12904 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 12905 12906 float count = 0.0; 12907 12908 float getValue(int batch, int xR, int xC, int d) { 12909 if (xC < 0 || xC >= ${e.inWidth}) { 12910 return initializationValue; 12911 } 12912 count += 1.0; 12913 return getX(batch, xR, xC, d); 12914 } 12915 12916 void main() { 12917 ivec4 coords = getOutputCoords(); 12918 int batch = coords[0]; 12919 int d = coords[3]; 12920 12921 ivec2 xRCCorner = coords.yz * strides - pads; 12922 int xRCorner = xRCCorner.x; 12923 int xCCorner = xRCCorner.y; 12924 12925 // max/min x(?, ?, d) to get y(yR, yC, d). 12926 // ? = to be determined 12927 vec4 minMaxValue = vec4(${w}); 12928 float avgValue = 0.0; 12929 count = 0.0; 12930 12931 for (int wR = 0; wR < ${u}; 12932 wR += ${l}) { 12933 int xR = xRCorner + wR; 12934 12935 if (xR < 0 || xR >= ${e.inHeight}) { 12936 continue; 12937 } 12938 12939 for (int wC = 0; wC < ${U}; wC += 4) { 12940 int xC = xCCorner + wC * ${c}; 12941 12942 vec4 values = vec4( 12943 getValue(batch, xR, xC, d), 12944 getValue(batch, xR, xC + ${c}, d), 12945 getValue(batch, xR, xC + 2 * ${c}, d), 12946 getValue(batch, xR, xC + 3 * ${c}, d) 12947 ); 12948 12949 ${D} 12950 } 12951 12952 int xC = xCCorner + ${U}; 12953 if (${F===1}) { 12954 vec4 values = vec4( 12955 getValue(batch, xR, xC, d), 12956 initializationValue, 12957 initializationValue, 12958 initializationValue 12959 ); 12960 12961 ${D} 12962 } else if (${F===2}) { 12963 vec4 values = vec4( 12964 getValue(batch, xR, xC, d), 12965 getValue(batch, xR, xC + ${c}, d), 12966 initializationValue, 12967 initializationValue 12968 ); 12969 12970 ${D} 12971 } else if (${F===3}) { 12972 vec4 values = vec4( 12973 getValue(batch, xR, xC, d), 12974 getValue(batch, xR, xC + ${c}, d), 12975 getValue(batch, xR, xC + 2 * ${c}, d), 12976 initializationValue 12977 ); 12978 12979 ${D} 12980 } 12981 } 12982 setOutput(${b}); 12983 } 12984 `}}class A2{constructor(e,t,r,i=!1,s=!1){if(this.variableNames=["x"],t==="avg"&&r)throw new Error("Cannot compute positions for average pool.");const a=e.filterWidth,o=e.strideDepth,A=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,u=e.dilationHeight,h=e.dilationWidth,f=e.effectiveFilterDepth,d=e.effectiveFilterHeight,g=e.effectiveFilterWidth,m=e.padInfo.front,p=e.padInfo.top,w=e.padInfo.left;this.outputShape=e.outShape;const C=t==="avg";let b="0.0";if(C||(b="-1.0 / 1e-20"),r){const R=">=";this.userCode=` 12985 const ivec3 strides = 12986 ivec3(${o}, ${A}, ${l}); 12987 const ivec3 pads = ivec3(${m}, ${p}, ${w}); 12988 12989 void main() { 12990 ivec5 coords = getOutputCoords(); 12991 int batch = coords.x; 12992 int ch = coords.u; 12993 12994 ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; 12995 int xDCorner = xCorner.x; 12996 int xRCorner = xCorner.y; 12997 int xCCorner = xCorner.z; 12998 12999 // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch). 13000 // ? = to be determined 13001 float minMaxValue = 0.0; 13002 float minMaxValueFound = 0.0; 13003 int minMaxPosition = 0; 13004 13005 for (int wD = 0; wD < ${f}; 13006 wD += ${c}) { 13007 int xD = xDCorner + wD; 13008 13009 if (xD < 0 || xD >= ${e.inDepth}) { 13010 continue; 13011 } 13012 13013 for (int wR = 0; wR < ${d}; 13014 wR += ${u}) { 13015 int xR = xRCorner + wR; 13016 13017 if (xR < 0 || xR >= ${e.inHeight}) { 13018 continue; 13019 } 13020 13021 for (int wC = 0; wC < ${g}; 13022 wC += ${h}) { 13023 int xC = xCCorner + wC; 13024 13025 if (xC < 0 || xC >= ${e.inWidth}) { 13026 continue; 13027 } 13028 13029 float value = getX(batch, xD, xR, xC, ch); 13030 13031 // If a min / max value has already been found, use it. If not, 13032 // use the current value. 13033 float currMinMaxValue = mix( 13034 value, minMaxValue, minMaxValueFound); 13035 if (value ${R} currMinMaxValue) { 13036 minMaxValue = value; 13037 minMaxValueFound = 1.0; 13038 minMaxPosition = ${i?s?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${d} * ${g} + 13039 wR * ${g} + wC`}; 13040 } 13041 } 13042 } 13043 } 13044 setOutput(float(minMaxPosition)); 13045 } 13046 `;return}const U="max";let F=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(F="avgValue / max(count, 1.0)");const D=Math.floor(a/4)*4,O=a%4,I=` 13047 if (${C}) { 13048 avgValue += dot(values, ones); 13049 } else { 13050 minMaxValue = ${U}(values, minMaxValue); 13051 } 13052 `;this.userCode=` 13053 const ivec3 strides = 13054 ivec3(${o}, ${A}, ${l}); 13055 const ivec3 pads = ivec3(${m}, ${p}, ${w}); 13056 const float initializationValue = ${b}; 13057 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 13058 13059 float count = 0.0; 13060 13061 float getValue(int batch, int xD, int xR, int xC, int ch) { 13062 if (xC < 0 || xC >= ${e.inWidth}) { 13063 return initializationValue; 13064 } 13065 count += 1.0; 13066 return getX(batch, xD, xR, xC, ch); 13067 } 13068 13069 void main() { 13070 ivec5 coords = getOutputCoords(); 13071 int batch = coords.x; 13072 int ch = coords.u; 13073 13074 ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; 13075 int xDCorner = xCorner.x; 13076 int xRCorner = xCorner.y; 13077 int xCCorner = xCorner.z; 13078 13079 // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch). 13080 // ? = to be determined 13081 vec4 minMaxValue = vec4(${b}); 13082 float avgValue = 0.0; 13083 count = 0.0; 13084 13085 for (int wD = 0; wD < ${f}; 13086 wD += ${c}) { 13087 int xD = xDCorner + wD; 13088 13089 if (xD < 0 || xD >= ${e.inDepth}) { 13090 continue; 13091 } 13092 13093 for (int wR = 0; wR < ${d}; 13094 wR += ${u}) { 13095 int xR = xRCorner + wR; 13096 13097 if (xR < 0 || xR >= ${e.inHeight}) { 13098 continue; 13099 } 13100 13101 for (int wC = 0; wC < ${D}; wC += 4) { 13102 int xC = xCCorner + wC * ${h}; 13103 13104 vec4 values = vec4( 13105 getValue(batch, xD, xR, xC, ch), 13106 getValue(batch, xD, xR, xC + ${h}, ch), 13107 getValue(batch, xD, xR, xC + 2 * ${h}, ch), 13108 getValue(batch, xD, xR, xC + 3 * ${h}, ch) 13109 ); 13110 13111 ${I} 13112 } 13113 13114 int xC = xCCorner + ${D}; 13115 if (${O===1}) { 13116 vec4 values = vec4( 13117 getValue(batch, xD, xR, xC, ch), 13118 initializationValue, 13119 initializationValue, 13120 initializationValue 13121 ); 13122 13123 ${I} 13124 } else if (${O===2}) { 13125 vec4 values = vec4( 13126 getValue(batch, xD, xR, xC, ch), 13127 getValue(batch, xD, xR, xC + ${h}, ch), 13128 initializationValue, 13129 initializationValue 13130 ); 13131 13132 ${I} 13133 } else if (${O===3}) { 13134 vec4 values = vec4( 13135 getValue(batch, xD, xR, xC, ch), 13136 getValue(batch, xD, xR, xC + ${h}, ch), 13137 getValue(batch, xD, xR, xC + 2 * ${h}, ch), 13138 initializationValue 13139 ); 13140 13141 ${I} 13142 } 13143 } 13144 } 13145 setOutput(${F}); 13146 } 13147 `}}/** 13148 * @license 13149 * Copyright 2020 Google LLC. All Rights Reserved. 13150 * Licensed under the Apache License, Version 2.0 (the "License");
13151 * you may not use this file except in compliance with the License. 13152 * You may obtain a copy of the License at 13153 * 13154 * http://www.apache.org/licenses/LICENSE-2.0 13155 * 13156 * Unless required by applicable law or agreed to in writing, software 13157 * distributed under the License is distributed on an "AS IS" BASIS, 13158 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13159 * See the License for the specific language governing permissions and 13160 * limitations under the License. 13161 * ============================================================================= 13162 */function AX(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e;xu(i,"avgPool");const{filterSize:s,strides:a,pad:o,dimRoundingMode:A}=r,l=1;H(Ti(a,l),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'`);const c=CA(i.shape,s,a,l,o,A);if(c.filterWidth===1&&c.filterHeight===1&&rr(c.inShape,c.outShape))return Ei({inputs:{x:i},backend:t});const u=new ru(c,"avg",!1);return t.runWebGLProgram(u,[i],"float32")}const lX={kernelName:Cv,backendName:"webgl",kernelFunc:AX};/** 13163 * @license 13164 * Copyright 2020 Google LLC. All Rights Reserved. 13165 * Licensed under the Apache License, Version 2.0 (the "License"); 13166 * you may not use this file except in compliance with the License. 13167 * You may obtain a copy of the License at 13168 * 13169 * http://www.apache.org/licenses/LICENSE-2.0 13170 * 13171 * Unless required by applicable law or agreed to in writing, software 13172 * distributed under the License is distributed on an "AS IS" BASIS, 13173 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13174 * See the License for the specific language governing permissions and 13175 * limitations under the License. 13176 * ============================================================================= 13177 */function cX(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{filterSize:s,strides:a,pad:o,dimRoundingMode:A,dataFormat:l}=r,c=[1,1,1],u=mu(i.shape,s,a,c,o,A,l),h=new A2(u,"avg",!1);return t.runWebGLProgram(h,[i],"float32")}const uX={kernelName:_v,backendName:"webgl",kernelFunc:cX};/** 13178 * @license 13179 * Copyright 2017 Google LLC. All Rights Reserved. 13180 * Licensed under the Apache License, Version 2.0 (the "License"); 13181 * you may not use this file except in compliance with the License. 13182 * You may obtain a copy of the License at 13183 * 13184 * http://www.apache.org/licenses/LICENSE-2.0 13185 * 13186 * Unless required by applicable law or agreed to in writing, software 13187 * distributed under the License is distributed on an "AS IS" BASIS, 13188 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13189 * See the License for the specific language governing permissions and 13190 * limitations under the License. 13191 * ============================================================================= 13192 */class hX{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,r=e.filterWidth,i=e.strideHeight,s=e.strideWidth,a=e.dilationHeight,o=e.dilationWidth,A=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=A-1-e.padInfo.top,u=l-1-e.padInfo.left,h=1/(t*r);this.userCode=` 13193 const ivec2 pads = ivec2(${c}, ${u}); 13194 const float avgMultiplier = float(${h}); 13195 13196 void main() { 13197 ivec4 coords = getOutputCoords(); 13198 int b = coords[0]; 13199 int d = coords[3]; 13200 13201 ivec2 dyRCCorner = coords.yz - pads; 13202 int dyRCorner = dyRCCorner.x; 13203 int dyCCorner = dyRCCorner.y; 13204 13205 // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). 13206 // ? = to be determined. : = across all values in that axis. 13207 float dotProd = 0.0; 13208 for (int wR = 0; wR < ${A}; 13209 wR += ${a}) { 13210 float dyR = float(dyRCorner + wR) / ${i}.0; 13211 13212 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { 13213 continue; 13214 } 13215 int idyR = int(dyR); 13216 13217 for (int wC = 0; wC < ${l}; 13218 wC+= ${o}) { 13219 float dyC = float(dyCCorner + wC) / ${s}.0; 13220 13221 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 13222 fract(dyC) > 0.0) { 13223 continue; 13224 } 13225 int idyC = int(dyC); 13226 13227 float dyValue = getDy(b, idyR, idyC, d); 13228 13229 dotProd += dyValue * avgMultiplier; 13230 } 13231 } 13232 setOutput(dotProd); 13233 } 13234 `}}class fX{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,r=e.filterHeight,i=e.filterWidth,s=e.strideDepth,a=e.strideHeight,o=e.strideWidth,A=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterDepth,h=e.effectiveFilterHeight,f=e.effectiveFilterWidth,d=u-1-e.padInfo.front,g=h-1-e.padInfo.top,m=f-1-e.padInfo.left,p=1/(t*r*i);this.userCode=` 13235 const ivec3 pads = ivec3(${d}, ${g}, ${m}); 13236 const float avgMultiplier = float(${p}); 13237 13238 void main() { 13239 ivec5 coords = getOutputCoords(); 13240 int batch = coords.x; 13241 int ch = coords.u; 13242 13243 ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; 13244 int dyDCorner = dyCorner.x; 13245 int dyRCorner = dyCorner.y; 13246 int dyCCorner = dyCorner.z; 13247 13248 // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get
13249 // dx(xD, xR, xC, ch). 13250 // ? = to be determined. : = across all values in that axis. 13251 float dotProd = 0.0; 13252 13253 for (int wD = 0; wD < ${u}; 13254 wD += ${A}) { 13255 float dyD = float(dyDCorner + wD) / ${s}.0; 13256 13257 if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { 13258 continue; 13259 } 13260 int idyD = int(dyD); 13261 13262 for (int wR = 0; wR < ${h}; 13263 wR += ${l}) { 13264 float dyR = float(dyRCorner + wR) / ${a}.0; 13265 13266 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || 13267 fract(dyR) > 0.0) { 13268 continue; 13269 } 13270 int idyR = int(dyR); 13271 13272 for (int wC = 0; wC < ${f}; 13273 wC += ${c}) { 13274 float dyC = float(dyCCorner + wC) / ${o}.0; 13275 13276 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 13277 fract(dyC) > 0.0) { 13278 continue; 13279 } 13280 int idyC = int(dyC); 13281 13282 float dyValue = getDy(batch, idyD, idyR, idyC, ch); 13283 13284 dotProd += dyValue * avgMultiplier; 13285 } 13286 } 13287 } 13288 setOutput(dotProd); 13289 } 13290 `}}/** 13291 * @license 13292 * Copyright 2020 Google LLC. All Rights Reserved. 13293 * Licensed under the Apache License, Version 2.0 (the "License"); 13294 * you may not use this file except in compliance with the License. 13295 * You may obtain a copy of the License at 13296 * 13297 * http://www.apache.org/licenses/LICENSE-2.0 13298 * 13299 * Unless required by applicable law or agreed to in writing, software 13300 * distributed under the License is distributed on an "AS IS" BASIS, 13301 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13302 * See the License for the specific language governing permissions and 13303 * limitations under the License. 13304 * ============================================================================= 13305 */function dX(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,input:s}=e,a=s,{filterSize:o,strides:A,pad:l,dimRoundingMode:c}=r,u=[1,1,1],h=mu(a.shape,o,A,u,l,c),f=new fX(h);return t.runWebGLProgram(f,[i],a.dtype)}const pX={kernelName:SM,backendName:"webgl",kernelFunc:dX};/** 13306 * @license 13307 * Copyright 2020 Google LLC. All Rights Reserved. 13308 * Licensed under the Apache License, Version 2.0 (the "License"); 13309 * you may not use this file except in compliance with the License. 13310 * You may obtain a copy of the License at 13311 * 13312 * http://www.apache.org/licenses/LICENSE-2.0 13313 * 13314 * Unless required by applicable law or agreed to in writing, software 13315 * distributed under the License is distributed on an "AS IS" BASIS, 13316 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13317 * See the License for the specific language governing permissions and 13318 * limitations under the License. 13319 * ============================================================================= 13320 */function mX(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,input:s}=e,a=s;xu([i,s],"avgPoolGrad");const{filterSize:o,strides:A,pad:l}=r,c=CA(a.shape,o,A,1,l),u=new hX(c);return t.runWebGLProgram(u,[i],a.dtype)}const gX={kernelName:EM,backendName:"webgl",kernelFunc:mX};/** 13321 * @license 13322 * Copyright 2020 Google LLC. All Rights Reserved. 13323 * Licensed under the Apache License, Version 2.0 (the "License"); 13324 * you may not use this file except in compliance with the License. 13325 * You may obtain a copy of the License at 13326 * 13327 * http://www.apache.org/licenses/LICENSE-2.0 13328 * 13329 * Unless required by applicable law or agreed to in writing, software 13330 * distributed under the License is distributed on an "AS IS" BASIS, 13331 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13332 * See the License for the specific language governing permissions and 13333 * limitations under the License. 13334 * ============================================================================= 13335 */function yX(n){const{inputs:e,backend:t,attrs:r}=n,{a:i,b:s}=e,{transposeA:a,transposeB:o}=r;return Bf({a:i,b:s,transposeA:a,transposeB:o,backend:t})}const vX={kernelName:Bv,backendName:"webgl",kernelFunc:yX};/** 13336 * @license 13337 * Copyright 2017 Google LLC. All Rights Reserved. 13338 * Licensed under the Apache License, Version 2.0 (the "License");
13339 * you may not use this file except in compliance with the License. 13340 * You may obtain a copy of the License at 13341 * 13342 * http://www.apache.org/licenses/LICENSE-2.0 13343 * 13344 * Unless required by applicable law or agreed to in writing, software 13345 * distributed under the License is distributed on an "AS IS" BASIS, 13346 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13347 * See the License for the specific language governing permissions and 13348 * limitations under the License. 13349 * ============================================================================= 13350 */class wX{constructor(e,t,r,i,s,a){this.outputShape=[],this.variableNames=["x","mean","variance"],Cn(e,t),Cn(e,r);let o="0.0";i!=null&&(Cn(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let A="1.0";s!=null&&(Cn(e,s),this.variableNames.push("scale"),A="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` 13351 void main() { 13352 float x = getXAtOutCoords(); 13353 float mean = getMeanAtOutCoords(); 13354 float variance = getVarianceAtOutCoords(); 13355 float offset = ${o}; 13356 float scale = ${A}; 13357 float inv = scale * inversesqrt(variance + float(${a})); 13358 setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); 13359 } 13360 `}}/** 13361 * @license 13362 * Copyright 2018 Google LLC. All Rights Reserved. 13363 * Licensed under the Apache License, Version 2.0 (the "License"); 13364 * you may not use this file except in compliance with the License. 13365 * You may obtain a copy of the License at 13366 * 13367 * http://www.apache.org/licenses/LICENSE-2.0 13368 * 13369 * Unless required by applicable law or agreed to in writing, software 13370 * distributed under the License is distributed on an "AS IS" BASIS, 13371 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13372 * See the License for the specific language governing permissions and 13373 * limitations under the License. 13374 * ============================================================================= 13375 */class xX{constructor(e,t,r,i,s,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Cn(e,t),Cn(e,r);let o="vec4(0.0)";i!=null&&(Cn(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let A="vec4(1.0)";s!=null&&(Cn(e,s),this.variableNames.push("scale"),A="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` 13376 void main() { 13377 vec4 offset = ${o}; 13378 vec4 scale = ${A}; 13379 13380 vec4 x = getXAtOutCoords(); 13381 vec4 mean = getMeanAtOutCoords(); 13382 vec4 variance = getVarianceAtOutCoords(); 13383 13384 vec4 inv = scale * inversesqrt(variance + vec4(${a})); 13385 13386 setOutput((x - mean) * inv + offset); 13387 } 13388 `}}/** 13389 * @license 13390 * Copyright 2020 Google LLC. All Rights Reserved. 13391 * Licensed under the Apache License, Version 2.0 (the "License"); 13392 * you may not use this file except in compliance with the License. 13393 * You may obtain a copy of the License at 13394 * 13395 * http://www.apache.org/licenses/LICENSE-2.0 13396 * 13397 * Unless required by applicable law or agreed to in writing, software 13398 * distributed under the License is distributed on an "AS IS" BASIS, 13399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13400 * See the License for the specific language governing permissions and 13401 * limitations under the License. 13402 * ============================================================================= 13403 */const bX=({inputs:n,backend:e,attrs:t})=>{const{x:r,mean:i,variance:s,offset:a,scale:o}=n;H(i.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),H(a==null||i.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),H(o==null||i.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:A}=t;A==null&&(A=.001);const l=[r,i,s];let c=null;a!=null&&(c=a.shape,l.push(a));let u=null;o!=null&&(u=o.shape,l.push(o));const h=pe().getBool("WEBGL_PACK_NORMALIZATION")?new xX(r.shape,i.shape,s.shape,c,u,A):new wX(r.shape,i.shape,s.shape,c,u,A);return e.runWebGLProgram(h,l,l[0].dtype)},CX={kernelName:uw,backendName:"webgl",kernelFunc:bX};/** 13404 * @license 13405 * Copyright 2017 Google LLC. All Rights Reserved. 13406 * Licensed under the Apache License, Version 2.0 (the "License");
13407 * you may not use this file except in compliance with the License. 13408 * You may obtain a copy of the License at 13409 * 13410 * http://www.apache.org/licenses/LICENSE-2.0 13411 * 13412 * Unless required by applicable law or agreed to in writing, software 13413 * distributed under the License is distributed on an "AS IS" BASIS, 13414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13415 * See the License for the specific language governing permissions and 13416 * limitations under the License. 13417 * ============================================================================= 13418 */class _X{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=Mn(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const r=BX(this.rank);let i;const s=e.map((a,o)=>`sourceLoc.${T1[o]} = start[${o}] + coords.${T1[o]};`);i=` 13419 ${t} sourceLoc; 13420 ${t} coords = getOutputCoords(); 13421 ${s.join(` 13422`)} 13423 `,this.userCode=` 13424 void main() { 13425 ${i} 13426 setOutput(getSource(${r})); 13427 } 13428 `}}const T1=["x","y","z","w","u","v"];function BX(n){if(n===1)return"sourceLoc";if(n<=6)return T1.slice(0,n).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${n} is not yet supported`)}/** 13429 * @license 13430 * Copyright 2019 Google LLC. All Rights Reserved. 13431 * Licensed under the Apache License, Version 2.0 (the "License"); 13432 * you may not use this file except in compliance with the License. 13433 * You may obtain a copy of the License at 13434 * 13435 * http://www.apache.org/licenses/LICENSE-2.0 13436 * 13437 * Unless required by applicable law or agreed to in writing, software 13438 * distributed under the License is distributed on an "AS IS" BASIS, 13439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13440 * See the License for the specific language governing permissions and 13441 * limitations under the License. 13442 * ============================================================================= 13443 */class EX{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=Mn(this.rank),r=qr("coords",this.rank),i=qr("sourceLoc",this.rank),s=this.rank===1?"sourceLoc":`vec2(${i.slice(-2).join()})`,a=`getChannel(getSource(${i.join()}), ${s})`,o=` 13444 result.x = ${a}; 13445 if (++${r[this.rank-1]} < ${e[this.rank-1]}) { 13446 ++${i[this.rank-1]}; 13447 result.y = ${a}; 13448 --${i[this.rank-1]}; 13449 } 13450 `,A=this.rank===1?"":` 13451 --${r[this.rank-1]}; 13452 if (++${r[this.rank-2]} < ${e[this.rank-2]}) { 13453 ++${i[this.rank-2]}; 13454 result.z = ${a}; 13455 if (++${r[this.rank-1]} < ${e[this.rank-1]}) { 13456 ++${i[this.rank-1]}; 13457 result.w = ${a}; 13458 } 13459 } 13460 `,l=this.rank<=4?`sourceLoc = coords + 13461 ${t}(${e.map((c,u)=>`start[${u}]`).join()});`:e.map((c,u)=>`${i[u]} = ${r[u]} + start[${u}];`).join(` 13462`);this.userCode=` 13463 void main() { 13464 ${t} coords = getOutputCoords(); 13465 ${t} sourceLoc; 13466 ${l} 13467 vec4 result = vec4(0.); 13468 ${o} 13469 ${A} 13470 setOutput(result); 13471 } 13472 `}}/** 13473 * @license 13474 * Copyright 2020 Google LLC. All Rights Reserved. 13475 * Licensed under the Apache License, Version 2.0 (the "License"); 13476 * you may not use this file except in compliance with the License. 13477 * You may obtain a copy of the License at 13478 * 13479 * http://www.apache.org/licenses/LICENSE-2.0 13480 * 13481 * Unless required by applicable law or agreed to in writing, software 13482 * distributed under the License is distributed on an "AS IS" BASIS, 13483 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13484 * See the License for the specific language governing permissions and 13485 * limitations under the License. 13486 * ============================================================================= 13487 */function SX(n,e,t,r){const i=r.texData.get(n.dataId),s=r.makeTensorInfo(t,n.dtype),a=r.texData.get(s.dataId);Object.assign(a,i),a.refCount=1,a.shape=t,a.dtype=n.dtype;let o=jg(e,Mr(n.shape));
vendor: 4,666 bytes, lines 13487-13543
13487i.slice&&(o+=i.slice.flatOffset),a.slice={flatOffset:o,origDataId:i.slice&&i.slice.origDataId||n.dataId};const A=r.dataRefCount.get(a.slice.origDataId)||1;return r.dataRefCount.set(a.slice.origDataId,A+1),s}function Zl(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{begin:s,size:a}=r,[o,A]=KC(i,s,a);if(OC(i,o,A),ze(A)===0)return t.makeTensorInfo(A,i.dtype,[]);if(t.shouldExecuteOnCPU([i])||i.dtype==="string"){const u=t.texData.get(i.dataId),h=vW(u.values,o,A,i.shape,i.dtype);return t.makeTensorInfo(A,i.dtype,h)}const{isPacked:l}=t.texData.get(i.dataId),c=Xg(i.shape,o,A);if(l||!c){const u=pe().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new EX(A):new _X(A),h=[o];return t.runWebGLProgram(u,[i],i.dtype,h)}return t.uploadToGPU(i.dataId),SX(i,o,A,t)}const TX={kernelName:wx,backendName:"webgl",kernelFunc:Zl};/** 13488 * @license 13489 * Copyright 2020 Google LLC. All Rights Reserved. 13490 * Licensed under the Apache License, Version 2.0 (the "License"); 13491 * you may not use this file except in compliance with the License. 13492 * You may obtain a copy of the License at 13493 * 13494 * http://www.apache.org/licenses/LICENSE-2.0 13495 * 13496 * Unless required by applicable law or agreed to in writing, software 13497 * distributed under the License is distributed on an "AS IS" BASIS, 13498 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13499 * See the License for the specific language governing permissions and 13500 * limitations under the License. 13501 * ============================================================================= 13502 */const IX=n=>{const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{blockShape:s,crops:a}=r;H(i.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const o=s.reduce((w,C)=>w*C),A=qg(i.shape,s,o),l=Jg(A.length,s.length),c=Zg(i.shape,s,o),u=t_(a,s.length),h=n_(c,a,s.length),f=[],d=et({inputs:{x:i},backend:t,attrs:{shape:A}}),g=Jr({inputs:{x:d},backend:t,attrs:{perm:l}}),m=et({inputs:{x:g},backend:t,attrs:{shape:c}}),p=Zl({inputs:{x:m},backend:t,attrs:{begin:u,size:h}});return f.push(d),f.push(g),f.push(m),f.forEach(w=>t.disposeIntermediateTensorInfo(w)),p},FX={kernelName:Ev,backendName:"webgl",kernelFunc:IX};/** 13503 * @license 13504 * Copyright 2020 Google LLC. All Rights Reserved. 13505 * Licensed under the Apache License, Version 2.0 (the "License"); 13506 * you may not use this file except in compliance with the License. 13507 * You may obtain a copy of the License at 13508 * 13509 * http://www.apache.org/licenses/LICENSE-2.0 13510 * 13511 * Unless required by applicable law or agreed to in writing, software 13512 * distributed under the License is distributed on an "AS IS" BASIS, 13513 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13514 * See the License for the specific language governing permissions and 13515 * limitations under the License. 13516 * ============================================================================= 13517 */function RX(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,weights:s}=e,{size:a}=r,o=t.readSync(i.dataId),A=t.readSync(s.dataId),l=rB(o,A,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,l)}const UX={kernelName:Sv,backendName:"webgl",kernelFunc:RX};/** 13518 * @license 13519 * Copyright 2023 Google LLC. 13520 * Licensed under the Apache License, Version 2.0 (the "License"); 13521 * you may not use this file except in compliance with the License. 13522 * You may obtain a copy of the License at 13523 * 13524 * http://www.apache.org/licenses/LICENSE-2.0 13525 * 13526 * Unless required by applicable law or agreed to in writing, software 13527 * distributed under the License is distributed on an "AS IS" BASIS, 13528 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13529 * See the License for the specific language governing permissions and 13530 * limitations under the License. 13531 * ============================================================================= 13532 */const MX=` 13533 int r = int(a.r) & int(b.r); 13534 int g = int(a.g) & int(b.g); 13535 int rb = int(a.b) & int(b.b); 13536 int ra = int(a.a) & int(b.a); 13537 return vec4(r, g, rb, ra); 13538`,NX=` 13539 return float(int(a.r) & int(b.r)); 13540`;function DX(n){const{inputs:e,backend:t}=n,{a:r,b:i}=e,s=pe().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=pe().getNumber("WEBGL_VERSION");if(t.shouldExecuteOnCPU([r,i])||a===1){const A=t.texData.get(r.dataId).values,l=t.texData.get(i.dataId).values,[c,u]=Vz(r.shape,i.shape,A,l,r.dtype),h=t.makeTensorInfo(u,r.dtype),f=t.texData.get(h.dataId);return f.values=c,h}let o;return s?o=new ql(MX,r.shape,i.shape,!1):o=new wA(NX,r.shape,i.shape),t.runWebGLProgram(o,[r,i],r.dtype)}const LX={kernelName:Tv,backendName:"webgl",kernelFunc:DX};/** 13541 * @license 13542 * Copyright 2021 Google LLC. All Rights Reserved. 13543 * Licensed under the Apache License, Version 2.0 (the "License");
13544 * you may not use this file except in compliance with the License. 13545 * You may obtain a copy of the License at 13546 * 13547 * http://www.apache.org/licenses/LICENSE-2.0 13548 * 13549 * Unless required by applicable law or agreed to in writing, software 13550 * distributed under the License is distributed on an "AS IS" BASIS, 13551 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13552 * See the License for the specific language governing permissions and 13553 * limitations under the License. 13554 * ============================================================================= 13555 */function OX(n){const{inputs:e,backend:t}=n,{s0:r,s1:i}=e,s=t.readSync(r.dataId),a=t.readSync(i.dataId),o=Cn(Array.from(s),Array.from(a));return t.makeTensorInfo([o.length],"int32",Int32Array.from(o))}const PX={kernelName:Iv,backendName:"webgl",kernelFunc:OX};/** 13556 * @license 13557 * Copyright 2020 Google LLC. All Rights Reserved. 13558 * Licensed under the Apache License, Version 2.0 (the "License"); 13559 * you may not use this file except in compliance with the License. 13560 * You may obtain a copy of the License at 13561 * 13562 * http://www.apache.org/licenses/LICENSE-2.0 13563 * 13564 * Unless required by applicable law or agreed to in writing, software 13565 * distributed under the License is distributed on an "AS IS" BASIS, 13566 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13567 * See the License for the specific language governing permissions and 13568 * limitations under the License. 13569 * ============================================================================= 13570 */const kX="return float(a != b);",gB=Lr({opSnippet:kX,cpuKernelImpl:cW,dtype:"bool"}),$X={kernelName:Gw,backendName:"webgl",kernelFunc:gB};/** 13571 * @license 13572 * Copyright 2020 Google LLC. All Rights Reserved. 13573 * Licensed under the Apache License, Version 2.0 (the "License"); 13574 * you may not use this file except in compliance with the License. 13575 * You may obtain a copy of the License at 13576 * 13577 * http://www.apache.org/licenses/LICENSE-2.0 13578 * 13579 * Unless required by applicable law or agreed to in writing, software 13580 * distributed under the License is distributed on an "AS IS" BASIS, 13581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13582 * See the License for the specific language governing permissions and 13583 * limitations under the License. 13584 * ============================================================================= 13585 */function Cu(n){const{inputs:e,backend:t}=n,{input:r}=e,i=t.texData.get(r.dataId);return Ei({inputs:{x:i.complexTensorInfos.real},backend:t})}const QX={kernelName:sx,backendName:"webgl",kernelFunc:Cu};/** 13586 * @license 13587 * Copyright 2020 Google LLC. All Rights Reserved. 13588 * Licensed under the Apache License, Version 2.0 (the "License"); 13589 * you may not use this file except in compliance with the License. 13590 * You may obtain a copy of the License at 13591 * 13592 * http://www.apache.org/licenses/LICENSE-2.0 13593 * 13594 * Unless required by applicable law or agreed to in writing, software 13595 * distributed under the License is distributed on an "AS IS" BASIS, 13596 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13597 * See the License for the specific language governing permissions and 13598 * limitations under the License. 13599 * ============================================================================= 13600 */const HX="return float(int(x));";function VX(n,e){const t=new Hs(n.shape,HX),r=e.runWebGLProgram(t,[n],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}/** 13601 * @license 13602 * Copyright 2020 Google LLC. All Rights Reserved. 13603 * Licensed under the Apache License, Version 2.0 (the "License"); 13604 * you may not use this file except in compliance with the License. 13605 * You may obtain a copy of the License at 13606 * 13607 * http://www.apache.org/licenses/LICENSE-2.0 13608 * 13609 * Unless required by applicable law or agreed to in writing, software 13610 * distributed under the License is distributed on an "AS IS" BASIS, 13611 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13612 * See the License for the specific language governing permissions and 13613 * limitations under the License. 13614 * ============================================================================= 13615 */function I1(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{dtype:s}=r;
vendor: 4,131 bytes, lines 13615-13685
13615if(s==="complex64"){if(i.dtype==="complex64")return Ei({inputs:{x:i},backend:t});const a=pA(i.shape),o=I1({inputs:{x:i},backend:t,attrs:{dtype:"float32"}}),A=To({inputs:{real:o,imag:a},backend:t});return a.dispose(),t.disposeIntermediateTensorInfo(o),A}if(i.dtype==="complex64"){const a=Cu({inputs:{input:i},backend:t}),o=I1({inputs:{x:a},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(a),o}if(!mM(i.dtype,s)){const a=Ei({inputs:{x:i},backend:t});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(t.shouldExecuteOnCPU([i])){const a=t.texData.get(i.dataId).values,[o,A,l]=Gz(a,i.shape,i.dtype,s);return t.makeTensorInfo(o,A,l)}if(s==="int32")return VX(i,t);if(s==="bool"){const a=t.makeTensorInfo([],"bool",vo("bool",1)),A=gB({inputs:{a:i,b:a},backend:t});return t.disposeIntermediateTensorInfo(a),A}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${s}`)}const GX={kernelName:Bg,backendName:"webgl",kernelFunc:I1};/** 13616 * @license 13617 * Copyright 2020 Google LLC. All Rights Reserved. 13618 * Licensed under the Apache License, Version 2.0 (the "License"); 13619 * you may not use this file except in compliance with the License. 13620 * You may obtain a copy of the License at 13621 * 13622 * http://www.apache.org/licenses/LICENSE-2.0 13623 * 13624 * Unless required by applicable law or agreed to in writing, software 13625 * distributed under the License is distributed on an "AS IS" BASIS, 13626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13627 * See the License for the specific language governing permissions and 13628 * limitations under the License. 13629 * ============================================================================= 13630 */const n4="return ceil(x);",zX=vn({opSnippet:n4,packedOpSnippet:n4,cpuKernelImpl:zz}),WX={kernelName:Fv,backendName:"webgl",kernelFunc:zX};/** 13631 * @license 13632 * Copyright 2017 Google LLC. All Rights Reserved. 13633 * Licensed under the Apache License, Version 2.0 (the "License"); 13634 * you may not use this file except in compliance with the License. 13635 * You may obtain a copy of the License at 13636 * 13637 * http://www.apache.org/licenses/LICENSE-2.0 13638 * 13639 * Unless required by applicable law or agreed to in writing, software 13640 * distributed under the License is distributed on an "AS IS" BASIS, 13641 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13642 * See the License for the specific language governing permissions and 13643 * limitations under the License. 13644 * ============================================================================= 13645 */class KX{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` 13646 13647 void main() { 13648 float value = getAAtOutCoords(); 13649 if (isnan(value)) { 13650 setOutput(value); 13651 return; 13652 } 13653 13654 setOutput(clamp(value, minVal, maxVal)); 13655 } 13656 `}}/** 13657 * @license 13658 * Copyright 2018 Google LLC. All Rights Reserved. 13659 * Licensed under the Apache License, Version 2.0 (the "License"); 13660 * you may not use this file except in compliance with the License. 13661 * You may obtain a copy of the License at 13662 * 13663 * http://www.apache.org/licenses/LICENSE-2.0 13664 * 13665 * Unless required by applicable law or agreed to in writing, software 13666 * distributed under the License is distributed on an "AS IS" BASIS, 13667 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13668 * See the License for the specific language governing permissions and 13669 * limitations under the License. 13670 * ============================================================================= 13671 */class XX{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` 13672 void main() { 13673 vec4 value = getAAtOutCoords(); 13674 13675 if (any(isnan(value))) { 13676 setOutput(value); 13677 return; 13678 } 13679 13680 setOutput(clamp(value, vec4(minVal), vec4(maxVal))); 13681 } 13682 `}}/** 13683 * @license 13684 * Copyright 2020 Google LLC. All Rights Reserved. 13685 * Licensed under the Apache License, Version 2.0 (the "License");
13686 * you may not use this file except in compliance with the License. 13687 * You may obtain a copy of the License at 13688 * 13689 * http://www.apache.org/licenses/LICENSE-2.0 13690 * 13691 * Unless required by applicable law or agreed to in writing, software 13692 * distributed under the License is distributed on an "AS IS" BASIS, 13693 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13694 * See the License for the specific language governing permissions and 13695 * limitations under the License. 13696 * ============================================================================= 13697 */function jX(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{clipValueMin:s,clipValueMax:a}=r;let o;pe().getBool("WEBGL_PACK_CLIP")?o=new XX(i.shape):o=new KX(i.shape);const A=[[s],[a]];return t.runWebGLProgram(o,[i],i.dtype,A)}const YX={kernelName:Rv,backendName:"webgl",kernelFunc:jX};/** 13698 * @license 13699 * Copyright 2018 Google LLC. All Rights Reserved. 13700 * Licensed under the Apache License, Version 2.0 (the "License"); 13701 * you may not use this file except in compliance with the License. 13702 * You may obtain a copy of the License at 13703 * 13704 * http://www.apache.org/licenses/LICENSE-2.0 13705 * 13706 * Unless required by applicable law or agreed to in writing, software 13707 * distributed under the License is distributed on an "AS IS" BASIS, 13708 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13709 * See the License for the specific language governing permissions and 13710 * limitations under the License. 13711 * ============================================================================= 13712 */class qX{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` 13713 void main() { 13714 float re = abs(getRealAtOutCoords()); 13715 float im = abs(getImagAtOutCoords()); 13716 float mx = max(re, im); 13717 13718 // sadly the length function in glsl is not underflow-safe 13719 // (at least not on Intel GPUs). So the safe solution is 13720 // to ensure underflow-safety in all cases. 13721 setOutput( 13722 mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) 13723 ); 13724 } 13725 `}}/** 13726 * @license 13727 * Copyright 2020 Google LLC. All Rights Reserved. 13728 * Licensed under the Apache License, Version 2.0 (the "License"); 13729 * you may not use this file except in compliance with the License. 13730 * You may obtain a copy of the License at 13731 * 13732 * http://www.apache.org/licenses/LICENSE-2.0 13733 * 13734 * Unless required by applicable law or agreed to in writing, software 13735 * distributed under the License is distributed on an "AS IS" BASIS, 13736 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13737 * See the License for the specific language governing permissions and 13738 * limitations under the License. 13739 * ============================================================================= 13740 */function r4(n,e){return{dataId:e.dataId,dtype:e.dtype,shape:n.shape}}function JX(n){const{inputs:e,backend:t}=n,{x:r}=e,i=t.texData.get(r.dataId),s=new qX(r.shape),a=[r4(r,i.complexTensorInfos.real),r4(r,i.complexTensorInfos.imag)];return t.runWebGLProgram(s,a,a[0].dtype)}const ZX={kernelName:Mv,backendName:"webgl",kernelFunc:JX};/** 13741 * @license 13742 * Copyright 2017 Google LLC. All Rights Reserved. 13743 * Licensed under the Apache License, Version 2.0 (the "License"); 13744 * you may not use this file except in compliance with the License. 13745 * You may obtain a copy of the License at 13746 * 13747 * http://www.apache.org/licenses/LICENSE-2.0 13748 * 13749 * Unless required by applicable law or agreed to in writing, software 13750 * distributed under the License is distributed on an "AS IS" BASIS, 13751 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13752 * See the License for the specific language governing permissions and 13753 * limitations under the License. 13754 * ============================================================================= 13755 */class ej{constructor(e){this.outputShape=[],this.outputShape=yA(e,1),this.variableNames=e.map((a,o)=>`T${o}`);const t=new Array(e.length-1);t[0]=e[0][1];for(let a=1;a<t.length;a++)t[a]=t[a-1]+e[a][1];const r=[`if (yC < ${t[0]}) setOutput(getT0(yR, yC));`];for(let a=1;a<t.length;a++){const o=t[a-1];r.push(`else if (yC < ${t[a]}) setOutput(getT${a}(yR, yC-${o}));`)}const i=t.length,s=t[t.length-1];r.push(`else setOutput(getT${i}(yR, yC-${s}));`),this.userCode=` 13756 void main() { 13757 ivec2 coords = getOutputCoords(); 13758 int yR = coords.x; 13759 int yC = coords.y; 13760 13761 ${r.join(` 13762 `)} 13763 } 13764 `}}/** 13765 * @license 13766 * Copyright 2019 Google LLC. All Rights Reserved. 13767 * Licensed under the Apache License, Version 2.0 (the "License");
13768 * you may not use this file except in compliance with the License. 13769 * You may obtain a copy of the License at 13770 * 13771 * http://www.apache.org/licenses/LICENSE-2.0 13772 * 13773 * Unless required by applicable law or agreed to in writing, software 13774 * distributed under the License is distributed on an "AS IS" BASIS, 13775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13776 * See the License for the specific language governing permissions and 13777 * limitations under the License. 13778 * ============================================================================= 13779 */class tj{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=yA(e,t);const r=this.outputShape,i=r.length,s=Mn(i),a=qr("coords",i),o=["x","y","z","w","u","v"].slice(0,i);this.variableNames=e.map((g,m)=>`T${m}`);const A=new Array(e.length-1);A[0]=e[0][t];for(let g=1;g<A.length;g++)A[g]=A[g-1]+e[g][t];const l=o[t],c=o.slice(-2),u=o.join();let h=`if (${l} < ${A[0]}) { 13780 return getChannel( 13781 getT0(${u}), vec2(${c.join()})); 13782 }`;for(let g=1;g<A.length;g++){const m=A[g-1];h+=` 13783 if (${l} < ${A[g]} && ${l} >= ${A[g-1]}) { 13784 return getChannel( 13785 getT${g}(${hh(o,l,m)}), 13786 vec2(${hh(c,l,m)})); 13787 }`}const f=A.length,d=A[A.length-1];h+=` 13788 return getChannel( 13789 getT${f}(${hh(o,l,d)}), 13790 vec2(${hh(c,l,d)}));`,this.userCode=` 13791 float getValue(${o.map(g=>"int "+g)}) { 13792 ${h} 13793 } 13794 13795 void main() { 13796 ${s} coords = getOutputCoords(); 13797 vec4 result = vec4(getValue(${a}), 0., 0., 0.); 13798 13799 ${a[i-1]} = ${a[i-1]} + 1; 13800 if (${a[i-1]} < ${r[i-1]}) { 13801 result.g = getValue(${a}); 13802 } 13803 13804 ${a[i-2]} = ${a[i-2]} + 1; 13805 if (${a[i-2]} < ${r[i-2]}) { 13806 result.a = getValue(${a}); 13807 } 13808 13809 ${a[i-1]} = ${a[i-1]} - 1; 13810 if (${a[i-2]} < ${r[i-2]} && 13811 ${a[i-1]} < ${r[i-1]}) { 13812 result.b = getValue(${a}); 13813 } 13814 setOutput(result); 13815 } 13816 `}}function hh(n,e,t){const r=n.indexOf(e);return n.map((s,a)=>a===r?`${s} - ${t}`:s).join()}/** 13817 * @license 13818 * Copyright 2020 Google LLC. All Rights Reserved. 13819 * Licensed under the Apache License, Version 2.0 (the "License"); 13820 * you may not use this file except in compliance with the License. 13821 * You may obtain a copy of the License at 13822 * 13823 * http://www.apache.org/licenses/LICENSE-2.0 13824 * 13825 * Unless required by applicable law or agreed to in writing, software 13826 * distributed under the License is distributed on an "AS IS" BASIS, 13827 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13828 * See the License for the specific language governing permissions and 13829 * limitations under the License. 13830 * ============================================================================= 13831 */function Ad(n){const{inputs:e,backend:t}=n,{input:r}=e,i=t.texData.get(r.dataId);return Ei({inputs:{x:i.complexTensorInfos.imag},backend:t})}const nj={kernelName:gw,backendName:"webgl",kernelFunc:Ad};/** 13832 * @license 13833 * Copyright 2020 Google LLC. All Rights Reserved. 13834 * Licensed under the Apache License, Version 2.0 (the "License"); 13835 * you may not use this file except in compliance with the License. 13836 * You may obtain a copy of the License at 13837 * 13838 * http://www.apache.org/licenses/LICENSE-2.0 13839 * 13840 * Unless required by applicable law or agreed to in writing, software 13841 * distributed under the License is distributed on an "AS IS" BASIS, 13842 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13843 * See the License for the specific language governing permissions and 13844 * limitations under the License. 13845 * ============================================================================= 13846 */function bc(n,e,t){const r=n[0].dtype;if(r==="complex64"){const f=n.map(w=>
vendor: 11,394 bytes, lines 13846-14101
13846Cu({inputs:{input:w},backend:t})),d=n.map(w=>Ad({inputs:{input:w},backend:t})),g=bc(f,e,t),m=bc(d,e,t),p=To({inputs:{real:g,imag:m},backend:t});return f.forEach(w=>t.disposeIntermediateTensorInfo(w)),d.forEach(w=>t.disposeIntermediateTensorInfo(w)),t.disposeIntermediateTensorInfo(g),t.disposeIntermediateTensorInfo(m),p}let i=t.shouldExecuteOnCPU(n);if(r==="string"&&(i=!0),i){const f=n.map(b=>{const F=[-1,ze(b.shape.slice(e))];return et({inputs:{x:b},backend:t,attrs:{shape:F}})}),d=f.map(b=>({vals:t.readSync(b.dataId),shape:b.shape})),g=yA(f.map(b=>b.shape),1),m=f[0].shape[0]===1,p=Wz(d,g,r,m),w=yA(n.map(b=>b.shape),e),C=t.makeTensorInfo(w,r,p);return f.forEach(b=>t.disposeIntermediateTensorInfo(b)),C}const s=n.filter(f=>ze(f.shape)>0),a=pe().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(s.length===1){const f=a?new Hs(n[0].shape,Ja):new so(n[0].shape,Ja);return t.runWebGLProgram(f,n,r)}const o=pe().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>o){const f=[];for(let g=0;g<s.length;g+=o){const m=s.slice(g,g+o);f.push(bc(m,e,t))}const d=bc(f,e,t);for(const g of f)t.disposeIntermediateTensorInfo(g);return d}if(a){const f=new tj(s.map(d=>d.shape),e);return t.runWebGLProgram(f,s,r)}const{tensors2D:A,outShape:l}=rj(s,e,t),c=new ej(A.map(f=>f.shape)),u=t.runWebGLProgram(c,A,r);A.forEach(f=>t.disposeIntermediateTensorInfo(f));const h=et({inputs:{x:u},attrs:{shape:l},backend:t});return t.disposeIntermediateTensorInfo(u),h}function rj(n,e,t){const r=yA(n.map(s=>s.shape),e);return{tensors2D:n.map(s=>et({inputs:{x:s},attrs:{shape:[-1,ze(s.shape.slice(e))]},backend:t})),outShape:r}}/** 13847 * @license 13848 * Copyright 2020 Google LLC. All Rights Reserved. 13849 * Licensed under the Apache License, Version 2.0 (the "License"); 13850 * you may not use this file except in compliance with the License. 13851 * You may obtain a copy of the License at 13852 * 13853 * http://www.apache.org/licenses/LICENSE-2.0 13854 * 13855 * Unless required by applicable law or agreed to in writing, software 13856 * distributed under the License is distributed on an "AS IS" BASIS, 13857 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13858 * See the License for the specific language governing permissions and 13859 * limitations under the License. 13860 * ============================================================================= 13861 */function yB(n){const{inputs:e,backend:t,attrs:r}=n,{axis:i}=r,s=Br(i,e[0].shape)[0],a=e.map(l=>l.shape);jC(a,s);const o=yA(e.map(l=>l.shape),s);if(ze(o)===0)return t.makeTensorInfo(o,e[0].dtype,[]);const A=e.filter(l=>ze(l.shape)>0);return A.length===1?Ei({inputs:{x:A[0]},backend:t}):bc(A,s,t)}const ij={kernelName:Nv,backendName:"webgl",kernelFunc:yB};/** 13862 * @license 13863 * Copyright 2017 Google LLC. All Rights Reserved. 13864 * Licensed under the Apache License, Version 2.0 (the "License"); 13865 * you may not use this file except in compliance with the License. 13866 * You may obtain a copy of the License at 13867 * 13868 * http://www.apache.org/licenses/LICENSE-2.0 13869 * 13870 * Unless required by applicable law or agreed to in writing, software 13871 * distributed under the License is distributed on an "AS IS" BASIS, 13872 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13873 * See the License for the specific language governing permissions and 13874 * limitations under the License. 13875 * ============================================================================= 13876 */class vB{constructor(e,t=!1,r=null,i=!1,s=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const a=e.padInfo.top,o=e.padInfo.left,A=e.strideHeight,l=e.strideWidth,c=e.dilationHeight,u=e.dilationWidth,h=e.filterHeight,f=e.filterWidth,d=Math.floor(e.inChannels/4)*4,g=e.inChannels%4,m=e.dataFormat==="channelsLast",p=m?1:2,w=m?2:3,C=m?3:1;let b="",U="";r&&(i?b=`float activation(float a) { 13877 float b = getPreluActivationWeightsAtOutCoords(); 13878 ${r} 13879 }`:s?b=`float activation(float a) { 13880 float b = getLeakyreluAlphaAtOutCoords(); 13881 ${r} 13882 }`:b=` 13883 float activation(float x) { 13884 ${r} 13885 } 13886 `,U="result = activation(result);");const F=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` 13887 ${b} 13888 13889 const ivec2 strides = ivec2(${A}, ${l}); 13890 const ivec2 pads = ivec2(${a}, ${o}); 13891 13892 void main() { 13893 ivec4 coords = getOutputCoords(); 13894 int batch = coords[0]; 13895 int d2 = coords[${C}]; 13896 13897 ivec2 xRCCorner = 13898 ivec2(coords[${p}], coords[${w}]) * strides - pads; 13899 int xRCorner = xRCCorner.x; 13900 int xCCorner = xRCCorner.y; 13901 13902 // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). 13903 // ? = to be determined. : = across all values in that axis. 13904 float dotProd = 0.0; 13905 for (int wR = 0; wR < ${h}; wR++) { 13906 int xR = xRCorner + wR * ${c}; 13907 13908 if (xR < 0 || xR >= ${e.inHeight}) { 13909 continue; 13910 } 13911 13912 for (int wC = 0; wC < ${f}; wC++) { 13913 int xC = xCCorner + wC * ${u}; 13914 13915 if (xC < 0 || xC >= ${e.inWidth}) { 13916 continue; 13917 } 13918 13919 for (int d1 = 0; d1 < ${d}; d1 += 4) { 13920 vec4 wValues = vec4( 13921 getW(wR, wC, d1, d2), 13922 getW(wR, wC, d1 + 1, d2), 13923 getW(wR, wC, d1 + 2, d2), 13924 getW(wR, wC, d1 + 3, d2) 13925 ); 13926 13927 if (${m}) { 13928 vec4 xValues = vec4( 13929 getX(batch, xR, xC, d1), 13930 getX(batch, xR, xC, d1 + 1), 13931 getX(batch, xR, xC, d1 + 2), 13932 getX(batch, xR, xC, d1 + 3) 13933 ); 13934 dotProd += dot(xValues, wValues); 13935 } else { 13936 vec4 xValues = vec4( 13937 getX(batch, d1, xR, xC), 13938 getX(batch, d1 + 1, xR, xC), 13939 getX(batch, d1 + 2, xR, xC), 13940 getX(batch, d1 + 3, xR, xC) 13941 ); 13942 dotProd += dot(xValues, wValues); 13943 } 13944 } 13945 13946 if (${g===1}) { 13947 13948 if (${m}) { 13949 dotProd += 13950 getX(batch, xR, xC, ${d}) * 13951 getW(wR, wC, ${d}, d2); 13952 } else { 13953 dotProd += 13954 getX(batch, ${d}, xR, xC) * 13955 getW(wR, wC, ${d}, d2); 13956 } 13957 13958 } else if (${g===2}) { 13959 vec2 wValues = vec2( 13960 getW(wR, wC, ${d}, d2), 13961 getW(wR, wC, ${d} + 1, d2) 13962 ); 13963 13964 if (${m}) { 13965 vec2 xValues = vec2( 13966 getX(batch, xR, xC, ${d}), 13967 getX(batch, xR, xC, ${d} + 1) 13968 ); 13969 dotProd += dot(xValues, wValues); 13970 } else { 13971 vec2 xValues = vec2( 13972 getX(batch, ${d}, xR, xC), 13973 getX(batch, ${d} + 1, xR, xC) 13974 ); 13975 dotProd += dot(xValues, wValues); 13976 } 13977 13978 } else if (${g===3}) { 13979 vec3 wValues = vec3( 13980 getW(wR, wC, ${d}, d2), 13981 getW(wR, wC, ${d} + 1, d2), 13982 getW(wR, wC, ${d} + 2, d2) 13983 ); 13984 13985 if (${m}) { 13986 vec3 xValues = vec3( 13987 getX(batch, xR, xC, ${d}), 13988 getX(batch, xR, xC, ${d} + 1), 13989 getX(batch, xR, xC, ${d} + 2) 13990 ); 13991 dotProd += dot(xValues, wValues); 13992 } else { 13993 vec3 xValues = vec3( 13994 getX(batch, ${d}, xR, xC), 13995 getX(batch, ${d} + 1, xR, xC), 13996 getX(batch, ${d} + 2, xR, xC) 13997 ); 13998 dotProd += dot(xValues, wValues); 13999 } 14000 14001 } 14002 } 14003 } 14004 14005 float result = dotProd; 14006 ${F} 14007 ${U} 14008 setOutput(result); 14009 } 14010 `}}class sj{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,r=e.padInfo.top,i=e.padInfo.left,s=e.strideDepth,a=e.strideHeight,o=e.strideWidth,A=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.filterDepth,h=e.filterHeight,f=e.filterWidth,d=Math.floor(e.inChannels/4)*4,g=e.inChannels%4;this.userCode=` 14011 const ivec3 strides = ivec3(${s}, ${a}, ${o}); 14012 const ivec3 pads = ivec3(${t}, ${r}, ${i}); 14013 14014 void main() { 14015 ivec5 coords = getOutputCoords(); 14016 int batch = coords.x; 14017 int d2 = coords.u; 14018 14019 ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; 14020 int xFCorner = xFRCCorner.x; 14021 int xRCorner = xFRCCorner.y; 14022 int xCCorner = xFRCCorner.z; 14023 14024 // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get 14025 // y(yF, yR, yC, d2). ? = to be determined. : = across all 14026 // values in that axis. 14027 float dotProd = 0.0; 14028 for (int wF = 0; wF < ${u}; wF++) { 14029 int xF = xFCorner + wF * ${A}; 14030 14031 if (xF < 0 || xF >= ${e.inDepth}) { 14032 continue; 14033 } 14034 14035 for (int wR = 0; wR < ${h}; wR++) { 14036 int xR = xRCorner + wR * ${l}; 14037 14038 if (xR < 0 || xR >= ${e.inHeight}) { 14039 continue; 14040 } 14041 14042 for (int wC = 0; wC < ${f}; wC++) { 14043 int xC = xCCorner + wC * ${c}; 14044 14045 if (xC < 0 || xC >= ${e.inWidth}) { 14046 continue; 14047 } 14048 14049 for (int d1 = 0; d1 < ${d}; d1 += 4) { 14050 vec4 xValues = vec4( 14051 getX(batch, xF, xR, xC, d1), 14052 getX(batch, xF, xR, xC, d1 + 1), 14053 getX(batch, xF, xR, xC, d1 + 2), 14054 getX(batch, xF, xR, xC, d1 + 3) 14055 ); 14056 vec4 wValues = vec4( 14057 getW(wF, wR, wC, d1, d2), 14058 getW(wF, wR, wC, d1 + 1, d2), 14059 getW(wF, wR, wC, d1 + 2, d2), 14060 getW(wF, wR, wC, d1 + 3, d2) 14061 ); 14062 14063 dotProd += dot(xValues, wValues); 14064 } 14065 14066 if (${g===1}) { 14067 dotProd += 14068 getX(batch, xF, xR, xC, ${d}) * 14069 getW(wF, wR, wC, ${d}, d2); 14070 } else if (${g===2}) { 14071 vec2 xValues = vec2( 14072 getX(batch, xF, xR, xC, ${d}), 14073 getX(batch, xF, xR, xC, ${d} + 1) 14074 ); 14075 vec2 wValues = vec2( 14076 getW(wF, wR, wC, ${d}, d2), 14077 getW(wF, wR, wC, ${d} + 1, d2) 14078 ); 14079 dotProd += dot(xValues, wValues); 14080 } else if (${g===3}) { 14081 vec3 xValues = vec3( 14082 getX(batch, xF, xR, xC, ${d}), 14083 getX(batch, xF, xR, xC, ${d} + 1), 14084 getX(batch, xF, xR, xC, ${d} + 2) 14085 ); 14086 vec3 wValues = vec3( 14087 getW(wF, wR, wC, ${d}, d2), 14088 getW(wF, wR, wC, ${d} + 1, d2), 14089 getW(wF, wR, wC, ${d} + 2, d2) 14090 ); 14091 dotProd += dot(xValues, wValues); 14092 } 14093 } 14094 } 14095 } 14096 setOutput(dotProd); 14097 } 14098 `}}/** 14099 * @license 14100 * Copyright 2022 Google LLC. All Rights Reserved. 14101 * Licensed under the Apache License, Version 2.0 (the "License");
14102 * you may not use this file except in compliance with the License. 14103 * You may obtain a copy of the License at 14104 * 14105 * http://www.apache.org/licenses/LICENSE-2.0 14106 * 14107 * Unless required by applicable law or agreed to in writing, software 14108 * distributed under the License is distributed on an "AS IS" BASIS, 14109 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14110 * See the License for the specific language governing permissions and 14111 * limitations under the License. 14112 * ============================================================================= 14113 */class wB{constructor(e,t=!1,r=null,i=!1,s=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=Vr(this.outputShape.length);const a=e.padInfo.left,o=e.strideWidth,A=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,u=c;let h=` 14114 int xR; int xC; int xCOffset; 14115 vec4 wTexel; vec4 previous; vec4 final;`;for(let m=0;m<c;m++)h+=` 14116 vec4 xTexelC${m*2}; 14117 int xTexelC${m*2}Ready; 14118 vec4 xTexelC${m*2+1}; 14119 int xTexelC${m*2+1}Ready; 14120 vec4 xC${m};`;h+=` 14121 for (int r = 0; r < ${l}; r++) { 14122 for (int d1 = 0; d1 < ${e.inChannels}; d1 += 2) { 14123 `;for(let m=0;m<c;m++)h+=` 14124 xTexelC${m*2} = vec4(0.0); 14125 xTexelC${m*2}Ready = 0; 14126 xTexelC${m*2+1} = vec4(0.0); 14127 xTexelC${m*2+1}Ready = 0; 14128 xC${m} = vec4(0.0);`;h+=` 14129 xR = xRCorner + r * dilations[0]; 14130 if (xR >=0 && xR < inDims[0]) { 14131 `;for(let m=0;m<(u+1)/2;m++){const p=m*2;if(h+=` 14132 xC = xCCorner + ${p*A}; 14133 `,o===1){if(p<c&&(a%2===1?(h+=` 14134 xCOffset = xC + 1; 14135 if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${p}Ready == 0) { 14136 xTexelC${p} = getX(batch, xR, xCOffset, d1); 14137 14138 // Need to manually clear unused channels in case 14139 // we're reading from recycled texture. 14140 if (xCOffset + 1 >= inDims[1]) { 14141 xTexelC${p}.zw = vec2(0.0); 14142 } 14143 xTexelC${p}Ready = 1; 14144 } 14145 `,A===1&&p>0?h+=` 14146 xC${p} = vec4(xTexelC${p-2}.zw, xTexelC${p}.xy); 14147 `:h+=` 14148 xCOffset = xC + 1 - 2; 14149 14150 if (xCOffset >= 0 && xCOffset < inDims[1]) { 14151 previous = getX(batch, xR, xCOffset, d1); 14152 14153 // Need to manually clear unused channels in case 14154 // we're reading from recycled texture. 14155 if (xCOffset + 1 >= inDims[1]) { 14156 previous.zw = vec2(0.0); 14157 } 14158 14159 xC${p} = vec4(previous.zw, xTexelC${p}.xy); 14160 } else { 14161 xC${p} = vec4(0.0, 0.0, xTexelC${p}.xy); 14162 } 14163 `):h+=` 14164 if (xC >= 0 && xC < inDims[1] && xTexelC${p}Ready == 0) { 14165 xTexelC${p} = getX(batch, xR, xC, d1); 14166 if (xC + 1 >= inDims[1]) { 14167 xTexelC${p}.zw = vec2(0.0); 14168 } 14169 xTexelC${p}Ready = 1; 14170 } 14171 14172 xC${p} = xTexelC${p}; 14173 `,p+1<c)){const w=a%2===0?xg(A):A;A%2===0&&a%2===1||A%2!==0&&a%2!==1?(h+=` 14174 xCOffset = xC + imod(pads[1], 2) + ${w}; 14175 14176 if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${p+1}Ready == 0) { 14177 xTexelC${p+1} = getX(batch, xR, xCOffset, d1); 14178 14179 // Need to manually clear unused channels in case 14180 // we're reading from recycled texture. 14181 if (xCOffset + 1 >= inDims[1]) { 14182 xTexelC${p+1}.zw = vec2(0.0); 14183 } 14184 xTexelC${p+1}Ready = 1; 14185 } 14186 `,A>1?h+=` 14187 xCOffset -= 2; 14188 if (xCOffset >= 0 && xCOffset < inDims[1]) { 14189 previous = getX(batch, xR, xCOffset, d1); 14190 xC${p+1} = vec4(previous.zw, xTexelC${p+1}.xy); 14191 } else { 14192 xC${p+1} = vec4(0.0, 0.0, xTexelC${p+1}.xy); 14193 } 14194 `:h+=` 14195 xC${p+1} = vec4(xTexelC${p}.zw, xTexelC${p+1}.xy); 14196 `):w===1?h+=` 14197 xC${p+1} = xTexelC${p}; 14198 `:h+=` 14199 xCOffset = xC + ${w}; 14200 14201 if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${p+1}Ready == 0) { 14202 xTexelC${p+1} = getX(batch, xR, xCOffset, d1); 14203 if (xCOffset + 1 >= inDims[1]) { 14204 xTexelC${p+1}.zw = vec2(0.0); 14205 } 14206 xTexelC${p+1}Ready = 1; 14207 } 14208 14209 xC${p+1} = xTexelC${p+1}; 14210 `}}else p<c&&(a%2===1?(h+=` 14211 xCOffset = xC + 1 - strides[1]; 14212 if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${p}Ready == 0) { 14213 xTexelC${p} = getX(batch, xR, xCOffset, d1); 14214 // Need to manually clear unused channels in case 14215 // we're reading from recycled texture. 14216 if (xCOffset + 1 >= inDims[1]) { 14217 xTexelC${p}.zw = vec2(0.0); 14218 } 14219 xTexelC${p}Ready = 1; 14220 } 14221 14222 if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${p+1}Ready == 0) { 14223 xTexelC${p+1} = getX(batch, xR, xC + 1, d1); 14224 // Need to manually clear unused channels in case 14225 // we're reading from recycled texture. 14226 if (xC + 2 >= inDims[1]) { 14227 xTexelC${p+1}.zw = vec2(0.0); 14228 } 14229 xTexelC${p+1}Ready = 1; 14230 } 14231 14232 xC${p} = vec4(xTexelC${p}.zw, xTexelC${p+1}.zw); 14233 `,p+1<c&&(h+=` 14234 final = vec4(0.0); 14235 xCOffset = xC + 1 + strides[1]; 14236 if(xCOffset >= 0 && xCOffset < inDims[1]) { 14237 final = getX(batch, xR, xCOffset, d1); 14238 } 14239 xC${p+1} = vec4(xTexelC${p+1}.xy, final.xy); 14240 `)):(h+=` 14241 if(xC >= 0 && xC < inDims[1] && xTexelC${p}Ready == 0) { 14242 xTexelC${p} = getX(batch, xR, xC, d1); 14243 if (xC + 1 >= inDims[1]) { 14244 xTexelC${p}.zw = vec2(0.0); 14245 } 14246 xTexelC${p}Ready = 1; 14247 } 14248 14249 xCOffset = xC + strides[1]; 14250 if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${p+1}Ready == 0) { 14251 xTexelC${p+1} = getX(batch, xR, xCOffset, d1); 14252 if (xCOffset + 1 >= inDims[1]) { 14253 xTexelC${p+1}.zw = vec2(0.); 14254 } 14255 xTexelC${p+1}Ready = 1; 14256 } 14257 14258 xC${p} = vec4( 14259 xTexelC${p}.xy, xTexelC${p+1}.xy); 14260 `,p+1<c&&(h+=` 14261 xC${p+1} = vec4(xTexelC${p}.zw, xTexelC${p+1}.zw); 14262 `)));p<c&&(h+=` 14263 wTexel = getW(r, ${p}, d1, d2); 14264 dotProd += xC${p}.xxzz * vec4(wTexel.xy, wTexel.xy); 14265 if(d1 + 1 < ${e.inChannels}) { 14266 dotProd += xC${p}.yyww * vec4(wTexel.zw, wTexel.zw); 14267 } 14268 `,p+1<c&&(h+=` 14269 wTexel = getW(r, ${p+1}, d1, d2); 14270 dotProd += xC${p+1}.xxzz * vec4(wTexel.xy, wTexel.xy); 14271 if(d1 + 1 < ${e.inChannels}) { 14272 dotProd += xC${p+1}.yyww * vec4(wTexel.zw, wTexel.zw); 14273 } 14274 `))}h+=` 14275 } 14276 `,h+=` 14277 } 14278 `,h+=` 14279 } 14280 `;let f="",d="";r&&(i?f=`vec4 activation(vec4 a) { 14281 vec4 b = getPreluActivationWeightsAtOutCoords(); 14282 ${r} 14283 }`:s?f=`vec4 activation(vec4 a) { 14284 vec4 b = getLeakyreluAlphaAtOutCoords(); 14285 ${r} 14286 }`:f=`vec4 activation(vec4 x) { 14287 ${r} 14288 }`,d="result = activation(result);");const g=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` 14289 ${f} 14290 14291 void main() { 14292 ivec4 coords = getOutputCoords(); 14293 int batch = coords.x; 14294 ivec2 xRCCorner = coords.yz * strides - pads; 14295 int d2 = coords.w; 14296 int xRCorner = xRCCorner.x; 14297 int xCCorner = xRCCorner.y; 14298 14299 //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss. 14300 vec4 dotProd = vec4(0.000000000000001); 14301 14302 ${h} 14303 14304 vec4 result = dotProd - vec4(0.000000000000001); 14305 ${g} 14306 ${d} 14307 setOutput(result); 14308 } 14309 `}}/** 14310 * @license 14311 * Copyright 2019 Google LLC. All Rights Reserved. 14312 * Licensed under the Apache License, Version 2.0 (the "License");
14313 * you may not use this file except in compliance with the License. 14314 * You may obtain a copy of the License at 14315 * 14316 * http://www.apache.org/licenses/LICENSE-2.0 14317 * 14318 * Unless required by applicable law or agreed to in writing, software 14319 * distributed under the License is distributed on an "AS IS" BASIS, 14320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14321 * See the License for the specific language governing permissions and 14322 * limitations under the License. 14323 * ============================================================================= 14324 */class aj{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec4"},{name:"pad",type:"ivec2"},{name:"stride",type:"ivec2"},{name:"dilation",type:"ivec2"},{name:"inChannels",type:"int"},{name:"itemsPerBlockRow",type:"int"},{name:"outWidth",type:"int"}],this.outputShape=e,this.enableShapeUniforms=Vr(this.outputShape.length);const{dataFormat:r}=t,i=Zr(),s=r==="channelsLast",a=s?1:2,o=s?2:3,A=this.enableShapeUniforms?"if(blockIndex < outShape[2] && pos < outShape[1]) {":`if(blockIndex < ${e[2]} && pos < ${e[1]}) {`;let l="";for(let c=0;c<=1;c++)for(let u=0;u<=1;u++)l+=` 14325 blockIndex = rc.z + ${u}; 14326 pos = rc.y + ${c}; 14327 14328 ${A} 14329 offsetY = int(blockIndex / outWidth) * stride[0] - pad[0]; 14330 d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow); 14331 14332 if(d0 < inputShape[${a}] && d0 >= 0) { 14333 // Use custom imod instead mod. On Intel GPU, mod may generate 14334 // unexpected value. 14335 // https://github.com/tensorflow/tfjs/issues/5447 14336 offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1]; 14337 d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) / 14338 inChannels); 14339 14340 if(d1 < inputShape[${o}] && d1 >= 0) { 14341 14342 ch = imod(pos, inChannels); 14343 14344 if (${s}) { 14345 innerDims = vec2(d1, ch); 14346 result[${c*2+u}] = getChannel( 14347 getA(rc.x, d0, int(innerDims.x), 14348 int(innerDims.y)), innerDims); 14349 } else { 14350 innerDims = vec2(d0, d1); 14351 result[${c*2+u}] = getChannel( 14352 getA(rc.x, ch, int(innerDims.x), 14353 int(innerDims.y)), innerDims); 14354 } 14355 } 14356 } 14357 } 14358 `;this.userCode=` 14359 void main() { 14360 ivec3 rc = getOutputCoords(); 14361 14362 vec4 result = vec4(0); 14363 14364 int blockIndex, pos, offsetY, d0, offsetX, d1, ch; 14365 vec2 innerDims; 14366 14367 ${l} 14368 14369 ${i.output} = result; 14370 } 14371 `}}/** 14372 * @license 14373 * Copyright 2020 Google LLC. All Rights Reserved. 14374 * Licensed under the Apache License, Version 2.0 (the "License"); 14375 * you may not use this file except in compliance with the License. 14376 * You may obtain a copy of the License at 14377 * 14378 * http://www.apache.org/licenses/LICENSE-2.0 14379 * 14380 * Unless required by applicable law or agreed to in writing, software 14381 * distributed under the License is distributed on an "AS IS" BASIS, 14382 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14383 * See the License for the specific language governing permissions and 14384 * limitations under the License. 14385 * ============================================================================= 14386 */function Ef(n,e){const t=n.length;return t>=3?e?[...n.slice(0,-3),n[t-3]*n[t-2],n[t-1]]:[...n.slice(0,-3),n[t-3],n[t-2]*n[t-1]]:!e&&t===1&&n[0]>1?[n[0],1]:null}function xB({x:n,filter:e,convInfo:t,backend:r,bias:i=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:o=null}){const A=n.shape,l=r.texData.get(n.dataId),c=t.inChannels,u=A[0]*A[1]*A[2],h=t.outChannels,f=t.dataFormat==="channelsLast",d=!1,g=!1;let m;const p=[];if(s!=null){const b=Ef(s.shape,f);b!=null&&(s=et({inputs:{x:s},backend:r,attrs:{shape:b}}),p.push(s))}if(i!=null){const b=Ef(i.shape,f);b!=null&&(i=et({inputs:{x:i},backend:r,attrs:{shape:b}}),p.push(i))}if(!((u===1||h===1)&&c>fB)&&l.isPacked&&f&&l.texture!=null&&A[2]%2!==0&&rr(l.shape.slice(-3),A.slice(-3))){const b=A[0]*A[1]*(A[2]+1),U={dataId:n.dataId,shape:[1,b,t.inChannels],dtype:n.dtype},F=l.shape;l.shape=l.shape.slice(),l.shape[l.shape.length-2]++,H(Cf(l.shape,U.shape),()=>`packed reshape ${l.shape} to ${U.shape} isn't free`);const D=et({inputs:{x:e},backend:r,attrs:{shape:[1,t.inChannels,t.outChannels]}});p.push(D);const O=Bf({a:U,b:D,backend:r,transposeA:d,transposeB:g,bias:i,activation:o,preluActivationWeights:s,leakyreluAlpha:a}),I=r.texData.get(O.dataId);H(I.isPacked,()=>"batchMatMul result is expected to be packed"),l.shape=F,I.shape=t.outShape,m=Ei({input
vendor: 10,861 bytes, lines 14386-14608
14386s:{x:O},backend:r}),m.shape=t.outShape,p.push(O)}else{const b=t.outHeight*t.outWidth,U=et({inputs:{x:n},backend:r,attrs:{shape:f?[t.batchSize,b,t.inChannels]:[t.batchSize,t.inChannels,b]}}),F=et({inputs:{x:e},backend:r,attrs:{shape:[1,t.inChannels,t.outChannels]}}),D=Bf({a:f?U:F,b:f?F:U,transposeA:!f,transposeB:g,backend:r,bias:i,activation:o,preluActivationWeights:s,leakyreluAlpha:a});m=et({inputs:{x:D},backend:r,attrs:{shape:t.outShape}}),p.push(U),p.push(F),p.push(D)}for(const b of p)r.disposeIntermediateTensorInfo(b);return m}function bB({x:n,filter:e,convInfo:t,backend:r,bias:i=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:o=null}){const{filterWidth:A,filterHeight:l,inChannels:c,outWidth:u,outHeight:h,dataFormat:f}=t,d=f==="channelsLast",g=A*l*c,m=h*u,p=[t.batchSize,g,m],w=!0,C=!1,b=[];if(s!=null){const ae=Ef(s.shape,d);ae!=null&&(s=et({inputs:{x:s},backend:r,attrs:{shape:ae}}),b.push(s))}if(i!=null){const ae=Ef(i.shape,d);ae!=null&&(i=et({inputs:{x:i},backend:r,attrs:{shape:ae}}),b.push(i))}const U=et({inputs:{x:e},backend:r,attrs:{shape:[1,g,ze(e.shape)/g]}});b.push(U);const F=new aj(p,t),D=[n.shape,[t.padInfo.top,t.padInfo.left],[t.strideHeight,t.strideWidth],[t.dilationHeight,t.dilationWidth],[t.inChannels],[t.filterWidth*t.inChannels],[t.outWidth]],O=r.runWebGLProgram(F,[n],"float32",D),I=et({inputs:{x:O},backend:r,attrs:{shape:p}});b.push(O),b.push(I);const R=i!=null,V=s!=null,re=o==="leakyrelu",Y=o?nu(o,!0):null,se=new hB(d?I.shape:U.shape,d?U.shape:I.shape,d?[t.batchSize,m,t.outChannels]:[t.batchSize,t.outChannels,m],w,C,R,Y,V,re),ge=d?[I,U]:[U,I];if(i&&ge.push(i),V&&ge.push(s),re){const ae=r.makeTensorInfo([],"float32",Hl(a,"float32"));ge.push(ae),b.push(ae)}const ue=r.runWebGLProgram(se,ge,"float32"),Ce=et({inputs:{x:ue},backend:r,attrs:{shape:t.outShape}});b.push(ue);for(const ae of b)r.disposeIntermediateTensorInfo(ae);return Ce}/** 14387 * @license 14388 * Copyright 2020 Google LLC. All Rights Reserved. 14389 * Licensed under the Apache License, Version 2.0 (the "License"); 14390 * you may not use this file except in compliance with the License. 14391 * You may obtain a copy of the License at 14392 * 14393 * http://www.apache.org/licenses/LICENSE-2.0 14394 * 14395 * Unless required by applicable law or agreed to in writing, software 14396 * distributed under the License is distributed on an "AS IS" BASIS, 14397 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14398 * See the License for the specific language governing permissions and 14399 * limitations under the License. 14400 * ============================================================================= 14401 */function oj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,filter:s}=e,{strides:a,pad:o,dataFormat:A,dilations:l,dimRoundingMode:c}=r,u=Vl(A),h=$i(i.shape,s.shape,a,l,o,c,!1,u);let f;if(h.filterHeight===1&&h.filterWidth===1&&h.dilationHeight===1&&h.dilationWidth===1&&h.strideHeight===1&&h.strideWidth===1&&(h.padInfo.type==="SAME"||h.padInfo.type==="VALID"))f=xB({x:i,filter:s,convInfo:h,backend:t});else if(h.strideWidth<=2&&u==="channelsLast"&&pe().getBool("WEBGL_EXP_CONV")){const g=new wB(h),m=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];f=t.runWebGLProgram(g,[i,s],"float32",m)}else if(pe().getBool("WEBGL_CONV_IM2COL"))f=bB({x:i,filter:s,convInfo:h,backend:t});else{const g=new vB(h);f=t.runWebGLProgram(g,[i,s],"float32")}const d=et({inputs:{x:f},backend:t,attrs:{shape:h.outShape}});return t.disposeIntermediateTensorInfo(f),d}const Aj={kernelName:Dv,backendName:"webgl",kernelFunc:oj};/** 14402 * @license 14403 * Copyright 2017 Google LLC. All Rights Reserved. 14404 * Licensed under the Apache License, Version 2.0 (the "License"); 14405 * you may not use this file except in compliance with the License. 14406 * You may obtain a copy of the License at 14407 * 14408 * http://www.apache.org/licenses/LICENSE-2.0 14409 * 14410 * Unless required by applicable law or agreed to in writing, software 14411 * distributed under the License is distributed on an "AS IS" BASIS, 14412 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14413 * See the License for the specific language governing permissions and 14414 * limitations under the License. 14415 * ============================================================================= 14416 */class lj{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,r=e.strideWidth,i=e.padInfo.top,s=e.padInfo.left,a=e.dataFormat==="channelsLast";this.userCode=` 14417 void main() { 14418 ivec4 coords = getOutputCoords(); 14419 int wR = coords.x; 14420 int wC = coords.y; 14421 int d1 = coords.z; 14422 int d2 = coords.w; 14423 14424 // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2). 14425 // ? = to be determined. : = across all values in that axis. 14426 float dotProd = 0.0; 14427 14428 for (int b = 0; b < ${e.batchSize}; b++) { 14429 for (int yR = 0; yR < ${e.outHeight}; yR++) { 14430 int xR = wR + yR * ${t} - ${i}; 14431 14432 if (xR < 0 || xR >= ${e.inHeight}) { 14433 continue; 14434 } 14435 14436 for (int yC = 0; yC < ${e.outWidth}; yC++) { 14437 int xC = wC + yC * ${r} - ${s}; 14438 14439 if (xC < 0 || xC >= ${e.inWidth}) { 14440 continue; 14441 } 14442 14443 ${a?`float dyValue = getDy(b, yR, yC, d2); 14444 float xValue = getX(b, xR, xC, d1); 14445 dotProd += (xValue * dyValue);`:`float dyValue = getDy(b, d2, yR, yC); 14446 float xValue = getX(b, d1, xR, xC); 14447 dotProd += (xValue * dyValue);`} 14448 } 14449 } 14450 } 14451 setOutput(dotProd); 14452 } 14453 `}}class cj{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,r=e.filterWidth,i=e.strideHeight,s=e.strideWidth,a=e.dataFormat==="channelsLast",o=t-1-e.padInfo.top,A=r-1-e.padInfo.left,l=a?1:2,c=a?2:3,u=a?3:1;this.userCode=` 14454 const ivec2 pads = ivec2(${o}, ${A}); 14455 14456 void main() { 14457 ivec4 coords = getOutputCoords(); 14458 int batch = coords[0]; 14459 int d1 = coords[${u}]; 14460 14461 ivec2 dyCorner = ivec2(coords[${l}], coords[${c}]) - pads; 14462 int dyRCorner = dyCorner.x; 14463 int dyCCorner = dyCorner.y; 14464 14465 // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). 14466 // ? = to be determined. : = across all values in that axis. 14467 float dotProd = 0.0; 14468 for (int wR = 0; wR < ${t}; wR++) { 14469 float dyR = float(dyRCorner + wR) / ${i}.0; 14470 14471 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { 14472 continue; 14473 } 14474 int idyR = int(dyR); 14475 14476 int wRPerm = ${t} - 1 - wR; 14477 14478 for (int wC = 0; wC < ${r}; wC++) { 14479 float dyC = float(dyCCorner + wC) / ${s}.0; 14480 14481 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 14482 fract(dyC) > 0.0) { 14483 continue; 14484 } 14485 int idyC = int(dyC); 14486 14487 int wCPerm = ${r} - 1 - wC; 14488 14489 for (int d2 = 0; d2 < ${e.outChannels}; d2++) { 14490 14491 if (${a}) { 14492 float xValue = getDy(batch, idyR, idyC, d2); 14493 float wValue = getW(wRPerm, wCPerm, d1, d2); 14494 dotProd += xValue * wValue; 14495 } else { 14496 float xValue = getDy(batch, d2, idyR, idyC); 14497 float wValue = getW(wRPerm, wCPerm, d1, d2); 14498 dotProd += xValue * wValue; 14499 } 14500 14501 } 14502 } 14503 } 14504 setOutput(dotProd); 14505 } 14506 `}}class uj{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,r=e.strideHeight,i=e.strideWidth,s=e.padInfo.front,a=e.padInfo.top,o=e.padInfo.left;this.userCode=` 14507 void main() { 14508 ivec5 coords = getOutputCoords(); 14509 int wF = coords.x; 14510 int wR = coords.y; 14511 int wC = coords.z; 14512 int d1 = coords.w; 14513 int d2 = coords.u; 14514 14515 float dotProd = 0.0; 14516 14517 for (int b = 0; b < ${e.batchSize}; b++) { 14518 for (int yF = 0; yF < ${e.outDepth}; yF++) { 14519 int xF = wF + yF * ${t} - ${s}; 14520 14521 if (xF < 0 || xF >= ${e.inDepth}) { 14522 continue; 14523 } 14524 14525 for (int yR = 0; yR < ${e.outHeight}; yR++) { 14526 int xR = wR + yR * ${r} - ${a}; 14527 14528 if (xR < 0 || xR >= ${e.inHeight}) { 14529 continue; 14530 } 14531 14532 for (int yC = 0; yC < ${e.outWidth}; yC++) { 14533 int xC = wC + yC * ${i} - ${o}; 14534 14535 if (xC < 0 || xC >= ${e.inWidth}) { 14536 continue; 14537 } 14538 14539 float dyValue = getDy(b, yF, yR, yC, d2); 14540 float xValue = getX(b, xF, xR, xC, d1); 14541 dotProd += (xValue * dyValue); 14542 } 14543 } 14544 } 14545 } 14546 setOutput(dotProd); 14547 } 14548 `}}class hj{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,r=e.filterHeight,i=e.filterWidth,s=e.strideDepth,a=e.strideHeight,o=e.strideWidth,A=t-1-e.padInfo.front,l=r-1-e.padInfo.top,c=i-1-e.padInfo.left;this.userCode=` 14549 const ivec3 pads = ivec3(${A}, ${l}, ${c}); 14550 14551 void main() { 14552 ivec5 coords = getOutputCoords(); 14553 int batch = coords.x; 14554 int d1 = coords.u; 14555 14556 14557 ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; 14558 int dyFCorner = dyCorner.x; 14559 int dyRCorner = dyCorner.y; 14560 int dyCCorner = dyCorner.z; 14561 14562 float dotProd = 0.0; 14563 for (int wF = 0; wF < ${t}; wF++) { 14564 float dyF = float(dyFCorner + wF) / ${s}.0; 14565 14566 if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { 14567 continue; 14568 } 14569 int idyF = int(dyF); 14570 14571 int wFPerm = ${t} - 1 - wF; 14572 14573 for (int wR = 0; wR < ${r}; wR++) { 14574 float dyR = float(dyRCorner + wR) / ${a}.0; 14575 14576 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || 14577 fract(dyR) > 0.0) { 14578 continue; 14579 } 14580 int idyR = int(dyR); 14581 14582 int wRPerm = ${r} - 1 - wR; 14583 14584 for (int wC = 0; wC < ${i}; wC++) { 14585 float dyC = float(dyCCorner + wC) / ${o}.0; 14586 14587 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 14588 fract(dyC) > 0.0) { 14589 continue; 14590 } 14591 int idyC = int(dyC); 14592 14593 int wCPerm = ${i} - 1 - wC; 14594 14595 for (int d2 = 0; d2 < ${e.outChannels}; d2++) { 14596 float xValue = getDy(batch, idyF, idyR, idyC, d2); 14597 float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2); 14598 dotProd += xValue * wValue; 14599 } 14600 } 14601 } 14602 } 14603 setOutput(dotProd); 14604 } 14605 `}}/** 14606 * @license 14607 * Copyright 2020 Google LLC. All Rights Reserved. 14608 * Licensed under the Apache License, Version 2.0 (the "License");
14609 * you may not use this file except in compliance with the License. 14610 * You may obtain a copy of the License at 14611 * 14612 * http://www.apache.org/licenses/LICENSE-2.0 14613 * 14614 * Unless required by applicable law or agreed to in writing, software 14615 * distributed under the License is distributed on an "AS IS" BASIS, 14616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14617 * See the License for the specific language governing permissions and 14618 * limitations under the License. 14619 * ============================================================================= 14620 */function fj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,dy:s}=e,{strides:a,pad:o,dataFormat:A,dimRoundingMode:l,filterShape:c}=r,u=Vl(A),h=$i(i.shape,c,a,1,o,l,!1,u),f=new lj(h);return t.runWebGLProgram(f,[i,s],"float32")}const dj={kernelName:Lv,backendName:"webgl",kernelFunc:fj};/** 14621 * @license 14622 * Copyright 2023 Google LLC. 14623 * Licensed under the Apache License, Version 2.0 (the "License"); 14624 * you may not use this file except in compliance with the License. 14625 * You may obtain a copy of the License at 14626 * 14627 * http://www.apache.org/licenses/LICENSE-2.0 14628 * 14629 * Unless required by applicable law or agreed to in writing, software 14630 * distributed under the License is distributed on an "AS IS" BASIS, 14631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14632 * See the License for the specific language governing permissions and 14633 * limitations under the License. 14634 * ============================================================================= 14635 */class pj{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=Vr(this.outputShape.length);const t=e.filterHeight,r=e.filterWidth,i=t-1-e.padInfo.top,s=r-1-e.padInfo.left;this.userCode=` 14636 const ivec2 pads = ivec2(${i}, ${s}); 14637 14638 void main() { 14639 ivec4 coords = getOutputCoords(); 14640 int batch = coords[0]; 14641 int d1 = coords[3]; 14642 14643 ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads; 14644 int dyRCorner = dyCorner.x; 14645 int dyCCorner = dyCorner.y; 14646 14647 vec4 result = vec4(0.); 14648 for (int wR = 0; wR < ${t}; wR++) { 14649 float dyR = float(dyRCorner + wR) / strides[0]; 14650 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { 14651 continue; 14652 } 14653 int idyR = int(dyR); 14654 int wRPerm = ${t} - 1 - wR; 14655 14656 for (int wC = 0; wC < ${r}; wC++) { 14657 int wCPerm = ${r} - 1 - wC; 14658 14659 float dyC = float(dyCCorner + wC) / strides[1]; 14660 bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0) 14661 && (fract(dyC) == 0.0); 14662 int idyC = int(dyC); 14663 14664 float dyC2 = float(dyCCorner + wC + 1) / strides[1]; 14665 bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0) 14666 && (fract(dyC2) == 0.0); 14667 int idyC2 = int(dyC2); 14668 14669 if (idyCVal && idyCVal2) { 14670 for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { 14671 vec4 wValue = getW(wRPerm, wCPerm, d1, d2); 14672 vec4 dySample = getDy(batch, idyR, idyC, d2); 14673 vec4 dySample2 = (idyC / 2 == idyC2 / 2) ? 14674 dySample : getDy(batch, idyR, idyC2, d2); 14675 14676 vec2 dyValue = mod(float(idyC), 2.) == 0. ? 14677 dySample.xy : dySample.zw; 14678 result.xy += vec2(dot(dyValue, wValue.xy), 14679 dot(dyValue, wValue.zw)); 14680 14681 dyValue = mod(float(idyC2), 2.) == 0. ? 14682 dySample2.xy : dySample2.zw; 14683 result.zw += vec2(dot(dyValue, wValue.xy), 14684 dot(dyValue, wValue.zw)); 14685 } 14686 } else if (idyCVal) { 14687 for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { 14688 vec4 wValue = getW(wRPerm, wCPerm, d1, d2); 14689 vec4 dySample = getDy(batch, idyR, idyC, d2); 14690 vec2 dyValue = mod(float(idyC), 2.) == 0. ? 14691 dySample.xy : dySample.zw; 14692 result.xy += vec2(dot(dyValue, wValue.xy), 14693 dot(dyValue, wValue.zw)); 14694 } 14695 } else if (idyCVal2) { 14696 for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { 14697 vec4 wValue = getW(wRPerm, wCPerm, d1, d2); 14698 vec4 dySample = getDy(batch, idyR, idyC2, d2); 14699 vec2 dyValue = mod(float(idyC2), 2.) == 0. ? 14700 dySample.xy : dySample.zw; 14701 result.zw += vec2(dot(dyValue, wValue.xy), 14702 dot(dyValue, wValue.zw)); 14703 } 14704 } 14705 } 14706 } 14707 setOutput(result); 14708 } 14709 `}}/** 14710 * @license 14711 * Copyright 2020 Google LLC. All Rights Reserved. 14712 * Licensed under the Apache License, Version 2.0 (the "License");
14713 * you may not use this file except in compliance with the License. 14714 * You may obtain a copy of the License at 14715 * 14716 * http://www.apache.org/licenses/LICENSE-2.0 14717 * 14718 * Unless required by applicable law or agreed to in writing, software 14719 * distributed under the License is distributed on an "AS IS" BASIS, 14720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14721 * See the License for the specific language governing permissions and 14722 * limitations under the License. 14723 * ============================================================================= 14724 */function mj(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,filter:s}=e,{inputShape:a,strides:o,pad:A,dataFormat:l,dimRoundingMode:c}=r,u=Vl(l),h=$i(a,s.shape,o,1,A,c,!1,u);if(pe().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&u==="channelsLast"){const f=[[h.strideHeight,h.strideWidth]],d=new pj(h);return t.runWebGLProgram(d,[i,s],"float32",f)}else{const f=new cj(h);return t.runWebGLProgram(f,[i,s],"float32")}}const gj={kernelName:Ov,backendName:"webgl",kernelFunc:mj};/** 14725 * @license 14726 * Copyright 2020 Google LLC. All Rights Reserved. 14727 * Licensed under the Apache License, Version 2.0 (the "License"); 14728 * you may not use this file except in compliance with the License. 14729 * You may obtain a copy of the License at 14730 * 14731 * http://www.apache.org/licenses/LICENSE-2.0 14732 * 14733 * Unless required by applicable law or agreed to in writing, software 14734 * distributed under the License is distributed on an "AS IS" BASIS, 14735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14736 * See the License for the specific language governing permissions and 14737 * limitations under the License. 14738 * ============================================================================= 14739 */function yj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,filter:s}=e,{strides:a,pad:o,dilations:A}=r,l=gu(i.shape,s.shape,a,A,o),c=new sj(l);return t.runWebGLProgram(c,[i,s],"float32")}const vj={kernelName:Pv,backendName:"webgl",kernelFunc:yj};/** 14740 * @license 14741 * Copyright 2020 Google LLC. All Rights Reserved. 14742 * Licensed under the Apache License, Version 2.0 (the "License"); 14743 * you may not use this file except in compliance with the License. 14744 * You may obtain a copy of the License at 14745 * 14746 * http://www.apache.org/licenses/LICENSE-2.0 14747 * 14748 * Unless required by applicable law or agreed to in writing, software 14749 * distributed under the License is distributed on an "AS IS" BASIS, 14750 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14751 * See the License for the specific language governing permissions and 14752 * limitations under the License. 14753 * ============================================================================= 14754 */function wj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,dy:s}=e,{strides:a,pad:o,filterShape:A}=r,l=gu(i.shape,A,a,1,o),c=new uj(l);return t.runWebGLProgram(c,[i,s],"float32")}const xj={kernelName:TM,backendName:"webgl",kernelFunc:wj};/** 14755 * @license 14756 * Copyright 2020 Google LLC. All Rights Reserved. 14757 * Licensed under the Apache License, Version 2.0 (the "License"); 14758 * you may not use this file except in compliance with the License. 14759 * You may obtain a copy of the License at 14760 * 14761 * http://www.apache.org/licenses/LICENSE-2.0 14762 * 14763 * Unless required by applicable law or agreed to in writing, software 14764 * distributed under the License is distributed on an "AS IS" BASIS, 14765 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14766 * See the License for the specific language governing permissions and 14767 * limitations under the License. 14768 * ============================================================================= 14769 */function bj(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,filter:s}=e,{pad:a,strides:o,inputShape:A}=r,l=gu(A,s.shape,o,1,a),c=new hj(l);return t.runWebGLProgram(c,[i,s],"float32")}const Cj={kernelName:kv,backendName:"webgl",kernelFunc:bj};/** 14770 * @license 14771 * Copyright 2020 Google LLC. All Rights Reserved. 14772 * Licensed under the Apache License, Version 2.0 (the "License"); 14773 * you may not use this file except in compliance with the License. 14774 * You may obtain a copy of the License at 14775 * 14776 * http://www.apache.org/licenses/LICENSE-2.0 14777 * 14778 * Unless required by applicable law or agreed to in writing, softw
14778are 14779 * distributed under the License is distributed on an "AS IS" BASIS, 14780 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14781 * See the License for the specific language governing permissions and 14782 * limitations under the License. 14783 * ============================================================================= 14784 */const _j=Jl+` 14785 return cos(x); 14786`,Bj=` 14787 vec4 result = cos(x); 14788 bvec4 isNaN = isnan(x); 14789 ${IA} 14790 return result; 14791`,Ej=vn({opSnippet:_j,packedOpSnippet:Bj}),Sj={kernelName:$v,backendName:"webgl",kernelFunc:Ej};/** 14792 * @license 14793 * Copyright 2020 Google LLC. All Rights Reserved. 14794 * Licensed under the Apache License, Version 2.0 (the "License"); 14795 * you may not use this file except in compliance with the License. 14796 * You may obtain a copy of the License at 14797 * 14798 * http://www.apache.org/licenses/LICENSE-2.0 14799 * 14800 * Unless required by applicable law or agreed to in writing, software 14801 * distributed under the License is distributed on an "AS IS" BASIS, 14802 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14803 * See the License for the specific language governing permissions and 14804 * limitations under the License. 14805 * ============================================================================= 14806 */const Tj=` 14807 float e2x = exp(-x); 14808 return (e2x + 1.0 / e2x) / 2.0; 14809`,Ij=vn({opSnippet:Tj}),Fj={kernelName:Qv,backendName:"webgl",kernelFunc:Ij};/** 14810 * @license 14811 * Copyright 2017 Google LLC. All Rights Reserved. 14812 * Licensed under the Apache License, Version 2.0 (the "License"); 14813 * you may not use this file except in compliance with the License. 14814 * You may obtain a copy of the License at 14815 * 14816 * http://www.apache.org/licenses/LICENSE-2.0 14817 * 14818 * Unless required by applicable law or agreed to in writing, software 14819 * distributed under the License is distributed on an "AS IS" BASIS, 14820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14821 * See the License for the specific language governing permissions and 14822 * limitations under the License. 14823 * ============================================================================= 14824 */class Rj{constructor(e,t,r,i,s){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[a,o,A,l]=e,[c]=t,[u,h]=r;this.outputShape=[c,u,h,l];const f=i==="bilinear"?1:0,[d,g]=[`${o-1}.0`,`${A-1}.0`],[m,p,w]=u>1?[`${(o-1)/(u-1)}`,"(y2-y1) * height_ratio",`y1*${d} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${d}`],[C,b,U]=h>1?[`${(A-1)/(h-1)}`,"(x2-x1) * width_ratio",`x1*${g} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${g}`];this.userCode=` 14825 const float height_ratio = float(${m}); 14826 const float width_ratio = float(${C}); 14827 void main() { 14828 ivec4 coords = getOutputCoords(); 14829 int b = coords[0]; 14830 int y = coords[1]; 14831 int x = coords[2]; 14832 int d = coords[3]; 14833 14834 // get box vals 14835 float y1 = getBoxes(b,0); 14836 float x1 = getBoxes(b,1); 14837 float y2 = getBoxes(b,2); 14838 float x2 = getBoxes(b,3); 14839 14840 // get image in batch index 14841 int bInd = round(getBoxInd(b)); 14842 if(bInd < 0 || bInd >= ${a}) { 14843 return; 14844 } 14845 14846 float height_scale = ${p}; 14847 float width_scale = ${b}; 14848 14849 float in_y = ${w}; 14850 if( in_y < 0.0 || in_y > ${d} ) { 14851 setOutput(float(${s})); 14852 return; 14853 } 14854 float in_x = ${U}; 14855 if( in_x < 0.0 || in_x > ${g} ) { 14856 setOutput(float(${s})); 14857 return; 14858 } 14859 14860 vec2 sourceFracIndexCR = vec2(in_x,in_y); 14861 if(${f} == 1) { 14862 // Compute the four integer indices. 14863 ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); 14864 ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); 14865 14866 float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d); 14867 float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d); 14868 float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d); 14869 float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d); 14870 14871 vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR); 14872 14873 float top = topLeft + (topRight - topLeft) * fracCR.x; 14874 float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x; 14875 float newValue = top + (bottom - top) * fracCR.y; 14876 setOutput(newValue); 14877 } else { 14878 // Compute the coordinators of nearest neighbor point. 14879 ivec2 sourceNearestCR = ivec2(floor( 14880 sourceFracIndexCR + vec2(0.5,0.5))); 14881 float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d); 14882 setOutput(newValue); 14883 } 14884 } 14885 `}}/** 14886 * @license 14887 * Copyright 2020 Google LLC. All Rights Reserved. 14888 * Licensed under the Apache License, Version 2.0 (the "License");
14889 * you may not use this file except in compliance with the License. 14890 * You may obtain a copy of the License at 14891 * 14892 * http://www.apache.org/licenses/LICENSE-2.0 14893 * 14894 * Unless required by applicable law or agreed to in writing, software 14895 * distributed under the License is distributed on an "AS IS" BASIS, 14896 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14897 * See the License for the specific language governing permissions and 14898 * limitations under the License. 14899 * ============================================================================= 14900 */const Uj=n=>{const{inputs:e,backend:t,attrs:r}=n,{image:i,boxes:s,boxInd:a}=e,{cropSize:o,method:A,extrapolationValue:l}=r,c=new Rj(i.shape,s.shape,o,A,l);return t.runWebGLProgram(c,[i,s,a],"float32")},Mj={kernelName:Gv,backendName:"webgl",kernelFunc:Uj};var iu;(function(n){n.Prod="*",n.Sum="+"})(iu||(iu={}));class i4{constructor(e,t,r,i){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const s=this.outputShape.length,a=this.op===iu.Prod?"1.0":"0.0",o=r?a:`getX(${s4(s,"coords",this.op)})`,A=this.outputShape[this.outputShape.length-1];let l="",c="";r?(l=i?`end != ${A-1}`:"end != 0",c=i?"end + 1":"end - 1"):(l=i?`end + pow2 < ${A}`:"end >= pow2",c=i?"end + pow2":"end - pow2"),this.userCode=` 14901 void main() { 14902 ${Mn(s)} coords = getOutputCoords(); 14903 int end = ${a4(s,"coords",this.op)}; 14904 float val = ${o}; 14905 int pow2 = int(pow(2.0, index)); 14906 if (${l}) { 14907 int idx = ${c}; 14908 ${a4(s,"coords",this.op)} = idx; 14909 val ${this.op}= getX(${s4(s,"coords",this.op)}); 14910 } 14911 setOutput(val); 14912 } 14913 `}}function s4(n,e,t){if(n===1)return`${e}`;if(n===2)return`${e}.x, ${e}.y`;if(n===3)return`${e}.x, ${e}.y, ${e}.z`;if(n===4)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw new Error(`Cumulative ${t} for rank ${n} is not yet supported`)}function a4(n,e,t){if(n===1)return`${e}`;if(n===2)return`${e}.y`;if(n===3)return`${e}.z`;if(n===4)return`${e}.w`;throw new Error(`Cumulative ${t} for rank ${n} is not yet supported`)}/** 14914 * @license 14915 * Copyright 2022 Google LLC. All Rights Reserved. 14916 * Licensed under the Apache License, Version 2.0 (the "License"); 14917 * you may not use this file except in compliance with the License. 14918 * You may obtain a copy of the License at 14919 * 14920 * http://www.apache.org/licenses/LICENSE-2.0 14921 * 14922 * Unless required by applicable law or agreed to in writing, software 14923 * distributed under the License is distributed on an "AS IS" BASIS, 14924 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14925 * See the License for the specific language governing permissions and 14926 * limitations under the License. 14927 * ============================================================================= 14928 */function CB(n,e,t,r,i,s){const a=e.shape.length,o=As([r],a);let A=e;o!=null&&(A=Jr({inputs:{x:e},backend:t,attrs:{perm:o}}));const l=ls(1,a)[0];if(l!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${r}`);const c=A.shape[l];let u=Ei({inputs:{x:A},backend:t});for(let h=0;h<=Math.ceil(Math.log2(c))-1;h++){const f=new i4(n,A.shape,!1,s),d=[[h]],g=u;u=t.runWebGLProgram(f,[u],u.dtype,d),t.disposeIntermediateTensorInfo(g)}if(i){const h=new i4(n,A.shape,i,s),f=u;u=t.runWebGLProgram(h,[u],u.dtype),t.disposeIntermediateTensorInfo(f)}if(o!=null){const h=Dg(o),f=Jr({inputs:{x:u},backend:t,attrs:{perm:h}});return t.disposeIntermediateTensorInfo(u),t.disposeIntermediateTensorInfo(A),f}return u}/** 14929 * @license 14930 * Copyright 2022 Google LLC. All Rights Reserved. 14931 * Licensed under the Apache License, Version 2.0 (the "License"); 14932 * you may not use this file except in compliance with the License. 14933 * You may obtain a copy of the License at 14934 * 14935 * http://www.apache.org/licenses/LICENSE-2.0 14936 * 14937 * Unless required by applicable law or agreed to in writing, software 14938 * distributed under the License is distributed on an "AS IS" BASIS, 14939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14940 * See the License for the specific language governing permissions and 14941 * limitations under the License. 14942 * ============================================================================= 14943 */function Nj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,exclusive:a,reverse:o}=r;return CB(iu.Prod,i,t,s,a,o)}const Dj={kernelName:Hv,backendName:"webgl",kernelFunc:Nj};/** 14944 * @license 14945 * Copyright 2022 Google LLC. All Rights Reserved. 14946 * Licensed under the Apache License, Version 2.0 (the "License");
14947 * you may not use this file except in compliance with the License. 14948 * You may obtain a copy of the License at 14949 * 14950 * http://www.apache.org/licenses/LICENSE-2.0 14951 * 14952 * Unless required by applicable law or agreed to in writing, software 14953 * distributed under the License is distributed on an "AS IS" BASIS, 14954 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14955 * See the License for the specific language governing permissions and 14956 * limitations under the License. 14957 * ============================================================================= 14958 */function Lj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,exclusive:a,reverse:o}=r;return CB(iu.Sum,i,t,s,a,o)}const Oj={kernelName:Vv,backendName:"webgl",kernelFunc:Lj};/** 14959 * @license 14960 * Copyright 2020 Google LLC. All Rights Reserved. 14961 * Licensed under the Apache License, Version 2.0 (the "License"); 14962 * you may not use this file except in compliance with the License. 14963 * You may obtain a copy of the License at 14964 * 14965 * http://www.apache.org/licenses/LICENSE-2.0 14966 * 14967 * Unless required by applicable law or agreed to in writing, software 14968 * distributed under the License is distributed on an "AS IS" BASIS, 14969 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14970 * See the License for the specific language governing permissions and 14971 * limitations under the License. 14972 * ============================================================================= 14973 */function Pj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,weights:s}=e,{size:a,binaryOutput:o}=r;if(i.shape.length===1){const A=t.readSync(i.dataId),l=t.readSync(s.dataId),c=rB(A,l,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,c)}else if(i.shape.length===2){const A=t.bufferSync(i),l=t.bufferSync(s),c=Hz(A,l,a,o);return t.makeTensorInfo(c.shape,s.dtype,c.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${i.shape.length}.`)}const kj={kernelName:zv,backendName:"webgl",kernelFunc:Pj};/** 14974 * @license 14975 * Copyright 2018 Google LLC. All Rights Reserved. 14976 * Licensed under the Apache License, Version 2.0 (the "License"); 14977 * you may not use this file except in compliance with the License. 14978 * You may obtain a copy of the License at 14979 * 14980 * http://www.apache.org/licenses/LICENSE-2.0 14981 * 14982 * Unless required by applicable law or agreed to in writing, software 14983 * distributed under the License is distributed on an "AS IS" BASIS, 14984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14985 * See the License for the specific language governing permissions and 14986 * limitations under the License. 14987 * ============================================================================= 14988 */class $j{constructor(e,t,r){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=r,this.userCode=` 14989 void main() { 14990 ivec4 coords = getOutputCoords(); 14991 int b = coords[0]; 14992 int h = ${this.getHeightCoordString()}; 14993 int w = ${this.getWidthCoordString()}; 14994 int d = ${this.getDepthCoordString()}; 14995 14996 int in_h = h / ${t}; 14997 int offset_h = imod(h, ${t}); 14998 int in_w = w / ${t}; 14999 int offset_w = imod(w, ${t}); 15000 int offset_d = (offset_h * ${t} + offset_w) * 15001 ${this.getOutputDepthSize()}; 15002 int in_d = d + offset_d; 15003 15004 float result = ${this.getInputSamplingString()}; 15005 setOutput(result); 15006 } 15007 `}
vendor: 4,458 bytes, lines 15007-15093
15007getHeightCoordString(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"}getWidthCoordString(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"}getDepthCoordString(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"}getOutputDepthSize(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}/** 15008 * @license 15009 * Copyright 2020 Google LLC. All Rights Reserved. 15010 * Licensed under the Apache License, Version 2.0 (the "License"); 15011 * you may not use this file except in compliance with the License. 15012 * You may obtain a copy of the License at 15013 * 15014 * http://www.apache.org/licenses/LICENSE-2.0 15015 * 15016 * Unless required by applicable law or agreed to in writing, software 15017 * distributed under the License is distributed on an "AS IS" BASIS, 15018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15019 * See the License for the specific language governing permissions and 15020 * limitations under the License. 15021 * ============================================================================= 15022 */function Qj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{blockSize:s,dataFormat:a}=r,o=i.shape[0],A=a==="NHWC"?i.shape[1]:i.shape[2],l=a==="NHWC"?i.shape[2]:i.shape[3],c=a==="NHWC"?i.shape[3]:i.shape[1],u=A*s,h=l*s,f=c/(s*s),d=a==="NHWC"?[o,u,h,f]:[o,f,u,h],g=new $j(d,s,a);return t.runWebGLProgram(g,[i],i.dtype)}const Hj={kernelName:Wv,backendName:"webgl",kernelFunc:Qj};/** 15023 * @license 15024 * Copyright 2017 Google LLC. All Rights Reserved. 15025 * Licensed under the Apache License, Version 2.0 (the "License"); 15026 * you may not use this file except in compliance with the License. 15027 * You may obtain a copy of the License at 15028 * 15029 * http://www.apache.org/licenses/LICENSE-2.0 15030 * 15031 * Unless required by applicable law or agreed to in writing, software 15032 * distributed under the License is distributed on an "AS IS" BASIS, 15033 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15034 * See the License for the specific language governing permissions and 15035 * limitations under the License. 15036 * ============================================================================= 15037 */class _B{constructor(e,t=!1,r=null,i=!1,s=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=Vr(this.outputShape.length);const a=e.filterHeight,o=e.filterWidth,A=e.outChannels/e.inChannels;let l="",c="";r&&(i?l=`float activation(float a) { 15038 float b = getPreluActivationWeightsAtOutCoords(); 15039 ${r} 15040 }`:s?l=`float activation(float a) { 15041 float b = getLeakyreluAlphaAtOutCoords(); 15042 ${r} 15043 }`:l=` 15044 float activation(float x) { 15045 ${r} 15046 } 15047 `,c="result = activation(result);");const u=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` 15048 ${l} 15049 15050 void main() { 15051 ivec4 coords = getOutputCoords(); 15052 int batch = coords.x; 15053 ivec2 xRCCorner = coords.yz * strides - pads; 15054 int d2 = coords.w; 15055 int d1 = d2 / ${A}; 15056 int q = d2 - d1 * ${A}; 15057 15058 int xRCorner = xRCCorner.x; 15059 int xCCorner = xRCCorner.y; 15060 15061 // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2). 15062 // ? = to be determined. : = across all values in that axis. 15063 float dotProd = 0.0; 15064 // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. 15065 for (int wR = 0; wR < ${a}; wR++) { 15066 int xR = xRCorner + wR * dilations[0]; 15067 15068 if (xR < 0 || xR >= inDims[0]) { 15069 continue; 15070 } 15071 15072 for (int wC = 0; wC < ${o}; wC++) { 15073 int xC = xCCorner + wC * dilations[1]; 15074 15075 if (xC < 0 || xC >= inDims[1]) { 15076 continue; 15077 } 15078 15079 float xVal = getX(batch, xR, xC, d1); 15080 float wVal = getW(wR, wC, d1, q); 15081 dotProd += xVal * wVal; 15082 } 15083 } 15084 15085 float result = dotProd; 15086 ${u} 15087 ${c} 15088 setOutput(result); 15089 } 15090 `}}/** 15091 * @license 15092 * Copyright 2018 Google LLC. All Rights Reserved. 15093 * Licensed under the Apache License, Version 2.0 (the "License");
15094 * you may not use this file except in compliance with the License. 15095 * You may obtain a copy of the License at 15096 * 15097 * http://www.apache.org/licenses/LICENSE-2.0 15098 * 15099 * Unless required by applicable law or agreed to in writing, software 15100 * distributed under the License is distributed on an "AS IS" BASIS, 15101 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15102 * See the License for the specific language governing permissions and 15103 * limitations under the License. 15104 * ============================================================================= 15105 */class BB{constructor(e,t=!1,r=null,i=!1,s=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=Vr(this.outputShape.length);const a=e.outChannels/e.inChannels,o=e.padInfo.left,A=e.strideWidth,l=e.dilationWidth,c=e.filterHeight,u=e.filterWidth,h=u;let f=` 15106 int xR; int xC; int xCOffset; 15107 vec4 wTexel; vec4 previous; vec4 final;`;for(let p=0;p<u;p++)f+=` 15108 vec4 xTexelC${p*2}; 15109 int xTexelC${p*2}Ready; 15110 vec4 xTexelC${p*2+1}; 15111 int xTexelC${p*2+1}Ready; 15112 vec4 xC${p};`;f+=` 15113 for (int r = 0; r < ${c}; r++) { 15114 `;for(let p=0;p<u;p++)f+=` 15115 xTexelC${p*2} = vec4(0.0); 15116 xTexelC${p*2}Ready = 0; 15117 xTexelC${p*2+1} = vec4(0.0); 15118 xTexelC${p*2+1}Ready = 0; 15119 xC${p} = vec4(0.0);`;f+=` 15120 xR = xRCorner + r * dilations[0]; 15121 if (xR >=0 && xR < inDims[0]) { 15122 `;for(let p=0;p<(h+1)/2;p++){const w=p*2;if(f+=` 15123 xC = xCCorner + ${w*l}; 15124 `,A===1){if(w<u&&(o%2===1?(f+=` 15125 xCOffset = xC + 1; 15126 if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${w}Ready == 0) { 15127 xTexelC${w} = getX(batch, xR, xCOffset, d1); 15128 15129 // Need to manually clear unused channels in case 15130 // we're reading from recycled texture. 15131 if (xCOffset + 1 >= inDims[1]) { 15132 xTexelC${w}.zw = vec2(0.0); 15133 } 15134 xTexelC${w}Ready = 1; 15135 } 15136 `,l===1&&w>0?f+=` 15137 xC${w} = vec4(xTexelC${w-2}.zw, xTexelC${w}.xy); 15138 `:f+=` 15139 xCOffset = xC + 1 - 2; 15140 15141 if (xCOffset >= 0 && xCOffset < inDims[1]) { 15142 previous = getX(batch, xR, xCOffset, d1); 15143 15144 // Need to manually clear unused channels in case 15145 // we're reading from recycled texture. 15146 if (xCOffset + 1 >= inDims[1]) { 15147 previous.zw = vec2(0.0); 15148 } 15149 15150 xC${w} = vec4(previous.zw, xTexelC${w}.xy); 15151 } else { 15152 xC${w} = vec4(0.0, 0.0, xTexelC${w}.xy); 15153 } 15154 `):f+=` 15155 if (xC >= 0 && xC < inDims[1] && xTexelC${w}Ready == 0) { 15156 xTexelC${w} = getX(batch, xR, xC, d1); 15157 if (xC + 1 >= inDims[1]) { 15158 xTexelC${w}.zw = vec2(0.0); 15159 } 15160 xTexelC${w}Ready = 1; 15161 } 15162 15163 xC${w} = xTexelC${w}; 15164 `,w+1<u)){const C=o%2===0?xg(l):l;l%2===0&&o%2===1||l%2!==0&&o%2!==1?(f+=` 15165 xCOffset = xC + imod(pads[1], 2) + ${C}; 15166 15167 if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${w+1}Ready == 0) { 15168 xTexelC${w+1} = getX(batch, xR, xCOffset, d1); 15169 15170 // Need to manually clear unused channels in case 15171 // we're reading from recycled texture. 15172 if (xCOffset + 1 >= inDims[1]) { 15173 xTexelC${w+1}.zw = vec2(0.0); 15174 } 15175 xTexelC${w+1}Ready = 1; 15176 } 15177 `,l>1?f+=` 15178 xCOffset -= 2; 15179 if (xCOffset >= 0 && xCOffset < inDims[1]) { 15180 previous = getX(batch, xR, xCOffset, d1); 15181 xC${w+1} = vec4(previous.zw, xTexelC${w+1}.xy); 15182 } else { 15183 xC${w+1} = vec4(0.0, 0.0, xTexelC${w+1}.xy); 15184 } 15185 `:f+=` 15186 xC${w+1} = vec4(xTexelC${w}.zw, xTexelC${w+1}.xy); 15187 `):C===1?f+=` 15188 xC${w+1} = xTexelC${w}; 15189 `:f+=` 15190 xCOffset = xC + ${C}; 15191 15192 if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${w+1}Ready == 0) { 15193 xTexelC${w+1} = getX(batch, xR, xCOffset, d1); 15194 if (xCOffset + 1 >= inDims[1]) { 15195 xTexelC${w+1}.zw = vec2(0.0); 15196 } 15197 xTexelC${w+1}Ready = 1; 15198 } 15199 15200 xC${w+1} = xTexelC${w+1}; 15201 `}}
vendor: 5,179 bytes, lines 15201-15312
15201else w<u&&(o%2===1?(f+=` 15202 xCOffset = xC + 1 - strides[1]; 15203 if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${w}Ready == 0) { 15204 xTexelC${w} = getX(batch, xR, xCOffset, d1); 15205 // Need to manually clear unused channels in case 15206 // we're reading from recycled texture. 15207 if (xCOffset + 1 >= inDims[1]) { 15208 xTexelC${w}.zw = vec2(0.0); 15209 } 15210 xTexelC${w}Ready = 1; 15211 } 15212 15213 if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${w+1}Ready == 0) { 15214 xTexelC${w+1} = getX(batch, xR, xC + 1, d1); 15215 // Need to manually clear unused channels in case 15216 // we're reading from recycled texture. 15217 if (xC + 2 >= inDims[1]) { 15218 xTexelC${w+1}.zw = vec2(0.0); 15219 } 15220 xTexelC${w+1}Ready = 1; 15221 } 15222 15223 xC${w} = vec4(xTexelC${w}.zw, xTexelC${w+1}.zw); 15224 `,w+1<u&&(f+=` 15225 final = vec4(0.0); 15226 xCOffset = xC + 1 + strides[1]; 15227 if(xCOffset >= 0 && xCOffset < inDims[1]) { 15228 final = getX(batch, xR, xCOffset, d1); 15229 } 15230 xC${w+1} = vec4(xTexelC${w+1}.xy, final.xy); 15231 `)):(f+=` 15232 if(xC >= 0 && xC < inDims[1] && xTexelC${w}Ready == 0) { 15233 xTexelC${w} = getX(batch, xR, xC, d1); 15234 if (xC + 1 >= inDims[1]) { 15235 xTexelC${w}.zw = vec2(0.0); 15236 } 15237 xTexelC${w}Ready = 1; 15238 } 15239 15240 xCOffset = xC + strides[1]; 15241 if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${w+1}Ready == 0) { 15242 xTexelC${w+1} = getX(batch, xR, xCOffset, d1); 15243 if (xCOffset + 1 >= inDims[1]) { 15244 xTexelC${w+1}.zw = vec2(0.); 15245 } 15246 xTexelC${w+1}Ready = 1; 15247 } 15248 15249 xC${w} = vec4( 15250 xTexelC${w}.xy, xTexelC${w+1}.xy); 15251 `,w+1<u&&(f+=` 15252 xC${w+1} = vec4(xTexelC${w}.zw, xTexelC${w+1}.zw); 15253 `)));w<u&&(f+=` 15254 wTexel = getW(r, ${w}, d1, q); 15255 dotProd += xC${w} * vec4(wTexel.xz, wTexel.xz); 15256 `,w+1<u&&(f+=` 15257 wTexel = getW(r, ${w+1}, d1, q); 15258 dotProd += xC${w+1} * vec4(wTexel.xz, wTexel.xz); 15259 `))}f+=` 15260 } 15261 `,f+=` 15262 } 15263 `;let d="",g="";r&&(i?d=`vec4 activation(vec4 a) { 15264 vec4 b = getPreluActivationWeightsAtOutCoords(); 15265 ${r} 15266 }`:s?d=`vec4 activation(vec4 a) { 15267 vec4 b = getLeakyreluAlphaAtOutCoords(); 15268 ${r} 15269 }`:d=`vec4 activation(vec4 x) { 15270 ${r} 15271 }`,g="result = activation(result);");const m=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` 15272 ${d} 15273 15274 void main() { 15275 ivec4 coords = getOutputCoords(); 15276 int batch = coords.x; 15277 ivec2 xRCCorner = coords.yz * strides - pads; 15278 int d2 = coords.w; 15279 int d1 = d2 / ${a}; 15280 int q = d2 - d1 * ${a}; 15281 int xRCorner = xRCCorner.x; 15282 int xCCorner = xRCCorner.y; 15283 15284 //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss. 15285 vec4 dotProd = vec4(0.000000000000001); 15286 15287 ${f} 15288 15289 vec4 result = dotProd - vec4(0.000000000000001); 15290 ${m} 15291 ${g} 15292 setOutput(result); 15293 } 15294 `}}/** 15295 * @license 15296 * Copyright 2020 Google LLC. All Rights Reserved. 15297 * Licensed under the Apache License, Version 2.0 (the "License"); 15298 * you may not use this file except in compliance with the License. 15299 * You may obtain a copy of the License at 15300 * 15301 * http://www.apache.org/licenses/LICENSE-2.0 15302 * 15303 * Unless required by applicable law or agreed to in writing, software 15304 * distributed under the License is distributed on an "AS IS" BASIS, 15305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15306 * See the License for the specific language governing permissions and 15307 * limitations under the License. 15308 * ============================================================================= 15309 */function Vj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,filter:s}=e,{strides:a,pad:o,dilations:A,dimRoundingMode:l}=r;let c=A;c==null&&(c=[1,1]),H(Ti(a,c),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`);const u=$i(i.shape,s.shape,a,c,o,l,!0);let h;pe().getBool("WEBGL_PACK_DEPTHWISECONV")&&u.strideWidth<=2&&u.outChannels/u.inChannels===1?h=new BB(u):h=new _B(u);const f=[[u.padInfo.top,u.padInfo.left],[u.strideHeight,u.strideWidth],[u.dilationHeight,u.dilationWidth],[u.inHeight,u.inWidth]];return t.runWebGLProgram(h,[i,s],"float32",f)}const Gj={kernelName:Kv,backendName:"webgl",kernelFunc:Vj};/** 15310 * @license 15311 * Copyright 2018 Google LLC. All Rights Reserved. 15312 * Licensed under the Apache License, Version 2.0 (the "License");
15313 * you may not use this file except in compliance with the License. 15314 * You may obtain a copy of the License at 15315 * 15316 * http://www.apache.org/licenses/LICENSE-2.0 15317 * 15318 * Unless required by applicable law or agreed to in writing, software 15319 * distributed under the License is distributed on an "AS IS" BASIS, 15320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15321 * See the License for the specific language governing permissions and 15322 * limitations under the License. 15323 * ============================================================================= 15324 */class zj{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,r=e.strideWidth,i=e.padInfo.top,s=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=` 15325 void main() { 15326 ivec4 coords = getOutputCoords(); 15327 int wR = coords.x; 15328 int wC = coords.y; 15329 int d1 = coords.z; 15330 int dm = coords.w; 15331 int d2 = d1 * ${a} + dm; 15332 15333 float dotProd = 0.0; 15334 15335 // TO DO: Vec4 over the batch size 15336 for (int b = 0; b < ${e.batchSize}; b++) { 15337 for (int yR = 0; yR < ${e.outHeight}; yR++) { 15338 int xR = wR + yR * ${t} - ${i}; 15339 15340 if (xR < 0 || xR >= ${e.inHeight}) { 15341 continue; 15342 } 15343 15344 for (int yC = 0; yC < ${e.outWidth}; yC++) { 15345 int xC = wC + yC * ${r} - ${s}; 15346 15347 if (xC < 0 || xC >= ${e.inWidth}) { 15348 continue; 15349 } 15350 15351 float dyValue = getDy(b, yR, yC, d2); 15352 float xValue = getX(b, xR, xC, d1); 15353 dotProd += (xValue * dyValue); 15354 } 15355 } 15356 } 15357 setOutput(dotProd); 15358 } 15359 `}}class Wj{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,r=e.filterWidth,i=e.strideHeight,s=e.strideWidth,a=t-1-e.padInfo.top,o=r-1-e.padInfo.left,A=e.outChannels/e.inChannels;this.userCode=` 15360 const ivec2 pads = ivec2(${a}, ${o}); 15361 15362 void main() { 15363 ivec4 coords = getOutputCoords(); 15364 int batch = coords[0]; 15365 int d1 = coords[3]; 15366 ivec2 dyCorner = coords.yz - pads; 15367 int dyRCorner = dyCorner.x; 15368 int dyCCorner = dyCorner.y; 15369 15370 float dotProd = 0.0; 15371 15372 for (int wR = 0; wR < ${t}; wR++) { 15373 float dyR = float(dyRCorner + wR) / ${i}.0; 15374 15375 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { 15376 continue; 15377 } 15378 int idyR = int(dyR); 15379 15380 int wRPerm = ${t} - 1 - wR; 15381 15382 for (int wC = 0; wC < ${r}; wC++) { 15383 float dyC = float(dyCCorner + wC) / ${s}.0; 15384 15385 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 15386 fract(dyC) > 0.0) { 15387 continue; 15388 } 15389 int idyC = int(dyC); 15390 15391 int wCPerm = ${r} - 1 - wC; 15392 15393 // TO DO: Vec4 over the channelMul 15394 for (int dm = 0; dm < ${A}; dm++) { 15395 int d2 = d1 * ${A} + dm; 15396 float xValue = getDy(batch, idyR, idyC, d2); 15397 float wValue = getW(wRPerm, wCPerm, d1, dm); 15398 dotProd += xValue * wValue; 15399 } 15400 } 15401 } 15402 setOutput(dotProd); 15403 } 15404 `}}/** 15405 * @license 15406 * Copyright 2020 Google LLC. All Rights Reserved. 15407 * Licensed under the Apache License, Version 2.0 (the "License"); 15408 * you may not use this file except in compliance with the License. 15409 * You may obtain a copy of the License at 15410 * 15411 * http://www.apache.org/licenses/LICENSE-2.0 15412 * 15413 * Unless required by applicable law or agreed to in writing, software 15414 * distributed under the License is distributed on an "AS IS" BASIS, 15415 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15416 * See the License for the specific language governing permissions and 15417 * limitations under the License. 15418 * ============================================================================= 15419 */function Kj(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,dy:s}=e,{strides:a,dilations:o,pad:A,dimRoundingMode:l,filterShape:c}=r,u=$i(i.shape,c,a,o,A,l,!0),h=new zj(u);return t.runWebGLProgram(h,[i,s],"float32")}const Xj={kernelName:Xv,backendName:"webgl",kernelFunc:Kj};/** 15420 * @license 15421 * Copyright 2020 Google LLC. All Rights Reserved. 15422 * Licensed under the Apache License, Version 2.0 (the "License");
15423 * you may not use this file except in compliance with the License. 15424 * You may obtain a copy of the License at 15425 * 15426 * http://www.apache.org/licenses/LICENSE-2.0 15427 * 15428 * Unless required by applicable law or agreed to in writing, software 15429 * distributed under the License is distributed on an "AS IS" BASIS, 15430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15431 * See the License for the specific language governing permissions and 15432 * limitations under the License. 15433 * ============================================================================= 15434 */function jj(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,filter:s}=e,{strides:a,dilations:o,pad:A,dimRoundingMode:l,inputShape:c}=r,u=$i(c,s.shape,a,o,A,l,!0),h=new Wj(u);return t.runWebGLProgram(h,[i,s],"float32")}const Yj={kernelName:jv,backendName:"webgl",kernelFunc:jj};/** 15435 * @license 15436 * Copyright 2019 Google LLC. All Rights Reserved. 15437 * Licensed under the Apache License, Version 2.0 (the "License"); 15438 * you may not use this file except in compliance with the License. 15439 * You may obtain a copy of the License at 15440 * 15441 * http://www.apache.org/licenses/LICENSE-2.0 15442 * 15443 * Unless required by applicable law or agreed to in writing, software 15444 * distributed under the License is distributed on an "AS IS" BASIS, 15445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15446 * See the License for the specific language governing permissions and 15447 * limitations under the License. 15448 * ============================================================================= 15449 */class qj{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` 15450 void main() { 15451 ivec2 coords = getOutputCoords(); 15452 float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; 15453 setOutput(val); 15454 } 15455 `}}/** 15456 * @license 15457 * Copyright 2020 Google LLC. All Rights Reserved. 15458 * Licensed under the Apache License, Version 2.0 (the "License"); 15459 * you may not use this file except in compliance with the License. 15460 * You may obtain a copy of the License at 15461 * 15462 * http://www.apache.org/licenses/LICENSE-2.0 15463 * 15464 * Unless required by applicable law or agreed to in writing, software 15465 * distributed under the License is distributed on an "AS IS" BASIS, 15466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15467 * See the License for the specific language governing permissions and 15468 * limitations under the License. 15469 * ============================================================================= 15470 */function Jj(n){const{inputs:e,backend:t}=n,{x:r}=e,i=[...r.shape,...r.shape],s=ze(r.shape),a=et({inputs:{x:r},backend:t,attrs:{shape:[s]}}),o=new qj(s),A=t.runWebGLProgram(o,[a],a.dtype),l=et({inputs:{x:A},backend:t,attrs:{shape:i}});return t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(A),l}const Zj={kernelName:Yv,backendName:"webgl",kernelFunc:Jj};/** 15471 * @license 15472 * Copyright 2017 Google LLC. All Rights Reserved. 15473 * Licensed under the Apache License, Version 2.0 (the "License"); 15474 * you may not use this file except in compliance with the License. 15475 * You may obtain a copy of the License at 15476 * 15477 * http://www.apache.org/licenses/LICENSE-2.0 15478 * 15479 * Unless required by applicable law or agreed to in writing, software 15480 * distributed under the License is distributed on an "AS IS" BASIS, 15481 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15482 * See the License for the specific language governing permissions and 15483 * limitations under the License. 15484 * ============================================================================= 15485 */class eY{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:r,padInfo:i,strideHeight:s,strideWidth:a,filterHeight:o,filterWidth:A,dilationHeight:l,dilationWidth:c}=e,{top:u,left:h}=i;this.userCode=` 15486 const ivec2 strides = ivec2(${s}, ${a}); 15487 const ivec2 pads = ivec2(${u}, ${h}); 15488 const float neg_infinity = -3.4e38; 15489 15490 void main() { 15491 ivec4 coords = getOutputCoords(); 15492 int batch = coords.x; 15493 int d1 = coords.w; 15494 ivec2 outTopLeftCorner = 15495 coords.yz * strides - pads; 15496 int hBeg = outTopLeftCorner.x; 15497 int wBeg = outTopLeftCorner.y; 15498 15499 float curVal = neg_infinity; 15500 for (int h = 0; h < ${o}; h++) { 15501 int hIn = hBeg + h * ${l}; 15502 15503 if (hIn >= 0 && hIn < ${t}) { 15504 for (int w = 0; w < ${A}; w++) { 15505 int wIn = wBeg + w * ${c}; 15506 15507 if (wIn >= 0 && wIn < ${r}) { 15508 float xVal = getX(batch, hIn, wIn, d1); 15509 float wVal = getW(h, w, d1); 15510 15511 float val = xVal + wVal; 15512 if (val > curVal) { 15513 curVal = val; 15514 } 15515 } 15516 } 15517 } 15518 } 15519 15520 float result = curVal; 15521 setOutput(result); 15522 } 15523 `}}/** 15524 * @license 15525 * Copyright 2020 Google LLC. All Rights Reserved. 15526 * Licensed under the Apache License, Version 2.0 (the "License");
15527 * you may not use this file except in compliance with the License. 15528 * You may obtain a copy of the License at 15529 * 15530 * http://www.apache.org/licenses/LICENSE-2.0 15531 * 15532 * Unless required by applicable law or agreed to in writing, software 15533 * distributed under the License is distributed on an "AS IS" BASIS, 15534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15535 * See the License for the specific language governing permissions and 15536 * limitations under the License. 15537 * ============================================================================= 15538 */function tY(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,filter:s}=e,{strides:a,pad:o,dilations:A}=r,l=Ub(i.shape,s.shape,a,o,"NHWC",A);let c;const u=new eY(l);c=t.runWebGLProgram(u,[i,s],"float32");const h=et({inputs:{x:c},backend:t,attrs:{shape:l.outShape}});return t.disposeIntermediateTensorInfo(c),h}const nY={kernelName:qv,backendName:"webgl",kernelFunc:tY};/** 15539 * @license 15540 * Copyright 2021 Google LLC. All Rights Reserved. 15541 * Licensed under the Apache License, Version 2.0 (the "License"); 15542 * you may not use this file except in compliance with the License. 15543 * You may obtain a copy of the License at 15544 * 15545 * http://www.apache.org/licenses/LICENSE-2.0 15546 * 15547 * Unless required by applicable law or agreed to in writing, software 15548 * distributed under the License is distributed on an "AS IS" BASIS, 15549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15550 * See the License for the specific language governing permissions and 15551 * limitations under the License. 15552 * ============================================================================= 15553 */function rY(n){const{inputs:e,backend:t,attrs:r}=n,{equation:i}=r,s=e,{allDims:a,summedDims:o,idDims:A}=u_(i,s.length);f_(a.length,A,s);const{path:l,steps:c}=d_(o,A),u=c.length;let h=null,f=a.length;const d=[];for(let g=0;g<u;++g){for(const m of c[g]){const{permutationIndices:p,expandDims:w}=h_(f,A[m]);let C;p_(p)?C=s[m]:(C=Jr({inputs:{x:s[m]},backend:t,attrs:{perm:p}}),d.push(C));const b=C.shape.slice();for(let U=0;U<w.length;++U)b.splice(w[U],0,1);rr(C.shape,b)||(C=et({inputs:{x:C},backend:t,attrs:{shape:b}}),d.push(C)),h===null?h=C:(h=o2({inputs:{a:C,b:h},backend:t}),d.push(h))}g<u-1&&(l[g]>=0&&(h=od({inputs:{x:h},backend:t,attrs:{axis:l[g]-(a.length-f),keepDims:!1}}),d.push(h)),f--)}for(const g of d)g!==h&&t.disposeIntermediateTensorInfo(g);return h}const iY={kernelName:Zv,backendName:"webgl",kernelFunc:rY};/** 15554 * @license 15555 * Copyright 2020 Google LLC. All Rights Reserved. 15556 * Licensed under the Apache License, Version 2.0 (the "License"); 15557 * you may not use this file except in compliance with the License. 15558 * You may obtain a copy of the License at 15559 * 15560 * http://www.apache.org/licenses/LICENSE-2.0 15561 * 15562 * Unless required by applicable law or agreed to in writing, software 15563 * distributed under the License is distributed on an "AS IS" BASIS, 15564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15565 * See the License for the specific language governing permissions and 15566 * limitations under the License. 15567 * ============================================================================= 15568 */const sY="return (x >= 0.0) ? x : (exp(x) - 1.0);",aY=` 15569 vec4 result; 15570 15571 result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); 15572 result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); 15573 result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); 15574 result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); 15575 15576 return result; 15577`,oY=vn({opSnippet:sY,packedOpSnippet:aY}),AY={kernelName:ew,backendName:"webgl",kernelFunc:oY};/** 15578 * @license 15579 * Copyright 2020 Google LLC. All Rights Reserved. 15580 * Licensed under the Apache License, Version 2.0 (the "License"); 15581 * you may not use this file except in compliance with the License. 15582 * You may obtain a copy of the License at 15583 * 15584 * http://www.apache.org/licenses/LICENSE-2.0 15585 * 15586 * Unless required by applicable law or agreed to in writing, software 15587 * distributed under the License is distributed on an "AS IS" BASIS, 15588 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15589 * See the License for the specific language governing permissions and 15590 * limitations under the License. 15591 * ============================================================================= 15592 */const lY="return (b >= 0.0) ? a : a * (b + 1.0);",cY=` 15593 vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));
15594 return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); 15595`,uY=n=>{const{inputs:e,backend:t}=n,{dy:r,y:i}=e,s=pe().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ql(cY,r.shape,i.shape):new wA(lY,r.shape,i.shape);return t.runWebGLProgram(s,[r,i],r.dtype)},hY={kernelName:FM,backendName:"webgl",kernelFunc:uY};/** 15596 * @license 15597 * Copyright 2020 Google LLC. All Rights Reserved. 15598 * Licensed under the Apache License, Version 2.0 (the "License"); 15599 * you may not use this file except in compliance with the License. 15600 * You may obtain a copy of the License at 15601 * 15602 * http://www.apache.org/licenses/LICENSE-2.0 15603 * 15604 * Unless required by applicable law or agreed to in writing, software 15605 * distributed under the License is distributed on an "AS IS" BASIS, 15606 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15607 * See the License for the specific language governing permissions and 15608 * limitations under the License. 15609 * ============================================================================= 15610 */const fY=` 15611 return vec4(equal(a, b)); 15612`,dY="return float(a == b);",pY=Lr({opSnippet:dY,packedOpSnippet:fY,dtype:"bool",cpuKernelImpl:Kz}),mY={kernelName:nw,backendName:"webgl",kernelFunc:pY};/** 15613 * @license 15614 * Copyright 2020 Google LLC. All Rights Reserved. 15615 * Licensed under the Apache License, Version 2.0 (the "License"); 15616 * you may not use this file except in compliance with the License. 15617 * You may obtain a copy of the License at 15618 * 15619 * http://www.apache.org/licenses/LICENSE-2.0 15620 * 15621 * Unless required by applicable law or agreed to in writing, software 15622 * distributed under the License is distributed on an "AS IS" BASIS, 15623 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15624 * See the License for the specific language governing permissions and 15625 * limitations under the License. 15626 * ============================================================================= 15627 */const gY=` 15628 // Error function is calculated approximately with elementary function. 15629 // See "Handbook of Mathematical Functions with Formulas, 15630 // Graphs, and Mathematical Tables", Abramowitz and Stegun. 15631 float p = ${s_}; 15632 float a1 = ${a_}; 15633 float a2 = ${o_}; 15634 float a3 = ${A_}; 15635 float a4 = ${l_}; 15636 float a5 = ${c_}; 15637 15638 float sign = sign(x); 15639 x = abs(x); 15640 float t = 1.0 / (1.0 + p * x); 15641 return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); 15642`,yY=vn({opSnippet:gY}),vY={kernelName:tw,backendName:"webgl",kernelFunc:yY};/** 15643 * @license 15644 * Copyright 2020 Google LLC. All Rights Reserved. 15645 * Licensed under the Apache License, Version 2.0 (the "License"); 15646 * you may not use this file except in compliance with the License. 15647 * You may obtain a copy of the License at 15648 * 15649 * http://www.apache.org/licenses/LICENSE-2.0 15650 * 15651 * Unless required by applicable law or agreed to in writing, software 15652 * distributed under the License is distributed on an "AS IS" BASIS, 15653 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15654 * See the License for the specific language governing permissions and 15655 * limitations under the License. 15656 * ============================================================================= 15657 */const wY=Jl+` 15658 return exp(x); 15659`,xY=` 15660 vec4 result = exp(x); 15661 bvec4 isNaN = isnan(x); 15662 result.r = isNaN.r ? x.r : result.r; 15663 result.g = isNaN.g ? x.g : result.g; 15664 result.b = isNaN.b ? x.b : result.b; 15665 result.a = isNaN.a ? x.a : result.a; 15666 15667 return result; 15668`,EB=vn({opSnippet:wY,packedOpSnippet:xY,cpuKernelImpl:Xz,dtype:"float32"}),bY={kernelName:rw,backendName:"webgl",kernelFunc:EB};/** 15669 * @license 15670 * Copyright 2020 Google LLC. All Rights Reserved. 15671 * Licensed under the Apache License, Version 2.0 (the License); 15672 * you may not use this file except in compliance with the License. 15673 * You may obtain a copy of the License at 15674 * 15675 * http://www.apache.org/licenses/LICENSE-2.0 15676 * 15677 * Unless required by applicable law or agreed to in writing, software 15678 * distributed under the License is distributed on an AS IS BASIS, 15679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15680 * See the License for the specific language governing permissions and 15681 * limitations under the License. 15682 * ============================================================================= 15683 */function F1(n){const{inputs:e,attrs:t,backend:r}=n,{dim:i}=t,{input:s}=e,a=s.shape.length,o=s.shape.slice();let A=i;return i<0&&(H(-(a+1)<=i,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),A=a+i+1),o.splice(A,0,1),et({inputs:{x:s},backend:r,attrs:{shape:o}})}const CY={kernelName:iw,backendName:"webgl",kernelFunc:F1};/** 15684 * @license 15685 * Copyright 2020 Google LLC. All Rights Reserved. 15686 * Licensed under the Apache License, Version 2.0 (the "License");
15687 * you may not use this file except in compliance with the License. 15688 * You may obtain a copy of the License at 15689 * 15690 * http://www.apache.org/licenses/LICENSE-2.0 15691 * 15692 * Unless required by applicable law or agreed to in writing, software 15693 * distributed under the License is distributed on an "AS IS" BASIS, 15694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15695 * See the License for the specific language governing permissions and 15696 * limitations under the License. 15697 * ============================================================================= 15698 */const o4="return exp(x) - 1.0;",_Y=vn({opSnippet:o4,packedOpSnippet:o4,cpuKernelImpl:jz}),BY={kernelName:sw,backendName:"webgl",kernelFunc:_Y};/** 15699 * @license 15700 * Copyright 2018 Google LLC. All Rights Reserved. 15701 * Licensed under the Apache License, Version 2.0 (the "License"); 15702 * you may not use this file except in compliance with the License. 15703 * You may obtain a copy of the License at 15704 * 15705 * http://www.apache.org/licenses/LICENSE-2.0 15706 * 15707 * Unless required by applicable law or agreed to in writing, software 15708 * distributed under the License is distributed on an "AS IS" BASIS, 15709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15710 * See the License for the specific language governing permissions and 15711 * limitations under the License. 15712 * ============================================================================= 15713 */class A4{constructor(e,t,r){this.variableNames=["real","imag"];const i=t[1];this.outputShape=t;const s=r?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=r?`${i}.0`:"1.0";let o;if(e==="real")o="return real * expR - imag * expI;";else if(e==="imag")o="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` 15714 const float exponentMultiplier = ${s}; 15715 15716 float unaryOpComplex(float real, float expR, float imag, float expI) { 15717 ${o} 15718 } 15719 15720 float mulMatDFT(int batch, int index) { 15721 float indexRatio = float(index) / float(${i}); 15722 float exponentMultiplierTimesIndexRatio = 15723 exponentMultiplier * indexRatio; 15724 15725 float result = 0.0; 15726 15727 for (int i = 0; i < ${i}; i++) { 15728 // x = (-2|2 * PI / N) * index * i; 15729 float x = exponentMultiplierTimesIndexRatio * float(i); 15730 float expR = cos(x); 15731 float expI = sin(x); 15732 float real = getReal(batch, i); 15733 float imag = getImag(batch, i); 15734 15735 result += 15736 unaryOpComplex(real, expR, imag, expI) / ${a}; 15737 } 15738 15739 return result; 15740 } 15741 15742 void main() { 15743 ivec2 coords = getOutputCoords(); 15744 setOutput(mulMatDFT(coords[0], coords[1])); 15745 } 15746 `}}/** 15747 * @license 15748 * Copyright 2020 Google LLC. All Rights Reserved. 15749 * Licensed under the Apache License, Version 2.0 (the "License"); 15750 * you may not use this file except in compliance with the License. 15751 * You may obtain a copy of the License at 15752 * 15753 * http://www.apache.org/licenses/LICENSE-2.0 15754 * 15755 * Unless required by applicable law or agreed to in writing, software 15756 * distributed under the License is distributed on an "AS IS" BASIS, 15757 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15758 * See the License for the specific language governing permissions and 15759 * limitations under the License. 15760 * ============================================================================= 15761 */function SB(n,e,t){const r=t.texData.get(n.dataId),i=ze(n.shape),s=n.shape[n.shape.length-1],a=i/s,o=et({inputs:{x:n},backend:t,attrs:{shape:[a,s]}}),A=o.shape,l=new A4("real",A,e),c=new A4("imag",A,e),u=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:A},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:A}],h=t.runWebGLProgram(l,u,"float32"),f=t.runWebGLProgram(c,u,"float32"),d=To({input
vendor: 4,443 bytes, lines 15761-15843
15761s:{real:h,imag:f},backend:t});t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(f);const g=et({inputs:{x:d},backend:t,attrs:{shape:n.shape}});return t.disposeIntermediateTensorInfo(o),t.disposeIntermediateTensorInfo(d),g}/** 15762 * @license 15763 * Copyright 2020 Google LLC. All Rights Reserved. 15764 * Licensed under the Apache License, Version 2.0 (the "License"); 15765 * you may not use this file except in compliance with the License. 15766 * You may obtain a copy of the License at 15767 * 15768 * http://www.apache.org/licenses/LICENSE-2.0 15769 * 15770 * Unless required by applicable law or agreed to in writing, software 15771 * distributed under the License is distributed on an "AS IS" BASIS, 15772 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15773 * See the License for the specific language governing permissions and 15774 * limitations under the License. 15775 * ============================================================================= 15776 */function EY(n){const{inputs:e,backend:t}=n,{input:r}=e;return SB(r,!1,t)}const SY={kernelName:aw,backendName:"webgl",kernelFunc:EY};/** 15777 * @license 15778 * Copyright 2019 Google LLC. All Rights Reserved. 15779 * Licensed under the Apache License, Version 2.0 (the "License"); 15780 * you may not use this file except in compliance with the License. 15781 * You may obtain a copy of the License at 15782 * 15783 * http://www.apache.org/licenses/LICENSE-2.0 15784 * 15785 * Unless required by applicable law or agreed to in writing, software 15786 * distributed under the License is distributed on an "AS IS" BASIS, 15787 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15788 * See the License for the specific language governing permissions and 15789 * limitations under the License. 15790 * ============================================================================= 15791 */class TY{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode=` 15792 void main() { 15793 // Input can be obtained from uniform value. 15794 setOutput(value); 15795 } 15796 `}}/** 15797 * @license 15798 * Copyright 2020 Google LLC. All Rights Reserved. 15799 * Licensed under the Apache License, Version 2.0 (the "License"); 15800 * you may not use this file except in compliance with the License. 15801 * You may obtain a copy of the License at 15802 * 15803 * http://www.apache.org/licenses/LICENSE-2.0 15804 * 15805 * Unless required by applicable law or agreed to in writing, software 15806 * distributed under the License is distributed on an "AS IS" BASIS, 15807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15808 * See the License for the specific language governing permissions and 15809 * limitations under the License. 15810 * ============================================================================= 15811 */function _u(n){const{backend:e,attrs:t}=n,{shape:r,value:i}=t;let{dtype:s}=t;if(s=s||du(i),s==="string"){const a=br(s,ze(r));return a.fill(i),e.makeTensorInfo(r,s,a)}else{const a=new TY(r,i),o=[[i]];return e.runWebGLProgram(a,[],s,o)}}const IY={kernelName:ow,backendName:"webgl",kernelFunc:_u};/** 15812 * @license 15813 * Copyright 2020 Google LLC. All Rights Reserved. 15814 * Licensed under the Apache License, Version 2.0 (the "License"); 15815 * you may not use this file except in compliance with the License. 15816 * You may obtain a copy of the License at 15817 * 15818 * http://www.apache.org/licenses/LICENSE-2.0 15819 * 15820 * Unless required by applicable law or agreed to in writing, software 15821 * distributed under the License is distributed on an "AS IS" BASIS, 15822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15823 * See the License for the specific language governing permissions and 15824 * limitations under the License. 15825 * ============================================================================= 15826 */class FY{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=` 15827 void main() { 15828 ivec4 coords = getOutputCoords(); 15829 int x = coords[2]; 15830 15831 int coordX = ${t} - x - 1; 15832 float outputValue; 15833 if(coordX >= 0 && coordX < ${t}) { 15834 outputValue = getImage(coords[0], coords[1], coordX, coords[3]); 15835 } else { 15836 outputValue = getImage(coords[0], coords[1], coords[2], coords[3]); 15837 } 15838 setOutput(outputValue); 15839 } 15840 `}}/** 15841 * @license 15842 * Copyright 2020 Google LLC. All Rights Reserved. 15843 * Licensed under the Apache License, Version 2.0 (the "License");
15844 * you may not use this file except in compliance with the License. 15845 * You may obtain a copy of the License at 15846 * 15847 * http://www.apache.org/licenses/LICENSE-2.0 15848 * 15849 * Unless required by applicable law or agreed to in writing, software 15850 * distributed under the License is distributed on an "AS IS" BASIS, 15851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15852 * See the License for the specific language governing permissions and 15853 * limitations under the License. 15854 * ============================================================================= 15855 */const RY={kernelName:Aw,backendName:"webgl",kernelFunc:({inputs:n,backend:e})=>{const{image:t}=n,r=e,i=new FY(t.shape);return r.runWebGLProgram(i,[t],t.dtype)}};/** 15856 * @license 15857 * Copyright 2020 Google LLC. All Rights Reserved. 15858 * Licensed under the Apache License, Version 2.0 (the "License"); 15859 * you may not use this file except in compliance with the License. 15860 * You may obtain a copy of the License at 15861 * 15862 * http://www.apache.org/licenses/LICENSE-2.0 15863 * 15864 * Unless required by applicable law or agreed to in writing, software 15865 * distributed under the License is distributed on an "AS IS" BASIS, 15866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15867 * See the License for the specific language governing permissions and 15868 * limitations under the License. 15869 * ============================================================================= 15870 */const l4="return floor(x);",UY=vn({opSnippet:l4,packedOpSnippet:l4,cpuKernelImpl:Yz}),MY={kernelName:lw,backendName:"webgl",kernelFunc:UY};/** 15871 * @license 15872 * Copyright 2020 Google LLC. All Rights Reserved. 15873 * Licensed under the Apache License, Version 2.0 (the "License"); 15874 * you may not use this file except in compliance with the License. 15875 * You may obtain a copy of the License at 15876 * 15877 * http://www.apache.org/licenses/LICENSE-2.0 15878 * 15879 * Unless required by applicable law or agreed to in writing, software 15880 * distributed under the License is distributed on an "AS IS" BASIS, 15881 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15882 * See the License for the specific language governing permissions and 15883 * limitations under the License. 15884 * ============================================================================= 15885 */const NY=` 15886 float s = sign(a) * sign(b); 15887 int ia = round(a); 15888 int ib = round(b); 15889 if (ib != 0) { 15890 // Windows (D3D) wants guaranteed non-zero int division at compile-time. 15891 return float(idiv(ia, ib, s)); 15892 } else { 15893 return NAN; 15894 } 15895`,DY=` 15896 ivec4 ia = round(a); 15897 ivec4 ib = round(b); 15898 bvec4 cond = notEqual(ib, ivec4(0)); 15899 ivec4 result = ivec4(0); 15900 vec4 s = sign(a) * sign(b); 15901 15902 // Windows (D3D) wants guaranteed non-zero int division at compile-time. 15903 if (cond[0]) { 15904 result[0] = idiv(ia[0], ib[0], s[0]); 15905 } 15906 if (cond[1]) { 15907 result[1] = idiv(ia[1], ib[1], s[1]); 15908 } 15909 if (cond[2]) { 15910 result[2] = idiv(ia[2], ib[2], s[2]); 15911 } 15912 if (cond[3]) { 15913 result[3] = idiv(ia[3], ib[3], s[3]); 15914 } 15915 return vec4(result); 15916`,LY=Lr({opSnippet:NY,packedOpSnippet:DY,dtype:"int32"}),OY={kernelName:cw,backendName:"webgl",kernelFunc:LY};/** 15917 * @license 15918 * Copyright 2018 Google LLC. All Rights Reserved. 15919 * Licensed under the Apache License, Version 2.0 (the "License"); 15920 * you may not use this file except in compliance with the License. 15921 * You may obtain a copy of the License at 15922 * 15923 * http://www.apache.org/licenses/LICENSE-2.0 15924 * 15925 * Unless required by applicable law or agreed to in writing, software 15926 * distributed under the License is distributed on an "AS IS" BASIS, 15927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15928 * See the License for the specific language governing permissions and 15929 * limitations under the License. 15930 * ============================================================================= 15931 */class PY{constructor(e){this.variableNames=["A"];const t=Zr(),[r,i]=e;this.outputShape=e,this.userCode=` 15932 void main() { 15933 ivec3 coords = getOutputCoords(); 15934 int texR = coords[0]; 15935 int texC = coords[1]; 15936 int depth = coords[2]; 15937 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${i}.0, ${r}.0); 15938 15939 vec4 values = ${t.texture2D}(A, uv); 15940 float value; 15941 if (depth == 0) { 15942 value = values.r; 15943 } else if (depth == 1) { 15944 value = values.g; 15945 } else if (depth == 2) { 15946 value = values.b; 15947 } else if (depth == 3) { 15948 value = values.a; 15949 } 15950 15951 setOutput(floor(value * 255.0 + 0.5)); 15952 } 15953 `}}/** 15954 * @license 15955 * Copyright 2018 Google LLC. All Rights Reserved. 15956 * Licensed under the Apache License, Version 2.0 (the "License");
15957 * you may not use this file except in compliance with the License. 15958 * You may obtain a copy of the License at 15959 * 15960 * http://www.apache.org/licenses/LICENSE-2.0 15961 * 15962 * Unless required by applicable law or agreed to in writing, software 15963 * distributed under the License is distributed on an "AS IS" BASIS, 15964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15965 * See the License for the specific language governing permissions and 15966 * limitations under the License. 15967 * ============================================================================= 15968 */class kY{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=Zr(),[r,i]=e;this.outputShape=e,this.userCode=` 15969 void main() { 15970 ivec3 coords = getOutputCoords(); 15971 int texR = coords[0]; 15972 int texC = coords[1]; 15973 int depth = coords[2]; 15974 15975 vec4 result = vec4(0.); 15976 15977 for(int row=0; row<=1; row++) { 15978 for(int col=0; col<=1; col++) { 15979 texC = coords[1] + row; 15980 depth = coords[2] + col; 15981 15982 vec2 uv = (vec2(texC, texR) + halfCR) / 15983 vec2(${i}.0, ${r}.0); 15984 vec4 values = ${t.texture2D}(A, uv); 15985 float value; 15986 if (depth == 0) { 15987 value = values.r; 15988 } else if (depth == 1) { 15989 value = values.g; 15990 } else if (depth == 2) { 15991 value = values.b; 15992 } else if (depth == 3) { 15993 value = values.a; 15994 } 15995 15996 result[row * 2 + col] = floor(value * 255.0 + 0.5); 15997 } 15998 } 15999 16000 ${t.output} = result; 16001 } 16002 `}}/** 16003 * @license 16004 * Copyright 2019 Google LLC. All Rights Reserved. 16005 * Licensed under the Apache License, Version 2.0 (the "License"); 16006 * you may not use this file except in compliance with the License. 16007 * You may obtain a copy of the License at 16008 * 16009 * http://www.apache.org/licenses/LICENSE-2.0 16010 * 16011 * Unless required by applicable law or agreed to in writing, software 16012 * distributed under the License is distributed on an "AS IS" BASIS, 16013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16014 * See the License for the specific language governing permissions and 16015 * limitations under the License. 16016 * ============================================================================= 16017 */const $Y={kernelName:zm,backendName:"webgl",kernelFunc:QY};let WA,_p=pe().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function QY(n){const{inputs:e,backend:t,attrs:r}=n;let{pixels:i}=e;const{numChannels:s}=r,a=typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement,o=typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement,[A,l]=a?[i.videoWidth,i.videoHeight]:[i.width,i.height],c=[l,A],u=[l,A,s];if(o||a){const g=pe().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(WA==null||g!==_p)&&(_p=g,WA=document.createElement("canvas").getContext("2d",{willReadFrequently:_p})),WA.canvas.width=A,WA.canvas.height=l,WA.drawImage(i,0,0,A,l),i=WA.canvas}const h=t.makeTensorInfo(c,"int32");t.texData.get(h.dataId).usage=Di.PIXELS,t.gpgpu.uploadPixelDataToTexture(t.getTexture(h.dataId),i);const f=pe().getBool("WEBGL_PACK")?new kY(u):new PY(u),d=t.runWebGLProgram(f,[h],"int32");return t.disposeData(h.dataId),d}/** 16018 * @license 16019 * Copyright 2020 Google LLC. All Rights Reserved. 16020 * Licensed under the Apache License, Version 2.0 (the "License"); 16021 * you may not use this file except in compliance with the License. 16022 * You may obtain a copy of the License at 16023 * 16024 * http://www.apache.org/licenses/LICENSE-2.0 16025 * 16026 * Unless required by applicable law or agreed to in writing, software 16027 * distributed under the License is distributed on an "AS IS" BASIS, 16028 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16029 * See the License for the specific language governing permissions and 16030 * limitations under the License. 16031 * ============================================================================= 16032 */function HY(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,filter:s,bias:a,preluActivationWeights:o}=e,{strides:A,pad:l,dataFormat:c,dilations:u,dimRoundingMode:h,activation:f,leakyreluAlpha:d}=r,g=Vl(c),m=$i(i.shape,s.shape,A,u,l,h,!1,g);let p;const w=[],C=a!=null,b=o!=null,U=f==="leakyrelu",F=()=>{const O=[i,s],I=(R,V)=>{if(V==="NCHW"&&R.shape.length===1&&R.shape[0]!==1){const re=et({inputs:{x:R},backend:t,attrs:{shape:[R.shape[0],1,1]}});return w.push(re),re}return R};if(C&&O.push(I(a,c)),b&&O.push(I(o,c)),U){const R=t.makeTensorInfo([],"float32",Hl(d,"float32"));O.push(R),w.push(R)}return O};if(m.filterHeight===1&&m.filterWidth===1&&m.dilationHeight===1&&m.dilationWidth===1&&m.strideHeight===1&&m.strideWidth===1&&(m.padInfo.type==="SAME"||m.padInfo.type==="VALID"))p=xB({x:i,filter:s,convInfo:m,backend:t,bias:a,activation:f,preluActivationWeights:o,leakyreluAlpha:d});else if(m.strideWidth<=2&&g==="channelsLast"&&pe().getBool("WEBGL_EXP_CONV")){const O=f?nu(f,!0):null,I=new wB(m,C,O,b,U),R=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]],V=F();
vendor: 7,382 bytes, lines 16032-16117
16032p=t.runWebGLProgram(I,V,"float32",R)}else if(pe().getBool("WEBGL_CONV_IM2COL"))p=bB({x:i,filter:s,convInfo:m,backend:t,bias:a,activation:f,preluActivationWeights:o,leakyreluAlpha:d});else{const O=f?nu(f,!1):null,I=new vB(m,C,O,b,U),R=F();p=t.runWebGLProgram(I,R,"float32")}const D=et({inputs:{x:p},backend:t,attrs:{shape:m.outShape}});return w.push(p),w.forEach(O=>t.disposeIntermediateTensorInfo(O)),D}const VY={kernelName:Km,backendName:"webgl",kernelFunc:HY};/** 16033 * @license 16034 * Copyright 2020 Google LLC. All Rights Reserved. 16035 * Licensed under the Apache License, Version 2.0 (the "License"); 16036 * you may not use this file except in compliance with the License. 16037 * You may obtain a copy of the License at 16038 * 16039 * http://www.apache.org/licenses/LICENSE-2.0 16040 * 16041 * Unless required by applicable law or agreed to in writing, software 16042 * distributed under the License is distributed on an "AS IS" BASIS, 16043 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16044 * See the License for the specific language governing permissions and 16045 * limitations under the License. 16046 * ============================================================================= 16047 */function GY(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,filter:s,bias:a,preluActivationWeights:o}=e,{strides:A,pad:l,dilations:c,dimRoundingMode:u,activation:h,leakyreluAlpha:f}=r,d=[];let g=c;g==null&&(g=[1,1]),H(Ti(A,g),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${A} and dilations '${g}'`);const m=$i(i.shape,s.shape,A,g,l,u,!0),p=pe().getBool("WEBGL_PACK_DEPTHWISECONV")&&m.strideWidth<=2&&m.outChannels/m.inChannels===1,w=h?nu(h,p):null,C=[i,s],b=a!=null,U=o!=null,F=h==="leakyrelu";if(b&&C.push(a),U&&C.push(o),F){const R=t.makeTensorInfo([],"float32",Hl(f,"float32"));C.push(R),d.push(R)}let D;p?D=new BB(m,b,w,U,F):D=new _B(m,b,w,U,F);const O=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]],I=t.runWebGLProgram(D,C,"float32",O);return d.forEach(R=>t.disposeIntermediateTensorInfo(R)),I}const zY={kernelName:Xm,backendName:"webgl",kernelFunc:GY};class WY{constructor(e,t,r,i){this.sliceDim=e,this.strides=t,this.paramsShape=i,this.variableNames=["x","indices"],this.outputShape=r;const s=Mn(r.length);let a=` 16048 int index;`;for(let o=0;o<this.sliceDim;o++)a+=` 16049 index = round(getIndices(coords[0], ${o})); 16050 out_of_bounds = out_of_bounds || index < 0; 16051 out_of_bounds = out_of_bounds || index >= ${this.paramsShape[o]}; 16052 flattenIndex += index * ${this.strides[o]};`;this.userCode=` 16053 void main() { 16054 ${s} coords = getOutputCoords(); 16055 int flattenIndex = 0; 16056 bool out_of_bounds = false; 16057 16058 ${a} 16059 16060 setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1])); 16061 } 16062 `}}/** 16063 * @license 16064 * Copyright 2020 Google LLC. All Rights Reserved. 16065 * Licensed under the Apache License, Version 2.0 (the "License"); 16066 * you may not use this file except in compliance with the License. 16067 * You may obtain a copy of the License at 16068 * 16069 * http://www.apache.org/licenses/LICENSE-2.0 16070 * 16071 * Unless required by applicable law or agreed to in writing, software 16072 * distributed under the License is distributed on an "AS IS" BASIS, 16073 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16074 * See the License for the specific language governing permissions and 16075 * limitations under the License. 16076 * ============================================================================= 16077 */function KY(n){const{inputs:e,backend:t}=n,{params:r,indices:i}=e,s=i.shape,a=s[s.length-1],o=ze(r.shape),[A,l,c,u]=LC(r,i),h=et({inputs:{x:i},backend:t,attrs:{shape:[l,a]}}),f=et({inputs:{x:r},backend:t,attrs:{shape:[ze(r.shape)/c,c]}});if(t.shouldExecuteOnCPU([r,i])||r.dtype==="string"){const p=t.readSync(i.dataId),w=t.bufferSync(r),C=qz(p,w,r.dtype,l,a,c,u,r.shape,o);return t.makeTensorInfo(A,r.dtype,C.values)}const d=new WY(a,u,[l,c],r.shape),g=t.runWebGLProgram(d,[f,h],f.dtype),m=et({inputs:{x:g},backend:t,attrs:{shape:A}});return t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(g),m}const XY={kernelName:fw,backendName:"webgl",kernelFunc:KY};/** 16078 * @license 16079 * Copyright 2017 Google LLC. All Rights Reserved. 16080 * Licensed under the Apache License, Version 2.0 (the "License"); 16081 * you may not use this file except in compliance with the License. 16082 * You may obtain a copy of the License at 16083 * 16084 * http://www.apache.org/licenses/LICENSE-2.0 16085 * 16086 * Unless required by applicable law or agreed to in writing, software 16087 * distributed under the License is distributed on an "AS IS" BASIS, 16088 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16089 * See the License for the specific language governing permissions and 16090 * limitations under the License. 16091 * ============================================================================= 16092 */class jY{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const r=Mn(this.rank),i=YY(e);this.userCode=` 16093 void main() { 16094 ${r} resRC = getOutputCoords(); 16095 int index = int(getIndices(resRC.x, resRC.z)); 16096 float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0; 16097 setOutput(inBounds * getA(${i})); 16098 } 16099 `}}function YY(n,e){const t=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[];for(let i=0;i<n.length;i++)i===2?r.push("index"):r.push(`${t[i]}`);return r.join()}/** 16100 * @license 16101 * Copyright 2020 Google LLC. All Rights Reserved. 16102 * Licensed under the Apache License, Version 2.0 (the "License"); 16103 * you may not use this file except in compliance with the License. 16104 * You may obtain a copy of the License at 16105 * 16106 * http://www.apache.org/licenses/LICENSE-2.0 16107 * 16108 * Unless required by applicable law or agreed to in writing, software 16109 * distributed under the License is distributed on an "AS IS" BASIS, 16110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16111 * See the License for the specific language governing permissions and 16112 * limitations under the License. 16113 * ============================================================================= 16114 */function TB(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,indices:s}=e,{axis:a,batchDims:o}=r,A=Br(a,i.shape)[0];if(pe().get("DEBUG")){const w=t.readSync(s.dataId),C=i.shape[A];for(let b=0;b<w.length;++b){const U=w[b];H(U<=C-1&&U>=0,()=>`GatherV2: the index value ${U} is not in [0, ${C-1}]`)}}const l=F_(i,s,A,o),c=ze(s.shape),u=[],h=et({inputs:{x:i},backend:t,attrs:{shape:[l.batchSize,l.outerSize,l.dimSize,l.sliceSize]}}),f=et({inputs:{x:s},backend:t,attrs:{shape:[l.batchSize,c/l.batchSize]}});u.push(h),u.push(f);const d=[l.batchSize,l.outerSize,c/l.batchSize,l.sliceSize];if(t.shouldExecuteOnCPU([i,s])||i.dtype==="string"){const w=t.bufferSync(f),C=t.bufferSync(h),b=Jz(C,w,d);return u.forEach(U=>t.disposeIntermediateTensorInfo(U)),t.makeTensorInfo(l.outputShape,b.dtype,b.values)}const g=new jY(h.shape,d),m=t.runWebGLProgram(g,[h,f],h.dtype);u.push(m);const p=et({inputs:{x:m},backend:t,attrs:{shape:l.outputShape}});return u.forEach(w=>t.disposeIntermediateTensorInfo(w)),p}const qY={kernelName:hw,backendName:"webgl",kernelFunc:TB};/** 16115 * @license 16116 * Copyright 2020 Google LLC. All Rights Reserved. 16117 * Licensed under the Apache License, Version 2.0 (the "License");
16118 * you may not use this file except in compliance with the License. 16119 * You may obtain a copy of the License at 16120 * 16121 * http://www.apache.org/licenses/LICENSE-2.0 16122 * 16123 * Unless required by applicable law or agreed to in writing, software 16124 * distributed under the License is distributed on an "AS IS" BASIS, 16125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16126 * See the License for the specific language governing permissions and 16127 * limitations under the License. 16128 * ============================================================================= 16129 */const JY="return float(a > b);",ZY=` 16130 return vec4(greaterThan(a, b)); 16131`,eq=Lr({opSnippet:JY,packedOpSnippet:ZY,cpuKernelImpl:Zz,dtype:"bool"}),tq={kernelName:dw,backendName:"webgl",kernelFunc:eq};/** 16132 * @license 16133 * Copyright 2020 Google LLC. All Rights Reserved. 16134 * Licensed under the Apache License, Version 2.0 (the "License"); 16135 * you may not use this file except in compliance with the License. 16136 * You may obtain a copy of the License at 16137 * 16138 * http://www.apache.org/licenses/LICENSE-2.0 16139 * 16140 * Unless required by applicable law or agreed to in writing, software 16141 * distributed under the License is distributed on an "AS IS" BASIS, 16142 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16143 * See the License for the specific language governing permissions and 16144 * limitations under the License. 16145 * ============================================================================= 16146 */const nq="return float(a >= b);",rq=` 16147 return vec4(greaterThanEqual(a, b)); 16148`,iq=Lr({opSnippet:nq,packedOpSnippet:rq,dtype:"bool",cpuKernelImpl:eW}),sq={kernelName:pw,backendName:"webgl",kernelFunc:iq};/** 16149 * @license 16150 * Copyright 2020 Google LLC. All Rights Reserved. 16151 * Licensed under the Apache License, Version 2.0 (the "License"); 16152 * you may not use this file except in compliance with the License. 16153 * You may obtain a copy of the License at 16154 * 16155 * http://www.apache.org/licenses/LICENSE-2.0 16156 * 16157 * Unless required by applicable law or agreed to in writing, software 16158 * distributed under the License is distributed on an "AS IS" BASIS, 16159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16160 * See the License for the specific language governing permissions and 16161 * limitations under the License. 16162 * ============================================================================= 16163 */function aq(n){const{inputs:e,backend:t}=n,{input:r}=e;return SB(r,!0,t)}const oq={kernelName:mw,backendName:"webgl",kernelFunc:aq};/** 16164 * @license 16165 * Copyright 2020 Google LLC. All Rights Reserved. 16166 * Licensed under the Apache License, Version 2.0 (the "License"); 16167 * you may not use this file except in compliance with the License. 16168 * You may obtain a copy of the License at 16169 * 16170 * http://www.apache.org/licenses/LICENSE-2.0 16171 * 16172 * Unless required by applicable law or agreed to in writing, software 16173 * distributed under the License is distributed on an "AS IS" BASIS, 16174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16175 * See the License for the specific language governing permissions and 16176 * limitations under the License. 16177 * ============================================================================= 16178 */const Aq="return float(!isnan(x) && !isinf(x));",lq=vn({opSnippet:Aq,dtype:"bool"}),cq={kernelName:yw,backendName:"webgl",kernelFunc:lq};/** 16179 * @license 16180 * Copyright 2020 Google LLC. All Rights Reserved. 16181 * Licensed under the Apache License, Version 2.0 (the "License"); 16182 * you may not use this file except in compliance with the License. 16183 * You may obtain a copy of the License at 16184 * 16185 * http://www.apache.org/licenses/LICENSE-2.0 16186 * 16187 * Unless required by applicable law or agreed to in writing, software 16188 * distributed under the License is distributed on an "AS IS" BASIS, 16189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16190 * See the License for the specific language governing permissions and 16191 * limitations under the License. 16192 * ============================================================================= 16193 */const uq="return float(isinf(x));",hq=vn({opSnippet:uq,dtype:"bool"}),fq={kernelName:vw,backendName:"webgl",kernelFunc:hq};/** 16194 * @license 16195 * Copyright 2020 Google LLC. All Rights Reserved. 16196 * Licensed under the Apache License, Version 2.0 (the "License");
16197 * you may not use this file except in compliance with the License. 16198 * You may obtain a copy of the License at 16199 * 16200 * http://www.apache.org/licenses/LICENSE-2.0 16201 * 16202 * Unless required by applicable law or agreed to in writing, software 16203 * distributed under the License is distributed on an "AS IS" BASIS, 16204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16205 * See the License for the specific language governing permissions and 16206 * limitations under the License. 16207 * ============================================================================= 16208 */const dq="return float(isnan(x));",pq=vn({opSnippet:dq,dtype:"bool"}),mq={kernelName:ww,backendName:"webgl",kernelFunc:pq};/** 16209 * @license 16210 * Copyright 2020 Google LLC. All Rights Reserved. 16211 * Licensed under the Apache License, Version 2.0 (the "License"); 16212 * you may not use this file except in compliance with the License. 16213 * You may obtain a copy of the License at 16214 * 16215 * http://www.apache.org/licenses/LICENSE-2.0 16216 * 16217 * Unless required by applicable law or agreed to in writing, software 16218 * distributed under the License is distributed on an "AS IS" BASIS, 16219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16220 * See the License for the specific language governing permissions and 16221 * limitations under the License. 16222 * ============================================================================= 16223 */const gq="return float(a < b);",yq=` 16224 return vec4(lessThan(a, b)); 16225`,vq=Lr({opSnippet:gq,packedOpSnippet:yq,cpuKernelImpl:tW,dtype:"bool"}),wq={kernelName:bw,backendName:"webgl",kernelFunc:vq};/** 16226 * @license 16227 * Copyright 2020 Google LLC. All Rights Reserved. 16228 * Licensed under the Apache License, Version 2.0 (the "License"); 16229 * you may not use this file except in compliance with the License. 16230 * You may obtain a copy of the License at 16231 * 16232 * http://www.apache.org/licenses/LICENSE-2.0 16233 * 16234 * Unless required by applicable law or agreed to in writing, software 16235 * distributed under the License is distributed on an "AS IS" BASIS, 16236 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16237 * See the License for the specific language governing permissions and 16238 * limitations under the License. 16239 * ============================================================================= 16240 */const xq="return float(a <= b);",bq=` 16241 return vec4(lessThanEqual(a, b)); 16242`,Cq=Lr({opSnippet:xq,packedOpSnippet:bq,cpuKernelImpl:nW,dtype:"bool"}),_q={kernelName:Cw,backendName:"webgl",kernelFunc:Cq};/** 16243 * @license 16244 * Copyright 2020 Google LLC. All Rights Reserved. 16245 * Licensed under the Apache License, Version 2.0 (the "License"); 16246 * you may not use this file except in compliance with the License. 16247 * You may obtain a copy of the License at 16248 * 16249 * http://www.apache.org/licenses/LICENSE-2.0 16250 * 16251 * Unless required by applicable law or agreed to in writing, software 16252 * distributed under the License is distributed on an "AS IS" BASIS, 16253 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16254 * See the License for the specific language governing permissions and 16255 * limitations under the License. 16256 * ============================================================================= 16257 */function Bq(n){const{backend:e,attrs:t}=n,{start:r,stop:i,num:s}=t,a=rW(r,i,s);return e.makeTensorInfo([a.length],"float32",a)}const Eq={kernelName:_w,backendName:"webgl",kernelFunc:Bq};/** 16258 * @license 16259 * Copyright 2020 Google LLC. All Rights Reserved. 16260 * Licensed under the Apache License, Version 2.0 (the "License"); 16261 * you may not use this file except in compliance with the License. 16262 * You may obtain a copy of the License at 16263 * 16264 * http://www.apache.org/licenses/LICENSE-2.0 16265 * 16266 * Unless required by applicable law or agreed to in writing, software 16267 * distributed under the License is distributed on an "AS IS" BASIS, 16268 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16269 * See the License for the specific language governing permissions and 16270 * limitations under the License. 16271 * ============================================================================= 16272 */const Sq=Jl+` 16273 return x < 0.0 ? 0./0. : log(x); 16274`,Tq=` 16275 vec4 result = log(x); 16276 bvec4 isNaN = isnan(x); 16277 result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r); 16278 result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g); 16279 result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b); 16280 result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a); 16281 return result;
16282`,Iq=vn({opSnippet:Sq,packedOpSnippet:Tq,cpuKernelImpl:iW}),Fq={kernelName:Bw,backendName:"webgl",kernelFunc:Iq};/** 16283 * @license 16284 * Copyright 2020 Google LLC. All Rights Reserved. 16285 * Licensed under the Apache License, Version 2.0 (the "License"); 16286 * you may not use this file except in compliance with the License. 16287 * You may obtain a copy of the License at 16288 * 16289 * http://www.apache.org/licenses/LICENSE-2.0 16290 * 16291 * Unless required by applicable law or agreed to in writing, software 16292 * distributed under the License is distributed on an "AS IS" BASIS, 16293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16294 * See the License for the specific language governing permissions and 16295 * limitations under the License. 16296 * ============================================================================= 16297 */const Rq=Jl+` 16298 return log(1.0 + x); 16299`,Uq=vn({opSnippet:Rq}),Mq={kernelName:Ew,backendName:"webgl",kernelFunc:Uq};/** 16300 * @license 16301 * Copyright 2020 Google LLC. All Rights Reserved. 16302 * Licensed under the Apache License, Version 2.0 (the "License"); 16303 * you may not use this file except in compliance with the License. 16304 * You may obtain a copy of the License at 16305 * 16306 * http://www.apache.org/licenses/LICENSE-2.0 16307 * 16308 * Unless required by applicable law or agreed to in writing, software 16309 * distributed under the License is distributed on an "AS IS" BASIS, 16310 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16311 * See the License for the specific language governing permissions and 16312 * limitations under the License. 16313 * ============================================================================= 16314 */const Nq="return float(a >= 1.0 && b >= 1.0);",Dq=` 16315 return vec4( 16316 vec4(greaterThanEqual(a, vec4(1.0))) * 16317 vec4(greaterThanEqual(b, vec4(1.0)))); 16318`,Lq=Lr({opSnippet:Nq,packedOpSnippet:Dq,dtype:"bool"}),Oq={kernelName:Sw,backendName:"webgl",kernelFunc:Lq};/** 16319 * @license 16320 * Copyright 2020 Google LLC. All Rights Reserved. 16321 * Licensed under the Apache License, Version 2.0 (the "License"); 16322 * you may not use this file except in compliance with the License. 16323 * You may obtain a copy of the License at 16324 * 16325 * http://www.apache.org/licenses/LICENSE-2.0 16326 * 16327 * Unless required by applicable law or agreed to in writing, software 16328 * distributed under the License is distributed on an "AS IS" BASIS, 16329 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16330 * See the License for the specific language governing permissions and 16331 * limitations under the License. 16332 * ============================================================================= 16333 */const Pq="return float(!(x >= 1.0));",kq=vn({opSnippet:Pq}),$q={kernelName:Tw,backendName:"webgl",kernelFunc:kq};/** 16334 * @license 16335 * Copyright 2020 Google LLC. All Rights Reserved. 16336 * Licensed under the Apache License, Version 2.0 (the "License"); 16337 * you may not use this file except in compliance with the License. 16338 * You may obtain a copy of the License at 16339 * 16340 * http://www.apache.org/licenses/LICENSE-2.0 16341 * 16342 * Unless required by applicable law or agreed to in writing, software 16343 * distributed under the License is distributed on an "AS IS" BASIS, 16344 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16345 * See the License for the specific language governing permissions and 16346 * limitations under the License. 16347 * ============================================================================= 16348 */const Qq="return float(a >= 1.0 || b >= 1.0);",Hq=` 16349 return min( 16350 vec4(greaterThanEqual(a, vec4(1.0))) + 16351 vec4(greaterThanEqual(b, vec4(1.0))), 16352 vec4(1.0)); 16353`,Vq=Lr({opSnippet:Qq,packedOpSnippet:Hq,dtype:"bool"}),Gq={kernelName:Iw,backendName:"webgl",kernelFunc:Vq};/** 16354 * @license 16355 * Copyright 2017 Google LLC. All Rights Reserved. 16356 * Licensed under the Apache License, Version 2.0 (the "License"); 16357 * you may not use this file except in compliance with the License. 16358 * You may obtain a copy of the License at 16359 * 16360 * http://www.apache.org/licenses/LICENSE-2.0 16361 * 16362 * Unless required by applicable law or agreed to in writing, software 16363 * distributed under the License is distributed on an "AS IS" BASIS, 16364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16365 * See the License for the specific language governing permissions and 16366 * limitations under the License. 16367 * ============================================================================= 16368 */class zq{constructor(e,t,r,i,s){this.variableNames=["x"],this.outputShape=[];const a=t,o=e[3]-1;this.outputShape=e;let A;const l=`float(${r}) + float(${i}) * sum`;s===.5?A=`inversesqrt(${l})`:s===1?A=`1.0/(${l})`:A=`exp(log(${l}) * float(-${s}));`,this.userCode=` 16369 void main() { 16370 ivec4 coords = getOutputCoords(); 16371 int b = coords[0]; 16372 int r = coords[1]; 16373 int c = coords[2]; 16374 int d = coords[3]; 16375 float x = getX(b, r, c, d); 16376 float sum = 0.0;
16377 for (int j = -${a}; j <= ${a}; j++) { 16378 int idx = d + j; 16379 if (idx >= 0 && idx <= ${o}) { 16380 float z = getX(b, r, c, idx); 16381 sum += z * z; 16382 } 16383 } 16384 float val = x * ${A}; 16385 setOutput(val); 16386 } 16387 `}}/** 16388 * @license 16389 * Copyright 2019 Google LLC. All Rights Reserved. 16390 * Licensed under the Apache License, Version 2.0 (the "License"); 16391 * you may not use this file except in compliance with the License. 16392 * You may obtain a copy of the License at 16393 * 16394 * http://www.apache.org/licenses/LICENSE-2.0 16395 * 16396 * Unless required by applicable law or agreed to in writing, software 16397 * distributed under the License is distributed on an "AS IS" BASIS, 16398 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16399 * See the License for the specific language governing permissions and 16400 * limitations under the License. 16401 * ============================================================================= 16402 */class Wq{constructor(e,t,r,i,s){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const a=t,o=e[3]-1;this.outputShape=e;let A;const l=`float(${r}) + float(${i}) * sum`;s===.5?A=`inversesqrt(${l})`:s===1?A=`1.0/(${l})`:A=`exp(log(${l}) * float(-${s}));`,this.userCode=` 16403 void main() { 16404 ivec4 coords = getOutputCoords(); 16405 int b = coords.x; 16406 int r = coords.y; 16407 int c = coords.z; 16408 int d = coords.w; 16409 16410 bool hasNextCol = d < ${this.outputShape[3]}; 16411 bool hasNextRow = c < ${this.outputShape[2]}; 16412 16413 vec4 sum = vec4(0.); 16414 vec4 xFragAtOutputCoords = getX(b, r, c, d); 16415 16416 vec4 xAtOutputCoords = vec4( 16417 getChannel(xFragAtOutputCoords, vec2(c, d)), 16418 hasNextCol ? 16419 getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0, 16420 hasNextRow ? 16421 getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0, 16422 (hasNextRow && hasNextCol) ? 16423 getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0 16424 ); 16425 16426 int firstChannel = d - ${a}; 16427 vec2 cache = vec2(0.); 16428 if(firstChannel >= 0){ 16429 vec4 firstChannelFrag = getX(b, r, c, firstChannel); 16430 cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel)); 16431 if(hasNextRow){ 16432 cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel)); 16433 } 16434 } 16435 16436 ivec2 depth = ivec2(d, d + 1); 16437 for (int j = - ${a}; j <= ${a}; j++) { 16438 ivec2 idx = depth + j; 16439 bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0)); 16440 bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${o})); 16441 16442 bool depthInRange = aboveLowerBound.x && belowUpperBound.x; 16443 bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y; 16444 16445 if(depthInRange || depthPlusOneInRange){ 16446 vec4 z = vec4(0.); 16447 vec4 xFragAtCurrentDepth; 16448 z.xz = cache.xy; 16449 if(depthPlusOneInRange && hasNextCol){ 16450 xFragAtCurrentDepth = idx.y != d ? 16451 getX(b, r, c, idx.y) : xFragAtOutputCoords; 16452 z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y)); 16453 if(hasNextRow){ 16454 z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y)); 16455 } 16456 } 16457 cache.xy = z.yw; 16458 sum += z * z; 16459 } 16460 } 16461 vec4 result = xAtOutputCoords * ${A}; 16462 setOutput(result); 16463 } 16464 `}}/** 16465 * @license 16466 * Copyright 2020 Google LLC. All Rights Reserved. 16467 * Licensed under the Apache License, Version 2.0 (the "License"); 16468 * you may not use this file except in compliance with the License. 16469 * You may obtain a copy of the License at 16470 * 16471 * http://www.apache.org/licenses/LICENSE-2.0 16472 * 16473 * Unless required by applicable law or agreed to in writing, software 16474 * distributed under the License is distributed on an "AS IS" BASIS, 16475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16476 * See the License for the specific language governing permissions and 16477 * limitations under the License. 16478 * ============================================================================= 16479 */const Kq=n=>{const{inputs:e,backend:t,attrs:r}=n,{x:i}
vendor: 4,766 bytes, lines 16479-16582
16479=e,{depthRadius:s,bias:a,alpha:o,beta:A}=r,l=pe().getBool("WEBGL_PACK_NORMALIZATION")?new Wq(i.shape,s,a,o,A):new zq(i.shape,s,a,o,A);return t.runWebGLProgram(l,[i],i.dtype)},Xq={kernelName:Fw,backendName:"webgl",kernelFunc:Kq};/** 16480 * @license 16481 * Copyright 2018 Google LLC. All Rights Reserved. 16482 * Licensed under the Apache License, Version 2.0 (the "License"); 16483 * you may not use this file except in compliance with the License. 16484 * You may obtain a copy of the License at 16485 * 16486 * http://www.apache.org/licenses/LICENSE-2.0 16487 * 16488 * Unless required by applicable law or agreed to in writing, software 16489 * distributed under the License is distributed on an "AS IS" BASIS, 16490 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16491 * See the License for the specific language governing permissions and 16492 * limitations under the License. 16493 * ============================================================================= 16494 */class jq{constructor(e,t,r,i,s){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=r,this.alpha=i,this.beta=s,this.userCode=` 16495 void main() { 16496 ivec4 coords = getOutputCoords(); 16497 int b = coords[0]; 16498 int r = coords[1]; 16499 int c = coords[2]; 16500 16501 float result = 0.0; 16502 for (int d = 0; d < ${this.depth}; ++d) { 16503 int depthBegin = int(max(0.0, float(d - ${t}))); 16504 int depthEnd = int(min(float(${this.depth}), 16505 float(d + ${t} + 1))); 16506 16507 const int MIN_DEPTH_BEGIN = 0; 16508 const int MAX_DEPTH_END = ${this.depth}; 16509 16510 float norm = 0.0; 16511 for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) { 16512 if (k < depthBegin){ 16513 continue; 16514 } 16515 else if (k >= depthBegin && k < depthEnd) { 16516 norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k); 16517 } 16518 else { 16519 break; 16520 } 16521 } 16522 16523 norm = float(${i}) * norm + float(${r}); 16524 16525 for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ 16526 if (k < depthBegin){ 16527 continue; 16528 } 16529 else if (k >= depthBegin && k < depthEnd){ 16530 float dyi = -2.0 * float(${i}) 16531 * float(${s}) 16532 * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d) 16533 / norm; 16534 if (k == d) { 16535 dyi += pow(norm, -1.0 * ${s}); 16536 } 16537 if (k == coords[3]) { 16538 dyi *= getDy(b, r, c, d); 16539 result += dyi; 16540 } 16541 } 16542 else { 16543 break; 16544 } 16545 } 16546 } 16547 setOutput(result); 16548 } 16549 `}}/** 16550 * @license 16551 * Copyright 2020 Google LLC. All Rights Reserved. 16552 * Licensed under the Apache License, Version 2.0 (the "License"); 16553 * you may not use this file except in compliance with the License. 16554 * You may obtain a copy of the License at 16555 * 16556 * http://www.apache.org/licenses/LICENSE-2.0 16557 * 16558 * Unless required by applicable law or agreed to in writing, software 16559 * distributed under the License is distributed on an "AS IS" BASIS, 16560 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16561 * See the License for the specific language governing permissions and 16562 * limitations under the License. 16563 * ============================================================================= 16564 */const Yq=n=>{const{inputs:e,backend:t,attrs:r}=n,{x:i,y:s,dy:a}=e,{depthRadius:o,bias:A,alpha:l,beta:c}=r,u=new jq(i.shape,o,A,l,c);return t.runWebGLProgram(u,[i,s,a],i.dtype)},qq={kernelName:RM,backendName:"webgl",kernelFunc:Yq};/** 16565 * @license 16566 * Copyright 2020 Google LLC. All Rights Reserved. 16567 * Licensed under the Apache License, Version 2.0 (the "License"); 16568 * you may not use this file except in compliance with the License. 16569 * You may obtain a copy of the License at 16570 * 16571 * http://www.apache.org/licenses/LICENSE-2.0 16572 * 16573 * Unless required by applicable law or agreed to in writing, software 16574 * distributed under the License is distributed on an "AS IS" BASIS, 16575 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16576 * See the License for the specific language governing permissions and 16577 * limitations under the License. 16578 * ============================================================================= 16579 */function Jq(n,e,t,r){const i=ze(e),a=ze(n.shape)/i,o=et({inputs:{x:n},attrs:{shape:[a,i]},backend:r}),A=FA(o,n.dtype,"max",r),l=et({inputs:{x:A},attrs:{shape:t},backend:r});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(A),l}/** 16580 * @license 16581 * Copyright 2020 Google LLC. All Rights Reserved. 16582 * Licensed under the Apache License, Version 2.0 (the "License");
16583 * you may not use this file except in compliance with the License. 16584 * You may obtain a copy of the License at 16585 * 16586 * http://www.apache.org/licenses/LICENSE-2.0 16587 * 16588 * Unless required by applicable law or agreed to in writing, software 16589 * distributed under the License is distributed on an "AS IS" BASIS, 16590 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16591 * See the License for the specific language governing permissions and 16592 * limitations under the License. 16593 * ============================================================================= 16594 */function IB(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{reductionIndices:s,keepDims:a}=r,o=i.shape.length,A=Br(s,i.shape);let l=A;const c=As(l,o),u=c!=null,h=t.shouldExecuteOnCPU([i]);let f=i;if(u){if(h){const C=t.texData.get(f.dataId).values,b=new Array(o);for(let D=0;D<b.length;D++)b[D]=i.shape[c[D]];const U=s2(C,i.shape,i.dtype,c,b);f=t.makeTensorInfo(b,i.dtype);const F=t.texData.get(f.dataId);F.values=U}else f=ad(i,c,t);l=ls(l.length,o)}Ms("max",l,o);const[d,g]=Zs(f.shape,l);let m=d;a&&(m=Qi(d,A));let p;if(h){const C=t.texData.get(f.dataId).values,b=sW(C,ze(g),m,i.dtype);p=t.makeTensorInfo(m,i.dtype);const U=t.texData.get(p.dataId);U.values=b}else p=Jq(f,g,m,t);return u&&t.disposeIntermediateTensorInfo(f),p}const Zq={kernelName:Rw,backendName:"webgl",kernelFunc:IB};/** 16595 * @license 16596 * Copyright 2020 Google LLC. All Rights Reserved. 16597 * Licensed under the Apache License, Version 2.0 (the "License"); 16598 * you may not use this file except in compliance with the License. 16599 * You may obtain a copy of the License at 16600 * 16601 * http://www.apache.org/licenses/LICENSE-2.0 16602 * 16603 * Unless required by applicable law or agreed to in writing, software 16604 * distributed under the License is distributed on an "AS IS" BASIS, 16605 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16606 * See the License for the specific language governing permissions and 16607 * limitations under the License. 16608 * ============================================================================= 16609 */const eJ=a2+` 16610 return max(a, b); 16611`,tJ=` 16612 vec4 result = vec4(max(a, b)); 16613 bvec4 isNaNA = isnan(a); 16614 bvec4 isNaNB = isnan(b); 16615 bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); 16616 `+IA+` 16617 return result; 16618`,nJ=Lr({opSnippet:eJ,packedOpSnippet:tJ,cpuKernelImpl:aW}),rJ={kernelName:Uw,backendName:"webgl",kernelFunc:nJ};/** 16619 * @license 16620 * Copyright 2020 Google LLC. All Rights Reserved. 16621 * Licensed under the Apache License, Version 2.0 (the "License"); 16622 * you may not use this file except in compliance with the License. 16623 * You may obtain a copy of the License at 16624 * 16625 * http://www.apache.org/licenses/LICENSE-2.0 16626 * 16627 * Unless required by applicable law or agreed to in writing, software 16628 * distributed under the License is distributed on an "AS IS" BASIS, 16629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16630 * See the License for the specific language governing permissions and 16631 * limitations under the License. 16632 * ============================================================================= 16633 */function iJ(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e;xu(i,"maxPool");const{filterSize:s,strides:a,pad:o,dimRoundingMode:A}=r,l=1;H(Ti(a,l),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'`);const c=CA(i.shape,s,a,l,o,A);if(c.filterWidth===1&&c.filterHeight===1&&rr(c.inShape,c.outShape))return Ei({inputs:{x:i},backend:t});const u=new ru(c,"max",!1);return t.runWebGLProgram(u,[i],i.dtype)}const sJ={kernelName:Mw,backendName:"webgl",kernelFunc:iJ};/** 16634 * @license 16635 * Copyright 2020 Google LLC. All Rights Reserved. 16636 * Licensed under the Apache License, Version 2.0 (the "License"); 16637 * you may not use this file except in compliance with the License. 16638 * You may obtain a copy of the License at 16639 * 16640 * http://www.apache.org/licenses/LICENSE-2.0 16641 * 16642 * Unless required by applicable law or agreed to in writing, software 16643 * distributed under the License is distributed on an "AS IS" BASIS, 16644 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16645 * See the License for the specific language governing permissions and 16646 * limitations under the License. 16647 * ============================================================================= 16648 */function aJ(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{filterSize:s,strides:a,pad:o,dataFormat:A,dimRoundingMode:l}=r,c=[1,1,1],u=mu(i.shape,s,a,c,o,l,A),h=new A2(u,"max",!1);return t.runWebGLProgram(h,[i],i.dtype)}const oJ={kernelName:Nw,backendName:"webgl",kernelFunc:aJ};/** 16649 * @license 16650 * Copyright 2017 Google LLC. All Rights Reserved. 16651 * Licensed under the Apache License, Version 2.0 (the "License");
16652 * you may not use this file except in compliance with the License. 16653 * You may obtain a copy of the License at 16654 * 16655 * http://www.apache.org/licenses/LICENSE-2.0 16656 * 16657 * Unless required by applicable law or agreed to in writing, software 16658 * distributed under the License is distributed on an "AS IS" BASIS, 16659 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16660 * See the License for the specific language governing permissions and 16661 * limitations under the License. 16662 * ============================================================================= 16663 */class AJ{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,r=e.strideWidth,i=e.dilationHeight,s=e.effectiveFilterHeight,a=e.effectiveFilterWidth,o=s-1-e.padInfo.top,A=a-1-e.padInfo.left,l=s*a-1;this.userCode=` 16664 const ivec2 pads = ivec2(${o}, ${A}); 16665 16666 void main() { 16667 ivec4 coords = getOutputCoords(); 16668 int b = coords[0]; 16669 int d = coords[3]; 16670 16671 ivec2 dyRCCorner = coords.yz - pads; 16672 int dyRCorner = dyRCCorner.x; 16673 int dyCCorner = dyRCCorner.y; 16674 16675 // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). 16676 // ? = to be determined. : = across all values in that axis. 16677 float dotProd = 0.0; 16678 for (int wR = 0; wR < ${s}; 16679 wR += ${i}) { 16680 float dyR = float(dyRCorner + wR) / ${t}.0; 16681 16682 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { 16683 continue; 16684 } 16685 int idyR = int(dyR); 16686 16687 for (int wC = 0; wC < ${a}; wC++) { 16688 float dyC = float(dyCCorner + wC) / ${r}.0; 16689 16690 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 16691 fract(dyC) > 0.0) { 16692 continue; 16693 } 16694 int idyC = int(dyC); 16695 16696 float dyValue = getDy(b, idyR, idyC, d); 16697 int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d)); 16698 16699 // Get the current value, check it against the value from the 16700 // position matrix. 16701 int curPosValue = wR * ${a} + wC; 16702 float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); 16703 16704 dotProd += dyValue * mask; 16705 } 16706 } 16707 setOutput(dotProd); 16708 } 16709 `}}class lJ{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,r=e.strideHeight,i=e.strideWidth,s=e.dilationDepth,a=e.dilationHeight,o=e.dilationWidth,A=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,u=A-1-e.padInfo.front,h=l-1-e.padInfo.top,f=c-1-e.padInfo.left,d=A*l*c-1;this.userCode=` 16710 const ivec3 pads = ivec3(${u}, ${h}, ${f}); 16711 16712 void main() { 16713 ivec5 coords = getOutputCoords(); 16714 int batch = coords.x; 16715 int ch = coords.u; 16716 16717 ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; 16718 int dyDCorner = dyCorner.x; 16719 int dyRCorner = dyCorner.y; 16720 int dyCCorner = dyCorner.z; 16721 16722 // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get 16723 // dx(xD, xR, xC, ch). 16724 // ? = to be determined. : = across all values in that axis. 16725 float dotProd = 0.0; 16726 16727 for (int wD = 0; wD < ${A}; 16728 wD += ${s}) { 16729 float dyD = float(dyDCorner + wD) / ${t}.0; 16730 16731 if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { 16732 continue; 16733 } 16734 int idyD = int(dyD); 16735 16736 for (int wR = 0; wR < ${l}; 16737 wR += ${a}) { 16738 float dyR = float(dyRCorner + wR) / ${r}.0; 16739 16740 if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || 16741 fract(dyR) > 0.0) { 16742 continue; 16743 } 16744 int idyR = int(dyR); 16745 16746 for (int wC = 0; wC < ${c}; 16747 wC += ${o}) { 16748 float dyC = float(dyCCorner + wC) / ${i}.0; 16749 16750 if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || 16751 fract(dyC) > 0.0) { 16752 continue; 16753 } 16754 int idyC = int(dyC); 16755 16756 float dyValue = getDy(batch, idyD, idyR, idyC, ch); 16757 int maxPosValue = ${d} - 16758 int(getMaxPos(batch, idyD, idyR, idyC, ch)); 16759 16760 // Get the current value, check it against the value from the 16761 // position matrix. 16762 int curPosValue = 16763 wD * ${l} * ${c} + 16764 wR * ${c} + wC; 16765 float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); 16766 16767 dotProd += dyValue * mask; 16768 } 16769 } 16770 } 16771 setOutput(dotProd); 16772 } 16773 `}}/** 16774 * @license 16775 * Copyright 2020 Google LLC. All Rights Reserved. 16776 * Licensed under the Apache License, Version 2.0 (the "License");
16777 * you may not use this file except in compliance with the License. 16778 * You may obtain a copy of the License at 16779 * 16780 * http://www.apache.org/licenses/LICENSE-2.0 16781 * 16782 * Unless required by applicable law or agreed to in writing, software 16783 * distributed under the License is distributed on an "AS IS" BASIS, 16784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16785 * See the License for the specific language governing permissions and 16786 * limitations under the License. 16787 * ============================================================================= 16788 */function cJ(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,input:s}=e,a=s,{filterSize:o,strides:A,pad:l,dimRoundingMode:c}=r,u=[1,1,1],h=mu(a.shape,o,A,u,l,c),f=new A2(h,"max",!0),d=t.runWebGLProgram(f,[a],a.dtype),g=new lJ(h),m=t.runWebGLProgram(g,[i,d],a.dtype);return t.disposeIntermediateTensorInfo(d),m}const uJ={kernelName:MM,backendName:"webgl",kernelFunc:cJ};/** 16789 * @license 16790 * Copyright 2020 Google LLC. All Rights Reserved. 16791 * Licensed under the Apache License, Version 2.0 (the "License"); 16792 * you may not use this file except in compliance with the License. 16793 * You may obtain a copy of the License at 16794 * 16795 * http://www.apache.org/licenses/LICENSE-2.0 16796 * 16797 * Unless required by applicable law or agreed to in writing, software 16798 * distributed under the License is distributed on an "AS IS" BASIS, 16799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16800 * See the License for the specific language governing permissions and 16801 * limitations under the License. 16802 * ============================================================================= 16803 */function hJ(n){const{inputs:e,backend:t,attrs:r}=n,{dy:i,input:s,output:a}=e,o=s;xu([s,a],"maxPoolGrad");const{filterSize:A,strides:l,pad:c,dimRoundingMode:u}=r,h=CA(o.shape,A,l,1,c,u),f=!0,d=new ru(h,"max",f),g=t.runWebGLProgram(d,[o],o.dtype),m=new AJ(h),p=t.runWebGLProgram(m,[i,g],o.dtype);return t.disposeIntermediateTensorInfo(g),p}const fJ={kernelName:UM,backendName:"webgl",kernelFunc:hJ};/** 16804 * @license 16805 * Copyright 2020 Google LLC. All Rights Reserved. 16806 * Licensed under the Apache License, Version 2.0 (the "License"); 16807 * you may not use this file except in compliance with the License. 16808 * You may obtain a copy of the License at 16809 * 16810 * http://www.apache.org/licenses/LICENSE-2.0 16811 * 16812 * Unless required by applicable law or agreed to in writing, software 16813 * distributed under the License is distributed on an "AS IS" BASIS, 16814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16815 * See the License for the specific language governing permissions and 16816 * limitations under the License. 16817 * ============================================================================= 16818 */function dJ(n,e,t,r){let i=new ru(t,"max",!1);const s=r.runWebGLProgram(i,[n],"float32");i=new ru(t,"max",!0,!0,e);const a=r.runWebGLProgram(i,[n],"float32");return[s,a]}/** 16819 * @license 16820 * Copyright 2020 Google LLC. All Rights Reserved. 16821 * Licensed under the Apache License, Version 2.0 (the "License"); 16822 * you may not use this file except in compliance with the License. 16823 * You may obtain a copy of the License at 16824 * 16825 * http://www.apache.org/licenses/LICENSE-2.0 16826 * 16827 * Unless required by applicable law or agreed to in writing, software 16828 * distributed under the License is distributed on an "AS IS" BASIS, 16829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16830 * See the License for the specific language governing permissions and 16831 * limitations under the License. 16832 * ============================================================================= 16833 */const pJ={kernelName:Dw,backendName:"webgl",kernelFunc:({inputs:n,attrs:e,backend:t})=>{const{x:r}=n,{filterSize:i,strides:s,pad:a,includeBatchInIndex:o}=e,A=t;H(r.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);const l=[1,1];H(Ti(s,l),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${l}'`);const c=CA(r.shape,i,s,l,a),[u,h]=dJ(r,o,c,A);return[u,h]}};/** 16834 * @license 16835 * Copyright 2020 Google LLC. All Rights Reserved. 16836 * Licensed under the Apache License, Version 2.0 (the "License");
16837 * you may not use this file except in compliance with the License. 16838 * You may obtain a copy of the License at 16839 * 16840 * http://www.apache.org/licenses/LICENSE-2.0 16841 * 16842 * Unless required by applicable law or agreed to in writing, software 16843 * distributed under the License is distributed on an "AS IS" BASIS, 16844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16845 * See the License for the specific language governing permissions and 16846 * limitations under the License. 16847 * ============================================================================= 16848 */function mJ(n,e,t,r){const i=ze(e),a=ze(n.shape)/i,o=et({inputs:{x:n},attrs:{shape:[a,i]},backend:r}),A=FA(o,"float32","mean",r),l=et({inputs:{x:A},attrs:{shape:t},backend:r});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(A),l}/** 16849 * @license 16850 * Copyright 2020 Google LLC. All Rights Reserved. 16851 * Licensed under the Apache License, Version 2.0 (the "License"); 16852 * you may not use this file except in compliance with the License. 16853 * You may obtain a copy of the License at 16854 * 16855 * http://www.apache.org/licenses/LICENSE-2.0 16856 * 16857 * Unless required by applicable law or agreed to in writing, software 16858 * distributed under the License is distributed on an "AS IS" BASIS, 16859 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16860 * See the License for the specific language governing permissions and 16861 * limitations under the License. 16862 * ============================================================================= 16863 */const gJ={kernelName:Lw,backendName:"webgl",kernelFunc:({inputs:n,attrs:e,backend:t})=>{const{x:r}=n,{keepDims:i,axis:s}=e,a=t,o=r.shape.length,A=Br(s,r.shape);let l=A;const c=As(l,o),u=c!=null,h=a.shouldExecuteOnCPU([r]),f=[];let d=r;if(u){if(h){const b=a.texData.get(d.dataId).values,U=new Array(o);for(let O=0;O<U.length;O++)U[O]=r.shape[c[O]];const F=s2(b,r.shape,r.dtype,c,U);d=a.makeTensorInfo(U,r.dtype);const D=a.texData.get(d.dataId);D.values=F}else d=ad(r,c,a);f.push(d),l=ls(l.length,o)}Ms("sum",l,o);const[g,m]=Zs(d.shape,l);let p=g;i&&(p=Qi(g,A));const w=mJ(d,m,p,a);for(const C of f)a.disposeIntermediateTensorInfo(C);return w}};/** 16864 * @license 16865 * Copyright 2020 Google LLC. All Rights Reserved. 16866 * Licensed under the Apache License, Version 2.0 (the "License"); 16867 * you may not use this file except in compliance with the License. 16868 * You may obtain a copy of the License at 16869 * 16870 * http://www.apache.org/licenses/LICENSE-2.0 16871 * 16872 * Unless required by applicable law or agreed to in writing, software 16873 * distributed under the License is distributed on an "AS IS" BASIS, 16874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16875 * See the License for the specific language governing permissions and 16876 * limitations under the License. 16877 * ============================================================================= 16878 */function yJ(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,keepDims:a}=r,o=i.shape.length,A=Br(s,i.shape);let l=A;const c=As(l,o);let u=i;c!=null&&(u=Jr({inputs:{x:i},backend:t,attrs:{perm:c}}),l=ls(l.length,i.shape.length)),Ms("min",l,o);const[h,f]=Zs(u.shape,l),d=ze(f),g=et({inputs:{x:u},backend:t,attrs:{shape:[-1,d]}}),m=FA(g,g.dtype,"min",t);let p;if(a){const w=Qi(h,A);p=et({inputs:{x:m},backend:t,attrs:{shape:w}})}else p=et({inputs:{x:m},backend:t,attrs:{shape:h}});return t.disposeIntermediateTensorInfo(g),t.disposeIntermediateTensorInfo(m),c!=null&&t.disposeIntermediateTensorInfo(u),p}const vJ={kernelName:Ow,backendName:"webgl",kernelFunc:yJ};/** 16879 * @license 16880 * Copyright 2020 Google LLC. All Rights Reserved. 16881 * Licensed under the Apache License, Version 2.0 (the "License"); 16882 * you may not use this file except in compliance with the License. 16883 * You may obtain a copy of the License at 16884 * 16885 * http://www.apache.org/licenses/LICENSE-2.0 16886 * 16887 * Unless required by applicable law or agreed to in writing, software 16888 * distributed under the License is distributed on an "AS IS" BASIS, 16889 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16890 * See the License for the specific language governing permissions and 16891 * limitations under the License. 16892 * ============================================================================= 16893 */const wJ=a2+` 16894 return min(a, b); 16895`,xJ=` 16896 vec4 result = vec4(min(a, b)); 16897 bvec4 isNaNA = isnan(a); 16898 bvec4 isNaNB = isnan(b); 16899 bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); 16900 `+IA+` 16901 return result; 16902`,bJ=Lr({opSnippet:wJ,packedOpSnippet:xJ,cpuKernelImpl:oW}),CJ={kernelName:Pw,backendName:"webgl",kernelFunc:bJ};/** 16903 * @license 16904 * Copyright 2020 Google LLC. All Rights Reserved. 16905 * Licensed under the Apache License, Version 2.0 (the "License");
16906 * you may not use this file except in compliance with the License. 16907 * You may obtain a copy of the License at 16908 * 16909 * http://www.apache.org/licenses/LICENSE-2.0 16910 * 16911 * Unless required by applicable law or agreed to in writing, software 16912 * distributed under the License is distributed on an "AS IS" BASIS, 16913 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16914 * See the License for the specific language governing permissions and 16915 * limitations under the License. 16916 * ============================================================================= 16917 */class _J{constructor(e,t,r){this.variableNames=["x"],this.outputShape=t.map((c,u)=>c[0]+e[u]+c[1]);const i=e.length,s=Mn(i),a=t.map(c=>c[0]).join(","),o=t.map((c,u)=>c[0]+e[u]).join(","),A=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i),l=r==="reflect"?0:1;if(i===1){this.userCode=` 16918 int start = ${a}; 16919 int end = ${o}; 16920 16921 void main() { 16922 int outC = getOutputCoords(); 16923 if (outC < start) { 16924 outC = start * 2 - outC - ${l}; 16925 } else if(outC >= end) { 16926 outC = (end - 1) * 2 - outC + ${l}; 16927 } 16928 setOutput(getX(outC - start)); 16929 } 16930 `;return}this.userCode=` 16931 ${s} start = ${s}(${a}); 16932 ${s} end = ${s}(${o}); 16933 16934 void main() { 16935 ${s} outC = getOutputCoords(); 16936 for (int i = 0; i < ${i}; i++) { 16937 if (outC[i] < start[i]) { 16938 outC[i] = start[i] * 2 - outC[i] - ${l}; 16939 } else if(outC[i] >= end[i]) { 16940 outC[i] = (end[i] - 1) * 2 - outC[i] + ${l}; 16941 } 16942 } 16943 ${s} coords = outC - start; 16944 setOutput(getX(${A})); 16945 } 16946 `}}/** 16947 * @license 16948 * Copyright 2020 Google LLC. All Rights Reserved. 16949 * Licensed under the Apache License, Version 2.0 (the "License"); 16950 * you may not use this file except in compliance with the License. 16951 * You may obtain a copy of the License at 16952 * 16953 * http://www.apache.org/licenses/LICENSE-2.0 16954 * 16955 * Unless required by applicable law or agreed to in writing, software 16956 * distributed under the License is distributed on an "AS IS" BASIS, 16957 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16958 * See the License for the specific language governing permissions and 16959 * limitations under the License. 16960 * ============================================================================= 16961 */class BJ{constructor(e,t,r){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((d,g)=>d[0]+e[g]+d[1]);const i=e.length,s=Mn(i),a=t.map(d=>d[0]).join(","),o=t.map((d,g)=>d[0]+e[g]).join(","),A=qr("rc",i),l=qr("source",i),c=`${A[i-1]} < ${this.outputShape[i-1]}`,u=i===1?"source":`vec2(${l.slice(-2).join()})`,h=r==="reflect"?0:1;let f="";if(i===1){const d=` 16962 ${s} source = rc; 16963 if (source < start) { 16964 source = start * 2 - source - ${h}; 16965 } else if (source >= end) { 16966 source = (end - 1) * 2 - source + ${h}; 16967 } 16968 source -= start; 16969 `;f=` 16970 ${s} rc = outputLoc; 16971 ${d} 16972 result[0] = getChannel(getX(${l.join()}), ${u}); 16973 ${A[i-1]} += 1; 16974 if(${c}) { 16975 ${d} 16976 result[1] = getChannel(getX(${l.join()}), ${u}); 16977 } 16978 `}else{const d=` 16979 ${s} source = rc; 16980 ${s} lt = ${s}(lessThan(source, start)); 16981 ${s} gte = ${s}(greaterThanEqual(source, end)); 16982 ${s} orig = 1 - (lt + gte); 16983 source = orig * source + 16984 lt * (start * 2 - source - ${h}) + 16985 gte * ((end - 1) * 2 - source + ${h}); 16986 source -= start; 16987 `;f=` 16988 ${s} rc = outputLoc; 16989 ${d} 16990 result[0] = getChannel(getX(${l.join()}), ${u}); 16991 ${A[i-1]} += 1; 16992 if(${c}) { 16993 ${d} 16994 result[1] = getChannel(getX(${l.join()}), ${u}); 16995 } 16996 rc = outputLoc; 16997 ${A[i-2]} += 1; 16998 if(${A[i-2]} < ${this.outputShape[i-2]}) { 16999 ${d} 17000 result[2] = getChannel(getX(${l.join()}), ${u}); 17001 ${A[i-1]} += 1; 17002 if(${c}) { 17003 ${d} 17004 result[3] = getChannel(getX(${l.join()}), ${u}); 17005 } 17006 } 17007 `}this.userCode=` 17008 const ${s} start = ${s}(${a}); 17009 const ${s} end = ${s}(${o}); 17010 17011 void main() { 17012 ${s} outputLoc = getOutputCoords(); 17013 vec4 result = vec4(0.); 17014 ${f} 17015 setOutput(result); 17016 } 17017 `}}/** 17018 * @license 17019 * Copyright 2020 Google LLC. All Rights Reserved. 17020 * Licensed under the Apache License, Version 2.0 (the "License");
17021 * you may not use this file except in compliance with the License. 17022 * You may obtain a copy of the License at 17023 * 17024 * http://www.apache.org/licenses/LICENSE-2.0 17025 * 17026 * Unless required by applicable law or agreed to in writing, software 17027 * distributed under the License is distributed on an "AS IS" BASIS, 17028 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17029 * See the License for the specific language governing permissions and 17030 * limitations under the License. 17031 * ============================================================================= 17032 */const EJ=({inputs:n,backend:e,attrs:t})=>{const{x:r}=n,{paddings:i,mode:s}=t,a=pe().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new BJ(r.shape,i,s):new _J(r.shape,i,s);return e.runWebGLProgram(a,[r],r.dtype)},SJ={kernelName:kw,backendName:"webgl",kernelFunc:EJ};/** 17033 * @license 17034 * Copyright 2020 Google LLC. All Rights Reserved. 17035 * Licensed under the Apache License, Version 2.0 (the "License"); 17036 * you may not use this file except in compliance with the License. 17037 * You may obtain a copy of the License at 17038 * 17039 * http://www.apache.org/licenses/LICENSE-2.0 17040 * 17041 * Unless required by applicable law or agreed to in writing, software 17042 * distributed under the License is distributed on an "AS IS" BASIS, 17043 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17044 * See the License for the specific language governing permissions and 17045 * limitations under the License. 17046 * ============================================================================= 17047 */const TJ=`if (b == 0.0) return NAN; 17048 return mod(a, b);`,IJ=` 17049 vec4 result = mod(a, b); 17050 bvec4 isNaN = equal(b, vec4(0.0)); 17051 `+IA+` 17052 return result; 17053`,FJ=Lr({opSnippet:TJ,packedOpSnippet:IJ}),RJ={kernelName:$w,backendName:"webgl",kernelFunc:FJ};/** 17054 * @license 17055 * Copyright 2017 Google LLC. All Rights Reserved. 17056 * Licensed under the Apache License, Version 2.0 (the "License"); 17057 * you may not use this file except in compliance with the License. 17058 * You may obtain a copy of the License at 17059 * 17060 * http://www.apache.org/licenses/LICENSE-2.0 17061 * 17062 * Unless required by applicable law or agreed to in writing, software 17063 * distributed under the License is distributed on an "AS IS" BASIS, 17064 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17065 * See the License for the specific language governing permissions and 17066 * limitations under the License. 17067 * ============================================================================= 17068 */class UJ{constructor(e,t,r){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,r],this.userCode=` 17069 void main() { 17070 ivec2 coords = getOutputCoords(); 17071 int batch = coords[0]; 17072 17073 float r = random(seed); 17074 float cdf = 0.0; 17075 17076 for (int i = 0; i < ${t-1}; i++) { 17077 cdf += getProbs(batch, i); 17078 17079 if (r < cdf) { 17080 setOutput(float(i)); 17081 return; 17082 } 17083 } 17084 17085 // If no other event happened, last event happened. 17086 setOutput(float(${t-1})); 17087 } 17088 `}}/** 17089 * @license 17090 * Copyright 2020 Google LLC. All Rights Reserved. 17091 * Licensed under the Apache License, Version 2.0 (the "License"); 17092 * you may not use this file except in compliance with the License. 17093 * You may obtain a copy of the License at 17094 * 17095 * http://www.apache.org/licenses/LICENSE-2.0 17096 * 17097 * Unless required by applicable law or agreed to in writing, software 17098 * distributed under the License is distributed on an "AS IS" BASIS, 17099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17100 * See the License for the specific language governing permissions and 17101 * limitations under the License. 17102 * ============================================================================= 17103 */const MJ=` 17104if (a == b) { 17105 return 1.0; 17106}; 17107return a / b;`,NJ=` 17108 // vec4 one = vec4(equal(a, b)); 17109 // return one + (vec4(1.0) - one) * a / b; 17110 vec4 result = a / b; 17111 if(a.x == b.x) { 17112 result.x = 1.; 17113 } 17114 if(a.y == b.y) { 17115 result.y = 1.; 17116 } 17117 if(a.z == b.z) { 17118 result.z = 1.; 17119 } 17120 if(a.w == b.w) { 17121 result.w = 1.; 17122 } 17123 17124 return result; 17125`,FB=Lr({opSnippet:MJ,packedOpSnippet:NJ,checkOutOfBounds:!0}),DJ={kernelName:Jv,backendName:"webgl",kernelFunc:FB};/** 17126 * @license 17127 * Copyright 2020 Google LLC. All Rights Reserved. 17128 * Licensed under the Apache License, Version 2.0 (the "License");
17129 * you may not use this file except in compliance with the License. 17130 * You may obtain a copy of the License at 17131 * 17132 * http://www.apache.org/licenses/LICENSE-2.0 17133 * 17134 * Unless required by applicable law or agreed to in writing, software 17135 * distributed under the License is distributed on an "AS IS" BASIS, 17136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17137 * See the License for the specific language governing permissions and 17138 * limitations under the License. 17139 * ============================================================================= 17140 */const c4="return a - b;",RB=Lr({opSnippet:c4,packedOpSnippet:c4,supportsComplex:!0,cpuKernelImpl:TW}),LJ={kernelName:Hx,backendName:"webgl",kernelFunc:RB};/** 17141 * @license 17142 * Copyright 2020 Google LLC. All Rights Reserved. 17143 * Licensed under the Apache License, Version 2.0 (the "License"); 17144 * you may not use this file except in compliance with the License. 17145 * You may obtain a copy of the License at 17146 * 17147 * http://www.apache.org/licenses/LICENSE-2.0 17148 * 17149 * Unless required by applicable law or agreed to in writing, software 17150 * distributed under the License is distributed on an "AS IS" BASIS, 17151 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17152 * See the License for the specific language governing permissions and 17153 * limitations under the License. 17154 * ============================================================================= 17155 */function UB(n){const{inputs:e,backend:t,attrs:r}=n,{logits:i}=e,{dim:s}=r,a=Br([s],i.shape),o=IB({inputs:{x:i},backend:t,attrs:{reductionIndices:a,keepDims:!1}}),A=Qi(o.shape,a),l=et({inputs:{x:o},backend:t,attrs:{shape:A}}),c=RB({inputs:{a:i,b:l},backend:t}),u=EB({inputs:{x:c},backend:t}),h=od({inputs:{x:u},backend:t,attrs:{axis:a,keepDims:!1}}),f=et({inputs:{x:h},backend:t,attrs:{shape:A}}),d=FB({inputs:{a:u,b:f},backend:t});return t.disposeIntermediateTensorInfo(o),t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(u),t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(f),d}const OJ={kernelName:Fx,backendName:"webgl",kernelFunc:UB};/** 17156 * @license 17157 * Copyright 2020 Google LLC. All Rights Reserved. 17158 * Licensed under the Apache License, Version 2.0 (the "License"); 17159 * you may not use this file except in compliance with the License. 17160 * You may obtain a copy of the License at 17161 * 17162 * http://www.apache.org/licenses/LICENSE-2.0 17163 * 17164 * Unless required by applicable law or agreed to in writing, software 17165 * distributed under the License is distributed on an "AS IS" BASIS, 17166 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17167 * See the License for the specific language governing permissions and 17168 * limitations under the License. 17169 * ============================================================================= 17170 */function PJ(n){const{inputs:e,backend:t,attrs:r}=n,{logits:i}=e,{numSamples:s,seed:a,normalized:o}=r,A=o?i:UB({inputs:{logits:i},backend:t,attrs:{dim:i.shape.length-1}}),l=A.shape[0],c=A.shape[1],u=new UJ(l,c,s),h=[[a]],f=t.runWebGLProgram(u,[A],"int32",h);return o||t.disposeIntermediateTensorInfo(A),f}const kJ={kernelName:Qw,backendName:"webgl",kernelFunc:PJ};/** 17171 * @license 17172 * Copyright 2020 Google LLC. All Rights Reserved. 17173 * Licensed under the Apache License, Version 2.0 (the "License"); 17174 * you may not use this file except in compliance with the License. 17175 * You may obtain a copy of the License at 17176 * 17177 * http://www.apache.org/licenses/LICENSE-2.0 17178 * 17179 * Unless required by applicable law or agreed to in writing, software 17180 * distributed under the License is distributed on an "AS IS" BASIS, 17181 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17182 * See the License for the specific language governing permissions and 17183 * limitations under the License. 17184 * ============================================================================= 17185 */const $J=cs+` 17186 return -x; 17187`,QJ=` 17188 vec4 result = -x; 17189 bvec4 isNaN = isnan(x); 17190 17191 result.r = isNaN.r ? x.r : result.r; 17192 result.g = isNaN.g ? x.g : result.g; 17193 result.b = isNaN.b ? x.b : result.b; 17194 result.a = isNaN.a ? x.a : result.a; 17195 17196 return result; 17197`;function HJ(n){const{inputs:e,backend:t}=n,{x:r}=e;if(t.shouldExecuteOnCPU([r])){const s=t.texData.get(r.dataId),[a,o]=lW(s.values,r.shape,r.dtype);return t.makeTensorInfo(o,r.dtype,a)}let i;
vendor: 4,164 bytes, lines 17197-17251
17197return pe().getBool("WEBGL_PACK_UNARY_OPERATIONS")?i=new so(r.shape,QJ):i=new Hs(r.shape,$J),t.runWebGLProgram(i,[r],r.dtype)}const VJ={kernelName:Vw,backendName:"webgl",kernelFunc:HJ};/** 17198 * @license 17199 * Copyright 2020 Google LLC. All Rights Reserved. 17200 * Licensed under the Apache License, Version 2.0 (the "License"); 17201 * you may not use this file except in compliance with the License. 17202 * You may obtain a copy of the License at 17203 * 17204 * http://www.apache.org/licenses/LICENSE-2.0 17205 * 17206 * Unless required by applicable law or agreed to in writing, software 17207 * distributed under the License is distributed on an "AS IS" BASIS, 17208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17209 * See the License for the specific language governing permissions and 17210 * limitations under the License. 17211 * ============================================================================= 17212 */const GJ=_C;function zJ(n){Cs("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:t,attrs:r}=n,{boxes:i,scores:s}=e,{maxOutputSize:a,iouThreshold:o,scoreThreshold:A}=r,l=t.readSync(i.dataId),c=t.readSync(s.dataId),{selectedIndices:u}=GJ(l,c,a,o,A);return t.makeTensorInfo([u.length],"int32",new Int32Array(u))}const WJ={kernelName:zw,backendName:"webgl",kernelFunc:zJ};/** 17213 * @license 17214 * Copyright 2020 Google LLC. All Rights Reserved. 17215 * Licensed under the Apache License, Version 2.0 (the "License"); 17216 * you may not use this file except in compliance with the License. 17217 * You may obtain a copy of the License at 17218 * 17219 * http://www.apache.org/licenses/LICENSE-2.0 17220 * 17221 * Unless required by applicable law or agreed to in writing, software 17222 * distributed under the License is distributed on an "AS IS" BASIS, 17223 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17224 * See the License for the specific language governing permissions and 17225 * limitations under the License. 17226 * ============================================================================= 17227 */const KJ=BC;function XJ(n){Cs("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:t,attrs:r}=n,{boxes:i,scores:s}=e,{maxOutputSize:a,iouThreshold:o,scoreThreshold:A,padToMaxOutputSize:l}=r,c=t.readSync(i.dataId),u=t.readSync(s.dataId),{selectedIndices:h,validOutputs:f}=KJ(c,u,a,o,A,l);return[t.makeTensorInfo([h.length],"int32",new Int32Array(h)),t.makeTensorInfo([],"int32",new Int32Array([f]))]}const jJ={kernelName:Ww,backendName:"webgl",kernelFunc:XJ};/** 17228 * @license 17229 * Copyright 2020 Google LLC. All Rights Reserved. 17230 * Licensed under the Apache License, Version 2.0 (the "License"); 17231 * you may not use this file except in compliance with the License. 17232 * You may obtain a copy of the License at 17233 * 17234 * http://www.apache.org/licenses/LICENSE-2.0 17235 * 17236 * Unless required by applicable law or agreed to in writing, software 17237 * distributed under the License is distributed on an "AS IS" BASIS, 17238 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17239 * See the License for the specific language governing permissions and 17240 * limitations under the License. 17241 * ============================================================================= 17242 */const YJ=EC;function qJ(n){Cs("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:t,attrs:r}=n,{boxes:i,scores:s}=e,{maxOutputSize:a,iouThreshold:o,scoreThreshold:A,softNmsSigma:l}=r,c=t.readSync(i.dataId),u=t.readSync(s.dataId),h=a,f=o,d=A,g=l,{selectedIndices:m,selectedScores:p}=YJ(c,u,h,f,d,g);return[t.makeTensorInfo([m.length],"int32",new Int32Array(m)),t.makeTensorInfo([p.length],"float32",new Float32Array(p))]}const JJ={kernelName:Kw,backendName:"webgl",kernelFunc:qJ};/** 17243 * @license 17244 * Copyright 2017 Google LLC. All Rights Reserved. 17245 * Licensed under the Apache License, Version 2.0 (the "License"); 17246 * you may not use this file except in compliance with the License. 17247 * You may obtain a copy of the License at 17248 * 17249 * http://www.apache.org/licenses/LICENSE-2.0 17250 * 17251 * Unless required by applicable law or agreed to in writing, softw
17251are 17252 * distributed under the License is distributed on an "AS IS" BASIS, 17253 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17254 * See the License for the specific language governing permissions and 17255 * limitations under the License. 17256 * ============================================================================= 17257 */class ZJ{constructor(e,t,r,i){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` 17258 void main() { 17259 ivec2 coords = getOutputCoords(); 17260 int index = round(getIndices(coords.x)); 17261 setOutput(mix(float(${i}), float(${r}), 17262 float(index == coords.y))); 17263 } 17264 `}}/** 17265 * @license 17266 * Copyright 2020 Google LLC. All Rights Reserved. 17267 * Licensed under the Apache License, Version 2.0 (the "License"); 17268 * you may not use this file except in compliance with the License. 17269 * You may obtain a copy of the License at 17270 * 17271 * http://www.apache.org/licenses/LICENSE-2.0 17272 * 17273 * Unless required by applicable law or agreed to in writing, software 17274 * distributed under the License is distributed on an "AS IS" BASIS, 17275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17276 * See the License for the specific language governing permissions and 17277 * limitations under the License. 17278 * ============================================================================= 17279 */const eZ=n=>{const{inputs:e,backend:t,attrs:r}=n,{indices:i}=e,{dtype:s,depth:a,onValue:o,offValue:A}=r,l=ze(i.shape),c=new ZJ(l,a,o,A),u=et({inputs:{x:i},backend:t,attrs:{shape:[l]}}),h=t.runWebGLProgram(c,[u],s);t.disposeIntermediateTensorInfo(u);const f=[...i.shape,a],d=et({inputs:{x:h},backend:t,attrs:{shape:f}});return t.disposeIntermediateTensorInfo(h),d},tZ={kernelName:jw,backendName:"webgl",kernelFunc:eZ};/** 17280 * @license 17281 * Copyright 2020 Google LLC. All Rights Reserved. 17282 * Licensed under the Apache License, Version 2.0 (the "License"); 17283 * you may not use this file except in compliance with the License. 17284 * You may obtain a copy of the License at 17285 * 17286 * http://www.apache.org/licenses/LICENSE-2.0 17287 * 17288 * Unless required by applicable law or agreed to in writing, software 17289 * distributed under the License is distributed on an "AS IS" BASIS, 17290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17291 * See the License for the specific language governing permissions and 17292 * limitations under the License. 17293 * ============================================================================= 17294 */function Sf(n){const{inputs:e,backend:t}=n,{x:r}=e;if(r.dtype==="complex64"){const i=Cu({inputs:{input:r},backend:t}),s=Sf({inputs:{x:i},backend:t}),a=Ad({inputs:{input:r},backend:t}),o=Sf({inputs:{x:a},backend:t}),A=To({inputs:{real:s,imag:o},backend:t});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(s),t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(o),A}else return _u({attrs:{shape:r.shape,dtype:r.dtype,value:r.dtype==="string"?"":0},backend:t})}const nZ={kernelName:Yx,backendName:"webgl",kernelFunc:Sf};/** 17295 * @license 17296 * Copyright 2020 Google LLC. All Rights Reserved. 17297 * Licensed under the Apache License, Version 2.0 (the "License"); 17298 * you may not use this file except in compliance with the License. 17299 * You may obtain a copy of the License at 17300 * 17301 * http://www.apache.org/licenses/LICENSE-2.0 17302 * 17303 * Unless required by applicable law or agreed to in writing, software 17304 * distributed under the License is distributed on an "AS IS" BASIS, 17305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17306 * See the License for the specific language governing permissions and 17307 * limitations under the License. 17308 * ============================================================================= 17309 */function MB(n){const{inputs:e,backend:t}=n,{x:r}=e;if(r.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(r.dtype==="complex64"){const i=Cu({inputs:{input:r},backend:t}),s=MB({inputs:{x:i},backend:t}),a=Ad({inputs:{input:r},backend:t}),o=Sf({inputs:{x:a},backend:t}),A=To({inputs:{real:s,imag:o},backend:t});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(s),t.disposeIntermediateTensorInfo(a),t.dis
vendor: 5,190 bytes, lines 17309-17406
17309poseIntermediateTensorInfo(o),A}else return _u({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:t})}const rZ={kernelName:Xw,backendName:"webgl",kernelFunc:MB};/** 17310 * @license 17311 * Copyright 2020 Google LLC. All Rights Reserved. 17312 * Licensed under the Apache License, Version 2.0 (the "License"); 17313 * you may not use this file except in compliance with the License. 17314 * You may obtain a copy of the License at 17315 * 17316 * http://www.apache.org/licenses/LICENSE-2.0 17317 * 17318 * Unless required by applicable law or agreed to in writing, software 17319 * distributed under the License is distributed on an "AS IS" BASIS, 17320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17321 * See the License for the specific language governing permissions and 17322 * limitations under the License. 17323 * ============================================================================= 17324 */function iZ(n){const{inputs:e,backend:t,attrs:r}=n,{axis:i}=r;if(e.length===1)return F1({inputs:{input:e[0]},backend:t,attrs:{dim:i}});const s=e[0].shape,a=e[0].dtype;e.forEach(c=>{Pi(s,c.shape,"All tensors passed to stack must have matching shapes"),H(a===c.dtype,()=>"All tensors passed to stack must have matching dtypes")});const o=[],A=e.map(c=>{const u=F1({inputs:{input:c},backend:t,attrs:{dim:i}});return o.push(u),u}),l=yB({inputs:A,backend:t,attrs:{axis:i}});return o.forEach(c=>t.disposeIntermediateTensorInfo(c)),l}const sZ={kernelName:Yw,backendName:"webgl",kernelFunc:iZ};/** 17325 * @license 17326 * Copyright 2017 Google LLC. All Rights Reserved. 17327 * Licensed under the Apache License, Version 2.0 (the "License"); 17328 * you may not use this file except in compliance with the License. 17329 * You may obtain a copy of the License at 17330 * 17331 * http://www.apache.org/licenses/LICENSE-2.0 17332 * 17333 * Unless required by applicable law or agreed to in writing, software 17334 * distributed under the License is distributed on an "AS IS" BASIS, 17335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17336 * See the License for the specific language governing permissions and 17337 * limitations under the License. 17338 * ============================================================================= 17339 */class aZ{constructor(e,t,r){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((l,c)=>l[0]+e[c]+l[1]);const i=e.length,s=Mn(i),a=t.map(l=>l[0]).join(","),o=t.map((l,c)=>l[0]+e[c]).join(","),A=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i);if(i===1){this.userCode=` 17340 int start = ${a}; 17341 int end = ${o}; 17342 17343 void main() { 17344 int outC = getOutputCoords(); 17345 if (outC < start || outC >= end) { 17346 setOutput(value); 17347 } else { 17348 setOutput(getX(outC - start)); 17349 } 17350 } 17351 `;return}this.userCode=` 17352 ${s} start = ${s}(${a}); 17353 ${s} end = ${s}(${o}); 17354 17355 void main() { 17356 ${s} outC = getOutputCoords(); 17357 if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { 17358 setOutput(value); 17359 } else { 17360 ${s} coords = outC - start; 17361 setOutput(getX(${A})); 17362 } 17363 } 17364 `}}/** 17365 * @license 17366 * Copyright 2019 Google LLC. All Rights Reserved. 17367 * Licensed under the Apache License, Version 2.0 (the "License"); 17368 * you may not use this file except in compliance with the License. 17369 * You may obtain a copy of the License at 17370 * 17371 * http://www.apache.org/licenses/LICENSE-2.0 17372 * 17373 * Unless required by applicable law or agreed to in writing, software 17374 * distributed under the License is distributed on an "AS IS" BASIS, 17375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17376 * See the License for the specific language governing permissions and 17377 * limitations under the License. 17378 * ============================================================================= 17379 */class oZ{constructor(e,t,r){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((g,m)=>g[0]+e[m]+g[1]);const i=e.length,s=Mn(i),a=t.map(g=>g[0]).join(","),o=t.map((g,m)=>g[0]+e[m]).join(","),A=qr("rc",i),l=qr("source",i),c=`${A[i-1]} < ${this.outputShape[i-1]}`,u=i===1?"source":`vec2(${l.slice(-2).join()})`,h=[`${s} rc = outputLoc;`,`${A[i-1]} += 1; 17380 if(${c}) { 17381 `,i===1?"":`} 17382 rc = outputLoc; 17383 ${A[i-2]} += 1; 17384 if(${A[i-2]} < ${this.outputShape[i-2]}) {`,i===1?"":` ${A[i-1]} += 1; 17385 if(${c}) {`],f=i===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let d="";for(let g=0,m=i===1?2:4;g<m;g++)d+=` 17386 ${h[g]} 17387 if (${f}) { 17388 result[${g}] = float(value); 17389 } else { 17390 ${s} source = rc - start; 17391 result[${g}] = getChannel(getX(${l.join()}), ${u}); 17392 } 17393 `;d+=i===1?"} ":"}}",this.userCode=` 17394 const ${s} start = ${s}(${a}); 17395 const ${s} end = ${s}(${o}); 17396 17397 void main() { 17398 ${s} outputLoc = getOutputCoords(); 17399 vec4 result = vec4(0.); 17400 ${d} 17401 setOutput(result); 17402 } 17403 `}}/** 17404 * @license 17405 * Copyright 2020 Google LLC. All Rights Reserved. 17406 * Licensed under the Apache License, Version 2.0 (the "License");
17407 * you may not use this file except in compliance with the License. 17408 * You may obtain a copy of the License at 17409 * 17410 * http://www.apache.org/licenses/LICENSE-2.0 17411 * 17412 * Unless required by applicable law or agreed to in writing, software 17413 * distributed under the License is distributed on an "AS IS" BASIS, 17414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17415 * See the License for the specific language governing permissions and 17416 * limitations under the License. 17417 * ============================================================================= 17418 */const NB=n=>{const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{paddings:s,constantValue:a}=r;if(ze(i.shape)===0){const l=s.map((c,u)=>c[0]+i.shape[u]+c[1]);return _u({backend:t,attrs:{shape:l,value:a,dtype:i.dtype}})}const o=pe().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new oZ(i.shape,s,a):new aZ(i.shape,s,a),A=[[a]];return t.runWebGLProgram(o,[i],i.dtype,A)},AZ={kernelName:qw,backendName:"webgl",kernelFunc:NB};/** 17419 * @license 17420 * Copyright 2020 Google LLC. All Rights Reserved. 17421 * Licensed under the Apache License, Version 2.0 (the "License"); 17422 * you may not use this file except in compliance with the License. 17423 * You may obtain a copy of the License at 17424 * 17425 * http://www.apache.org/licenses/LICENSE-2.0 17426 * 17427 * Unless required by applicable law or agreed to in writing, software 17428 * distributed under the License is distributed on an "AS IS" BASIS, 17429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17430 * See the License for the specific language governing permissions and 17431 * limitations under the License. 17432 * ============================================================================= 17433 */const lZ=` 17434 if(a < 0.0 && floor(b) < b){ 17435 return NAN; 17436 } 17437 if (b == 0.0) { 17438 return 1.0; 17439 } 17440 return (round(mod(b, 2.0)) != 1) ?
17441 pow(abs(a), b) : sign(a) * pow(abs(a), b); 17442`,cZ=` 17443 // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. 17444 vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); 17445 vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); 17446 vec4 result = multiplier * pow(abs(a), b); 17447 17448 // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS 17449 bvec4 isExpZero = equal(b, vec4(0.0)); 17450 result.r = isExpZero.r ? 1.0 : result.r; 17451 result.g = isExpZero.g ? 1.0 : result.g; 17452 result.b = isExpZero.b ? 1.0 : result.b; 17453 result.a = isExpZero.a ? 1.0 : result.a; 17454 17455 bvec4 isNaN1 = lessThan(a, vec4(0.0)); 17456 bvec4 isNaN2 = lessThan(floor(b), b); 17457 bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w); 17458 `+IA+` 17459 return result; 17460`,uZ=Lr({opSnippet:lZ,packedOpSnippet:cZ}),hZ={kernelName:Jw,backendName:"webgl",kernelFunc:uZ};/** 17461 * @license 17462 * Copyright 2020 Google LLC. All Rights Reserved. 17463 * Licensed under the Apache License, Version 2.0 (the "License"); 17464 * you may not use this file except in compliance with the License. 17465 * You may obtain a copy of the License at 17466 * 17467 * http://www.apache.org/licenses/LICENSE-2.0 17468 * 17469 * Unless required by applicable law or agreed to in writing, software 17470 * distributed under the License is distributed on an "AS IS" BASIS, 17471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17472 * See the License for the specific language governing permissions and 17473 * limitations under the License. 17474 * ============================================================================= 17475 */function fZ(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{axis:s,keepDims:a}=r,o=i.shape.length,A=[],l=Br(s,i.shape);let c=l;const u=As(c,o);let h=i;u!=null&&(h=Jr({inputs:{x:i},backend:t,attrs:{perm:u}}),c=ls(c.length,o),A.push(h)),Ms("prod",c,o);let f;if(t.shouldExecuteOnCPU([h])){const d=t.texData.get(h.dataId).values,{outVals:g,outShape:m,outDtype:p}=uW(h.shape,h.dtype,d,c);f=t.makeTensorInfo(m,p,g)}else{const[d,g]=Zs(h.shape,c),m=ze(g),p=et({inputs:{x:h},backend:t,attrs:{shape:[-1,m]}}),w=Ig(i.dtype),C=FA(p,w,"prod",t);f=et({inputs:{x:C},backend:t,attrs:{shape:d}}),A.push(p),A.push(C)}if(a){A.push(f);const d=Qi(f.shape,l);f=et({inputs:{x:f},backend:t,attrs:{shape:d}})}return A.forEach(d=>t.disposeIntermediateTensorInfo(d)),f}const dZ={kernelName:ex,backendName:"webgl",kernelFunc:fZ};/** 17476 * @license 17477 * Copyright 2022 Google LLC. All Rights Reserved. 17478 * Licensed under the Apache License, Version 2.0 (the "License"); 17479 * you may not use this file except in compliance with the License. 17480 * You may obtain a copy of the License at 17481 * 17482 * http://www.apache.org/licenses/LICENSE-2.0 17483 * 17484 * Unless required by applicable law or agreed to in writing, software 17485 * distributed under the License is distributed on an "AS IS" BASIS, 17486 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17487 * See the License for the specific language governing permissions and 17488 * limitations under the License. 17489 * ============================================================================= 17490 */function pZ(n){const{inputs:e,backend:t,attrs:r}=n,{paramsNestedSplits:i,paramsDenseValues:s,indices:a}=e,{outputRaggedRank:o}=r,A=i.map(p=>t.readSync(p.dataId)),l=i.map(p=>p.shape),c=t.readSync(s.dataId),u=t.readSync(a.dataId),[h,f,d]=hW(A,l,c,s.shape,s.dtype,u,a.shape,o),g=h.map(p=>t.makeTensorInfo([p.length],"int32",p)),m=t.makeTensorInfo(d,s.dtype,f);return g.concat([m])}const mZ={kernelName:tx,backendName:"webgl",kernelFunc:pZ};/** 17491 * @license 17492 * Copyright 2022 Google LLC. 17493 * Licensed under the Apache License, Version 2.0 (the "License"); 17494 * you may not use this file except in compliance with the License. 17495 * You may obtain a copy of the License at 17496 * 17497 * http://www.apache.org/licenses/LICENSE-2.0 17498 * 17499 * Unless required by applicable law or agreed to in writing, software 17500 * distributed under the License is distributed on an "AS IS" BASIS, 17501 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17502 * See the License for the specific language governing permissions and 17503 * limitations under the License. 17504 * ============================================================================= 17505 */function gZ(n){const{inputs:e,backend:t}=n,{starts:r,limits:i,deltas:s}=e,a=t.readSync(r.dataId),o=t.readSync(i.dataId),A=t.readSync(s.dataId),[l,c]=fW(a,r.shape,r.dtype,o,i.shape,A,s.shape),u=t.makeTensorInfo([l.length],"int32",l),h=t.makeTensorInfo([c.length],r.dtype,c);return[u,h]}const yZ={kernelName:nx,backendName:"webgl",kernelFunc:gZ};/** 17506 * @license 17507 * Copyright 2022 Google LLC. All Rights Reserved. 17508 * Licensed under the Apache License, Version 2.0 (the "License");
17509 * you may not use this file except in compliance with the License. 17510 * You may obtain a copy of the License at 17511 * 17512 * http://www.apache.org/licenses/LICENSE-2.0 17513 * 17514 * Unless required by applicable law or agreed to in writing, software 17515 * distributed under the License is distributed on an "AS IS" BASIS, 17516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17517 * See the License for the specific language governing permissions and 17518 * limitations under the License. 17519 * ============================================================================= 17520 */function vZ(n){const{inputs:e,backend:t,attrs:r}=n,{shape:i,values:s,defaultValue:a,rowPartitionTensors:o}=e,{rowPartitionTypes:A}=r,l=t.readSync(i.dataId),c=t.readSync(s.dataId),u=t.readSync(a.dataId),h=o.map(m=>t.readSync(m.dataId)),f=o.map(m=>m.shape),[d,g]=dW(l,i.shape,c,s.shape,s.dtype,u,a.shape,h,f,A);return t.makeTensorInfo(d,s.dtype,g)}const wZ={kernelName:rx,backendName:"webgl",kernelFunc:vZ};/** 17521 * @license 17522 * Copyright 2020 Google LLC. All Rights Reserved. 17523 * Licensed under the Apache License, Version 2.0 (the "License"); 17524 * you may not use this file except in compliance with the License. 17525 * You may obtain a copy of the License at 17526 * 17527 * http://www.apache.org/licenses/LICENSE-2.0 17528 * 17529 * Unless required by applicable law or agreed to in writing, software 17530 * distributed under the License is distributed on an "AS IS" BASIS, 17531 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17532 * See the License for the specific language governing permissions and 17533 * limitations under the License. 17534 * ============================================================================= 17535 */const DB=n=>{const{backend:e,attrs:t}=n,{start:r,stop:i,step:s,dtype:a}=t,o=pW(r,i,s,a);return e.makeTensorInfo([o.length],a,o)},xZ={kernelName:ix,backendName:"webgl",kernelFunc:DB};/** 17536 * @license 17537 * Copyright 2020 Google LLC. All Rights Reserved. 17538 * Licensed under the Apache License, Version 2.0 (the "License"); 17539 * you may not use this file except in compliance with the License. 17540 * You may obtain a copy of the License at 17541 * 17542 * http://www.apache.org/licenses/LICENSE-2.0 17543 * 17544 * Unless required by applicable law or agreed to in writing, software 17545 * distributed under the License is distributed on an "AS IS" BASIS, 17546 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17547 * See the License for the specific language governing permissions and 17548 * limitations under the License. 17549 * ============================================================================= 17550 */const bZ="return 1.0 / x;",CZ=vn({opSnippet:bZ}),_Z={kernelName:ax,backendName:"webgl",kernelFunc:CZ};/** 17551 * @license 17552 * Copyright 2020 Google LLC. All Rights Reserved. 17553 * Licensed under the Apache License, Version 2.0 (the "License"); 17554 * you may not use this file except in compliance with the License. 17555 * You may obtain a copy of the License at 17556 * 17557 * http://www.apache.org/licenses/LICENSE-2.0 17558 * 17559 * Unless required by applicable law or agreed to in writing, software 17560 * distributed under the License is distributed on an "AS IS" BASIS, 17561 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17562 * See the License for the specific language governing permissions and 17563 * limitations under the License. 17564 * ============================================================================= 17565 */const BZ=cs+` 17566 return (x < 0.0) ? 0.0 : x; 17567`,EZ=` 17568 vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); 17569 bvec4 isNaN = isnan(x); 17570 17571 result.r = isNaN.r ? x.r : result.r; 17572 result.g = isNaN.g ? x.g : result.g; 17573 result.b = isNaN.b ? x.b : result.b; 17574 result.a = isNaN.a ? x.a : result.a; 17575 17576 return result; 17577`,SZ=vn({opSnippet:BZ,packedOpSnippet:EZ}),TZ={kernelName:ox,backendName:"webgl",kernelFunc:SZ};/** 17578 * @license 17579 * Copyright 2020 Google LLC. All Rights Reserved. 17580 * Licensed under the Apache License, Version 2.0 (the "License"); 17581 * you may not use this file except in compliance with the License. 17582 * You may obtain a copy of the License at 17583 * 17584 * http://www.apache.org/licenses/LICENSE-2.0 17585 * 17586 * Unless required by applicable law or agreed to in writing, softw
17586are 17587 * distributed under the License is distributed on an "AS IS" BASIS, 17588 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17589 * See the License for the specific language governing permissions and 17590 * limitations under the License. 17591 * ============================================================================= 17592 */const IZ=cs+` 17593 return (x < 0.0) ? 0.0 : min(6.0, x); 17594`,FZ=` 17595 vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); 17596 bvec4 isNaN = isnan(x); 17597 17598 result.r = isNaN.r ? x.r : result.r; 17599 result.g = isNaN.g ? x.g : result.g; 17600 result.b = isNaN.b ? x.b : result.b; 17601 result.a = isNaN.a ? x.a : result.a; 17602 17603 return result; 17604`,RZ=vn({opSnippet:IZ,packedOpSnippet:FZ}),UZ={kernelName:ux,backendName:"webgl",kernelFunc:RZ};/** 17605 * @license 17606 * Copyright 2017 Google LLC. All Rights Reserved. 17607 * Licensed under the Apache License, Version 2.0 (the "License"); 17608 * you may not use this file except in compliance with the License. 17609 * You may obtain a copy of the License at 17610 * 17611 * http://www.apache.org/licenses/LICENSE-2.0 17612 * 17613 * Unless required by applicable law or agreed to in writing, software 17614 * distributed under the License is distributed on an "AS IS" BASIS, 17615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17616 * See the License for the specific language governing permissions and 17617 * limitations under the License. 17618 * ============================================================================= 17619 */class MZ{constructor(e,t,r,i,s){this.variableNames=["A"],this.outputShape=[];const[a,o,A,l]=e;this.outputShape=[a,t,r,l];const c=[i&&t>1?o-1:o,i&&r>1?A-1:A],u=[i&&t>1?t-1:t,i&&r>1?r-1:r];let h;s?h="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":h="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` 17620 const vec2 effectiveInputOverOutputRatioRC = vec2( 17621 ${c[0]/u[0]}, 17622 ${c[1]/u[1]}); 17623 const vec2 inputShapeRC = vec2(${o}.0, ${A}.0); 17624 17625 void main() { 17626 ivec4 coords = getOutputCoords(); 17627 int b = coords[0]; 17628 int d = coords[3]; 17629 ivec2 yRC = coords.yz; 17630 17631 // Fractional source index. 17632 vec2 sourceFracIndexRC = ${h}; 17633 17634 // Compute the four integer indices. 17635 ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0))); 17636 ivec2 sourceCeilRC = ivec2( 17637 min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); 17638 17639 float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d); 17640 float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d); 17641 float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d); 17642 float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d); 17643 17644 vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC); 17645 17646 float top = topLeft + (topRight - topLeft) * fracRC.y; 17647 float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y; 17648 float newValue = top + (bottom - top) * fracRC.x; 17649 17650 setOutput(newValue); 17651 } 17652 `}}/** 17653 * @license 17654 * Copyright 2019 Google LLC. All Rights Reserved. 17655 * Licensed under the Apache License, Version 2.0 (the "License"); 17656 * you may not use this file except in compliance with the License. 17657 * You may obtain a copy of the License at 17658 * 17659 * http://www.apache.org/licenses/LICENSE-2.0 17660 * 17661 * Unless required by applicable law or agreed to in writing, software 17662 * distributed under the License is distributed on an "AS IS" BASIS, 17663 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17664 * See the License for the specific language governing permissions and 17665 * limitations under the License. 17666 * ============================================================================= 17667 */class NZ{constructor(e,t,r,i,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[a,o,A,l]=e;this.outputShape=[a,t,r,l];const c=[i&&t>1?o-1:o,i&&r>1?A-1:A],u=[i&&t>1?t-1:t,i&&r>1?r-1:r];let h;s?h="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":h="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` 17668 const vec3 effectiveInputOverOutputRatioRC = vec3( 17669 ${c[0]/u[0]}, 17670 ${c[1]/u[1]}, 17671 ${c[1]/u[1]}); 17672 const vec3 inputShapeRC = vec3(${o}.0, ${A}.0, 17673 ${A}.0); 17674 17675 float getAValue(int b, int r, int c, int d) { 17676 return getChannel(getA(b, r, c, d), vec2(c, d)); 17677 } 17678 17679 void main() { 17680 ivec4 coords = getOutputCoords(); 17681 int b = coords[0]; 17682 int d = coords[3]; 17683 // Calculate values for next column in yRC.z. 17684 ivec3 yRC = coords.yzz + ivec3(0, 0, 1); 17685 17686 // Fractional source index. 17687 vec3 sourceFracIndexRC = ${h}; 17688 17689 // Compute the four integer indices. 17690 ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0))); 17691 ivec3 sourceCeilRC = ivec3( 17692 min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); 17693 17694 // Should we calculate next column and row elements in 2x2 packed cell. 17695 bool hasNextCol = d < ${l-1}; 17696 bool hasNextRow = coords.z < ${r-1}
vendor: 2,018 bytes, lines 17696-17744
17696; 17697 17698 // In parallel, construct four corners for all four components in 17699 // packed 2x2 cell. 17700 vec4 topLeft = vec4( 17701 getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d), 17702 hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1) 17703 : 0.0, 17704 hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d) 17705 : 0.0, 17706 (hasNextRow && hasNextCol) ? 17707 getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0); 17708 17709 vec4 bottomLeft = vec4( 17710 getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d), 17711 hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1) 17712 : 0.0, 17713 hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d) 17714 : 0.0, 17715 (hasNextRow && hasNextCol) ? 17716 getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0); 17717 17718 vec4 topRight = vec4( 17719 getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d), 17720 hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1) 17721 : 0.0, 17722 hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d) 17723 : 0.0, 17724 (hasNextRow && hasNextCol) ? 17725 getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0); 17726 17727 vec4 bottomRight = vec4( 17728 getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d), 17729 hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1) 17730 : 0.0, 17731 hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d) 17732 : 0.0, 17733 (hasNextRow && hasNextCol) ? 17734 getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0); 17735 17736 vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC); 17737 17738 vec4 top = mix(topLeft, topRight, fracRC.yyzz); 17739 vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz); 17740 vec4 newValue = mix(top, bottom, fracRC.x); 17741 17742 setOutput(newValue); 17743 } 17744 `}
vendor: 4,807 bytes, lines 17744-17858
17744}/** 17745 * @license 17746 * Copyright 2020 Google LLC. All Rights Reserved. 17747 * Licensed under the Apache License, Version 2.0 (the "License"); 17748 * you may not use this file except in compliance with the License. 17749 * You may obtain a copy of the License at 17750 * 17751 * http://www.apache.org/licenses/LICENSE-2.0 17752 * 17753 * Unless required by applicable law or agreed to in writing, software 17754 * distributed under the License is distributed on an "AS IS" BASIS, 17755 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17756 * See the License for the specific language governing permissions and 17757 * limitations under the License. 17758 * ============================================================================= 17759 */function DZ(n){const{inputs:e,backend:t,attrs:r}=n,{images:i}=e,{alignCorners:s,halfPixelCenters:a,size:o}=r,[A,l]=o,c=pe().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new NZ(i.shape,A,l,s,a):new MZ(i.shape,A,l,s,a);return t.runWebGLProgram(c,[i],"float32")}const LZ={kernelName:cx,backendName:"webgl",kernelFunc:DZ};/** 17760 * @license 17761 * Copyright 2018 Google LLC. All Rights Reserved. 17762 * Licensed under the Apache License, Version 2.0 (the "License"); 17763 * you may not use this file except in compliance with the License. 17764 * You may obtain a copy of the License at 17765 * 17766 * http://www.apache.org/licenses/LICENSE-2.0 17767 * 17768 * Unless required by applicable law or agreed to in writing, software 17769 * distributed under the License is distributed on an "AS IS" BASIS, 17770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17771 * See the License for the specific language governing permissions and 17772 * limitations under the License. 17773 * ============================================================================= 17774 */class OZ{constructor(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,s]=t,[,a,o]=e,A=[r&&a>1?i-1:i,r&&o>1?s-1:s],l=[r&&a>1?a-1:a,r&&o>1?o-1:o],c=A[0]/l[0],u=A[1]/l[1],h=1/c,f=1/u,d=Math.ceil(h)*2+2,g=Math.ceil(f)*2+2;this.userCode=` 17775 void main() { 17776 ivec4 coords = getOutputCoords(); 17777 int b = coords[0]; 17778 int d = coords[3]; 17779 int r = coords[1]; 17780 int c = coords[2]; 17781 17782 float accumulator = 0.0; 17783 17784 const float heightScale = float(${c}); 17785 const float widthScale = float(${u}); 17786 17787 const float invHeightScale = float(${h}); 17788 const float invWidthScale = float(${f}); 17789 17790 const int winHeight = int(${d}); 17791 const int winWidth = int(${g}); 17792 17793 // Compute bounds for where in dy we will look 17794 float startRLerp = floor(float(r) * invHeightScale); 17795 int startDyR = int(startRLerp - float(winHeight / 2)); 17796 17797 float startCLerp = floor(float(c) * invWidthScale); 17798 int startDyC = int(startCLerp - float(winWidth / 2)); 17799 17800 // Loop over dy 17801 for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { 17802 int dyR = dyROffset + startDyR; 17803 17804 // Guard against the window exceeding the bounds of dy 17805 if (dyR < 0 || dyR >= ${a}) { 17806 continue; 17807 } 17808 17809 for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { 17810 int dyC = dyCOffset + startDyC; 17811 17812 // Guard against the window exceeding the bounds of dy 17813 if (dyC < 0 || dyC >= ${o}) { 17814 continue; 17815 } 17816 17817 float dxR = float(dyR) * heightScale; 17818 int topDxRIndex = int(floor(dxR)); 17819 int bottomDxRIndex = int(min(ceil(dxR), ${i-1}.0)); 17820 float dxRLerp = dxR - float(topDxRIndex); 17821 float inverseDxRLerp = 1.0 - dxRLerp; 17822 17823 float dxC = float(dyC) * widthScale; 17824 int leftDxCIndex = int(floor(dxC)); 17825 int rightDxCIndex = int(min(ceil(dxC), ${s-1}.0)); 17826 float dxCLerp = dxC - float(leftDxCIndex); 17827 float inverseDxCLerp = 1.0 - dxCLerp; 17828 17829 if (r == topDxRIndex && c == leftDxCIndex) { 17830 // topLeft 17831 accumulator += 17832 getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp; 17833 } 17834 17835 if (r == topDxRIndex && c == rightDxCIndex) { 17836 // topRight 17837 accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp; 17838 } 17839 17840 if (r == bottomDxRIndex && c == leftDxCIndex) { 17841 // bottomLeft 17842 accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp; 17843 } 17844 17845 if (r == bottomDxRIndex && c == rightDxCIndex) { 17846 // bottomRight 17847 accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp; 17848 } 17849 } 17850 } 17851 // End loop over dy 17852 17853 setOutput(accumulator); 17854 } 17855 `}}/** 17856 * @license 17857 * Copyright 2020 Google LLC. All Rights Reserved. 17858 * Licensed under the Apache License, Version 2.0 (the "License");
17859 * you may not use this file except in compliance with the License. 17860 * You may obtain a copy of the License at 17861 * 17862 * http://www.apache.org/licenses/LICENSE-2.0 17863 * 17864 * Unless required by applicable law or agreed to in writing, software 17865 * distributed under the License is distributed on an "AS IS" BASIS, 17866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17867 * See the License for the specific language governing permissions and 17868 * limitations under the License. 17869 * ============================================================================= 17870 */function PZ(n){const{inputs:e,backend:t,attrs:r}=n,{images:i,dy:s}=e,{alignCorners:a}=r,o=new OZ(s.shape,i.shape,a);return t.runWebGLProgram(o,[s],s.dtype)}const kZ={kernelName:DM,backendName:"webgl",kernelFunc:PZ};/** 17871 * @license 17872 * Copyright 2018 Google LLC. All Rights Reserved. 17873 * Licensed under the Apache License, Version 2.0 (the "License"); 17874 * you may not use this file except in compliance with the License. 17875 * You may obtain a copy of the License at 17876 * 17877 * http://www.apache.org/licenses/LICENSE-2.0 17878 * 17879 * Unless required by applicable law or agreed to in writing, software 17880 * distributed under the License is distributed on an "AS IS" BASIS, 17881 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17882 * See the License for the specific language governing permissions and 17883 * limitations under the License. 17884 * ============================================================================= 17885 */class $Z{constructor(e,t,r,i,s){this.variableNames=["A"],this.outputShape=[];const[a,o,A,l]=e;this.outputShape=[a,t,r,l];const c=[i&&t>1?o-1:o,i&&r>1?A-1:A],u=[i&&t>1?t-1:t,i&&r>1?r-1:r],h=i?"0.5":"0.0";let f;s?f="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":f="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` 17886 const vec2 effectiveInputOverOutputRatioRC = vec2( 17887 ${c[0]/u[0]}, 17888 ${c[1]/u[1]}); 17889 const vec2 inputShapeRC = vec2(${o}.0, ${A}.0); 17890 17891 void main() { 17892 ivec4 coords = getOutputCoords(); 17893 int b = coords[0]; 17894 int d = coords[3]; 17895 ivec2 yRC = coords.yz; 17896 17897 // Fractional source index. 17898 vec2 sourceFracIndexRC = ${f}; 17899 17900 // Compute the coordinators of nearest neighbor point. 17901 ivec2 sourceNearestRC = ivec2( 17902 min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h}))); 17903 float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); 17904 17905 setOutput(newValue); 17906 } 17907 `}}/** 17908 * @license 17909 * Copyright 2019 Google LLC. All Rights Reserved. 17910 * Licensed under the Apache License, Version 2.0 (the "License"); 17911 * you may not use this file except in compliance with the License. 17912 * You may obtain a copy of the License at 17913 * 17914 * http://www.apache.org/licenses/LICENSE-2.0 17915 * 17916 * Unless required by applicable law or agreed to in writing, software 17917 * distributed under the License is distributed on an "AS IS" BASIS, 17918 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17919 * See the License for the specific language governing permissions and 17920 * limitations under the License. 17921 * ============================================================================= 17922 */class QZ{constructor(e,t,r,i,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[a,o,A,l]=e;this.outputShape=[a,t,r,l];const c=[i&&t>1?o-1:o,i&&r>1?A-1:A],u=[i&&t>1?t-1:t,i&&r>1?r-1:r],h=i?"0.5":"0.0";let f;s?f="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":f="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` 17923 const vec3 effectiveInputOverOutputRatioRC = vec3( 17924 ${c[0]/u[0]}, 17925 ${c[1]/u[1]}, 17926 ${c[1]/u[1]}); 17927 const vec3 inputShapeRC = vec3(${o}.0, ${A}.0, 17928 ${A}.0); 17929 17930 float getAValue(int b, int r, int c, int d) { 17931 return getChannel(getA(b, r, c, d), vec2(c, d)); 17932 } 17933 17934 void main() { 17935 ivec4 coords = getOutputCoords(); 17936 int b = coords[0]; 17937 int d = coords[3]; 17938 // Calculate values for next column in yRC.z. 17939 ivec3 yRC = coords.yzz + ivec3(0, 0, 1); 17940 17941 // Fractional source index. 17942 vec3 sourceFracIndexRC = ${f}; 17943 17944 // Compute the coordinators of nearest neighbor point. 17945 ivec3 sourceNearestRC = ivec3( 17946 min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h}))); 17947 17948 // Should we calculate next column and row elements in 2x2 packed cell. 17949 bool hasNextCol = d < ${l-1}; 17950 bool hasNextRow = coords.z < ${r-1}; 17951 17952 vec4 newValue = vec4(
17953 getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d), 17954 hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1) 17955 : 0.0, 17956 hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d) 17957 : 0.0, 17958 (hasNextRow && hasNextCol) ? 17959 getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0); 17960 17961 setOutput(newValue); 17962 } 17963 `}}/** 17964 * @license 17965 * Copyright 2020 Google LLC. All Rights Reserved. 17966 * Licensed under the Apache License, Version 2.0 (the "License"); 17967 * you may not use this file except in compliance with the License. 17968 * You may obtain a copy of the License at 17969 * 17970 * http://www.apache.org/licenses/LICENSE-2.0 17971 * 17972 * Unless required by applicable law or agreed to in writing, software 17973 * distributed under the License is distributed on an "AS IS" BASIS, 17974 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17975 * See the License for the specific language governing permissions and 17976 * limitations under the License. 17977 * ============================================================================= 17978 */function HZ(n){const{inputs:e,backend:t,attrs:r}=n,{images:i}=e,{alignCorners:s,halfPixelCenters:a,size:o}=r,[A,l]=o,c=pe().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new QZ(i.shape,A,l,s,a):new $Z(i.shape,A,l,s,a);return t.runWebGLProgram(c,[i],i.dtype)}const VZ={kernelName:lx,backendName:"webgl",kernelFunc:HZ};/** 17979 * @license 17980 * Copyright 2018 Google LLC. All Rights Reserved. 17981 * Licensed under the Apache License, Version 2.0 (the "License"); 17982 * you may not use this file except in compliance with the License. 17983 * You may obtain a copy of the License at 17984 * 17985 * http://www.apache.org/licenses/LICENSE-2.0 17986 * 17987 * Unless required by applicable law or agreed to in writing, software 17988 * distributed under the License is distributed on an "AS IS" BASIS, 17989 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17990 * See the License for the specific language governing permissions and 17991 * limitations under the License. 17992 * ============================================================================= 17993 */class GZ{constructor(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,s]=t,[,a,o]=e,A=[r&&a>1?i-1:i,r&&o>1?s-1:s],l=[r&&a>1?a-1:a,r&&o>1?o-1:o],c=A[0]/l[0],u=A[1]/l[1],h=1/c,f=1/u,d=Math.ceil(h)*2+2,g=Math.ceil(f)*2+2;this.userCode=` 17994 void main() { 17995 ivec4 coords = getOutputCoords(); 17996 int b = coords[0]; 17997 int d = coords[3]; 17998 int r = coords[1]; 17999 int c = coords[2]; 18000 18001 float accumulator = 0.0; 18002 18003 const float heightScale = float(${c}); 18004 const float widthScale = float(${u}); 18005 18006 const float invHeightScale = float(${h}); 18007 const float invWidthScale = float(${f}); 18008 18009 const int winHeight = int(${d}); 18010 const int winWidth = int(${g}); 18011 18012 // Compute bounds for where in dy we will look 18013 float startRLerp = floor(float(r) * invHeightScale); 18014 int startDyR = int(floor(startRLerp - float(winHeight / 2))); 18015 18016 float startCLerp = floor(float(c) * invWidthScale); 18017 int startDyC = int(floor(startCLerp - float(winWidth / 2))); 18018 18019 // Loop over dy 18020 for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { 18021 int dyR = dyROffset + startDyR; 18022 18023 // Guard against the window exceeding the bounds of dy 18024 if (dyR < 0 || dyR >= ${a}) { 18025 continue; 18026 } 18027 18028 for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { 18029 int dyC = dyCOffset + startDyC; 18030 18031 // Guard against the window exceeding the bounds of dy 18032 if (dyC < 0 || dyC >= ${o}) { 18033 continue; 18034 } 18035 18036 float sourceFracRow = 18037 float(${A[0]}) * 18038 (float(dyR) / float(${l[0]})); 18039 18040 float sourceFracCol = 18041 float(${A[1]}) * 18042 (float(dyC) / float(${l[1]})); 18043 18044 int sourceNearestRow = int(min( 18045 float(int(${i}) - 1), 18046 ${r} ? float(round(sourceFracRow)) : 18047 float(floor(sourceFracRow)))); 18048 18049 int sourceNearestCol = int(min( 18050 float(int(${s}) - 1), 18051 ${r} ? float(round(sourceFracCol)) : 18052 float(floor(sourceFracCol)))); 18053 18054 if (r == sourceNearestRow && c == sourceNearestCol) { 18055 accumulator += getDy(b, dyR, dyC, d); 18056 } 18057 } 18058 } 18059 // End loop over dy 18060 18061 setOutput(accumulator); 18062 } 18063 `}}/** 18064 * @license 18065 * Copyright 2020 Google LLC. All Rights Reserved. 18066 * Licensed under the Apache License, Version 2.0 (the "License");
18067 * you may not use this file except in compliance with the License. 18068 * You may obtain a copy of the License at 18069 * 18070 * http://www.apache.org/licenses/LICENSE-2.0 18071 * 18072 * Unless required by applicable law or agreed to in writing, software 18073 * distributed under the License is distributed on an "AS IS" BASIS, 18074 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18075 * See the License for the specific language governing permissions and 18076 * limitations under the License. 18077 * ============================================================================= 18078 */function zZ(n){const{inputs:e,backend:t,attrs:r}=n,{images:i,dy:s}=e,{alignCorners:a}=r,o=new GZ(s.shape,i.shape,a);return t.runWebGLProgram(o,[s],s.dtype)}const WZ={kernelName:NM,backendName:"webgl",kernelFunc:zZ};/** 18079 * @license 18080 * Copyright 2017 Google LLC. All Rights Reserved. 18081 * Licensed under the Apache License, Version 2.0 (the "License"); 18082 * you may not use this file except in compliance with the License. 18083 * You may obtain a copy of the License at 18084 * 18085 * http://www.apache.org/licenses/LICENSE-2.0 18086 * 18087 * Unless required by applicable law or agreed to in writing, software 18088 * distributed under the License is distributed on an "AS IS" BASIS, 18089 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18090 * See the License for the specific language governing permissions and 18091 * limitations under the License. 18092 * ============================================================================= 18093 */class KZ{constructor(e,t){this.variableNames=["x"];const r=e.length;if(r>4)throw new Error(`WebGL backend: Reverse of rank-${r} tensor is not yet supported`);if(this.outputShape=e,r===1){this.userCode=` 18094 void main() { 18095 int coord = getOutputCoords(); 18096 setOutput(getX(${e[0]} - coord - 1)); 18097 } 18098 `;return}const i=o=>t.indexOf(o)!==-1&&e[o]!==1?`${e[o]} - coords[${o}] - 1`:`coords[${o}]`,s=e.map((o,A)=>i(A)).join(","),a=Mn(r);this.userCode=` 18099 void main() { 18100 ${a} coords = getOutputCoords(); 18101 setOutput(getX(${s})); 18102 } 18103 `}}/** 18104 * @license 18105 * Copyright 2019 Google LLC. All Rights Reserved. 18106 * Licensed under the Apache License, Version 2.0 (the "License"); 18107 * you may not use this file except in compliance with the License. 18108 * You may obtain a copy of the License at 18109 * 18110 * http://www.apache.org/licenses/LICENSE-2.0 18111 * 18112 * Unless required by applicable law or agreed to in writing, software 18113 * distributed under the License is distributed on an "AS IS" BASIS, 18114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18115 * See the License for the specific language governing permissions and 18116 * limitations under the License. 18117 * ============================================================================= 18118 */class XZ{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const r=e.length;if(r>4)throw new Error(`WebGL backend: Reverse of rank-${r} tensor is not yet supported`);this.outputShape=e;const i=qr("rc",r),s=`${i[r-1]} + 1 < ${this.outputShape[r-1]}`,a=`${i[r-2]} + 1 < ${this.outputShape[r-2]}`,o=Mn(r);r===1?this.userCode=` 18119 void main(){ 18120 int rc = getOutputCoords(); 18121 vec4 result = vec4(0.); 18122 result.r = getChannel(getX(${e[0]} - rc - 1), 18123 ${e[0]} - rc - 1); 18124 if(${s}){ 18125 result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), 18126 ${e[0]} - (rc + 1) - 1); 18127 } 18128 setOutput(result); 18129 } 18130 `:this.userCode=` 18131 void main() { 18132 ${o} rc = getOutputCoords(); 18133 vec4 result = vec4(0.); 18134 result.r = ${A(i.slice())}; 18135 if(${s}){ 18136 result.g = ${l(i.slice())}; 18137 } 18138 if(${a}) { 18139 result.b = ${c(i.slice())}; 18140 if(${s}) { 18141 result.a = ${u(i.slice())}; 18142 } 18143 } 18144 setOutput(result); 18145 } 18146 `;function A(d){return h(d)}function l(d){return d[r-1]="("+d[r-1]+" + 1)",h(d)}function c(d){return d[r-2]="("+d[r-2]+" + 1)",h(d)}function u(d){return d[r-1]="("+d[r-1]+" + 1)",d[r-2]="("+d[r-2]+" + 1)",h(d)}function h(d){const g=e.map((w,C)=>f(C,d)),m=g.join(","),p=g.slice(-2).join(",");return`getChannel(getX(${m}), vec2(${p}))`}function f(d,g){return t.indexOf(d)!==-1&&e[d]!==1?`${e[d]} - ${g[d]} - 1`:`${g[d]}`}}}/** 18147 * @license 18148 * Copyright 2020 Google LLC. All Rights Reserved. 18149 * Licensed under the Apache License, Version 2.0 (the "License");
18150 * you may not use this file except in compliance with the License. 18151 * You may obtain a copy of the License at 18152 * 18153 * http://www.apache.org/licenses/LICENSE-2.0 18154 * 18155 * Unless required by applicable law or agreed to in writing, software 18156 * distributed under the License is distributed on an "AS IS" BASIS, 18157 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18158 * See the License for the specific language governing permissions and 18159 * limitations under the License. 18160 * ============================================================================= 18161 */function jZ(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{dims:s}=r,a=i.shape.length,o=Br(s,i.shape);if(a===0)return Ei({inputs:{x:i},backend:t});const A=pe().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new XZ(i.shape,o):new KZ(i.shape,o);return t.runWebGLProgram(A,[i],i.dtype)}const YZ={kernelName:hx,backendName:"webgl",kernelFunc:jZ};/** 18162 * @license 18163 * Copyright 2020 Google LLC. All Rights Reserved. 18164 * Licensed under the Apache License, Version 2.0 (the "License"); 18165 * you may not use this file except in compliance with the License. 18166 * You may obtain a copy of the License at 18167 * 18168 * http://www.apache.org/licenses/LICENSE-2.0 18169 * 18170 * Unless required by applicable law or agreed to in writing, software 18171 * distributed under the License is distributed on an "AS IS" BASIS, 18172 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18173 * See the License for the specific language governing permissions and 18174 * limitations under the License. 18175 * ============================================================================= 18176 */class qZ{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const r=e[1],i=e[2];this.outputShape=e;let s="";typeof t=="number"?s=`float outputValue = ${t.toFixed(2)};`:s=` 18177 vec3 fill = vec3(${t.join(",")}); 18178 float outputValue = fill[coords[3]];`,this.userCode=` 18179 void main() { 18180 ivec4 coords = getOutputCoords(); 18181 int x = coords[2]; 18182 int y = coords[1]; 18183 float coordXFloat = (float(x) - params[0]) * params[3] - 18184 (float(y) - params[1]) * params[2]; 18185 float coordYFloat = (float(x) - params[0]) * params[2] + 18186 (float(y) - params[1]) * params[3];
18187 int coordX = int(round(coordXFloat + params[0])); 18188 int coordY = int(round(coordYFloat + params[1])); 18189 ${s} 18190 if(coordX >= 0 && coordX < ${i} && coordY >= 0 && coordY < ${r}) { 18191 outputValue = getImage(coords[0], coordY, coordX, coords[3]); 18192 } 18193 setOutput(outputValue); 18194 } 18195 `}}/** 18196 * @license 18197 * Copyright 2020 Google LLC. All Rights Reserved. 18198 * Licensed under the Apache License, Version 2.0 (the "License"); 18199 * you may not use this file except in compliance with the License. 18200 * You may obtain a copy of the License at 18201 * 18202 * http://www.apache.org/licenses/LICENSE-2.0 18203 * 18204 * Unless required by applicable law or agreed to in writing, software 18205 * distributed under the License is distributed on an "AS IS" BASIS, 18206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18207 * See the License for the specific language governing permissions and 18208 * limitations under the License. 18209 * ============================================================================= 18210 */const JZ={kernelName:Jx,backendName:"webgl",kernelFunc:({inputs:n,attrs:e,backend:t})=>{const{image:r}
vendor: 4,169 bytes, lines 18210-18299
18210=n,{radians:i,fillValue:s,center:a}=e,o=t,A=new qZ(r.shape,s),[l,c]=e_(a,r.shape[1],r.shape[2]),u=[[l,c,Math.sin(i),Math.cos(i)]];return o.runWebGLProgram(A,[r],r.dtype,u)}};/** 18211 * @license 18212 * Copyright 2020 Google LLC. All Rights Reserved. 18213 * Licensed under the Apache License, Version 2.0 (the "License"); 18214 * you may not use this file except in compliance with the License. 18215 * You may obtain a copy of the License at 18216 * 18217 * http://www.apache.org/licenses/LICENSE-2.0 18218 * 18219 * Unless required by applicable law or agreed to in writing, software 18220 * distributed under the License is distributed on an "AS IS" BASIS, 18221 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18222 * See the License for the specific language governing permissions and 18223 * limitations under the License. 18224 * ============================================================================= 18225 */const ZZ=` 18226 // OpenGL ES does not support round function. 18227 // The algorithm is based on banker's rounding. 18228 float base = floor(x); 18229 if ((x - base) < 0.5) { 18230 return floor(x); 18231 } else if ((x - base) > 0.5) { 18232 return ceil(x); 18233 } else { 18234 if (mod(base, 2.0) == 0.0) { 18235 return base; 18236 } else { 18237 return base + 1.0; 18238 } 18239 } 18240`,eee=vn({opSnippet:ZZ}),tee={kernelName:fx,backendName:"webgl",kernelFunc:eee};/** 18241 * @license 18242 * Copyright 2020 Google LLC. All Rights Reserved. 18243 * Licensed under the Apache License, Version 2.0 (the "License"); 18244 * you may not use this file except in compliance with the License. 18245 * You may obtain a copy of the License at 18246 * 18247 * http://www.apache.org/licenses/LICENSE-2.0 18248 * 18249 * Unless required by applicable law or agreed to in writing, software 18250 * distributed under the License is distributed on an "AS IS" BASIS, 18251 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18252 * See the License for the specific language governing permissions and 18253 * limitations under the License. 18254 * ============================================================================= 18255 */const nee="return inversesqrt(x);",ree=vn({opSnippet:nee,cpuKernelImpl:mW}),iee={kernelName:dx,backendName:"webgl",kernelFunc:ree};/** 18256 * @license 18257 * Copyright 2018 Google LLC. All Rights Reserved. 18258 * Licensed under the Apache License, Version 2.0 (the "License"); 18259 * you may not use this file except in compliance with the License. 18260 * You may obtain a copy of the License at 18261 * 18262 * http://www.apache.org/licenses/LICENSE-2.0 18263 * 18264 * Unless required by applicable law or agreed to in writing, software 18265 * distributed under the License is distributed on an "AS IS" BASIS, 18266 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18267 * See the License for the specific language governing permissions and 18268 * limitations under the License. 18269 * ============================================================================= 18270 */class l2{constructor(e,t,r,i,s,a,o=!0,A=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=a;const l=Mn(s.length),c=Mn(a.length);let u="";r===1?u="i":r===2&&(u="i, j");const h=`getIndices(${u})`;let f="";i===1?f="i":i===2&&(f="i, coords[1]");const d=`getUpdates(${f})`;let g="";A&&(g="coords[0], coords[1]");const m=`getDefaultValue(${g})`,p=t>1?"strides[j]":"strides";this.userCode=` 18271 ${l} strides = ${l}(${s}); 18272 18273 void main() { 18274 ${c} coords = getOutputCoords(); 18275 float sum = 0.0; 18276 bool found = false; 18277 for (int i = 0; i < ${e}; i++) { 18278 int flattenedIndex = 0; 18279 for (int j = 0; j < ${t}; j++) { 18280 int index = round(${h}); 18281 flattenedIndex += index * ${p}; 18282 } 18283 if (flattenedIndex == coords[0]) { 18284 sum += ${d}; 18285 found = true; 18286 } 18287 } 18288 setOutput(mix(${m}, sum, float(found))); 18289 } 18290 `}}/** 18291 * @license 18292 * Copyright 2023 Google LLC. 18293 * Licensed under the Apache License, Version 2.0 (the "License"); 18294 * you may not use this file except in compliance with the License. 18295 * You may obtain a copy of the License at 18296 * 18297 * http://www.apache.org/licenses/LICENSE-2.0 18298 * 18299 * Unless required by applicable law or agreed to in writing, softw
18299are 18300 * distributed under the License is distributed on an "AS IS" BASIS, 18301 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18302 * See the License for the specific language governing permissions and 18303 * limitations under the License. 18304 * ============================================================================= 18305 */class see{constructor(e,t,r,i,s,a,o=!0,A=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;const l=Mn(s.length),c=Mn(a.length);let u="";r===1?u="i":r===2&&(u="i, j");const h=`getIndices(${u})`;let f="";i===1?f="i":i===2&&(f="i, coords[1]");const d=`getUpdates(${f})`;let g="";A&&(g="coords[0], coords[1]");const m=`getDefaultValue(${g})`,p=t>1?"strides[j]":"strides",w=t>1?"strides[j + 1]":"strides";this.userCode=` 18306 ${l} strides = ${l}(${s}); 18307 18308 void main() { 18309 ${c} coords = getOutputCoords(); 18310 vec4 sum = vec4(0.); 18311 vec4 found = vec4(0.); 18312 for (int i = 0; i < ${e}; i+=2) { 18313 ivec2 flattenedIndex = ivec2(0); 18314 for (int j = 0; j < ${t}; j+=2) { 18315 ivec4 index = round(${h}); 18316 flattenedIndex += index.xz * ${p}; 18317 if (j + 1 < ${t}) { 18318 flattenedIndex += index.yw * ${w}; 18319 } 18320 } 18321 if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] || 18322 flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) { 18323 vec4 updVals = ${d}; 18324 if (flattenedIndex[0] == coords[0]) { 18325 sum.xy += updVals.xy; 18326 found.xy = vec2(1.); 18327 } else if (flattenedIndex[0] == coords[0] + 1) { 18328 sum.zw += updVals.xy; 18329 found.zw = vec2(1.); 18330 } 18331 if (flattenedIndex[1] == coords[0]) { 18332 sum.xy += updVals.zw; 18333 found.xy = vec2(1.); 18334 } else if (flattenedIndex[1] == coords[0] + 1) { 18335 sum.zw += updVals.zw; 18336 found.zw = vec2(1.); 18337 } 18338 } 18339 } 18340 setOutput(mix(${m}, sum, found)); 18341 } 18342 `}}/** 18343 * @license 18344 * Copyright 2020 Google LLC. All Rights Reserved. 18345 * Licensed under the Apache License, Version 2.0 (the "License"); 18346 * you may not use this file except in compliance with the License. 18347 * You may obtain a copy of the License at 18348 * 18349 * http://www.apache.org/licenses/LICENSE-2.0 18350 * 18351 * Unless required by applicable law or agreed to in writing, software 18352 * distributed under the License is distributed on an "AS IS" BASIS, 18353 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18354 * See the License for the specific language governing permissions and 18355 * limitations under the License. 18356 * ============================================================================= 18357 */function aee(n){const{inputs:e,backend:t,attrs:r}=n,{indices:i,updates:s}=e,{shape:a}=r,{sliceRank:o,numUpdates:A,sliceSize:l,strides:c,outputSize:u}=Jf(s,i,a),h=[u/l,l];if(u===0)return t.makeTensorInfo(a,i.dtype);const f=et({inputs:{x:i},backend:t,attrs:{shape:[A,o]}}),d=et({inputs:{x:s},backend:t,attrs:{shape:[A,l]}}),g=t.makeTensorInfo([],"float32",new Float32Array([0]));let m;pe().getBool("WEBGL_PACK")?m=new see(A,o,f.shape.length,d.shape.length,c,h):m=new l2(A,o,f.shape.length,d.shape.length,c,h);const p=t.runWebGLProgram(m,[d,f,g],d.dtype),w=et({inputs:{x:p},backend:t,attrs:{shape:a}});return t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(p),t.disposeIntermediateTensorInfo(g),w}const oee={kernelName:px,backendName:"webgl",kernelFunc:aee};/** 18358 * @license 18359 * Copyright 2022 Google LLC. All Rights Reserved. 18360 * Licensed under the Apache License, Version 2.0 (the "License"); 18361 * you may not use this file except in compliance with the License. 18362 * You may obtain a copy of the License at 18363 * 18364 * http://www.apache.org/licenses/LICENSE-2.0 18365 * 18366 * Unless required by applicable law or agreed to in writing, software 18367 * distributed under the License is distributed on an "AS IS" BASIS, 18368 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18369 * See the License for the specific language governing permissions and 18370 * limitations under the License. 18371 * =============================================================================
vendor: 4,304 bytes, lines 18372-18455
18372 */class Aee{constructor(e,t,r,i){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,r];const s="while (left < right) {",a=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,o=pe().getNumber("WEBGL_VERSION")===2?s:a,A=i==="left"?"<":"<=";this.userCode=` 18373 int findBound(int batch, float value) { 18374 int left = 0; 18375 int right = numInputs; 18376 int mid; 18377 ${o} 18378 mid = (left + right) / 2; 18379 if (getSortedSequence(batch, mid) ${A} value) { 18380 left = mid + 1; 18381 } else { 18382 right = mid; 18383 } 18384 } 18385 return right; 18386 } 18387 18388 void main() { 18389 ivec2 coords = getOutputCoords(); 18390 int batch = coords[0]; 18391 int valueIndex = coords[1]; 18392 18393 float value = getValues(batch, valueIndex); 18394 18395 setOutput(float(findBound(batch, value))); 18396 } 18397 `}}/** 18398 * @license 18399 * Copyright 2022 Google LLC. All Rights Reserved. 18400 * Licensed under the Apache License, Version 2.0 (the "License"); 18401 * you may not use this file except in compliance with the License. 18402 * You may obtain a copy of the License at 18403 * 18404 * http://www.apache.org/licenses/LICENSE-2.0 18405 * 18406 * Unless required by applicable law or agreed to in writing, software 18407 * distributed under the License is distributed on an "AS IS" BASIS, 18408 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18409 * See the License for the specific language governing permissions and 18410 * limitations under the License. 18411 * ============================================================================= 18412 */function lee(n){const{inputs:e,backend:t,attrs:r}=n,{sortedSequence:i,values:s}=e,{side:a}=r,o=new Aee(i.shape[0],i.shape[1],s.shape[1],a),A=[[i.shape[1]]];return t.runWebGLProgram(o,[i,s],"int32",A)}const cee={kernelName:gx,backendName:"webgl",kernelFunc:lee};/** 18413 * @license 18414 * Copyright 2017 Google LLC. All Rights Reserved. 18415 * Licensed under the Apache License, Version 2.0 (the "License"); 18416 * you may not use this file except in compliance with the License. 18417 * You may obtain a copy of the License at 18418 * 18419 * http://www.apache.org/licenses/LICENSE-2.0 18420 * 18421 * Unless required by applicable law or agreed to in writing, software 18422 * distributed under the License is distributed on an "AS IS" BASIS, 18423 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18424 * See the License for the specific language governing permissions and 18425 * limitations under the License. 18426 * ============================================================================= 18427 */class uee{constructor(e,t,r){this.variableNames=["c","a","b"],this.outputShape=t;let i,s;if(r>4)throw Error(`Where for rank ${r} is not yet supported`);if(r===1)s="resRC",i="resRC";else{const o=["resRC.x","resRC.y","resRC.z","resRC.w"],A=[],l=[];for(let c=0;c<t.length;c++)l.push(`${o[c]}`),c<e&&A.push(`${o[c]}`);i=A.join(),s=l.join()}const a=Mn(r);this.userCode=` 18428 void main() { 18429 ${a} resRC = getOutputCoords(); 18430 float cVal = getC(${i}); 18431 if (cVal >= 1.0) { 18432 setOutput(getA(${s})); 18433 } else { 18434 setOutput(getB(${s})); 18435 } 18436 } 18437 `}}/** 18438 * @license 18439 * Copyright 2020 Google LLC. All Rights Reserved. 18440 * Licensed under the Apache License, Version 2.0 (the "License"); 18441 * you may not use this file except in compliance with the License. 18442 * You may obtain a copy of the License at 18443 * 18444 * http://www.apache.org/licenses/LICENSE-2.0 18445 * 18446 * Unless required by applicable law or agreed to in writing, software 18447 * distributed under the License is distributed on an "AS IS" BASIS, 18448 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18449 * See the License for the specific language governing permissions and 18450 * limitations under the License. 18451 * ============================================================================= 18452 */function hee(n){const{inputs:e,backend:t}=n,{condition:r,t:i,e:s}=e,a=new uee(r.shape.length,i.shape,i.shape.length);return t.runWebGLProgram(a,[r,i,s],Ys(i.dtype,s.dtype))}const fee={kernelName:yx,backendName:"webgl",kernelFunc:hee};/** 18453 * @license 18454 * Copyright 2020 Google LLC. All Rights Reserved. 18455 * Licensed under the Apache License, Version 2.0 (the "License");
18456 * you may not use this file except in compliance with the License. 18457 * You may obtain a copy of the License at 18458 * 18459 * http://www.apache.org/licenses/LICENSE-2.0 18460 * 18461 * Unless required by applicable law or agreed to in writing, software 18462 * distributed under the License is distributed on an "AS IS" BASIS, 18463 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18464 * See the License for the specific language governing permissions and 18465 * limitations under the License. 18466 * ============================================================================= 18467 */const dee=` 18468 // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. 18469 // see: https://arxiv.org/abs/1706.02515 18470 float scaleAlpha = ${r_}; 18471 float scale = ${i_}; 18472 return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); 18473`,pee=vn({opSnippet:dee}),mee={kernelName:vx,backendName:"webgl",kernelFunc:pee};/** 18474 * @license 18475 * Copyright 2020 Google LLC. All Rights Reserved. 18476 * Licensed under the Apache License, Version 2.0 (the "License"); 18477 * you may not use this file except in compliance with the License. 18478 * You may obtain a copy of the License at 18479 * 18480 * http://www.apache.org/licenses/LICENSE-2.0 18481 * 18482 * Unless required by applicable law or agreed to in writing, software 18483 * distributed under the License is distributed on an "AS IS" BASIS, 18484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18485 * See the License for the specific language governing permissions and 18486 * limitations under the License. 18487 * ============================================================================= 18488 */const gee=Jl+` 18489 return 1.0 / (1.0 + exp(-1.0 * x)); 18490`,yee=` 18491 vec4 result = 1.0 / (1.0 + exp(-1.0 * x)); 18492 bvec4 isNaN = isnan(x); 18493 18494 result.r = isNaN.r ? x.r : result.r; 18495 result.g = isNaN.g ? x.g : result.g; 18496 result.b = isNaN.b ? x.b : result.b; 18497 result.a = isNaN.a ? x.a : result.a; 18498 18499 return result; 18500`,vee=vn({opSnippet:gee,packedOpSnippet:yee,cpuKernelImpl:yW}),wee={kernelName:_x,backendName:"webgl",kernelFunc:vee};/** 18501 * @license 18502 * Copyright 2020 Google LLC. All Rights Reserved. 18503 * Licensed under the Apache License, Version 2.0 (the "License"); 18504 * you may not use this file except in compliance with the License. 18505 * You may obtain a copy of the License at 18506 * 18507 * http://www.apache.org/licenses/LICENSE-2.0 18508 * 18509 * Unless required by applicable law or agreed to in writing, software 18510 * distributed under the License is distributed on an "AS IS" BASIS, 18511 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18512 * See the License for the specific language governing permissions and 18513 * limitations under the License. 18514 * ============================================================================= 18515 */const xee=` 18516 if (isnan(x)) { return 0.0; } 18517 return sign(x); 18518`,bee=vn({opSnippet:xee}),Cee={kernelName:Cx,backendName:"webgl",kernelFunc:bee};/** 18519 * @license 18520 * Copyright 2020 Google LLC. All Rights Reserved. 18521 * Licensed under the Apache License, Version 2.0 (the "License"); 18522 * you may not use this file except in compliance with the License. 18523 * You may obtain a copy of the License at 18524 * 18525 * http://www.apache.org/licenses/LICENSE-2.0 18526 * 18527 * Unless required by applicable law or agreed to in writing, software 18528 * distributed under the License is distributed on an "AS IS" BASIS, 18529 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18530 * See the License for the specific language governing permissions and 18531 * limitations under the License. 18532 * ============================================================================= 18533 */const _ee=Jl+` 18534 return sin(x); 18535`,Bee=` 18536 vec4 result = sin(x); 18537 bvec4 isNaN = isnan(x); 18538 ${IA} 18539 return result; 18540`,Eee=vn({opSnippet:_ee,packedOpSnippet:Bee}),See={kernelName:xx,backendName:"webgl",kernelFunc:Eee};/** 18541 * @license 18542 * Copyright 2020 Google LLC. All Rights Reserved. 18543 * Licensed under the Apache License, Version 2.0 (the "License"); 18544 * you may not use this file except in compliance with the License. 18545 * You may obtain a copy of the License at 18546 * 18547 * http://www.apache.org/licenses/LICENSE-2.0 18548 * 18549 * Unless required by applicable law or agreed to in writing, softw
18549are 18550 * distributed under the License is distributed on an "AS IS" BASIS, 18551 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18552 * See the License for the specific language governing permissions and 18553 * limitations under the License. 18554 * ============================================================================= 18555 */const Tee=` 18556 float e2x = exp(x); 18557 return (e2x - 1.0 / e2x) / 2.0; 18558`,Iee=vn({opSnippet:Tee}),Fee={kernelName:bx,backendName:"webgl",kernelFunc:Iee};/** 18559 * @license 18560 * Copyright 2020 Google LLC. All Rights Reserved. 18561 * Licensed under the Apache License, Version 2.0 (the "License"); 18562 * you may not use this file except in compliance with the License. 18563 * You may obtain a copy of the License at 18564 * 18565 * http://www.apache.org/licenses/LICENSE-2.0 18566 * 18567 * Unless required by applicable law or agreed to in writing, software 18568 * distributed under the License is distributed on an "AS IS" BASIS, 18569 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18570 * See the License for the specific language governing permissions and 18571 * limitations under the License. 18572 * ============================================================================= 18573 */const Ree=` 18574 float epsilon = 1.1920928955078125e-7; 18575 float threshold = log(epsilon) + 2.0; 18576 18577 bool too_large = x > -threshold; 18578 bool too_small = x < threshold; 18579 18580 float result; 18581 float exp_x = exp(x); 18582 18583 if (too_large){ 18584 result = x; 18585 } 18586 else if (too_small){ 18587 result = exp_x; 18588 } 18589 else{ 18590 result = log(exp_x + 1.0); 18591 } 18592 return result; 18593`,Uee=vn({opSnippet:Ree}),Mee={kernelName:Bx,backendName:"webgl",kernelFunc:Uee};/** 18594 * @license 18595 * Copyright 2020 Google LLC. All Rights Reserved. 18596 * Licensed under the Apache License, Version 2.0 (the "License"); 18597 * you may not use this file except in compliance with the License. 18598 * You may obtain a copy of the License at 18599 * 18600 * http://www.apache.org/licenses/LICENSE-2.0 18601 * 18602 * Unless required by applicable law or agreed to in writing, software 18603 * distributed under the License is distributed on an "AS IS" BASIS, 18604 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18605 * See the License for the specific language governing permissions and 18606 * limitations under the License. 18607 * ============================================================================= 18608 */const Nee=n=>{const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{blockShape:s,paddings:a}=r;H(i.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const o=s.reduce((p,w)=>p*w),A=[[0,0]];A.push(...a);for(let p=1+s.length;p<i.shape.length;++p)A.push([0,0]);const l=[],c=NB({inputs:{x:i},backend:t,attrs:{paddings:A,constantValue:0}}),u=qg(c.shape,s,o,!1),h=Jg(u.length,s.length,!1),f=Zg(c.shape,s,o,!1),d=et({inputs:{x:c},backend:t,attrs:{shape:u}}),g=Jr({inputs:{x:d},backend:t,attrs:{perm:h}}),m=et({inputs:{x:g},backend:t,attrs:{shape:f}});return l.push(c),l.push(d),l.push(g),l.forEach(p=>t.disposeIntermediateTensorInfo(p)),m},Dee={kernelName:Tx,backendName:"webgl",kernelFunc:Nee};/** 18609 * @license 18610 * Copyright 2021 Google LLC. All Rights Reserved. 18611 * Licensed under the Apache License, Version 2.0 (the "License"); 18612 * you may not use this file except in compliance with the License. 18613 * You may obtain a copy of the License at 18614 * 18615 * http://www.apache.org/licenses/LICENSE-2.0 18616 * 18617 * Unless required by applicable law or agreed to in writing, software 18618 * distributed under the License is distributed on an "AS IS" BASIS, 18619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18620 * See the License for the specific language governing permissions and 18621 * limitations under the License. 18622 * ============================================================================= 18623 */function Lee(n){const{inputs:e,backend:t}=n,{indices:r,values:i,denseShape:s,defaultValue:a}=e;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: 18624 ${s.shape}`);if(r.shape.length!==2)throw new Error(`Indices must be a matrix, saw: 18625 ${r.shape}`);if(i.shape.length!==1)throw new Error(`Values must be a vector, saw: 18626 ${i.shape}`);if(a.shape.length!==0)throw new Error(`Default value must be a scalar, saw: 18627 ${a.shape}`);const o=t.readSync(r.dataId),A=t.readSync(i.dataId),l=t.readSync(s.dataId),c=t.readSync(a.dataId)[0],[u,h,f,d,g]=wW(o,r.shape,r.dtype,A,i.dtype,l,c);return[t.makeTensorInfo(h,r.dtype,u),t.makeTensorInfo([h[0]],i.dtype,f),t.makeTensorInfo([d.length],"bool",new Uint8Array(d.map(m=>Number(m)))),t.makeTensorInfo([g.length],r.dtype,new Int32Array(g))]}const Oee={kernelName:Rx,backendName:"webgl",kernelFunc:Lee};/** 18628 * @license 18629 * Copyright 2021 Google LLC. All Rights Reserved. 18630 * Licensed under the Apache License, Version 2.0 (the "License");
18631 * you may not use this file except in compliance with the License. 18632 * You may obtain a copy of the License at 18633 * 18634 * http://www.apache.org/licenses/LICENSE-2.0 18635 * 18636 * Unless required by applicable law or agreed to in writing, software 18637 * distributed under the License is distributed on an "AS IS" BASIS, 18638 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18639 * See the License for the specific language governing permissions and 18640 * limitations under the License. 18641 * ============================================================================= 18642 */function Pee(n){const{inputs:e,backend:t}=n,{inputIndices:r,inputShape:i,newShape:s}=e;if(r.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${r.shape}`);if(i.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${i.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const a=Array.from(t.readSync(i.dataId)),o=t.readSync(r.dataId),A=Array.from(t.readSync(s.dataId)),[l,c,u]=xW(o,r.shape,r.dtype,a,A);return[t.makeTensorInfo(c,r.dtype,l),t.makeTensorInfo([u.length],s.dtype,new Int32Array(u))]}const kee={kernelName:Ux,backendName:"webgl",kernelFunc:Pee};/** 18643 * @license 18644 * Copyright 2021 Google LLC. All Rights Reserved. 18645 * Licensed under the Apache License, Version 2.0 (the "License"); 18646 * you may not use this file except in compliance with the License. 18647 * You may obtain a copy of the License at 18648 * 18649 * http://www.apache.org/licenses/LICENSE-2.0 18650 * 18651 * Unless required by applicable law or agreed to in writing, software 18652 * distributed under the License is distributed on an "AS IS" BASIS, 18653 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18654 * See the License for the specific language governing permissions and 18655 * limitations under the License. 18656 * ============================================================================= 18657 */function $ee(n){const{inputs:e,backend:t}=n,{data:r,indices:i,segmentIds:s}=e;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(i.shape.length!==1)throw new Error(`Indices should be a vector but received shape 18658 ${i.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape 18659 ${s.shape}`);const a=t.readSync(r.dataId),o=t.readSync(i.dataId),A=t.readSync(s.dataId),[l,c]=sB(a,r.shape,r.dtype,o,A,!0);return t.makeTensorInfo(c,r.dtype,l)}const Qee={kernelName:Mx,backendName:"webgl",kernelFunc:$ee};/** 18660 * @license 18661 * Copyright 2021 Google LLC. All Rights Reserved. 18662 * Licensed under the Apache License, Version 2.0 (the "License"); 18663 * you may not use this file except in compliance with the License. 18664 * You may obtain a copy of the License at 18665 * 18666 * http://www.apache.org/licenses/LICENSE-2.0 18667 * 18668 * Unless required by applicable law or agreed to in writing, software 18669 * distributed under the License is distributed on an "AS IS" BASIS, 18670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18671 * See the License for the specific language governing permissions and 18672 * limitations under the License. 18673 * ============================================================================= 18674 */function Hee(n){const{inputs:e,backend:t}=n,{data:r,indices:i,segmentIds:s}=e;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(i.shape.length!==1)throw new Error(`Indices should be a vector but received shape 18675 ${i.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape 18676 ${s.shape}`);const a=t.readSync(r.dataId),o=t.readSync(i.dataId),A=t.readSync(s.dataId),[l,c]=sB(a,r.shape,r.dtype,o,A);return t.makeTensorInfo(c,r.dtype,l)}const Vee={kernelName:Nx,backendName:"webgl",kernelFunc:Hee};/** 18677 * @license 18678 * Copyright 2020 Google LLC. All Rights Reserved. 18679 * Licensed under the Apache License, Version 2.0 (the "License"); 18680 * you may not use this file except in compliance with the License. 18681 * You may obtain a copy of the License at 18682 * 18683 * http://www.apache.org/licenses/LICENSE-2.0 18684 * 18685 * Unless required by applicable law or agreed to in writing, softw
18685are 18686 * distributed under the License is distributed on an "AS IS" BASIS, 18687 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18688 * See the License for the specific language governing permissions and 18689 * limitations under the License. 18690 * ============================================================================= 18691 */function Gee(n){const{inputs:e,backend:t,attrs:r}=n,{sparseIndices:i,sparseValues:s,defaultValue:a}=e,{outputShape:o}=r,{sliceRank:A,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=Jf(s,i,o),f=!1;if(s.dtype==="string"){const p=t.bufferSync(i),w=t.bufferSync(s),C=Il(t.readSync(a.dataId)[0]),b=gW(p,w,o,h,c,l,A,u,C,f);return t.makeTensorInfo(o,b.dtype,b.values)}const d=new l2(l,A,i.shape.length,s.shape.length,u,[h,1],f),g=t.runWebGLProgram(d,[s,i,a],s.dtype),m=et({inputs:{x:g},backend:t,attrs:{shape:o}});return t.disposeIntermediateTensorInfo(g),m}const zee={kernelName:Dx,backendName:"webgl",kernelFunc:Gee};/** 18692 * @license 18693 * Copyright 2020 Google LLC. All Rights Reserved. 18694 * Licensed under the Apache License, Version 2.0 (the "License"); 18695 * you may not use this file except in compliance with the License. 18696 * You may obtain a copy of the License at 18697 * 18698 * http://www.apache.org/licenses/LICENSE-2.0 18699 * 18700 * Unless required by applicable law or agreed to in writing, software 18701 * distributed under the License is distributed on an "AS IS" BASIS, 18702 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18703 * See the License for the specific language governing permissions and 18704 * limitations under the License. 18705 * ============================================================================= 18706 */function Wee(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{numOrSizeSplits:s,axis:a}=r,o=Br(a,i.shape)[0],A=m_(i,s,o),l=i.shape.length,c=new Array(l).fill(0),u=i.shape.slice();return A.map(h=>{const f=[...u];f[o]=h;const d=Zl({inputs:{x:i},backend:t,attrs:{begin:c,size:f}});return c[o]+=h,d})}const Kee={kernelName:Ix,backendName:"webgl",kernelFunc:Wee};/** 18707 * @license 18708 * Copyright 2020 Google LLC. All Rights Reserved. 18709 * Licensed under the Apache License, Version 2.0 (the "License"); 18710 * you may not use this file except in compliance with the License. 18711 * You may obtain a copy of the License at 18712 * 18713 * http://www.apache.org/licenses/LICENSE-2.0 18714 * 18715 * Unless required by applicable law or agreed to in writing, software 18716 * distributed under the License is distributed on an "AS IS" BASIS, 18717 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18718 * See the License for the specific language governing permissions and 18719 * limitations under the License. 18720 * ============================================================================= 18721 */const u4="return sqrt(x);",Xee=vn({opSnippet:u4,packedOpSnippet:u4,cpuKernelImpl:bW}),jee={kernelName:Ex,backendName:"webgl",kernelFunc:Xee};/** 18722 * @license 18723 * Copyright 2019 Google LLC. All Rights Reserved. 18724 * Licensed under the Apache License, Version 2.0 (the "License"); 18725 * you may not use this file except in compliance with the License. 18726 * You may obtain a copy of the License at 18727 * 18728 * http://www.apache.org/licenses/LICENSE-2.0 18729 * 18730 * Unless required by applicable law or agreed to in writing, software 18731 * distributed under the License is distributed on an "AS IS" BASIS, 18732 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18733 * See the License for the specific language governing permissions and 18734 * limitations under the License. 18735 * ============================================================================= 18736 */const Yee="return x * x;",qee=vn({opSnippet:Yee}),Jee={kernelName:LM,backendName:"webgl",kernelFunc:qee};/** 18737 * @license 18738 * Copyright 2020 Google LLC. All Rights Reserved. 18739 * Licensed under the Apache License, Version 2.0 (the "License"); 18740 * you may not use this file except in compliance with the License. 18741 * You may obtain a copy of the License at 18742 * 18743 * http://www.apache.org/licenses/LICENSE-2.0 18744 * 18745 * Unless required by applicable law or agreed to in writing, software 18746 * distributed under the License is distributed on an "AS IS" BASIS, 18747 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18748 * See the License for the specific language governing permissions and 18749 * limitations under the License. 18750 * =============================================================================
18751 */const h4="return (a - b) * (a - b);",Zee=Lr({opSnippet:h4,packedOpSnippet:h4}),ete={kernelName:Lx,backendName:"webgl",kernelFunc:Zee};/** 18752 * @license 18753 * Copyright 2023 Google LLC. 18754 * Licensed under the Apache License, Version 2.0 (the "License"); 18755 * you may not use this file except in compliance with the License. 18756 * You may obtain a copy of the License at 18757 * 18758 * http://www.apache.org/licenses/LICENSE-2.0 18759 * 18760 * Unless required by applicable law or agreed to in writing, software 18761 * distributed under the License is distributed on an "AS IS" BASIS, 18762 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18763 * See the License for the specific language governing permissions and 18764 * limitations under the License. 18765 * ============================================================================= 18766 */function tte(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e;if(i.dtype!=="string")throw new Error("Input must be of datatype string");const s=t.readSync(i.dataId),a=Ul(s),o=CW(a,"string",r);return t.makeTensorInfo(i.shape,"string",o)}const nte={kernelName:Ox,backendName:"webgl",kernelFunc:tte};/** 18767 * @license 18768 * Copyright 2020 Google LLC. All Rights Reserved. 18769 * Licensed under the Apache License, Version 2.0 (the "License"); 18770 * you may not use this file except in compliance with the License. 18771 * You may obtain a copy of the License at 18772 * 18773 * http://www.apache.org/licenses/LICENSE-2.0 18774 * 18775 * Unless required by applicable law or agreed to in writing, software 18776 * distributed under the License is distributed on an "AS IS" BASIS, 18777 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18778 * See the License for the specific language governing permissions and 18779 * limitations under the License. 18780 * ============================================================================= 18781 */function rte({inputs:n,attrs:e,backend:t}){const{x:r}=n,i=cs+` 18782 return x > 0.0 ? 1.0 : float(${e.alpha}); 18783 `,s=new Hs(r.shape,i);return t.runWebGLProgram(s,[r],r.dtype)}const ite={kernelName:qx,backendName:"webgl",kernelFunc:rte};/** 18784 * @license 18785 * Copyright 2017 Google LLC. All Rights Reserved. 18786 * Licensed under the Apache License, Version 2.0 (the "License"); 18787 * you may not use this file except in compliance with the License. 18788 * You may obtain a copy of the License at 18789 * 18790 * http://www.apache.org/licenses/LICENSE-2.0 18791 * 18792 * Unless required by applicable law or agreed to in writing, software 18793 * distributed under the License is distributed on an "AS IS" BASIS, 18794 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18795 * See the License for the specific language governing permissions and 18796 * limitations under the License. 18797 * ============================================================================= 18798 */class ste{constructor(e,t,r){this.variableNames=["x"],this.outputShape=r;const i=r.length,s=Mn(r.length),a=Mn(r.length);let o="";if(i===1)o="coords * strides + begin";else{let A=0;o=r.map((l,c)=>(A++,r.length===1?`coords * strides[${c}] + begin[${c}]`:`coords[${A-1}] * strides[${c}] + begin[${c}]`)).join(",")}this.userCode=` 18799 ${s} begin = ${s}(${e}); 18800 ${s} strides = ${s}(${t}); 18801 18802 void main() { 18803 ${a} coords = getOutputCoords(); 18804 setOutput(getX(${o})); 18805 } 18806 `}}/** 18807 * @license 18808 * Copyright 2020 Google LLC. All Rights Reserved. 18809 * Licensed under the Apache License, Version 2.0 (the "License"); 18810 * you may not use this file except in compliance with the License. 18811 * You may obtain a copy of the License at 18812 * 18813 * http://www.apache.org/licenses/LICENSE-2.0 18814 * 18815 * Unless required by applicable law or agreed to in writing, software 18816 * distributed under the License is distributed on an "AS IS" BASIS, 18817 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18818 * See the License for the specific language governing permissions and 18819 * limitations under the License. 18820 * ============================================================================= 18821 */function ate(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{begin:s,end:a,strides:o,beginMask:A,endMask:l,ellipsisMask:c,newAxisMask:u,shrinkAxisMask:h}=r,{finalShapeSparse:f,finalShape:d,isIdentity:g,sliceDim0:m,isSimpleSlice:p,begin:w,end:C,strides:b}=XC(i.shape,s,a,o,A,l,c,u,h);let U;if(g)U=et({inputs:{x:i},backend:t,attrs:{shape:d}});else if(m||p){H(i.shape.length>=1,()=>`Input must have rank at least 1, got: ${i.shape.length}`);const D=PC(w,C,b),O=Zl({inputs:{x:i},backend:t,attrs:{begin:w,size:D}});U=et({inputs:{x:O},backend:t,attrs:{shape:d}}
vendor: 4,223 bytes, lines 18821-18875
18821),t.disposeIntermediateTensorInfo(O)}else if(t.shouldExecuteOnCPU([i])){const O=t.readSync(i.dataId),I=ir(i.shape,i.dtype,O),R=_W(f,I,b,w);U=t.makeTensorInfo(d,i.dtype,R.values)}else{const O=new ste(w,b,f);U=t.runWebGLProgram(O,[i],i.dtype)}const F=et({inputs:{x:U},backend:t,attrs:{shape:d}});return t.disposeIntermediateTensorInfo(U),F}const ote={kernelName:Px,backendName:"webgl",kernelFunc:ate};/** 18822 * @license 18823 * Copyright 2021 Google LLC. All Rights Reserved. 18824 * Licensed under the Apache License, Version 2.0 (the "License"); 18825 * you may not use this file except in compliance with the License. 18826 * You may obtain a copy of the License at 18827 * 18828 * http://www.apache.org/licenses/LICENSE-2.0 18829 * 18830 * Unless required by applicable law or agreed to in writing, software 18831 * distributed under the License is distributed on an "AS IS" BASIS, 18832 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18833 * See the License for the specific language governing permissions and 18834 * limitations under the License. 18835 * ============================================================================= 18836 */function Ate(n){const{inputs:e,backend:t,attrs:r}=n,{separator:i,nGramWidths:s,leftPad:a,rightPad:o,padWidth:A,preserveShortSequences:l}=r,{data:c,dataSplits:u}=e,h=t.readSync(c.dataId),f=t.readSync(u.dataId),[d,g]=BW(h,f,i,s,a,o,A,l);return[t.makeTensorInfo([d.length],"string",d),t.makeTensorInfo(u.shape,"int32",g)]}const lte={kernelName:kx,backendName:"webgl",kernelFunc:Ate};/** 18837 * @license 18838 * Copyright 2021 Google LLC. All Rights Reserved. 18839 * Licensed under the Apache License, Version 2.0 (the "License"); 18840 * you may not use this file except in compliance with the License. 18841 * You may obtain a copy of the License at 18842 * 18843 * http://www.apache.org/licenses/LICENSE-2.0 18844 * 18845 * Unless required by applicable law or agreed to in writing, software 18846 * distributed under the License is distributed on an "AS IS" BASIS, 18847 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18848 * See the License for the specific language governing permissions and 18849 * limitations under the License. 18850 * ============================================================================= 18851 */function cte(n){const{inputs:e,backend:t,attrs:r}=n,{skipEmpty:i}=r,{input:s,delimiter:a}=e;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const o=t.readSync(s.dataId),A=t.readSync(a.dataId)[0],[l,c,u]=EW(o,A,i),h=c.length;return[t.makeTensorInfo([h,2],"int32",l),t.makeTensorInfo([h],"string",c),t.makeTensorInfo([2],"int32",new Int32Array(u))]}const ute={kernelName:$x,backendName:"webgl",kernelFunc:cte};/** 18852 * @license 18853 * Copyright 2021 Google LLC. All Rights Reserved. 18854 * Licensed under the Apache License, Version 2.0 (the "License"); 18855 * you may not use this file except in compliance with the License. 18856 * You may obtain a copy of the License at 18857 * 18858 * http://www.apache.org/licenses/LICENSE-2.0 18859 * 18860 * Unless required by applicable law or agreed to in writing, software 18861 * distributed under the License is distributed on an "AS IS" BASIS, 18862 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18863 * See the License for the specific language governing permissions and 18864 * limitations under the License. 18865 * ============================================================================= 18866 */function hte(n){const{inputs:e,backend:t,attrs:r}=n,{numBuckets:i}=r,{input:s}=e;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(i<=0)throw new Error("Number of buckets must be at least 1");const a=t.readSync(s.dataId),o=SW(a,i);return t.makeTensorInfo(s.shape,"int32",o)}const fte={kernelName:Qx,backendName:"webgl",kernelFunc:hte};/** 18867 * @license 18868 * Copyright 2020 Google LLC. All Rights Reserved. 18869 * Licensed under the Apache License, Version 2.0 (the "License"); 18870 * you may not use this file except in compliance with the License. 18871 * You may obtain a copy of the License at 18872 * 18873 * http://www.apache.org/licenses/LICENSE-2.0 18874 * 18875 * Unless required by applicable law or agreed to in writing, softw
18875are 18876 * distributed under the License is distributed on an "AS IS" BASIS, 18877 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18878 * See the License for the specific language governing permissions and 18879 * limitations under the License. 18880 * ============================================================================= 18881 */const dte="return tan(x);",pte=vn({opSnippet:dte}),mte={kernelName:Vx,backendName:"webgl",kernelFunc:pte};/** 18882 * @license 18883 * Copyright 2020 Google LLC. All Rights Reserved. 18884 * Licensed under the Apache License, Version 2.0 (the "License"); 18885 * you may not use this file except in compliance with the License. 18886 * You may obtain a copy of the License at 18887 * 18888 * http://www.apache.org/licenses/LICENSE-2.0 18889 * 18890 * Unless required by applicable law or agreed to in writing, software 18891 * distributed under the License is distributed on an "AS IS" BASIS, 18892 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18893 * See the License for the specific language governing permissions and 18894 * limitations under the License. 18895 * ============================================================================= 18896 */const gte=` 18897 float e2x = exp(-2.0 * abs(x)); 18898 return sign(x) * (1.0 - e2x) / (1.0 + e2x); 18899`,yte=vn({opSnippet:gte}),vte={kernelName:Gx,backendName:"webgl",kernelFunc:yte};/** 18900 * @license 18901 * Copyright 2022 Google LLC. All Rights Reserved. 18902 * Licensed under the Apache License, Version 2.0 (the "License"); 18903 * you may not use this file except in compliance with the License. 18904 * You may obtain a copy of the License at 18905 * 18906 * http://www.apache.org/licenses/LICENSE-2.0 18907 * 18908 * Unless required by applicable law or agreed to in writing, software 18909 * distributed under the License is distributed on an "AS IS" BASIS, 18910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18911 * See the License for the specific language governing permissions and 18912 * limitations under the License. 18913 * ============================================================================= 18914 */function wte(n){const{inputs:e,backend:t,attrs:r}=n,{tensor:i,indices:s,updates:a}=e,{sliceRank:o,numUpdates:A,sliceSize:l,strides:c,outputSize:u}=Jf(a,s,i.shape),h=[u/l,l];if(u===0)return t.makeTensorInfo(i.shape,s.dtype);const f=et({inputs:{x:s},backend:t,attrs:{shape:[A,o]}}),d=et({inputs:{x:a},backend:t,attrs:{shape:[A,l]}}),g=et({inputs:{x:i},backend:t,attrs:{shape:h}}),m=new l2(A,o,f.shape.length,d.shape.length,c,h,!1,!0),p=t.runWebGLProgram(m,[d,f,g],g.dtype),w=et({inputs:{x:p},backend:t,attrs:{shape:i.shape}});return t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(g),t.disposeIntermediateTensorInfo(p),w}const xte={kernelName:mx,backendName:"webgl",kernelFunc:wte};/** 18915 * @license 18916 * Copyright 2017 Google LLC. All Rights Reserved. 18917 * Licensed under the Apache License, Version 2.0 (the "License"); 18918 * you may not use this file except in compliance with the License. 18919 * You may obtain a copy of the License at 18920 * 18921 * http://www.apache.org/licenses/LICENSE-2.0 18922 * 18923 * Unless required by applicable law or agreed to in writing, software 18924 * distributed under the License is distributed on an "AS IS" BASIS, 18925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18926 * See the License for the specific language governing permissions and 18927 * limitations under the License. 18928 * ============================================================================= 18929 */class bte{constructor(e,t){this.variableNames=["A"];const r=new Array(e.length);for(let a=0;a<r.length;a++)r[a]=e[a]*t[a];this.outputShape=r,this.rank=r.length;const i=Mn(this.rank),s=Cte(e);this.userCode=` 18930 void main() { 18931 ${i} resRC = getOutputCoords(); 18932 setOutput(getA(${s})); 18933 } 18934 `}}function Cte(n){const e=n.length;if(e>5)throw Error(`Tile for rank ${e} is not yet supported`);if(e===1)return`imod(resRC, ${n[0]})`;const t=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[];for(let i=0;i<n.length;i++)r.push(`imod(${t[i]}, ${n[i]})`);return r.join()}/** 18935 * @license 18936 * Copyright 2020 Google LLC. All Rights Reserved. 18937 * Licensed under the Apache License, Version 2.0 (the "License");
18938 * you may not use this file except in compliance with the License. 18939 * You may obtain a copy of the License at 18940 * 18941 * http://www.apache.org/licenses/LICENSE-2.0 18942 * 18943 * Unless required by applicable law or agreed to in writing, software 18944 * distributed under the License is distributed on an "AS IS" BASIS, 18945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18946 * See the License for the specific language governing permissions and 18947 * limitations under the License. 18948 * ============================================================================= 18949 */function LB(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{reps:s}=r;if(i.dtype==="string"||i.shape.length>5){const A=t.readSync(i.dataId),l=i.dtype==="string"?A.map(h=>Il(h)):A,c=ir(i.shape,i.dtype,l),u=IW(c,s);return t.makeTensorInfo(u.shape,u.dtype,u.values)}const a=new bte(i.shape,s);return t.runWebGLProgram(a,[i],i.dtype)}const _te={kernelName:Sg,backendName:"webgl",kernelFunc:LB};class Bte{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode=` 18950 void main() { 18951 ivec2 coords = getOutputCoords(); 18952 int batch = coords[0]; 18953 int elemIdx = coords[1]; 18954 18955 // We compare elements pair-wise within a group of size 2 * inc. 18956 // The comparing rule for each group alternates between ascending 18957 // and descending. Within each group, we compare each pair at 18958 // positions i and i+inc. To decide whether an element at position i 18959 // is x0 or x1, we mod it by 2 * inc, if the result is smaller than 18960 // inc, it is in the first half of the group, we denote it as x0, 18961 // otherwise we denote it as x1. 18962 // For example, as shown in the Bitonic top K paper referenced above, 18963 // Figure5(a) shows that element[1] is in the 18964 // second half of the group when group size is 2, but it is in the 18965 // first half of the group when group size is 4. 18966 18967 bool isFirstInPair = imod(elemIdx, 2 * inc) < inc; 18968 int i = isFirstInPair ? elemIdx : elemIdx - inc; 18969 18970 int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); 18971 int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc)); 18972 float x0 = i0 < n ? getX(batch, i0) : negativeInf; 18973 float x1 = i1 < n ? getX(batch, i1) : negativeInf; 18974 18975 // Denotes which direction indices are in (ascending or descending). 18976 bool reverse = imod(elemIdx, 2 * dir) >= dir; 18977 bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0); 18978 if (reverse == isGreater) { // Elements in opposite order of direction 18979 int iTemp = i0; 18980 i0 = i1; 18981 i1 = iTemp; 18982 } 18983 if (isFirstInPair) { 18984 setOutput(float(i0)); 18985 } else { 18986 setOutput(float(i1)); 18987 } 18988 } 18989 `}}class Ete{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode=` 18990 void main() { 18991 // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ... 18992 ivec2 coords = getOutputCoords(); 18993 int batch = coords[0]; 18994 int elemIdx = coords[1]; 18995 18996 // The output size is half of the previous size. 18997 // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4), 18998 // we only need to output the indices at positions |, the indices at 18999 // positions _ can be thrown away, see Figure5(b) After Phase 2 19000 // (Merge phase) in the Bitonic Top K paper referenced above. 19001 // For example, the paper shows we only need to output the orange bars. 19002 // The output sequence should look like this | | | | | | | |. 19003 // Because the sequence is halved, to map the output index back 19004 // to the previous sequence to find the corresponding value, 19005 // we need to double the index. When we double the index, 19006 // we basically interpolate a position, so 2i looks like 19007 // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position 19008 // of each 2k positions by - elemIdx % k. E.g. for output at 19009 // index 4,5,6,7, we want to get the corresponding element at 19010 // original index 8,9,10,11, for output at index 8,9,10,11, 19011 // we want to get the corresponding element at original index 19012 // 16,17,18,19, so on and so forth. 19013 19014 int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k)); 19015 int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); 19016 int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k)); 19017 19018 float x0 = getX(batch, i0); 19019 float x1 = i1 < n ? getX(batch, i1) : x0; 19020 19021 setOutput(x0 >= x1 ? float(i0) : float(i1)); 19022 } 19023 `}}/** 19024 * @license 19025 * Copyright 2020 Google LLC. All Rights Reserved. 19026 * Licensed under the Apache License, Version 2.0 (the "License");
19027 * you may not use this file except in compliance with the License. 19028 * You may obtain a copy of the License at 19029 * 19030 * http://www.apache.org/licenses/LICENSE-2.0 19031 * 19032 * Unless required by applicable law or agreed to in writing, software 19033 * distributed under the License is distributed on an "AS IS" BASIS, 19034 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19035 * See the License for the specific language governing permissions and 19036 * limitations under the License. 19037 * ============================================================================= 19038 */function $o(n,e){e!==null&&n.disposeIntermediateTensorInfo(e)}function f4(n){let e=1;for(;e<n;)e*=2;return e}function Ste(n){const{inputs:e,backend:t,attrs:r}=n,{x:i}=e,{k:s,sorted:a}=r,o=pe().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"),A=pe().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"),l=i.shape,c=l[l.length-1];if(t.shouldExecuteOnCPU([i])||c<o||s>A){const R=t.readSync(i.dataId),[V,re]=FW(R,l,i.dtype,s,a);return[t.makeTensorInfo(V.shape,V.dtype,V.values),t.makeTensorInfo(re.shape,re.dtype,re.values)]}if(s===0)return l[l.length-1]=0,[t.makeTensorInfo(l,i.dtype,[]),t.makeTensorInfo(l,"int32",[])];if(c===1)return[i,_u({attrs:{shape:l,dtype:"int32",value:0},backend:t})];const u=t.texData.get(i.dataId),h=u!==null&&u.isPacked,f=h?t.unpackTensor(i):i,g=ze(l)/c,m=et({inputs:{x:f},attrs:{shape:[g,c]},backend:t});h&&$o(t,f);const p=f4(s),w=f4(c);let C=null;const b=()=>C===null?[m,m]:[m,C],U=(R,V,re)=>{const Y=b(),se=new Bte(re),ue=[[c],[C===null?1:0],[Number.NEGATIVE_INFINITY],[R],[V]],Ce=C;C=t.runWebGLProgram(se,Y,"int32",ue),$o(t,Ce)};for(let R=1;R<p;R*=2){const V=R*2;for(let re=R;re>=1;re/=2)U(V,re,[g,w])}for(let R=w;R>p;R/=2){const V=b(),re=new Ete([g,R/2]),se=[[c],[C===null?1:0],[p]],ge=C;C=t.runWebGLProgram(re,V,"int32",se),$o(t,ge);const ue=p/2,Ce=ue*2;for(let ae=ue;ae>=1;ae/=2)U(Ce,ae,C.shape)}let F=C;C=Zl({inputs:{x:C},backend:t,attrs:{begin:0,size:[g,s]}}),$o(t,F);let D=TB({inputs:{x:m,indices:C},backend:t,attrs:{axis:1,batchDims:1}});$o(t,m);const O=l.slice(0,-1);O.push(s),F=C,C=et({inputs:{x:C},attrs:{shape:O},backend:t}),$o(t,F);const I=D;return D=et({inputs:{x:D},attrs:{shape:O},backend:t}),$o(t,I),[D,C]}const Tte={kernelName:zx,backendName:"webgl",kernelFunc:Ste};/** 19039 * @license 19040 * Copyright 2021 Google LLC. All Rights Reserved. 19041 * Licensed under the Apache License, Version 2.0 (the "License"); 19042 * you may not use this file except in compliance with the License. 19043 * You may obtain a copy of the License at 19044 * 19045 * http://www.apache.org/licenses/LICENSE-2.0 19046 * 19047 * Unless required by applicable law or agreed to in writing, software 19048 * distributed under the License is distributed on an "AS IS" BASIS, 19049 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19050 * See the License for the specific language governing permissions and 19051 * limitations under the License. 19052 * ============================================================================= 19053 */class Ite{constructor(e,t,r,i,s,a){this.variableNames=["Image","Transforms"],this.outputShape=a;const o=r==="nearest"?1:2;let A;switch(i){case"constant":A=1;break;case"reflect":A=2;break;case"wrap":A=3;break;case"nearest":A=4;break;default:A=1;break}this.userCode=` 19054 float mapCoord(float outCoord, float len) { 19055 float inCoord = outCoord; 19056 if(${A} == 2) { 19057 if (inCoord < 0.0) { 19058 if (len <= 1.0) { 19059 inCoord = 0.0; 19060 } else { 19061 float sz2 = 2.0 * len; 19062 if (inCoord < sz2) { 19063 inCoord = sz2 * float(int(float(-inCoord / sz2))) + 19064 inCoord; 19065 } 19066 inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0; 19067 } 19068 } else if (inCoord > len - 1.0) { 19069 if (len <= 1.0) { 19070 inCoord = 0.0; 19071 } else { 19072 float sz2 = 2.0 * len; 19073 inCoord -= sz2 * float(int(float(inCoord / sz2))); 19074 if (inCoord >= len) { 19075 inCoord = sz2 - inCoord - 1.0; 19076 } 19077 } 19078 } 19079 return clamp(inCoord, 0.0, len - 1.0); 19080 } else if (${A} == 3) { 19081 if (inCoord < 0.0) { 19082 if (len <= 1.0) { 19083 inCoord = 0.0; 19084 } else { 19085 float sz = len - 1.0; 19086 inCoord += len * (float(int(float(-inCoord / sz))) + 1.0); 19087 } 19088 } else if (inCoord > len - 1.0) { 19089 if (len <= 1.0) { 19090 inCoord = 0.0; 19091 } else { 19092 float sz = len - 1.0; 19093 inCoord -= len * float(int(float(inCoord / sz))); 19094 } 19095 } 19096 return clamp(inCoord, 0.0, len - 1.0); 19097 } else if (${A} == 4) { 19098 return clamp(outCoord, 0.0, len - 1.0); 19099 } else { 19100 return outCoord; 19101 } 19102 } 19103 19104 float readWithFillValue(int batch, int coordY, int coordX, 19105 int channel) { 19106 float outputValue; 19107 if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) { 19108 outputValue = getImage(batch, coordY, coordX, channel); 19109 } else { 19110 outputValue = float(${s}); 19111 } 19112 return outputValue; 19113 } 19114 19115 void main() { 19116 ivec4 coords = getOutputCoords(); 19117 float outputValue; 19118 int batch = coords[0]; 19119 int x = coords[2]; 19120 int y = coords[1]; 19121 int channel = coords[3]; 19122 float xf = float(x); 19123 float yf = float(y); 19124 float a1 = getTransforms(batch, 0); 19125 float a2 = getTransforms(batch, 1); 19126 float a3 = getTransforms(batch, 2); 19127 float b1 = getTransforms(batch, 3); 19128 float b2 = getTransforms(batch, 4); 19129 float b3 = getTransforms(batch, 5); 19130 float c1 = getTransforms(batch, 6); 19131 float c2 = getTransforms(batch, 7); 19132 float projection = c1 * xf + c2 * yf + 1.0; 19133 if (projection == 0.0) { 19134 outputValue = float(${s}); 19135 } else { 19136 float inX = (a1 * xf + a2 * yf + a3) / projection; 19137 float inY = (b1 * xf + b2 * yf + b3) / projection; 19138 float mapX = mapCoord(inX, float(${t})); 19139 float mapY = mapCoord(inY, float(${e})); 19140 19141 if (${o} == 1) {
19142 int coordY = int(round(mapY)); 19143 int coordX = int(round(mapX)); 19144 outputValue = readWithFillValue(batch, coordY, coordX, 19145 channel); 19146 } else { 19147 float yFloor = floor(mapY); 19148 float xFloor = floor(mapX); 19149 float yCeil = yFloor + 1.0; 19150 float xCeil = xFloor + 1.0; 19151 float valueYFloor = (xCeil - mapX) * 19152 readWithFillValue(batch, int(yFloor), int(xFloor), channel) + 19153 (mapX - xFloor) * 19154 readWithFillValue(batch, int(yFloor), int(xCeil), channel); 19155 float valueYCeil = (xCeil - mapX) * 19156 readWithFillValue(batch, int(yCeil), int(xFloor), channel) + 19157 (mapX - xFloor) * 19158 readWithFillValue(batch, int(yCeil), int(xCeil), channel); 19159 outputValue = (yCeil - mapY) * valueYFloor + 19160 (mapY - yFloor) * valueYCeil; 19161 } 19162 } 19163 setOutput(outputValue); 19164 } 19165 `}}/** 19166 * @license 19167 * Copyright 2021 Google LLC. All Rights Reserved. 19168 * Licensed under the Apache License, Version 2.0 (the "License"); 19169 * you may not use this file except in compliance with the License. 19170 * You may obtain a copy of the License at 19171 * 19172 * http://www.apache.org/licenses/LICENSE-2.0 19173 * 19174 * Unless required by applicable law or agreed to in writing, software 19175 * distributed under the License is distributed on an "AS IS" BASIS, 19176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19177 * See the License for the specific language governing permissions and 19178 * limitations under the License. 19179 * ============================================================================= 19180 */function Fte(n){const{inputs:e,backend:t,attrs:r}=n,{image:i,transforms:s}=e,{interpolation:a,fillMode:o,fillValue:A,outputShape:l}=r,[c,u,h,f]=i.shape,[d,g]=l!=null?l:[u,h],m=[c,d,g,f],p=new Ite(u,h,a,o,A,m);return t.runWebGLProgram(p,[i,s],"float32")}const Rte={kernelName:Wx,backendName:"webgl",kernelFunc:Fte};/** 19181 * @license 19182 * Copyright 2020 Google LLC. All Rights Reserved. 19183 * Licensed under the Apache License, Version 2.0 (the License); 19184 * you may not use this file except in compliance with the License. 19185 * You may obtain a copy of the License at 19186 * 19187 * http://www.apache.org/licenses/LICENSE-2.0 19188 * 19189 * Unless required by applicable law or agreed to in writing, software 19190 * distributed under the License is distributed on an AS IS BASIS, 19191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19192 * See the License for the specific language governing permissions and 19193 * limitations under the License. 19194 * ============================================================================= 19195 */function Ute(n){const{inputs:e,attrs:t,backend:r}=n,{axis:i}=t,{x:s}=e;xu(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const a=r.readSync(s.dataId),{outputValues:o,outputShape:A,indices:l}=RW(a,i,s.shape,s.dtype);return[r.makeTensorInfo(A,s.dtype,o),r.makeTensorInfo([l.length],"int32",l)]}const Mte={kernelName:Kx,backendName:"webgl",kernelFunc:Ute};/** 19196 * @license 19197 * Copyright 2020 Google LLC. All Rights Reserved. 19198 * Licensed under the Apache License, Version 2.0 (the "License"); 19199 * you may not use this file except in compliance with the License. 19200 * You may obtain a copy of the License at 19201 * 19202 * http://www.apache.org/licenses/LICENSE-2.0 19203 * 19204 * Unless required by applicable law or agreed to in writing, software 19205 * distributed under the License is distributed on an "AS IS" BASIS, 19206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19207 * See the License for the specific language governing permissions and 19208 * limitations under the License. 19209 * ============================================================================= 19210 */function Nte(n){const{inputs:e,backend:t,attrs:r}=n,{value:i}=e;let{axis:s}=r;s<0&&(s+=i.shape.length);const a=i,o=a.shape.length,A=i.shape[s],l=new Array(o-1);let c=0;for(let g=0;g<o;g++)g!==s&&(l[c++]=a.shape[g]);const u=[],h=new Array(o).fill(0),f=a.shape.slice();f[s]=1;const d=new Array(A);for(let g=0;g<d.length;g++){h[s]=g;const m=Zl({inputs:{x:a},backend:t,attrs:{begin:h,size:f}}),p=et({inputs:{x:m},backend:t,attrs:{shape:l}});d[g]=p,u.push(m)}return u.forEach(g=>t.disposeIntermediateTensorInfo(g)),d}const Dte={kernelName:Xx,backendName:"webgl",kernelFunc:Nte};/** 19211 * @license 19212 * Copyright 2018 Google LLC. All Rights Reserved. 19213 * Licensed under the Apache License, Version 2.0 (the "License");
19214 * you may not use this file except in compliance with the License. 19215 * You may obtain a copy of the License at 19216 * 19217 * http://www.apache.org/licenses/LICENSE-2.0 19218 * 19219 * Unless required by applicable law or agreed to in writing, software 19220 * distributed under the License is distributed on an "AS IS" BASIS, 19221 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19222 * See the License for the specific language governing permissions and 19223 * limitations under the License. 19224 * ============================================================================= 19225 */class Lte{constructor(e,t){this.variableNames=["x","segmentIds"];const r=e.windowSize,i=e.batchSize,s=e.inSize,a=e.numSegments,o=a*Math.ceil(s/r);this.outputShape=[i,o];const A="0.0",l="sumValue",c=Math.floor(r/4)*4,u=r%4,h=` 19226 sumValue += dot(values, segFilter); 19227 `;let f="";s%r>0&&(f=` 19228 if (inIdx < 0 || inIdx >= ${s}) { 19229 return initializationValue; 19230 } 19231 `);let d="";s%r>0&&(d=` 19232 if (inIdx < 0 || inIdx >= ${s}) { 19233 return -1.0; 19234 } 19235 `),this.userCode=` 19236 const float initializationValue = ${A}; 19237 19238 float getValue(int batch, int inIdx) { 19239 ${f} 19240 return getX(batch, inIdx); 19241 } 19242 19243 float getSegmentIdAtIndex(int inIdx) { 19244 ${d} 19245 return getSegmentIds(inIdx); 19246 } 19247 19248 void main() { 19249 ivec2 coords = getOutputCoords(); 19250 int batch = coords[0]; 19251 int outIdx = coords[1]; 19252 int inOffset = int(floor(float(outIdx) / float( 19253 ${a})) * float(${r})); 19254 int currentSeg = int(mod(float(outIdx), float(${a}))); 19255 19256 float sumValue = 0.0; 19257 19258 for (int i = 0; i < ${c}; i += 4) { 19259 int inIdx = inOffset + i; 19260 vec4 values = vec4( 19261 getValue(batch, inIdx), 19262 getValue(batch, inIdx + 1), 19263 getValue(batch, inIdx + 2), 19264 getValue(batch, inIdx + 3) 19265 ); 19266 19267 vec4 segFilter = vec4( 19268 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 19269 int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 19270 int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, 19271 int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 19272 ); 19273 19274 ${h} 19275 } 19276 19277 int inIdx = inOffset + ${c}; 19278 if (${u===1}) { 19279 vec4 values = vec4( 19280 getValue(batch, inIdx), 19281 initializationValue, 19282 initializationValue, 19283 initializationValue 19284 ); 19285 19286 int inIdxSeg = int(getSegmentIdAtIndex(inIdx)); 19287 19288 vec4 segFilter = vec4( 19289 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 19290 0, 19291 0, 19292 0 19293 ); 19294 19295 ${h} 19296 } else if (${u===2}) { 19297 vec4 values = vec4( 19298 getValue(batch, inIdx), 19299 getValue(batch, inIdx + 1), 19300 initializationValue, 19301 initializationValue 19302 ); 19303 19304 vec4 segFilter = vec4( 19305 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 19306 int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 19307 0, 19308 0 19309 ); 19310 19311 ${h} 19312 } else if (${u===3}) { 19313 vec4 values = vec4( 19314 getValue(batch, inIdx), 19315 getValue(batch, inIdx + 1), 19316 getValue(batch, inIdx + 2), 19317 initializationValue 19318 ); 19319 19320 vec4 segFilter = vec4( 19321 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 19322 int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 19323 int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, 19324 0 19325 ); 19326 19327 ${h} 19328 } 19329 setOutput(${l}); 19330 } 19331 `}}/** 19332 * @license 19333 * Copyright 2020 Google LLC. All Rights Reserved. 19334 * Licensed under the Apache License, Version 2.0 (the "License"); 19335 * you may not use this file except in compliance with the License. 19336 * You may obtain a copy of the License at 19337 * 19338 * http://www.apache.org/licenses/LICENSE-2.0 19339 * 19340 * Unless required by applicable law or agreed to in writing, softw
19340are 19341 * distributed under the License is distributed on an "AS IS" BASIS, 19342 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19343 * See the License for the specific language governing permissions and 19344 * limitations under the License. 19345 * ============================================================================= 19346 */function Ote(n){const{inputs:e,backend:t,attrs:r}=n,{x:i,segmentIds:s}=e,{numSegments:a}=r,o=i.shape.length,A=[];let l=0;const c=As([l],o);let u=i;c!=null&&(u=Jr({inputs:{x:i},backend:t,attrs:{perm:c}}),A.push(u),l=ls(1,o)[0]);const h=I_(u.shape,l,a),f=ze([u.shape[l]]),d=et({inputs:{x:u},backend:t,attrs:{shape:[-1,f]}});A.push(d);const g=Ig(i.dtype),m=(b,U,F,D,O)=>{const I=b.shape[0],R=b.shape[1],V=T_(R,O),re={windowSize:V,inSize:R,batchSize:I,numSegments:O},Y=new Lte(re,U),se=t.compileAndRun(Y,[b,F],D);if(A.push(se),se.shape[1]===O)return se;const ge=DB({backend:t,attrs:{start:0,stop:O,step:1,dtype:"float32"}}),ue=LB({inputs:{x:ge},backend:t,attrs:{reps:[R/V]}});return A.push(ge),A.push(ue),m(se,U,ue,D,O)},p=m(d,"unsortedSegmentSum",s,g,a),w=et({inputs:{x:p},backend:t,attrs:{shape:h}});let C=w;if(c!=null){A.push(w);const b=Dg(c);C=Jr({inputs:{x:C},backend:t,attrs:{perm:b}})}return A.forEach(b=>t.disposeIntermediateTensorInfo(b)),C}const Pte={kernelName:jx,backendName:"webgl",kernelFunc:Ote};/** 19347 * @license 19348 * Copyright 2020 Google LLC. All Rights Reserved. 19349 * Licensed under the Apache License, Version 2.0 (the "License"); 19350 * you may not use this file except in compliance with the License. 19351 * You may obtain a copy of the License at 19352 * 19353 * http://www.apache.org/licenses/LICENSE-2.0 19354 * 19355 * Unless required by applicable law or agreed to in writing, software 19356 * distributed under the License is distributed on an "AS IS" BASIS, 19357 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19358 * See the License for the specific language governing permissions and 19359 * limitations under the License. 19360 * ============================================================================= 19361 */const kte=[bK,_K,SK,FK,UK,DK,OK,kK,VK,zK,XK,qK,eX,iX,oX,lX,uX,pX,gX,vX,CX,FX,UX,LX,PX,GX,WX,YX,sK,ZX,ij,Aj,dj,gj,vj,xj,Cj,Sj,Fj,Mj,Dj,Oj,kj,Hj,Gj,Xj,Yj,Zj,nY,iY,AY,hY,mY,vY,bY,CY,BY,SY,IY,RY,MY,OY,$Y,VY,zY,XY,qY,tq,sq,iK,oq,nj,cq,fq,mq,oK,wq,_q,Eq,Fq,Mq,Oq,$q,Gq,Xq,qq,Zq,rJ,sJ,oJ,uJ,fJ,pJ,gJ,vJ,CJ,SJ,RJ,kJ,cK,VJ,WJ,jJ,JJ,$X,tZ,rZ,sZ,AZ,hZ,lK,dZ,mZ,yZ,wZ,xZ,QX,DJ,_Z,TZ,UZ,hK,LZ,kZ,VZ,WZ,YZ,JZ,tee,iee,oee,cee,fee,mee,wee,Cee,See,Fee,TX,OJ,Mee,Dee,Oee,kee,Qee,Vee,zee,Kee,jee,Jee,ete,nte,ite,ote,lte,ute,fte,LJ,vK,mte,vte,xte,_te,Tte,Rte,wK,Mte,Dte,Pte,nZ];for(const n of kte)kM(n);class $te{constructor(e,t="user",r=null,i=1280,s=720){this._webcamElement=e,this._webcamElement.width=this._webcamElement.width||640,this._webcamElement.height=this._webcamElement.height||360,this._resolutionWidth=i,this._resolutionHeight=s,this._facingMode=t,this._webcamList=[],this._streamList=[],this._selectedDeviceId="",this._canvasElement=r}get facingMode(){return this._facingMode}set facingMode(e){this._facingMode=e}get webcamList(){return this._webcamList}get webcamCount(){return this._webcamList.length}get selectedDeviceId(){return this._selectedDeviceId}getVideoInputs(e){return this._webcamList=[],e.forEach(t=>{t.kind==="videoinput"&&this._webcamList.push(t)}),this._webcamList.length==1&&(this._facingMode="user"),this._webcamList}getMediaConstraints(){var e={};this._selectedDeviceId==""?e.facingMode=this._facingMode:e.deviceId={exact:this._selectedDeviceId},e.width={exact:this._resolutionWidth},e.height={exact:this._resolutionHeight};var t={video:e,audio:!1};return t}selectCamera(){for(let e of this._webcamList)if(this._facingMode=="user"&&e.label.toLowerCase().includes("front")||this._facingMode=="environment"&&e.label.toLowerCase().includes("back")){this._selectedDeviceId=e.deviceId;break}}flip(){this._facingMode=this._facingMode=="user"?"environment":"user",this._webcamElement.style.transform="",this.selectCamera()}async start(e=!0){return new Promise((t,r)=>{this.stop(),navigator.mediaDevices.getUserMedia(this.getMediaConstraints()).then(i=>{this._streamList.push(i),this.info().then(s=>{this.selectCamera(),e?this.stream().then(a=>{t(this._facingMode)}).catch(a=>{r(a)}):t(this._selectedDeviceId)}).catch(s=>{r(s)})}).catch(i=>{r(i)})})}async info(){return new Promise((e,t)=>
19361{navigator.mediaDevices.enumerateDevices().then(r=>{this.getVideoInputs(r),e(this._webcamList)}).catch(r=>{t(r)})})}async stream(){return new Promise((e,t)=>{navigator.mediaDevices.getUserMedia(this.getMediaConstraints()).then(r=>{this._streamList.push(r),this._webcamElement.srcObject=r,this._facingMode=="user"&&(this._webcamElement.style.transform="scale(-1,1)"),this._webcamElement.play(),e(this._facingMode)}).catch(r=>{console.log(r),t(r)})})}stop(){this._streamList.forEach(e=>{e.getTracks().forEach(t=>{t.stop()})})}}var OB={name:"ToggleButton",extends:lu,emits:["update:modelValue","change","click","focus","blur"],props:{modelValue:Boolean,onIcon:String,offIcon:String,onLabel:{type:String,default:"Yes"},offLabel:{type:String,default:"No"},iconPos:{type:String,default:"left"},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,data(){return{focused:!1}},mounted(){this.bindOutsideClickListener()},beforeUnmount(){this.unbindOutsideClickListener()},methods:{onClick(n){this.disabled||(this.$emit("update:modelValue",!this.modelValue),this.$emit("change",n),this.$emit("click",n),this.focused=!0)},onFocus(n){this.focused=!0,this.$emit("focus",n)},onBlur(n){this.focused=!1,this.$emit("blur",n)},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=n=>{this.focused&&!this.$refs.container.contains(n.target)&&(this.focused=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)}},computed:{buttonClass(){return["p-button p-togglebutton p-component",{"p-focus":this.focused,"p-button-icon-only":this.hasIcon&&!this.hasLabel,"p-disabled":this.disabled,"p-highlight":this.modelValue===!0}]},iconClass(){return[this.modelValue?this.onIcon:this.offIcon,"p-button-icon",{"p-button-icon-left":this.iconPos==="left"&&this.label,"p-button-icon-right":this.iconPos==="right"&&this.label}]},hasLabel(){return this.onLabel&&this.onLabel.length>0&&this.offLabel&&this.offLabel.length>0},hasIcon(){return this.$slots.icon||this.onIcon&&this.offIcon},label(){return this.hasLabel?this.modelValue?this.onLabel:this.offLabel:" "}},directives:{ripple:Pf}};const Qte=["id","checked","value","aria-labelledby","aria-label"];function Hte(n,e,t,r,i,s){const a=Au("ripple");return aA((jt(),Hn("div",bn({ref:"container",class:s.buttonClass,onClick:e[2]||(e[2]=o=>s.onClick(o))},n.ptm("root")),[Sn("span",bn({class:"p-hidden-accessible"},n.ptm("hiddenInputWrapper")),[Sn("input",bn({id:t.inputId,type:"checkbox",role:"switch",class:t.inputClass,style:t.inputStyle,checked:t.modelValue,value:t.modelValue,"aria-labelledby":n.ariaLabelledby,"aria-label":n.ariaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},{...t.inputProps,...n.ptm("hiddenInput")}),null,16,Qte)],16),WE(n.$slots,"icon",{value:t.modelValue,class:Oh(s.iconClass)},()=>[t.onIcon||t.offIcon?(jt(),Hn("span",bn({key:0,class:s.iconClass},n.ptm("icon")),null,16)):tr("",!0)]),Sn("span",bn({class:"p-button-label"},n.ptm("label")),dy(s.label),17)],16)),[[a]])}OB.render=Hte;/*! 19362 * html2canvas 1.4.1 <https://html2canvas.hertzen.com> 19363 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com> 19364 * Released under MIT License 19365 *//*! ***************************************************************************** 19366Copyright (c) Microsoft Corporation. 19367 19368Permission to use, copy, modify, and/or distribute this software for any 19369purpose with or without fee is hereby granted. 19370 19371THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 19372REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 19373AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 19374INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 19375LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 19376OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 19377PERFORMANCE OF THIS SOFTWARE. 19378***************************************************************************** */var R1=function(n,e){return R1=Object.
vendor: 6,087 bytes, line 19378
19378setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},R1(n,e)};function Ns(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");R1(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var U1=function(){return U1=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},U1.apply(this,arguments)};function ai(n,e,t,r){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(r.next(c))}catch(u){a(u)}}function A(c){try{l(r.throw(c))}catch(u){a(u)}}function l(c){c.done?s(c.value):i(c.value).then(o,A)}l((r=r.apply(n,e||[])).next())})}function Kr(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(c){return A([l,c])}}function A(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(c){l=[6,c],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function fh(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||e)}var Ra=function(){function n(e,t,r,i){this.left=e,this.top=t,this.width=r,this.height=i}return n.prototype.add=function(e,t,r,i){return new n(this.left+e,this.top+t,this.width+r,this.height+i)},n.fromClientRect=function(e,t){return new n(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},n.fromDOMRectList=function(e,t){var r=Array.from(t).find(function(i){return i.width!==0});return r?new n(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):n.EMPTY},n.EMPTY=new n(0,0,0,0),n}(),ld=function(n,e){return Ra.fromClientRect(n,e.getBoundingClientRect())},Vte=function(n){var e=n.body,t=n.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),i=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new Ra(0,0,r,i)},cd=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var s=n.charCodeAt(t++);(s&64512)===56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},fr=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,s="";++i<t;){var a=n[i];a<=65535?r.push(a):(a-=65536,r.push((a>>10)+55296,a%1024+56320)),(i+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},d4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gte=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var dh=0;dh<d4.length;dh++)Gte[d4.charCodeAt(dh)]=dh;var p4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cc=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ph=0;ph<p4.length;ph++)Cc[p4.charCodeAt(ph)]=ph;var zte=function(n){var e=n.length*.75,t=n.length,r,i=0,s,a,o,A;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),c=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<t;r+=4)s=Cc[n.charCodeAt(r)],a=Cc[n.charCodeAt(r+1)],o=Cc[n.charCodeAt(r+2)],A=Cc[n.charCodeAt(r+3)],c[i++]=s<<2|a>>4,c[i++]=(a&15)<<4|o>>2,c[i++]=(o&3)<<6|A&63;return l},Wte=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},Kte=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},iA=5,c2=6+5,Bp=2,Xte=c2-iA,PB=65536>>iA,jte=1<<iA,Ep=jte-1,Yte=1024>>iA,qte=PB+Yte,Jte=qte,Zte=32,ene=Jte+Zte,tne=65536>>c2,nne=1<<Xte,rne=nne-1,m4=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},ine=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},sne=function(n,e){var t=zte(n),r=Array.isArray(t)?Kte(t):new Uint32Array(t),i=Array.isArray(t)?Wte(t):new Uint16Array(t),s=24,a=m4(i,s/2,r[4]/2),o=r[5]===2?m4(i,(s+r[4])/2):ine(r,Math.ceil((s+r[4])/4));return new ane(r[0],r[1],r[2],r[3],a,o)},ane=function(){function n(e,t,r,i,s,a){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=s,this.data=a}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>iA],t=(t<<Bp)+(e&Ep),this.data[t];if(e<=65535)return t=this.index[PB+(e-55296>>iA)],t=(t<<Bp)+(e&Ep),this.data[t];if(e<this.highStart)return t=ene-tne+(e>>c2),t=this.index[t],t+=e>>iA&rne,t=this.index[t],t=(t<<Bp)+(e&Ep),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),g4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",one=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var mh=0;mh<g4.length;mh++)one[g4.charCodeAt(mh)]=mh;var Ane=
vendor: 52,891 bytes, line 19378
19378"KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",
vendor: 3,535 bytes, line 19378
19378y4=50,lne=1,kB=2,$B=3,cne=4,une=5,v4=7,QB=8,w4=9,ao=10,M1=11,x4=12,N1=13,hne=14,_c=15,D1=16,gh=17,fc=18,fne=19,b4=20,L1=21,dc=22,Sp=23,KA=24,Ui=25,Bc=26,Ec=27,XA=28,dne=29,Yo=30,pne=31,yh=32,vh=33,O1=34,P1=35,k1=36,su=37,$1=38,qh=39,Jh=40,Tp=41,HB=42,mne=43,gne=[9001,65288],VB="!",gn="\xD7",wh="\xF7",Q1=sne(Ane),ua=[Yo,k1],H1=[lne,kB,$B,une],GB=[ao,QB],C4=[Ec,Bc],yne=H1.concat(GB),_4=[$1,qh,Jh,O1,P1],vne=[_c,N1],wne=function(n,e){e===void 0&&(e="strict");var t=[],r=[],i=[];return n.forEach(function(s,a){var o=Q1.get(s);if(o>y4?(i.push(!0),o-=y4):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return r.push(a),t.push(D1);if(o===cne||o===M1){if(a===0)return r.push(a),t.push(Yo);var A=t[a-1];return yne.indexOf(A)===-1?(r.push(r[a-1]),t.push(A)):(r.push(a),t.push(Yo))}if(r.push(a),o===pne)return t.push(e==="strict"?L1:su);if(o===HB||o===dne)return t.push(Yo);if(o===mne)return s>=131072&&s<=196605||s>=196608&&s<=262141?t.push(su):t.push(Yo);t.push(o)}),[r,t,i]},Ip=function(n,e,t,r){var i=r[t];if(Array.isArray(n)?n.indexOf(i)!==-1:n===i)for(var s=t;s<=r.length;){s++;var a=r[s];if(a===e)return!0;if(a!==ao)break}if(i===ao)for(var s=t;s>0;){s--;var o=r[s];if(Array.isArray(n)?n.indexOf(o)!==-1:n===o)for(var A=t;A<=r.length;){A++;var a=r[A];if(a===e)return!0;if(a!==ao)break}if(o!==ao)break}return!1},B4=function(n,e){for(var t=n;t>=0;){var r=e[t];if(r===ao)t--;else return r}return 0},xne=function(n,e,t,r,i){if(t[r]===0)return gn;var s=r-1;if(Array.isArray(i)&&i[s]===!0)return gn;var a=s-1,o=s+1,A=e[s],l=a>=0?e[a]:0,c=e[o];if(A===kB&&c===$B)return gn;if(H1.indexOf(A)!==-1)return VB;if(H1.indexOf(c)!==-1||GB.indexOf(c)!==-1)return gn;if(B4(s,e)===QB)return wh;if(Q1.get(n[s])===M1||(A===yh||A===vh)&&Q1.get(n[o])===M1||A===v4||c===v4||A===w4||[ao,N1,_c].indexOf(A)===-1&&c===w4||[gh,fc,fne,KA,XA].indexOf(c)!==-1||B4(s,e)===dc||Ip(Sp,dc,s,e)||Ip([gh,fc],L1,s,e)||Ip(x4,x4,s,e))return gn;if(A===ao)return wh;if(A===Sp||c===Sp)return gn;if(c===D1||A===D1)return wh;if([N1,_c,L1].indexOf(c)!==-1||A===hne||l===k1&&vne.indexOf(A)!==-1||A===XA&&c===k1||c===b4||ua.indexOf(c)!==-1&&A===Ui||ua.indexOf(A)!==-1&&c===Ui||A===Ec&&[su,yh,vh].indexOf(c)!==-1||[su,yh,vh].indexOf(A)!==-1&&c===Bc||ua.indexOf(A)!==-1&&C4.indexOf(c)!==-1||C4.indexOf(A)!==-1&&ua.indexOf(c)!==-1||[Ec,Bc].indexOf(A)!==-1&&(c===Ui||[dc,_c].indexOf(c)!==-1&&e[o+1]===Ui)||[dc,_c].indexOf(A)!==-1&&c===Ui||A===Ui&&[Ui,XA,KA].indexOf(c)!==-1)return gn;if([Ui,XA,KA,gh,fc].indexOf(c)!==-1)for(var u=s;u>=0;){var h=e[u];if(h===Ui)return gn;if([XA,KA].indexOf(h)!==-1)u--;else break}if([Ec,Bc].indexOf(c)!==-1)for(var u=[gh,fc].indexOf(A)!==-1?a:s;u>=0;){var h=e[u];if(h===Ui)return gn;if([XA,KA].indexOf(h)!==-1)u--;else break}if($1===A&&[$1,qh,O1,P1].indexOf(c)!==-1||[qh,O1].indexOf(A)!==-1&&[qh,Jh].indexOf(c)!==-1||[Jh,P1].indexOf(A)!==-1&&c===Jh||_4.indexOf(A)!==-1&&[b4,Bc].indexOf(c)!==-1||_4.indexOf(c)!==-1&&A===Ec||ua.indexOf(A)!==-1&&ua.indexOf(c)!==-1||A===KA&&ua.indexOf(c)!==-1||ua.concat(Ui).indexOf(A)!==-1&&c===dc&&gne.indexOf(n[o])===-1||ua.concat(Ui).indexOf(c)!==-1&&A===fc)return gn;if(A===Tp&&c===Tp){for(var f=t[s],d=1;f>0&&(f--,e[f]===Tp);)d++;if(d%2!==0)return gn}return A===yh&&c===vh?gn:wh},bne=function(n,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=wne(n,e.lineBreak),r=t[0],i=t[1],s=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(o){return[Ui,Yo,HB].indexOf(o)!==-1?su:o}));var a=e.wordBreak==="keep-all"?s.map(function(o,A){return o&&n[A]>
vendor: 11,666 bytes, line 19378
19378=19968&&n[A]<=40959}):void 0;return[r,i,a]},Cne=function(){function n(e,t,r,i){this.codePoints=e,this.required=t===VB,this.start=r,this.end=i}return n.prototype.slice=function(){return fr.apply(void 0,this.codePoints.slice(this.start,this.end))},n}(),_ne=function(n,e){var t=cd(n),r=bne(t,e),i=r[0],s=r[1],a=r[2],o=t.length,A=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var c=gn;l<o&&(c=xne(t,s,i,++l,a))===gn;);if(c!==gn||l===o){var u=new Cne(t,c,A,l);return A=l,{value:u,done:!1}}return{done:!0,value:null}}}},Bne=1<<0,Ene=1<<1,Bu=1<<2,E4=1<<3,Tf=10,S4=47,Dc=92,Sne=9,Tne=32,xh=34,pc=61,Ine=35,Fne=36,Rne=37,bh=39,Ch=40,mc=41,Une=95,bi=45,Mne=33,Nne=60,Dne=62,Lne=64,One=91,Pne=93,kne=61,$ne=123,_h=63,Qne=125,T4=124,Hne=126,Vne=128,I4=65533,Fp=42,tA=43,Gne=44,zne=58,Wne=59,au=46,Kne=0,Xne=8,jne=11,Yne=14,qne=31,Jne=127,Ps=-1,zB=48,WB=97,KB=101,Zne=102,ere=117,tre=122,XB=65,jB=69,YB=70,nre=85,rre=90,jr=function(n){return n>=zB&&n<=57},ire=function(n){return n>=55296&&n<=57343},jA=function(n){return jr(n)||n>=XB&&n<=YB||n>=WB&&n<=Zne},sre=function(n){return n>=WB&&n<=tre},are=function(n){return n>=XB&&n<=rre},ore=function(n){return sre(n)||are(n)},Are=function(n){return n>=Vne},Bh=function(n){return n===Tf||n===Sne||n===Tne},If=function(n){return ore(n)||Are(n)||n===Une},F4=function(n){return If(n)||jr(n)||n===bi},lre=function(n){return n>=Kne&&n<=Xne||n===jne||n>=Yne&&n<=qne||n===Jne},Za=function(n,e){return n!==Dc?!1:e!==Tf},Eh=function(n,e,t){return n===bi?If(e)||Za(e,t):If(n)?!0:!!(n===Dc&&Za(n,e))},Rp=function(n,e,t){return n===tA||n===bi?jr(e)?!0:e===au&&jr(t):jr(n===au?e:n)},cre=function(n){var e=0,t=1;(n[e]===tA||n[e]===bi)&&(n[e]===bi&&(t=-1),e++);for(var r=[];jr(n[e]);)r.push(n[e++]);var i=r.length?parseInt(fr.apply(void 0,r),10):0;n[e]===au&&e++;for(var s=[];jr(n[e]);)s.push(n[e++]);var a=s.length,o=a?parseInt(fr.apply(void 0,s),10):0;(n[e]===jB||n[e]===KB)&&e++;var A=1;(n[e]===tA||n[e]===bi)&&(n[e]===bi&&(A=-1),e++);for(var l=[];jr(n[e]);)l.push(n[e++]);var c=l.length?parseInt(fr.apply(void 0,l),10):0;return t*(i+o*Math.pow(10,-a))*Math.pow(10,A*c)},ure={type:2},hre={type:3},fre={type:4},dre={type:13},pre={type:8},mre={type:21},gre={type:9},yre={type:10},vre={type:11},wre={type:12},xre={type:14},Sh={type:23},bre={type:1},Cre={type:25},_re={type:24},Bre={type:26},Ere={type:27},Sre={type:28},Tre={type:29},Ire={type:31},V1={type:32},qB=function(){function n(){this._value=[]}return n.prototype.write=function(e){this._value=this._value.concat(cd(e))},n.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==V1;)e.push(t),t=this.consumeToken();return e},n.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case xh:return this.consumeStringToken(xh);case Ine:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(F4(t)||Za(r,i)){var s=Eh(t,r,i)?Ene:Bne,a=this.consumeName();return{type:5,value:a,flags:s}}break;case Fne:if(this.peekCodePoint(0)===pc)return this.consumeCodePoint(),dre;break;case bh:return this.consumeStringToken(bh);case Ch:return ure;case mc:return hre;case Fp:if(this.peekCodePoint(0)===pc)return this.consumeCodePoint(),xre;break;case tA:if(Rp(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Gne:return fre;case bi:var o=e,A=this.peekCodePoint(0),l=this.peekCodePoint(1);if(Rp(o,A,l))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(Eh(o,A,l))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(A===bi&&l===Dne)return this.consumeCodePoint(),this.consumeCodePoint(),_re;break;case au:if(Rp(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case S4:if(this.peekCodePoint(0)===Fp)for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(c===Fp&&(c=this.consumeCodePoint(),c===S4))return this.consumeToken();if(c===Ps)return this.consumeToken()}break;case zne:return Bre;case Wne:return Ere;case Nne:if(this.peekCodePoint(0)===Mne&&this.peekCodePoint(1)===bi&&this.peekCodePoint(2)===bi)return this.consumeCodePoint(),this.consumeCodePoint(),Cre;break;case Lne:var u=this.peekCodePoint(0),h=this.peekCodePoint(1),f=this.peekCodePoint(2);if(Eh(u,h,f)){var a=this.consumeName();return{type:7,value:a}}break;case One:return Sre;case Dc:if(Za(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case Pne:return Tre;case kne:if(this.peekCodePoint(0)===pc)return this.consumeCodePoint(),pre;break;case $ne:return vre;case Qne:return wre;case ere:case nre:var d=this.peekCodePoint(0),g=this.peekCodePoint(1);return d===tA&&(jA(g)||g===_h)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case T4:if(this.peekCodePoint(0)===pc)return this.consumeCodePoint(),gre;if(this.peekCodePoint(0)===T4)return this.consumeCodePoint(),mre;break;case Hne:if(this.peekCodePoint(0)===pc)return this.consumeCodePoint(),yre;break;case Ps:return V1}return Bh(e)?(this.consumeWhiteSpace(),Ire):jr(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):If(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:fr(e)}},n.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},n.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},n.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},n.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();jA(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;t===_h&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r){var i=parseInt(fr.apply(void 0,e.map(function(A){return A===_h?zB:A})),16),s=parseInt(fr.apply(void 0,e.map(function(A){return A===_h?YB:A})),16);return{type:30,start:i,end:s}}var a=parseInt(fr.apply(void 0,e),16);if(this.peekCodePoint(0)===bi&&jA(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];jA(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var s=parseInt(fr.apply(void 0,o),16);return{type:30,start:a,end:s}}else return{type:30,start:a,end:a}},n.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===Ch?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Ch?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},n.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ps)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===bh||t===xh){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ps||this.peekCodePoint(0)===mc)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Sh)}for(;;){var i=this.consumeCodePoint();if(i===Ps||i===mc)return{type:22,value:fr.apply(void 0,e)};if(Bh(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Ps||this.peekCodePoint(0)===mc?(this.consumeCodePoint(),{type:22,value:fr.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Sh);if(i===xh||i===bh||i===Ch||lre(i))return this.consumeBadUrlRemnants(),Sh;if(i===Dc)if(Za(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Sh;else e.push(i)}},n.prototype.consumeWhiteSpace=function(){for(;Bh(this.peekCodePoint(0));)this.consumeCodePoint()},n.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===mc||e===Ps)return;Za(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},n.prototype.consumeStringSlice=function(e){for(var t=5e4,r="";e>0;){var i=Math.min(t,e);r+=fr.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),r},n.prototype.consumeStringToken=function(e){var t="",r=0;do{var i=this._value[r];if(i===Ps||i===void 0||i===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(i===Tf)return this._value.splice(0,r),bre;if(i===Dc){var s=this._value[r+1];s!==Ps&&s!==void 0&&(s===Tf?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):Za(i,s)&&(t+=this.consumeStringSlice(r),t+=fr(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},n.prototype.consumeNumber=function(){var e=[],t=Bu,r=this.peekCodePoint(0);for((r===tA||r===bi)&&e.push(this.consumeCodePoint());jr(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===au&&jr(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=E4;jr(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((r===jB||r===KB)&&((i===tA||i===bi)&&jr(s)||jr(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=E4;jr(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[cre(e),t]},n.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],i=this.peekCodePoint(0),s=this.peekCodePoint(1),a=this.peekCodePoint(2);if(Eh(i,s,a)){var o=this.consumeName();return{type:15,number:t,flags:r,unit:o}}return i===Rne?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},n.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(jA(e)){for(var t=fr(e);jA(this.peekCodePoint(0))&&t.length<6;)t+=fr(this.consumeCodePoint());Bh(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||ire(r)||r>1114111?I4:r}return e===Ps?I4:e},n.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(F4(t))e+=fr(t);else if(Za(t,this.peekCodePoint(0)))e+=fr(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},n}(),JB=function(){function n(e){this._tokens=e}return n.create=function(e){var t=new qB;return t.write(e),new n(t.read())},n.parseValue=function(e){return n.create(e).parseComponentValue()},n.parseValues=function(e){return n.create(e).parseComponentValues()},n.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},n.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},n.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},n.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(r.type===32||Rre(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},n.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},n.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?V1:e},n.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},n}(),Eu=function(n){return n.type===15},ec=function(n){return n.type===17},On=function(n){return n.type===20},Fre=function(n){return n.type===0},G1=function(n,e){return On(n)&&n.value===e},ZB=function(n){return n.type!==31},Ll=function(n){return n.type!==31&&n.type!==4},ea=function(n){var e=[],t=[];
vendor: 14,454 bytes, line 19378
19378return n.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},Rre=function(n,e){return e===11&&n.type===12||e===28&&n.type===29?!0:e===2&&n.type===3},_o=function(n){return n.type===17||n.type===15},pr=function(n){return n.type===16||_o(n)},eE=function(n){return n.length>1?[n[0],n[1]]:[n[0]]},Hr={type:17,number:0,flags:Bu},u2={type:16,number:50,flags:Bu},oo={type:16,number:100,flags:Bu},Sc=function(n,e,t){var r=n[0],i=n[1];return[Gn(r,e),Gn(typeof i<"u"?i:r,t)]},Gn=function(n,e){if(n.type===16)return n.number/100*e;if(Eu(n))switch(n.unit){case"rem":case"em":return 16*n.number;case"px":default:return n.number}return n.number},tE="deg",nE="grad",rE="rad",iE="turn",ud={name:"angle",parse:function(n,e){if(e.type===15)switch(e.unit){case tE:return Math.PI*e.number/180;case nE:return Math.PI/200*e.number;case rE:return e.number;case iE:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},sE=function(n){return n.type===15&&(n.unit===tE||n.unit===nE||n.unit===rE||n.unit===iE)},aE=function(n){var e=n.filter(On).map(function(t){return t.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Hr,Hr];case"to top":case"bottom":return is(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Hr,oo];case"to right":case"left":return is(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[oo,oo];case"to bottom":case"top":return is(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[oo,Hr];case"to left":case"right":return is(270)}return 0},is=function(n){return Math.PI*n/180},mo={name:"color",parse:function(n,e){if(e.type===18){var t=Ure[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(n,e.values)}if(e.type===5){if(e.value.length===3){var r=e.value.substring(0,1),i=e.value.substring(1,2),s=e.value.substring(2,3);return Ao(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(e.value.length===4){var r=e.value.substring(0,1),i=e.value.substring(1,2),s=e.value.substring(2,3),a=e.value.substring(3,4);return Ao(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(a+a,16)/255)}if(e.value.length===6){var r=e.value.substring(0,2),i=e.value.substring(2,4),s=e.value.substring(4,6);return Ao(parseInt(r,16),parseInt(i,16),parseInt(s,16),1)}if(e.value.length===8){var r=e.value.substring(0,2),i=e.value.substring(2,4),s=e.value.substring(4,6),a=e.value.substring(6,8);return Ao(parseInt(r,16),parseInt(i,16),parseInt(s,16),parseInt(a,16)/255)}}if(e.type===20){var o=Ca[e.value.toUpperCase()];if(typeof o<"u")return o}return Ca.TRANSPARENT}},go=function(n){return(255&n)===0},Ir=function(n){var e=255&n,t=255&n>>8,r=255&n>>16,i=255&n>>24;return e<255?"rgba("+i+","+r+","+t+","+e/255+")":"rgb("+i+","+r+","+t+")"},Ao=function(n,e,t,r){return(n<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0},R4=function(n,e){if(n.type===17)return n.number;if(n.type===16){var t=e===3?1:255;return e===3?n.number/100*t:Math.round(n.number/100*t)}return 0},U4=function(n,e){var t=e.filter(Ll);if(t.length===3){var r=t.map(R4),i=r[0],s=r[1],a=r[2];return Ao(i,s,a,1)}if(t.length===4){var o=t.map(R4),i=o[0],s=o[1],a=o[2],A=o[3];return Ao(i,s,a,A)}return 0};function Up(n,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-n)*t*6+n:t<1/2?e:t<2/3?(e-n)*6*(2/3-t)+n:n}var M4=function(n,e){var t=e.filter(Ll),r=t[0],i=t[1],s=t[2],a=t[3],o=(r.type===17?is(r.number):ud.parse(n,r))/(Math.PI*2),A=pr(i)?i.number/100:0,l=pr(s)?s.number/100:0,c=typeof a<"u"&&pr(a)?Gn(a,1):1;if(A===0)return Ao(l*255,l*255,l*255,1);var u=l<=.5?l*(A+1):l+A-l*A,h=l*2-u,f=Up(h,u,o+1/3),d=Up(h,u,o),g=Up(h,u,o-1/3);return Ao(f*255,d*255,g*255,c)},Ure={hsl:M4,hsla:M4,rgb:U4,rgba:U4},Lc=function(n,e){return mo.parse(n,JB.create(e).parseComponentValue())},Ca={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Mre={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(On(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Nre={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},hd=function(n,e){var t=mo.parse(n,e[0]),r=e[1];return r&&pr(r)?{color:t,stop:r}:{color:t,stop:null}},N4=function(n,e){var t=n[0],r=n[n.length-1];t.stop===null&&(t.stop=Hr),r.stop===null&&(r.stop=oo);for(var i=[],s=0,a=0;a<n.length;a++){var o=n[a].stop;if(o!==null){var A=Gn(o,e);A>s?i.push(A):i.push(s),s=A}else i.push(null)}for(var l=null,a=0;a<i.length;a++){var c=i[a];if(c===null)l===null&&(l=a);else if(l!==null){for(var u=a-l,h=i[l-1],f=(c-h)/(u+1),d=1;d<=u;d++)i[l+d-1]=f*d;l=null}}return n.map(function(g,m){var p=g.color;return{color:p,stop:Math.max(Math.min(1,i[m]/e),0)}})},Dre=function(n,e,t){var r=e/2,i=t/2,s=Gn(n[0],e)-r,a=i-Gn(n[1],t);return(Math.atan2(a,s)+Math.PI*2)%(Math.PI*2)},Lre=function(n,e,t){var r=typeof n=="number"?n:Dre(n,e,t),i=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),s=e/2,a=t/2,o=i/2,A=Math.sin(r-Math.PI/2)*o,l=Math.cos(r-Math.PI/2)*o;return[i,s-l,s+l,a-A,a+A]},ms=function(n,e){return Math.sqrt(n*n+e*e)},D4=function(n,e,t,r,i){var s=[[0,0],[0,e],[n,0],[n,e]];return s.reduce(function(a,o){var A=o[0],l=o[1],c=ms(t-A,r-l);return(i?c<a.optimumDistance:c>a.optimumDistance)?{optimumCorner:o,optimumDistance:c}:a},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Ore=function(n,e,t,r,i){var s=0,a=0;switch(n.size){case 0:n.shape===0?s=a=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(s=Math.min(Math.abs(e),Math.abs(e-r)),a=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(n.shape===0)s=a=Math.min(ms(e,t),ms(e,t-i),ms(e-r,t),ms(e-r,t-i));else if(n.shape===1){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-r)),A=D4(r,i,e,t,!0),l=A[0],c=A[1];s=ms(l-e,(c-t)/o),a=o*s}break;case 1:n.shape===0?s=a=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(s=Math.max(Math.abs(e),Math.abs(e-r)),a=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(n.shape===0)s=a=Math.max(ms(e,t),ms(e,t-i),ms(e-r,t),ms(e-r,t-i));else if(n.shape===1){var o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-r)),u=D4(r,i,e,t,!1),l=u[0],c=u[1];s=ms(l-e,(c-t)/o),a=o*s}break}return Array.isArray(n.size)&&(s=Gn(n.size[0],r),a=n.size.length===2?Gn(n.size[1],i):s),[s,a]},Pre=function(n,e){var t=is(180),r=[];return ea(e).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&a.value==="to"){t=aE(i);return}else if(sE(a)){t=ud.parse(n,a);return}}var o=hd(n,i);r.push(o)}),{angle:t,stops:r,type:1}},Th=function(n,e){var t=is(180),r=[];return ea(e).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){t=aE(i);return}else if(sE(a)){t=(ud.parse(n,a)+is(270))%is(360);return}}var o=hd(n,i);r.push(o)}),{angle:t,stops:r,type:1}},kre=function(n,e){var t=is(180),r=[],i=1,s=0,a=3,o=[];return ea(e).forEach(function(A,l){var c=A[0];if(l===0){if(On(c)&&c.value==="linear"){i=1;return}else if(On(c)&&c.value==="radial"){i=2;return}}if(c.type===18){if(c.name==="from"){var u=mo.parse(n,c.values[0]);r.push({stop:Hr,color:u})}else if(c.name==="to"){var u=mo.parse(n,c.values[0]);r.push({stop:oo,color:u})}else if(c.name==="color-stop"){var h=c.values.filter(Ll);if(h.length===2){var u=mo.parse(n,h[1]),f=h[0];ec(f)&&r.push({stop:{type:16,number:f.number*100,flags:f.flags},color:u})}}}}),i===1?{angle:(t+is(180))%is(360),stops:r,type:i}:{size:a,shape:s,stops:r,position:o,type:i}},oE="closest-side",AE="farthest-side",lE="closest-corner",cE="farthest-corner",uE="circle",hE="ellipse",fE="cover",dE="contain",$re=function(n,e){var t=0,r=3,i=[],s=[];return ea(e).forEach(function(a,o){var A=!0;if(o===0){var l=!1;A=a.reduce(function(u,h){if(l)if(On(h))switch(h.value){case"center":return s.push(u2),u;case"top":case"left":return s.push(Hr),u;case"right":case"bottom":return s.push(oo),u}else(pr(h)||_o(h))&&s.push(h);else if(On(h))switch(h.value){case uE:return t=0,!1;case hE:return t=1,!1;case"at":return l=!0,!1;case oE:return r=0,!1;case fE:case AE:return r=1,!1;case dE:case lE:return r=2,!1;case cE:return r=3,!1}else if(_o(h)||pr(h))return Array.isArray(r)||(r=[]),r.push(h),!1;return u},A)}if(A){var c=hd(n,a);i.push(c)}}),{size:r,shape:t,stops:i,position:s,type:2}},Ih=function(n,e){var t=0,r=3,i=[],s=[];return ea(e).forEach(function(a,o){var A=!0;if(o===0?A=a.reduce(function(c,u){if(On(u))switch(u.value){case"center":return s.push(u2),!1;case"top":case"left":return s.push(Hr),!1;case"right":case"bottom":return s.push(oo),!1}else if(pr(u)||_o(u))return s.push(u),!1;return c},A):o===1&&(A=a.reduce(function(c,u){if(On(u))switch(u.value){case uE:return t=0,!1;case hE:return t=1,!1;case dE:case oE:return r=0,!1;case AE:return r=1,!1;case lE:return r=2,!1;case fE:case cE:return r=3,!1}else if(_o(u)||pr(u))return Array.isArray(r)||(r=[]),r.push(u),!1;return c},A)),A){var l=hd(n,a);i.push(l)}}),{size:r,shape:t,stops:i,position:s,type:2}},Qre=function(n){return n.type===1},Hre=function(n){return n.type===2},h2={name:"image",parse:function(n,e){if(e.type===22){var t={url:e.value,type:0};return n.cache.addImage(e.value),t}if(e.type===18){var r=pE[e.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(n,e.values)}throw new Error("Unsupported image type "+e.type)}};function Vre(n){return!(n.type===20&&n.value==="none")&&(n.type!==18||!!pE[n.name])}var pE={"linear-gradient":Pre,"-moz-linear-gradient":Th,"-ms-linear-gradient":Th,"-o-linear-gradient":Th,"-webkit-linear-gradient":Th,"radial-gradient":$re,"-moz-radial-gradient":Ih,"-ms-radial-gradient":Ih,"-o-radial-gradient":Ih,"-webkit-radial-gradient":Ih,"-webkit-gradient":kre},Gre={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(function(r){return Ll(r)&&Vre(r)}).map(function(r){return h2.parse(n,r)})}},zre={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(On(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Wre={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(n,e){return ea(e).map(function(t){return t.filter(pr)}).map(eE)}},Kre={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(n,e){return ea(e).map(function(t){return t.filter(On).map(function(r){return r.value}).join(" ")}).map(Xre)}},Xre=function(n){switch(n){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},gl;(function(n){n.AUTO="auto",n.CONTAIN="contain",n.COVER="cover"})(gl||(gl={}));var jre={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(n,e){return ea(e).map(function(t){return t.filter(Yre)})}},Yre=function(n){return On(n)||pr(n)},fd=function(n){return{name:"border-"+n+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},qre=fd("top"),Jre=fd("right"),Zre=fd("bottom"),eie=fd("left"),dd=function(n){return{name:"border-radius-"+n,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return eE(t.filter(pr))}}}
vendor: 16,774 bytes, line 19378
19378,tie=dd("top-left"),nie=dd("top-right"),rie=dd("bottom-right"),iie=dd("bottom-left"),pd=function(n){return{name:"border-"+n+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},sie=pd("top"),aie=pd("right"),oie=pd("bottom"),Aie=pd("left"),md=function(n){return{name:"border-"+n+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Eu(t)?t.number:0}}},lie=md("top"),cie=md("right"),uie=md("bottom"),hie=md("left"),fie={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},die={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(n,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},pie={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(n,e){return e.filter(On).reduce(function(t,r){return t|mie(r.value)},0)}},mie=function(n){switch(n){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},gie={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},yie={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(n,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},Ff;(function(n){n.NORMAL="normal",n.STRICT="strict"})(Ff||(Ff={}));var vie={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"strict":return Ff.STRICT;case"normal":default:return Ff.NORMAL}}},wie={name:"line-height",initialValue:"normal",prefix:!1,type:4},L4=function(n,e){return On(n)&&n.value==="normal"?1.2*e:n.type===17?e*n.number:pr(n)?Gn(n,e):e},xie={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(n,e){return e.type===20&&e.value==="none"?null:h2.parse(n,e)}},bie={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(n,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},z1={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},gd=function(n){return{name:"margin-"+n,initialValue:"0",prefix:!1,type:4}},Cie=gd("top"),_ie=gd("right"),Bie=gd("bottom"),Eie=gd("left"),Sie={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(n,e){return e.filter(On).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},Tie={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},yd=function(n){return{name:"padding-"+n,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Iie=yd("top"),Fie=yd("right"),Rie=yd("bottom"),Uie=yd("left"),Mie={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(n,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},Nie={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(n,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Die={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&G1(e[0],"none")?[]:ea(e).map(function(t){for(var r={color:Ca.TRANSPARENT,offsetX:Hr,offsetY:Hr,blur:Hr},i=0,s=0;s<t.length;s++){var a=t[s];_o(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:r.blur=a,i++):r.color=mo.parse(n,a)}return r})}},Lie={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Oie={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(n,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var t=$ie[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},Pie=function(n){var e=n.filter(function(t){return t.type===17}).map(function(t){return t.number});return e.length===6?e:null},kie=function(n){var e=n.filter(function(A){return A.type===17}).map(function(A){return A.number}),t=e[0],r=e[1];e[2],e[3];var i=e[4],s=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var a=e[12],o=e[13];return e[14],e[15],e.length===16?[t,r,i,s,a,o]:null},$ie={matrix:Pie,matrix3d:kie},O4={type:16,number:50,flags:Bu},Qie=[O4,O4],Hie={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(n,e){var t=e.filter(pr);return t.length!==2?Qie:[t[0],t[1]]}},Vie={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},Oc;(function(n){n.NORMAL="normal",n.BREAK_ALL="break-all",n.KEEP_ALL="keep-all"})(Oc||(Oc={}));var Gie={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-all":return Oc.BREAK_ALL;case"keep-all":return Oc.KEEP_ALL;case"normal":default:return Oc.NORMAL}}},zie={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(n,e){if(e.type===20)return{auto:!0,order:0};if(ec(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},mE={name:"time",parse:function(n,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},Wie={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(n,e){return ec(e)?e.number:1}},Kie={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Xie={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(n,e){return e.filter(On).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},jie={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(n,e){var t=[],r=[];return e.forEach(function(i){switch(i.type){case 20:case 0:t.push(i.value);break;case 17:t.push(i.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},Yie={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},qie={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(n,e){if(ec(e))return e.number;if(On(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},Jie={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.filter(On).map(function(t){return t.value})}},Zie={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},xr=function(n,e){return(n&e)!==0},ese={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e}},tse={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;for(var r=[],i=e.filter(ZB),s=0;s<i.length;s++){var a=i[s],o=i[s+1];if(a.type===20){var A=o&&ec(o)?o.number:1;r.push({counter:a.value,increment:A})}}return r}},nse={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return[];for(var t=[],r=e.filter(ZB),i=0;i<r.length;i++){var s=r[i],a=r[i+1];if(On(s)&&s.value!=="none"){var o=a&&ec(a)?a.number:0;t.push({counter:s.value,reset:o})}}return t}},rse={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(n,e){return e.filter(Eu).map(function(t){return mE.parse(n,t)})}},ise={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;var r=[],i=e.filter(Fre);if(i.length%2!==0)return null;for(var s=0;s<i.length;s+=2){var a=i[s].value,o=i[s+1].value;r.push({open:a,close:o})}return r}},P4=function(n,e,t){if(!n)return"";var r=n[Math.min(e,n.length-1)];return r?t?r.open:r.close:""},sse={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&G1(e[0],"none")?[]:ea(e).map(function(t){for(var r={color:255,offsetX:Hr,offsetY:Hr,blur:Hr,spread:Hr,inset:!1},i=0,s=0;s<t.length;s++){var a=t[s];G1(a,"inset")?r.inset=!0:_o(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:i===2?r.blur=a:r.spread=a,i++):r.color=mo.parse(n,a)}return r})}},ase={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(n,e){var t=[0,1,2],r=[];return e.filter(On).forEach(function(i){switch(i.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(function(i){r.indexOf(i)===-1&&r.push(i)}),r}},ose={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Ase={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(n,e){return Eu(e)?e.number:0}},lse=function(){function n(e,t){var r,i;this.animationDuration=dt(e,rse,t.animationDuration),this.backgroundClip=dt(e,Mre,t.backgroundClip),this.backgroundColor=dt(e,Nre,t.backgroundColor),this.backgroundImage=dt(e,Gre,t.backgroundImage),this.backgroundOrigin=dt(e,zre,t.backgroundOrigin),this.backgroundPosition=dt(e,Wre,t.backgroundPosition),this.backgroundRepeat=dt(e,Kre,t.backgroundRepeat),this.backgroundSize=dt(e,jre,t.backgroundSize),this.borderTopColor=dt(e,qre,t.borderTopColor),this.borderRightColor=dt(e,Jre,t.borderRightColor),this.borderBottomColor=dt(e,Zre,t.borderBottomColor),this.borderLeftColor=dt(e,eie,t.borderLeftColor),this.borderTopLeftRadius=dt(e,tie,t.borderTopLeftRadius),this.borderTopRightRadius=dt(e,nie,t.borderTopRightRadius),this.borderBottomRightRadius=dt(e,rie,t.borderBottomRightRadius),this.borderBottomLeftRadius=dt(e,iie,t.borderBottomLeftRadius),this.borderTopStyle=dt(e,sie,t.borderTopStyle),this.borderRightStyle=dt(e,aie,t.borderRightStyle),this.borderBottomStyle=dt(e,oie,t.borderBottomStyle),this.borderLeftStyle=dt(e,Aie,t.borderLeftStyle),this.borderTopWidth=dt(e,lie,t.borderTopWidth),this.borderRightWidth=dt(e,cie,t.borderRightWidth),this.borderBottomWidth=dt(e,uie,t.borderBottomWidth),this.borderLeftWidth=dt(e,hie,t.borderLeftWidth),this.boxShadow=dt(e,sse,t.boxShadow),this.color=dt(e,fie,t.color),this.direction=dt(e,die,t.direction),this.display=dt(e,pie,t.display),this.float=dt(e,gie,t.cssFloat),this.fontFamily=dt(e,jie,t.fontFamily),this.fontSize=dt(e,Yie,t.fontSize),this.fontStyle=dt(e,Zie,t.fontStyle),this.fontVariant=dt(e,Jie,t.fontVariant),this.fontWeight=dt(e,qie,t.fontWeight),this.letterSpacing=dt(e,yie,t.letterSpacing),this.lineBreak=dt(e,vie,t.lineBreak),this.lineHeight=dt(e,wie,t.lineHeight),this.listStyleImage=dt(e,xie,t.listStyleImage),this.listStylePosition=dt(e,bie,t.listStylePosition),this.listStyleType=dt(e,z1,t.listStyleType),this.marginTop=dt(e,Cie,t.marginTop),this.marginRight=dt(e,_ie,t.marginRight),this.marginBottom=dt(e,Bie,t.marginBottom),this.marginLeft=dt(e,Eie,t.marginLeft),this.opacity=dt(e,Wie,t.opacity);var s=dt(e,Sie,t.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=dt(e,Tie,t.overflowWrap),this.paddingTop=dt(e,Iie,t.paddingTop),this.paddingRight=dt(e,Fie,t.paddingRight),this.paddingBottom=dt(e,Rie,t.paddingBottom),this.paddingLeft=dt(e,Uie,t.paddingLeft),this.paintOrder=dt(e,ase,t.paintOrder),this.position=dt(e,Nie,t.position),this.textAlign=dt(e,Mie,t.textAlign),this.textDecorationColor=dt(e,Kie,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=dt(e,Xie,(i=t.textDecorationLine)!==null&&i!==void 0?i:t.textDecoration),this.textShadow=dt(e,Die,t.textShadow),this.textTransform=dt(e,Lie,t.textTransform),this.transform=dt(e,Oie,t.transform),this.transformOrigin=dt(e,Hie,t.transformOrigin),this.visibility=dt(e,Vie,t.visibility),this.webkitTextStrokeColor=dt(e,ose,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=dt(e,Ase,t.webkitTextStrokeWidth),this.wordBreak=dt(e,Gie,t.wordBreak),this.zIndex=dt(e,zie,t.zIndex)}return n.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},n.prototype.isTransparent=function(){return go(this.backgroundColor)},n.prototype.isTransformed=function(){return this.transform!==null},n.prototype.isPositioned=function(){return this.position!==0},n.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},n.prototype.isFloating=function(){return this.float!==0},n.prototype.isInlineLevel=function(){return xr(this.display,4)||xr(this.display,33554432)||xr(this.display,268435456)||xr(this.display,536870912)||xr(this.display,67108864)||xr(this.display,134217728)},n}(),cse=function(){function n(e,t){this.content=dt(e,ese,t.content),this.quotes=dt(e,ise,t.quotes)}return n}(),k4=function(){function n(e,t){this.counterIncrement=dt(e,tse,t.counterIncrement),this.counterReset=dt(e,nse,t.counterReset)}return n}(),dt=function(n,e,t){var r=new qB,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(i);var s=new JB(r.read());switch(e.type){case 2:var a=s.parseComponentValue();return e.parse(n,On(a)?a.value:e.initialValue);case 0:return e.parse(n,s.parseComponentValue());case 1:return e.parse(n,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(e.format){case"angle":return ud.parse(n,s.parseComponentValue());case"color":return mo.parse(n,s.parseComponentValue());case"image":return h2.parse(n,s.parseComponentValue());case"length":var o=s.parseComponentValue();return _o(o)?o:Hr;case"length-percentage":var A=s.parseComponentValue();return pr(A)?A:Hr;case"time":return mE.parse(n,s.parseComponentValue())}break}},use="data-html2canvas-debug",hse=function(n){var e=n.getAttribute(use);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},W1=function(n,e){var t=hse(n);return t===1||e===t},ta=function(){function n(e,t){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,W1(t,3))debugger;this.styles=new lse(e,window.getComputedStyle(t,null)),j1(t)&&(this.styles.animationDuration.some(function(r){return r>0}
19378)&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=ld(this.context,t),W1(t,4)&&(this.flags|=16)}return n}(),fse
vendor: 13,339 bytes, line 19378
19378="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAB
vendor: 12,821 bytes, line 19378
19378QAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",
19378$4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 31,472 bytes, lines 19378-19382
19378+/",Tc=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Fh=0;Fh<$4.length;Fh++)Tc[$4.charCodeAt(Fh)]=Fh;var dse=function(n){var e=n.length*.75,t=n.length,r,i=0,s,a,o,A;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),c=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<t;r+=4)s=Tc[n.charCodeAt(r)],a=Tc[n.charCodeAt(r+1)],o=Tc[n.charCodeAt(r+2)],A=Tc[n.charCodeAt(r+3)],c[i++]=s<<2|a>>4,c[i++]=(a&15)<<4|o>>2,c[i++]=(o&3)<<6|A&63;return l},pse=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},mse=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},sA=5,f2=6+5,Mp=2,gse=f2-sA,gE=65536>>sA,yse=1<<sA,Np=yse-1,vse=1024>>sA,wse=gE+vse,xse=wse,bse=32,Cse=xse+bse,_se=65536>>f2,Bse=1<<gse,Ese=Bse-1,Q4=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},Sse=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},Tse=function(n,e){var t=dse(n),r=Array.isArray(t)?mse(t):new Uint32Array(t),i=Array.isArray(t)?pse(t):new Uint16Array(t),s=24,a=Q4(i,s/2,r[4]/2),o=r[5]===2?Q4(i,(s+r[4])/2):Sse(r,Math.ceil((s+r[4])/4));return new Ise(r[0],r[1],r[2],r[3],a,o)},Ise=function(){function n(e,t,r,i,s,a){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=s,this.data=a}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>sA],t=(t<<Mp)+(e&Np),this.data[t];if(e<=65535)return t=this.index[gE+(e-55296>>sA)],t=(t<<Mp)+(e&Np),this.data[t];if(e<this.highStart)return t=Cse-_se+(e>>f2),t=this.index[t],t+=e>>sA&Ese,t=this.index[t],t=(t<<Mp)+(e&Np),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),H4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fse=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Rh=0;Rh<H4.length;Rh++)Fse[H4.charCodeAt(Rh)]=Rh;var Rse=1,Dp=2,Lp=3,V4=4,G4=5,Use=7,z4=8,Op=9,Pp=10,W4=11,K4=12,X4=13,j4=14,kp=15,Mse=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var s=n.charCodeAt(t++);(s&64512)===56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},Nse=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,s="";++i<t;){var a=n[i];a<=65535?r.push(a):(a-=65536,r.push((a>>10)+55296,a%1024+56320)),(i+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},Dse=Tse(fse),ji="\xD7",$p="\xF7",Lse=function(n){return Dse.get(n)},Ose=function(n,e,t){var r=t-2,i=e[r],s=e[t-1],a=e[t];if(s===Dp&&a===Lp)return ji;if(s===Dp||s===Lp||s===V4||a===Dp||a===Lp||a===V4)return $p;if(s===z4&&[z4,Op,W4,K4].indexOf(a)!==-1||(s===W4||s===Op)&&(a===Op||a===Pp)||(s===K4||s===Pp)&&a===Pp||a===X4||a===G4||a===Use||s===Rse)return ji;if(s===X4&&a===j4){for(;i===G4;)i=e[--r];if(i===j4)return ji}if(s===kp&&a===kp){for(var o=0;i===kp;)o++,i=e[--r];if(o%2===0)return ji}return $p},Pse=function(n){var e=Mse(n),t=e.length,r=0,i=0,s=e.map(Lse);return{next:function(){if(r>=t)return{done:!0,value:null};for(var a=ji;r<t&&(a=Ose(e,s,++r))===ji;);if(a!==ji||r===t){var o=Nse.apply(null,e.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},kse=function(n){for(var e=Pse(n),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t},$se=function(n){var e=123;if(n.createRange){var t=n.createRange();if(t.getBoundingClientRect){var r=n.createElement("boundtest");r.style.height=e+"px",r.style.display="block",n.body.appendChild(r),t.selectNode(r);var i=t.getBoundingClientRect(),s=Math.round(i.height);if(n.body.removeChild(r),s===e)return!0}}return!1},Qse=function(n){var e=n.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",n.body.appendChild(e);var t=n.createRange();e.innerHTML=typeof"".repeat=="function"?"👨".repeat(10):"";var r=e.firstChild,i=cd(r.data).map(function(A){return fr(A)}),s=0,a={},o=i.every(function(A,l){t.setStart(r,s),t.setEnd(r,s+A.length);var c=t.getBoundingClientRect();s+=A.length;var u=c.x>a.x||c.y>a.y;return a=c,l===0?!0:u});return n.body.removeChild(e),o},Hse=function(){return typeof new Image().crossOrigin<"u"},Vse=function(){return typeof new XMLHttpRequest().responseType=="string"},Gse=function(n){var e=new Image,t=n.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},Y4=function(n){return n[0]===0&&n[1]===255&&n[2]===0&&n[3]===255},zse=function(n){var e=n.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var i=new Image,s=e.toDataURL();i.src=s;var a=K1(t,t,0,0,i);return r.fillStyle="red",r.fillRect(0,0,t,t),q4(a).then(function(o){r.drawImage(o,0,0);var A=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var l=n.createElement("div");return l.style.backgroundImage="url("+s+")",l.style.height=t+"px",Y4(A)?q4(K1(t,t,0,0,l)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),Y4(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},K1=function(n,e,t,r,i){var s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return a.setAttributeNS(null,"width",n.toString()),a.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(o),o.appendChild(i),a},q4=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(n))})},Pr={get SUPPORT_RANGE_BOUNDS(){var n=$se(document);return Object.defineProperty(Pr,"SUPPORT_RANGE_BOUNDS",{value:n}),n},get SUPPORT_WORD_BREAKING(){var n=Pr.SUPPORT_RANGE_BOUNDS&&Qse(document);return Object.defineProperty(Pr,"SUPPORT_WORD_BREAKING",{value:n}),n},get SUPPORT_SVG_DRAWING(){var n=Gse(document);return Object.defineProperty(Pr,"SUPPORT_SVG_DRAWING",{value:n}),n},get SUPPORT_FOREIGNOBJECT_DRAWING(){var n=typeof Array.from=="function"&&typeof window.fetch=="function"?zse(document):Promise.resolve(!1);return Object.defineProperty(Pr,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:n}),n},get SUPPORT_CORS_IMAGES(){var n=Hse();return Object.defineProperty(Pr,"SUPPORT_CORS_IMAGES",{value:n}),n},get SUPPORT_RESPONSE_TYPE(){var n=Vse();return Object.defineProperty(Pr,"SUPPORT_RESPONSE_TYPE",{value:n}),n},get SUPPORT_CORS_XHR(){var n="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Pr,"SUPPORT_CORS_XHR",{value:n}),n},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var n=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Pr,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:n}),n}},Pc=function(){function n(e,t){this.text=e,this.bounds=t}return n}(),Wse=function(n,e,t,r){var i=jse(e,t),s=[],a=0;return i.forEach(function(o){if(t.textDecorationLine.length||o.trim().length>0)if(Pr.SUPPORT_RANGE_BOUNDS){var A=J4(r,a,o.length).getClientRects();if(A.length>1){var l=d2(o),c=0;l.forEach(function(h){s.push(new Pc(h,Ra.fromDOMRectList(n,J4(r,c+a,h.length).getClientRects()))),c+=h.length})}else s.push(new Pc(o,Ra.fromDOMRectList(n,A)))}else{var u=r.splitText(o.length);s.push(new Pc(o,Kse(n,r))),r=u}else Pr.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));a+=o.length}),s},Kse=function(n,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var s=ld(n,r);return r.firstChild&&i.replaceChild(r.firstChild,r),s}}return Ra.EMPTY},J4=function(n,e,t){var r=n.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(n,e),i.setEnd(n,e+t),i},d2=function(n){if(Pr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(n)).map(function(t){return t.segment})}return kse(n)},Xse=function(n,e){if(Pr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(n)).map(function(r){return r.segment})}return qse(n,e)},jse=function(n,e){return e.letterSpacing!==0?d2(n):Xse(n,e)},Yse=[32,160,4961,65792,65793,4153,4241],qse=function(n,e){for(var t=_ne(n,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[],i,s=function(){if(i.value){var a=i.value.slice(),o=cd(a),A="";o.forEach(function(l){Yse.indexOf(l)===-1?A+=fr(l):(A.length&&r.push(A),r.push(fr(l)),A="")}),A.length&&r.push(A)}};!(i=t.next()).done;)s();return r},Jse=function(){function n(e,t,r){this.text=Zse(t.data,r.textTransform),this.textBounds=Wse(e,this.text,r,t)}return n}(),Zse=function(n,e){switch(e){case 1:return n.toLowerCase();case 3:return n.replace(eae,tae);case 2:return n.toUpperCase();default:return n}},eae=/(^|\s|:|-|\(|\))([a-z])/g,tae=function(n,e,t){return n.length>0?e+t.toUpperCase():n},yE=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return e}(ta),vE=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return e}(ta),wE=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this,s=new XMLSerializer,a=ld(t,r);return r.setAttribute("width",a.width+"px"),r.setAttribute("height",a.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(r)),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e}(ta),xE=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(ta),X1=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.start=r.start,i.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,i}return e}(ta),nae=[{type:15,flags:0,unit:"px",number:3}],rae=[{type:16,flags:0,number:50}],iae=function(n){return n.width>n.height?new Ra(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new Ra(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n},sae=function(n){var e=n.type===aae?new Array(n.value.length+1).join("\u2022"):n.value;return e.length===0?n.placeholder||"":e},Rf="checkbox",Uf="radio",aae="password",Z4=707406591,p2=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=sae(r),(i.type===Rf||i.type===Uf)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=iae(i.bounds)),i.type){case Rf:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=nae;break;case Uf:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=rae;break}return i}return e}(ta),bE=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this,s=r.options[r.selectedIndex||0];return i.value=s&&s.text||"",i}return e}(ta),CE=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(ta),_E=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=EE(t,r.contentWindow.document.documentElement);var s=r.contentWindow.document.documentElement?Lc(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):Ca.TRANSPARENT,a=r.contentWindow.document.body?Lc(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):Ca.TRANSPARENT;i.backgroundColor=go(s)?go(a)?i.styles.backgroundColor:a:s}}catch{}return i}return e}(ta),oae=["OL","UL","MENU"],Zh=function(n,e,t,r){for(var i=e.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,SE(i)&&i.data.trim().length>0)t.textNodes.push(new Jse(n,i,t.styles));else if(Al(i))if(RE(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return Zh(n,o,t,r)});else{var a=BE(n,i);a.styles.isVisible()&&(Aae(i,a,r)?a.flags|=4:lae(a.styles)&&(a.flags|=2),oae.indexOf(i.tagName)!==-1&&(a.flags|=8),t.elements.push(a),i.slot,i.shadowRoot?Zh(n,i.shadowRoot,a,r):!Mf(i)&&!TE(i)&&!Nf(i)&&Zh(n,i,a,r))}},BE=function(n,e){return Y1(e)?new yE(n,e):IE(e)?new vE(n,e):TE(e)?new wE(n,e):cae(e)?new xE(n,e):uae(e)?new X1(n,e):hae(e)?new p2(n,e):Nf(e)?new bE(n,e):Mf(e)?new CE(n,e):FE(e)?new _E(n,e):new ta(n,e)},EE=function(n,e){var t=BE(n,e);return t.flags|=4,Zh(n,e,t,t),t},Aae=function(n,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||m2(n)&&t.styles.isTransparent()},lae=function(n){return n.isPositioned()||n.isFloating()},SE=function(n){return n.nodeType===Node.TEXT_NODE},Al=function(n){return n.nodeType===Node.ELEMENT_NODE},j1=function(n){return Al(n)&&typeof n.style<"u"&&!ef(n)},ef=function(n){return typeof n.className=="object"},cae=function(n){return n.tagName==="LI"},uae=function(n){return n.tagName==="OL"},hae=function(n){return n.tagName==="INPUT"},fae=function(n){return n.tagName==="HTML"},TE=function(n){return n.tagName==="svg"},m2=function(n){return n.tagName==="BODY"},IE=function(n){return n.tagName==="CANVAS"},ey=function(n){return n.tagName==="VIDEO"},Y1=function(n){return n.tagName==="IMG"},FE=function(n){return n.tagName==="IFRAME"},ty=function(n){return n.tagName==="STYLE"},dae=function(n){return n.tagName==="SCRIPT"},Mf=function(n){return n.tagName==="TEXTAREA"},Nf=function(n){return n.tagName==="SELECT"},RE=function(n){return n.tagName==="SLOT"},ny=function(n){return n.tagName.indexOf("-")>0},pae=function(){function n(){this.counters={}}return n.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},n.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},n.prototype.pop=function(e){var t=this;e.forEach(function(r){return t.counters[r].pop()})},n.prototype.parse=function(e){var t=this,r=e.counterIncrement,i=e.counterReset,s=!0;r!==null&&r.forEach(function(o){var A=t.counters[o.counter];A&&o.increment!==0&&(s=!1,A.length||A.push(1),A[Math.max(0,A.length-1)]+=o.increment)});var a=[];return s&&i.forEach(function(o){var A=t.counters[o.counter];a.push(o.counter),A||(A=t.counters[o.counter]=[]),A.push(o.reset)}),a},n}(),ry={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},iy={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054F","\u054E","\u054D","\u054C","\u054B","\u054A","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053F","\u053E","\u053D","\u053C","\u053B","\u053A","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},mae={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05D9\u05F3","\u05D8\u05F3","\u05D7\u05F3","\u05D6\u05F3","\u05D5\u05F3","\u05D4\u05F3","\u05D3\u05F3","\u05D2\u05F3","\u05D1\u05F3","\u05D0\u05F3","\u05EA","\u05E9","\u05E8","\u05E7","\u05E6","\u05E4","\u05E2","\u05E1","\u05E0","\u05DE","\u05DC","\u05DB","\u05D9\u05D8","\u05D9\u05D7","\u05D9\u05D6","\u05D8\u05D6","\u05D8\u05D5","\u05D9","\u05D8","\u05D7","\u05D6","\u05D5","\u05D4","\u05D3","\u05D2","\u05D1","\u05D0"]},gae={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10F5","\u10F0","\u10EF","\u10F4","\u10EE","\u10ED","\u10EC","\u10EB","\u10EA","\u10E9","\u10E8","\u10E7","\u10E6","\u10E5","\u10E4","\u10F3","\u10E2","\u10E1","\u10E0","\u10DF","\u10DE","\u10DD","\u10F2","\u10DC","\u10DB","\u10DA","\u10D9","\u10D8","\u10D7","\u10F1","\u10D6","\u10D5","\u10D4","\u10D3","\u10D2","\u10D1","\u10D0"]},YA=function(n,e,t,r,i,s){return n<e||n>t?ou(n,i,s.length>0):r.integers.reduce(function(a,o,A){for(;n>=o;)n-=o,a+=r.values[A];return a},"")+s},UE=function(n,e,t,r){var i="";do t||n--,i=r(n)+i,n/=e;while(n*e>=e);return i},hr=function(n,e,t,r,i){var s=t-e+1;return(n<0?"-":"")+(UE(Math.abs(n),s,r,function(a){return fr(Math.floor(a%s)+e)})+i)},Qo=function(n,e,t){t===void 0&&(t=". ");var r=e.length;return UE(Math.abs(n),r,!1,function(i){return e[Math.floor(i%r)]})+t},nl=1<<0,Xa=1<<1,ja=1<<2,Ic=1<<3,ha=function(n,e,t,r,i,s){if(n<-9999||n>9999)return ou(n,4,i.length>0);var a=Math.abs(n),o=i;if(a===0)return e[0]+o;for(var A=0;a>0&&A<=4;A++){var l=a%10;l===0&&xr(s,nl)&&o!==""?o=e[l]+o:l>1||l===1&&A===0||l===1&&A===1&&xr(s,Xa)||l===1&&A===1&&xr(s,ja)&&n>100||l===1&&A>1&&xr(s,Ic)?o=e[l]+(A>0?t[A-1]:"")+o:l===1&&A>0&&(o=t[A-1]+o),a=Math.floor(a/10)}return(n<0?r:"")+o},sy="\u5341\u767E\u5343\u842C",ay="\u62FE\u4F70\u4EDF\u842C",oy="\u30DE\u30A4\u30CA\u30B9",Qp="\uB9C8\uC774\uB108\uC2A4",ou=function(n,e,t){var r=t?". ":"",i=t?"\u3001":"",s=t?", ":"",a=t?" ":"";switch(e){case 0:return"\u2022"+a;case 1:return"\u25E6"+a;case 2:return"\u25FE"+a;case 5:var o=hr(n,48,57,!0,r);return o.length<4?"0"+o:o;case 4:return Qo(n,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",i);case 6:return YA(n,1,3999,ry,3,r).toLowerCase();case 7:return YA(n,1,3999,ry,3,r);case 8:return hr(n,945,969,!1,r);case 9:return hr(n,97,122,!1,r);case 10:return hr(n,65,90,!1,r);case 11:return hr(n,1632,1641,!0,r);case 12:case 49:return YA(n,1,9999,iy,3,r);case 35:return YA(n,1,9999,iy,3,r).toLowerCase();case 13:return hr(n,2534,2543,!0,r);case 14:case 30:return hr(n,6112,6121,!0,r);case 15:return Qo(n,"\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5",i);case 16:return Qo(n,"\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678",i);case 17:case 48:return ha(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",sy,"\u8CA0",i,Xa|ja|Ic);case 47:return ha(n,"\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396",ay,"\u8CA0",i,nl|Xa|ja|Ic);case 42:return ha(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",sy,"\u8D1F",i,Xa|ja|Ic);case 41:return ha(n,"\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396",ay,"\u8D1F",i,nl|Xa|ja|Ic);case 26:return ha(n,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u4E07",oy,i,0);case 25:return ha(n,"\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343\u4E07",oy,i,nl|Xa|ja);case 31:return ha(n,"\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C","\uC2ED\uBC31\uCC9C\uB9CC",Qp,s,nl|Xa|ja);case 33:return ha(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u842C",Qp,s,0);case 32:return ha(n,"\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343",Qp,s,nl|Xa|ja);case 18:return hr(n,2406,2415,!0,r);case 20:return YA(n,1,19999,gae,3,r);case 21:return hr(n,2790,2799,!0,r);case 22:return hr(n,2662,2671,!0,r);case 22:return YA(n,1,10999,mae,3,r);case 23:return Qo(n,"\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093");case 24:return Qo(n,"\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059");case 27:return hr(n,3302,3311,!0,r);case 28:return Qo(n,"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3",i);case 29:return Qo(n,"\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9",i);case 34:return hr(n,3792,3801,!0,r);case 37:return hr(n,6160,6169,!0,r);case 38:return hr(n,4160,4169,!0,r);case 39:return hr(n,2918,2927,!0,r);case 40:return hr(n,1776,1785,!0,r);case 43:return hr(n,3046,3055,!0,r);case 44:return hr(n,3174,3183,!0,r);case 45:return hr(n,3664,3673,!0,r);case 46:return hr(n,3872,3881,!0,r);case 3:default:return hr(n,48,57,!0,r)}},ME="data-html2canvas-ignore",Ay=function(){function n(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new pae,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return n.prototype.toIFrame=function(e,t){var r=this,i=yae(e,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,o=i.contentWindow,A=o.document,l=xae(i).then(function(){return ai(r,void 0,void 0,function(){var c,u;return Kr(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(Bae),o&&(o.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==t.top||o.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),c=this.options.onclone,u=this.clonedReferenceElement,typeof u>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:A.fonts&&A.fonts.ready?[4,A.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,wae(A)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof c=="function"?[2,Promise.resolve().then(function(){return c(A,u)}).then(function(){return i})]:[2,i]}})})});return A.open(),A.write(Cae(document.doctype)+"<html></html>"),_ae(this.referenceElement.ownerDocument,s,a),A.replaceChild(A.adoptNode(this.documentElement),A.documentElement),A.close(),l},n.prototype.createElementClone=function(e){if(W1(e,2))debugger;if(IE(e))return this.createCanvasClone(e);if(ey(e))return this.createVideoClone(e);if(ty(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Y1(t)&&(Y1(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),ny(t)?this.createCustomElementClone(t):t},n.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Hp(e.style,t),t},n.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(s,a){return a&&typeof a.cssText=="string"?s+a.cssText:s},""),i=e.cloneNode(!1);return i.textContent=r,i}}catch(s){if(this.context.logger.error("Unable to access cssRules property",s),s.name!=="SecurityError")throw s}return e.cloneNode(!1)},n.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var s=e.getContext("2d"),a=i.getContext("2d");if(a)if(!this.options.allowTaint&&s)a.putImageData(s.getImageData(0,0,e.width,e.height),0,0);else{var o=(t=e.getContext("webgl2"))!==null&&t!==void 0?t:e.getContext("webgl");if(o){var A=o.getContextAttributes();(A==null?void 0:A.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},n.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},n.prototype.appendChildNode=function(e,t,r){(!Al(t)||!dae(t)&&!t.hasAttribute(ME)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!Al(t)||!ty(t))&&e.appendChild(this.cloneNode(t,r))},n.prototype.cloneChildNodes=function(e,t,r){for(var i=this,s=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;s;s=s.nextSibling)if(Al(s)&&RE(s)&&typeof s.assignedNodes=="function"){var a=s.assignedNodes();a.length&&a.forEach(function(o){return i.appendChildNode(t,o,r)})}else this.appendChildNode(t,s,r)},n.prototype.cloneNode=function(e,t){if(SE(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&Al(e)&&(j1(e)||ef(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var s=r.getComputedStyle(e),a=r.getComputedStyle(e,":before"),o=r.getComputedStyle(e,":after");this.referenceElement===e&&j1(i)&&(this.clonedReferenceElement=i),m2(i)&&Tae(i);var A=this.counters.parse(new k4(this.context,s)),l=this.resolvePseudoContent(e,i,a,kc.BEFORE);ny(e)&&(t=!0),ey(e)||this.cloneChildNodes(e,i,t),l&&i.insertBefore(l,i.firstChild);var c=this.resolvePseudoContent(e,i,o,kc.AFTER);return c&&i.appendChild(c),this.counters.pop(A),(s&&(this.options.copyStyles||ef(e))&&!FE(e)||t)&&Hp(s,i),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(Mf(e)||Nf(e))&&(Mf(i)||Nf(i))&&(i.value=e.value),i}return e.cloneNode(!1)},n.prototype.resolvePseudoContent=function(e,t,r,i){var s=this;if(!!r){var a=r.content,o=t.ownerDocument;if(!(!o||!a||a==="none"||a==="-moz-alt-content"||r.display==="none")){this.counters.parse(new k4(this.context,r));var A=new cse(this.context,r),l=o.createElement("html2canvaspseudoelement");Hp(r,l),A.content.forEach(function(u){if(u.type===0)l.appendChild(o.createTextNode(u.value));else if(u.type===22){var h=o.createElement("img");h.src=u.value,h.style.opacity="1",l.appendChild(h)}else if(u.type===18){if(u.name==="attr"){var f=u.values.filter(On);f.length&&l.appendChild(o.createTextNode(e.getAttribute(f[0].value)||""))}else if(u.name==="counter"){var d=u.values.filter(Ll),g=d[0],m=d[1];if(g&&On(g)){var p=s.counters.getCounterValue(g.value),w=m&&On(m)?z1.parse(s.context,m.value):3;l.appendChild(o.createTextNode(ou(p,w,!1)))}}else if(u.name==="counters"){var C=u.values.filter(Ll),g=C[0],b=C[1],m=C[2];if(g&&On(g)){var U=s.counters.getCounterValues(g.value),F=m&&On(m)?z1.parse(s.context,m.value):3,D=b&&b.type===0?b.value:"",O=U.map(function(V){return ou(V,F,!1)}).join(D);l.appendChild(o.createTextNode(O))}}}else if(u.type===20)switch(u.value){case"open-quote":l.appendChild(o.createTextNode(P4(A.quotes,s.quoteDepth++,!0)));break;case"close-quote":l.appendChild(o.createTextNode(P4(A.quotes,--s.quoteDepth,!1)));break;default:l.appendChild(o.createTextNode(u.value))}}),l.className=q1+" "+J1;var c=i===kc.BEFORE?" "+q1:" "+J1;return ef(t)?t.className.baseValue+=c:t.className+=c,l}}},n.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},n}(),kc;(function(n){n[n.BEFORE=0]="BEFORE",n[n.AFTER=1]="AFTER"})(kc||(kc={}));var yae=function(n,e){var t=n.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(ME,"true"),n.body.appendChild(t),t},vae=function(n){return new Promise(function(e){if(n.complete){e();return}if(!n.src){e();return}n.onload=e,n.onerror=e})},wae=function(n){return Promise.all([].slice.call(n.images,0).map(vae))},xae=function(n){return new Promise(function(e,t){var r=n.contentWindow;if(!r)return t("No window assigned for iframe");var i=r.document;r.onload=n.onload=function(){r.onload=n.onload=null;var s=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(s),e(n))},50)}})},bae=["all","d","content"],Hp=function(n,e){for(var t=n.length-1;t>=0;t--){var r=n.item(t);bae.indexOf(r)===-1&&e.style.setProperty(r,n.getPropertyValue(r))}return e},Cae=function(n){var e="";return n&&(e+="<!DOCTYPE ",n.name&&(e+=n.name),n.internalSubset&&(e+=n.internalSubset),n.publicId&&(e+='"'+n.publicId+'"'),n.systemId&&(e+='"'+n.systemId+'"'),e+=">"),e},_ae=function(n,e,t){n&&n.defaultView&&(e!==n.defaultView.pageXOffset||t!==n.defaultView.pageYOffset)&&n.defaultView.scrollTo(e,t)},Bae=function(n){var e=n[0],t=n[1],r=n[2];e.scrollLeft=t,e.scrollTop=r},Eae=":before",Sae=":after",q1="___html2canvas___pseudoelement_before",J1="___html2canvas___pseudoelement_after",ly=`{ 19379 content: "" !important; 19380 display: none !important; 19381}`,Tae=function(n){Iae(n,"."+q1+Eae+ly+` 19382 .`+J1+Sae+ly)},Iae=function(n,e){var t=n.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,n.appendChild(r)}},NE=function(){function n(){}return n.getOrigin=function(e){var t=n._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},n.isSameOrigin=function(e){return n.getOrigin(e)===n._origin},n.setContext=function(e){n._link=e.document.createElement("a"),n._origin=n.getOrigin(e.location.href)},n._origin="about:blank",n}(),Fae=function(){function n(e,t){this.context=e,this._options=t,this._cache={}}return n.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Gp(e)||Nae(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},n.prototype.match=function(e){return this._cache[e]},n.prototype.loadImage=function(e){return ai(this,void 0,void 0,function(){var t,r,i,s,a=this;return Kr(this,function(o){switch(o.label){case 0:return t=NE.isSameOrigin(e),r=!Vp(e)&&this._options.useCORS===!0&&Pr.SUPPORT_CORS_IMAGES&&!t,i=!Vp(e)&&!t&&!Gp(e)&&typeof this._options.proxy=="str
19382ing"&&Pr.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Vp(e)&&!Gp(e)&&!i&&!r?[2]:(s=e,i?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(A,l){var c=new Image;c.onload=function(){return A(c)},c.onerror=l,(Dae(s)||r)&&(c.crossOrigin="anonymous"),c.src=s,c.complete===!0&&setTimeout(function(){return A(c)},500),a._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},n.prototype.has=function(e){return typeof this._cache[e]<"u"},n.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},n.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(s,a){var o=Pr.SUPPORT_RESPONSE_TYPE?"blob":"text",A=new XMLHttpRequest;A.onload=function(){if(A.status===200)if(o==="text")s(A.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(h){return a(h)},!1),u.readAsDataURL(A.response)}else a("Failed to proxy resource "+i+" with status code "+A.status)},A.onerror=a;var l=r.indexOf("?")>-1?"&":"?";if(A.open("GET",""+r+l+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&A instanceof XMLHttpRequest&&(A.responseType=o),t._options.imageTimeout){var c=t._options.imageTimeout;A.timeout=c,A.ontimeout=function(){return a("Timed out ("+c+"ms) proxying "+i)}}A.send()})},n}(),Rae=/^data:image\/svg\+xml/i,Uae=/^data:image\/.*;base64,/i,Mae=/^data:image\/.*/i,Nae=function(n){return Pr.SUPPORT_SVG_DRAWING||!Lae(n)},Vp=function(n){return Mae.test(n)},Dae=function(n){return Uae.test(n)},Gp=function(n){return n.substr(0,4)==="blob"},Lae=function(n){return n.substr(-3).toLowerCase()==="svg"||Rae.test(n)},ct=function(){function n(e,t){this.type=0,this.x=e,this.y=t}return n.prototype.add=function(e,t){return new n(this.x+e,this.y+t)},n}(),qA=function(n,e,t){return new ct(n.x+(e.x-n.x)*t,n.y+(e.y-n.y)*t)},Uh=function(){function n(e,t,r,i){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=i}return n.prototype.subdivide=function(e,t){var r=qA(this.start,this.startControl,e),i=qA(this.startControl,this.endControl,e),s=qA(this.endControl,this.end,e),a=qA(r,i,e),o=qA(i,s,e),A=qA(a,o,e);return t?new n(this.start,r,a,A):new n(A,o,s,this.end)},n.prototype.add=function(e,t){return new n(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},n.prototype.reverse=function(){return new n(this.end,this.endControl,this.startControl,this.start)},n}(),Ji=function(n){return n.type===1},Oae=function(){function n(e){var t=e.styles,r=e.bounds,i=Sc(t.borderTopLeftRadius,r.width,r.height),s=i[0],a=i[1],o=Sc(t.borderTopRightRadius,r.width,r.height),A=o[0],l=o[1],c=Sc(t.borderBottomRightRadius,r.width,r.height),u=c[0],h=c[1],f=Sc(t.borderBottomLeftRadius,r.width,r.height),d=f[0],g=f[1],m=[];m.push((s+A)/r.width),m.push((d+u)/r.width),m.push((a+g)/r.height),m.push((l+h)/r.height);var p=Math.max.apply(Math,m);p>1&&(s/=p,a/=p,A/=p,l/=p,u/=p,h/=p,d/=p,g/=p);var w=r.width-A,C=r.height-h,b=r.width-u,U=r.height-g,F=t.borderTopWidth,D=t.borderRightWidth,O=t.borderBottomWidth,I=t.borderLeftWidth,R=Gn(t.paddingTop,e.bounds.width),V=Gn(t.paddingRight,e.bounds.width),re=Gn(t.paddingBottom,e.bounds.width),Y=Gn(t.paddingLeft,e.boun
vendor: 16,836 bytes, line 19382
19382ds.width);this.topLeftBorderDoubleOuterBox=s>0||a>0?Zn(r.left+I/3,r.top+F/3,s-I/3,a-F/3,In.TOP_LEFT):new ct(r.left+I/3,r.top+F/3),this.topRightBorderDoubleOuterBox=s>0||a>0?Zn(r.left+w,r.top+F/3,A-D/3,l-F/3,In.TOP_RIGHT):new ct(r.left+r.width-D/3,r.top+F/3),this.bottomRightBorderDoubleOuterBox=u>0||h>0?Zn(r.left+b,r.top+C,u-D/3,h-O/3,In.BOTTOM_RIGHT):new ct(r.left+r.width-D/3,r.top+r.height-O/3),this.bottomLeftBorderDoubleOuterBox=d>0||g>0?Zn(r.left+I/3,r.top+U,d-I/3,g-O/3,In.BOTTOM_LEFT):new ct(r.left+I/3,r.top+r.height-O/3),this.topLeftBorderDoubleInnerBox=s>0||a>0?Zn(r.left+I*2/3,r.top+F*2/3,s-I*2/3,a-F*2/3,In.TOP_LEFT):new ct(r.left+I*2/3,r.top+F*2/3),this.topRightBorderDoubleInnerBox=s>0||a>0?Zn(r.left+w,r.top+F*2/3,A-D*2/3,l-F*2/3,In.TOP_RIGHT):new ct(r.left+r.width-D*2/3,r.top+F*2/3),this.bottomRightBorderDoubleInnerBox=u>0||h>0?Zn(r.left+b,r.top+C,u-D*2/3,h-O*2/3,In.BOTTOM_RIGHT):new ct(r.left+r.width-D*2/3,r.top+r.height-O*2/3),this.bottomLeftBorderDoubleInnerBox=d>0||g>0?Zn(r.left+I*2/3,r.top+U,d-I*2/3,g-O*2/3,In.BOTTOM_LEFT):new ct(r.left+I*2/3,r.top+r.height-O*2/3),this.topLeftBorderStroke=s>0||a>0?Zn(r.left+I/2,r.top+F/2,s-I/2,a-F/2,In.TOP_LEFT):new ct(r.left+I/2,r.top+F/2),this.topRightBorderStroke=s>0||a>0?Zn(r.left+w,r.top+F/2,A-D/2,l-F/2,In.TOP_RIGHT):new ct(r.left+r.width-D/2,r.top+F/2),this.bottomRightBorderStroke=u>0||h>0?Zn(r.left+b,r.top+C,u-D/2,h-O/2,In.BOTTOM_RIGHT):new ct(r.left+r.width-D/2,r.top+r.height-O/2),this.bottomLeftBorderStroke=d>0||g>0?Zn(r.left+I/2,r.top+U,d-I/2,g-O/2,In.BOTTOM_LEFT):new ct(r.left+I/2,r.top+r.height-O/2),this.topLeftBorderBox=s>0||a>0?Zn(r.left,r.top,s,a,In.TOP_LEFT):new ct(r.left,r.top),this.topRightBorderBox=A>0||l>0?Zn(r.left+w,r.top,A,l,In.TOP_RIGHT):new ct(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||h>0?Zn(r.left+b,r.top+C,u,h,In.BOTTOM_RIGHT):new ct(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=d>0||g>0?Zn(r.left,r.top+U,d,g,In.BOTTOM_LEFT):new ct(r.left,r.top+r.height),this.topLeftPaddingBox=s>0||a>0?Zn(r.left+I,r.top+F,Math.max(0,s-I),Math.max(0,a-F),In.TOP_LEFT):new ct(r.left+I,r.top+F),this.topRightPaddingBox=A>0||l>0?Zn(r.left+Math.min(w,r.width-D),r.top+F,w>r.width+D?0:Math.max(0,A-D),Math.max(0,l-F),In.TOP_RIGHT):new ct(r.left+r.width-D,r.top+F),this.bottomRightPaddingBox=u>0||h>0?Zn(r.left+Math.min(b,r.width-I),r.top+Math.min(C,r.height-O),Math.max(0,u-D),Math.max(0,h-O),In.BOTTOM_RIGHT):new ct(r.left+r.width-D,r.top+r.height-O),this.bottomLeftPaddingBox=d>0||g>0?Zn(r.left+I,r.top+Math.min(U,r.height-O),Math.max(0,d-I),Math.max(0,g-O),In.BOTTOM_LEFT):new ct(r.left+I,r.top+r.height-O),this.topLeftContentBox=s>0||a>0?Zn(r.left+I+Y,r.top+F+R,Math.max(0,s-(I+Y)),Math.max(0,a-(F+R)),In.TOP_LEFT):new ct(r.left+I+Y,r.top+F+R),this.topRightContentBox=A>0||l>0?Zn(r.left+Math.min(w,r.width+I+Y),r.top+F+R,w>r.width+I+Y?0:A-I+Y,l-(F+R),In.TOP_RIGHT):new ct(r.left+r.width-(D+V),r.top+F+R),this.bottomRightContentBox=u>0||h>0?Zn(r.left+Math.min(b,r.width-(I+Y)),r.top+Math.min(C,r.height+F+R),Math.max(0,u-(D+V)),h-(O+re),In.BOTTOM_RIGHT):new ct(r.left+r.width-(D+V),r.top+r.height-(O+re)),this.bottomLeftContentBox=d>0||g>0?Zn(r.left+I+Y,r.top+U,Math.max(0,d-(I+Y)),g-(O+re),In.BOTTOM_LEFT):new ct(r.left+I+Y,r.top+r.height-(O+re))}return n}(),In;(function(n){n[n.TOP_LEFT=0]="TOP_LEFT",n[n.TOP_RIGHT=1]="TOP_RIGHT",n[n.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",n[n.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(In||(In={}));var Zn=function(n,e,t,r,i){var s=4*((Math.sqrt(2)-1)/3),a=t*s,o=r*s,A=n+t,l=e+r;switch(i){case In.TOP_LEFT:return new Uh(new ct(n,l),new ct(n,l-o),new ct(A-a,e),new ct(A,e));case In.TOP_RIGHT:return new Uh(new ct(n,e),new ct(n+a,e),new ct(A,l-o),new ct(A,l));case In.BOTTOM_RIGHT:return new Uh(new ct(A,e),new ct(A,e+o),new ct(n+a,l),new ct(n,l));case In.BOTTOM_LEFT:default:return new Uh(new ct(A,l),new ct(A-a,l),new ct(n,e+o),new ct(n,e))}},Df=function(n){return[n.topLeftBorderBox,n.topRightBorderBox,n.bottomRightBorderBox,n.bottomLeftBorderBox]},Pae=function(n){return[n.topLeftContentBox,n.topRightContentBox,n.bottomRightContentBox,n.bottomLeftContentBox]},Lf=function(n){return[n.topLeftPaddingBox,n.topRightPaddingBox,n.bottomRightPaddingBox,n.bottomLeftPaddingBox]},kae=function(){function n(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return n}(),Mh=function(){function n(e,t){this.path=e,this.target=t,this.type=1}return n}(),$ae=function(){function n(e){this.opacity=e,this.type=2,this.target=6}return n}(),Qae=function(n){return n.type===0},DE=function(n){return n.type===1},Hae=function(n){return n.type===2},cy=function(n,e){return n.length===e.length?n.some(function(t,r){return t===e[r]}):!1},Vae=function(n,e,t,r,i){return n.map(function(s,a){switch(a){case 0:return s.add(e,t);case 1:return s.add(e+r,t);case 2:return s.add(e+r,t+i);case 3:return s.add(e,t+i)}return s})},LE=function(){function n(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return n}(),OE=function(){function n(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Oae(this.container),this.container.styles.opacity<1&&this.effects.push(new $ae(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new kae(r,i,s))}if(this.container.styles.overflowX!==0){var a=Df(this.curves),o=Lf(this.curves);cy(a,o)?this.effects.push(new Mh(a,6)):(this.effects.push(new Mh(a,2)),this.effects.push(new Mh(o,4)))}}return n.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,i=this.effects.slice(0);r;){var s=r.effects.filter(function(A){return!DE(A)});if(t||r.container.styles.position!==0||!r.parent){if(i.unshift.apply(i,s),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var a=Df(r.curves),o=Lf(r.curves);cy(a,o)||i.unshift(new Mh(o,6))}}else i.unshift.apply(i,s);r=r.parent}return i.filter(function(A){return xr(A.target,e)})},n}(),Z1=function(n,e,t,r){n.container.elements.forEach(function(i){var s=xr(i.flags,4),a=xr(i.flags,2),o=new OE(i,n);xr(i.styles.display,2048)&&r.push(o);var A=xr(i.flags,8)?[]:r;if(s||a){var l=s||i.styles.isPositioned()?t:e,c=new LE(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var h=0;l.negativeZIndex.some(function(d,g){return u>d.element.container.styles.zIndex.order?(h=g,!1):h>0}),l.negativeZIndex.splice(h,0,c)}else if(u>0){var f=0;l.positiveZIndex.some(function(d,g){return u>=d.element.container.styles.zIndex.order?(f=g+1,!1):f>0}),l.positiveZIndex.splice(f,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);Z1(o,c,s?c:t,A)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),Z1(o,e,t,A);xr(i.flags,8)&&PE(i,A)})},PE=function(n,e){for(var t=n instanceof X1?n.start:1,r=n instanceof X1?n.reversed:!1,i=0;i<e.length;i++){var s=e[i];s.container instanceof xE&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=ou(t,s.container.styles.listStyleType,!0),t+=r?-1:1}},Gae=function(n){var e=new OE(n,null),t=new LE(e),r=[];return Z1(e,t,t,r),PE(e.container,r),t},uy=function(n,e){switch(e){case 0:return ss(n.topLeftBorderBox,n.topLeftPaddingBox,n.topRightBorderBox,n.topRightPaddingBox);case 1:return ss(n.topRightBorderBox,n.topRightPaddingBox,n.bottomRightBorderBox,n.bottomRightPaddingBox);case 2:return ss(n.bottomRightBorderBox,n.bottomRightPaddingBox,n.bottomLeftBorderBox,n.bottomLeftPaddingBox);case 3:default:return ss(n.bottomLeftBorderBox,n.bottomLeftPaddingBox,n.topLeftBorderBox,n.topLeftPaddingBox)}},zae=function(n,e){switch(e){case 0:return ss(n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox,n.topRightBorderBox,n.topRightBorderDoubleOuterBox);case 1:return ss(n.topRightBorderBox,n.topRightBorderDoubleOuterBox,n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox);case 2:return ss(n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox,n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox);case 3:default:return ss(n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox,n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox)}},Wae=function(n,e){switch(e){case 0:return ss(n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox,n.topRightBorderDoubleInnerBox,n.topRightPaddingBox);case 1:return ss(n.topRightBorderDoubleInnerBox,n.topRightPaddingBox,n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox);case 2:return ss(n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox,n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox);case 3:default:return ss(n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox,n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox)}},Kae=function(n,e){switch(e){case 0:return Nh(n.topLeftBorderStroke,n.topRightBorderStroke);case 1:return Nh(n.topRightBorderStroke,n.bottomRightBorderStroke);case 2:return Nh(n.bottomRightBorderStroke,n.bottomLeftBorderStroke);case 3:default:return Nh(n.bottomLeftBorderStroke,n.topLeftBorderStroke)}},Nh=function(n,e){var t=[];return Ji(n)?t.push(n.subdivide(.5,!1)):t.push(n),Ji(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},ss=function(n,e,t,r){var i=[];return Ji(n)?i.push(n.subdivide(.5,!1)):i.push(n),Ji(t)?i.push(t.subdivide(.5,!0)):i.push(t),Ji(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Ji(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},kE=function(n){var e=n.bounds,t=n.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Of=function(n){var e=n.styles,t=n.bounds,r=Gn(e.paddingLeft,t.width),i=Gn(e.paddingRight,t.width),s=Gn(e.paddingTop,t.width),a=Gn(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+i),-(e.borderTopWidth+e.borderBottomWidth+s+a))},Xae=function(n,e){return n===0?e.bounds:n===2?Of(e):kE(e)},jae=function(n,e){return n===0?e.bounds:n===2?Of(e):kE(e)},zp=function(n,e,t){var r=Xae(rl(n.styles.backgroundOrigin,e),n),i=jae(rl(n.styles.backgroundClip,e),n),s=Yae(rl(n.styles.backgroundSize,e),t,r),a=s[0],o=s[1],A=Sc(rl(n.styles.backgroundPosition,e),r.width-a,r.height-o),l=qae(rl(n.styles.backgroundRepeat,e),A,s,r,i),c=Math.round(r.left+A[0]),u=Math.round(r.top+A[1]);return[l,c,u,a,o]},JA=function(n){return On(n)&&n.value===gl.AUTO},Dh=function(n){return typeof n=="number"},Yae=function(n,e,t){var r=e[0],i=e[1],s=e[2],a=n[0],o=n[1];if(!a)return[0,0];if(pr(a)&&o&&pr(o))return[Gn(a,t.width),Gn(o,t.height)];var A=Dh(s);if(On(a)&&(a.value===gl.CONTAIN||a.value===gl.COVER)){if(Dh(s)){var l=t.width/t.height;return l<s!=(a.value===gl.COVER)?[t.width,t.width/s]:[t.height*s,t.height]}return[t.width,t.height]}var c=Dh(r),u=Dh(i),h=c||u;if(JA(a)&&(!o||JA(o))){if(c&&u)return[r,i];if(!A&&!h)return[t.width,t.height];if(h&&A){var f=c?r:i*s,d=u?i:r/s;return[f,d]}var g=c?r:t.width,m=u?i:t.height;return[g,m]}if(A){var p=0,w=0;return pr(a)?p=Gn(a,t.width):pr(o)&&(w=Gn(o,t.height)),JA(a)?p=w*s:(!o||JA(o))&&(w=p/s),[p,w]}var C=null,b=null;if(pr(a)?C=Gn(a,t.width):o&&pr(o)&&(b=Gn(o,t.height)),C!==null&&(!o||JA(o))&&(b=c&&u?C/r*i:t.height),b!==null&&JA(a)&&(C=c&&u?b/i*r:t.width),C!==null&&b!==null)return[C,b];throw new Error("Unable to calculate background-size for element")},rl=function(n,e){var t=n[e];return typeof t>"u"?n[0]:t},qae=function(n,e,t,r,i){var s=e[0],a=e[1],o=t[0],A=t[1];switch(n){case 2:return[new ct(Math.round(r.left),Math.round(r.top+a)),new ct(Math.round(r.left+r.width),Math.round(r.top+a)),new ct(Math.round(r.left+r.width),Math.round(A+r.top+a)),new ct(Math.round(r.left),Math.round(A+r.top+a))];case 3:return[new ct(Math.round(r.left+s),Math.round(r.top)),new ct(Math.round(r.left+s+o),Math.round(r.top)),new ct(Math.round(r.left+s+o),Math.round(r.height+r.top)),new ct(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new ct(Math.round(r.left+s),Math.round(r.top+a)),new ct(Math.round(r.left+s+o),Math.round(r.top+a)),new ct(Math.round(r.left+s+o),Math.round(r.top+a+A)),new ct(Math.round(r.left+s),Math.round(r.top+a+A))];default:return[new ct(Math.round(i.left),Math.round(i.top)),new ct(Math.round(i.left+i.width),Math.round(i.top)),new ct(Math.round(i.left+i.width),Math.round(i.height+i.top)),new ct(Math.round(i.left),Math.round(i.height+i.top))]}},Jae="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hy="Hidden Text",Zae=function(){function n(e){this._data={},this._document=e}return n.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),i=this._document.createElement("img"),s=this._document.createElement("span"),a=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",a.appendChild(r),i.src=Jae,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",s.style.fontFamily=e,s.style.fontSize=t,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(hy)),r.appendChild(s),r.appendChild(i);var o=i.offsetTop-s.offsetTop+2;r.removeChild(s),r.appendChild(this._document.createTextNode(hy)),r.style.lineHeight="normal",i.style.verticalAlign="super";var A=i.offsetTop-r.offsetTop+2;return a.removeChild(r),{baseline:o,middle:A}},n.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},n}(),$E=function(){function n(e,t){this.context=e,this.options=t}return n}(),eoe=1e4,toe=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px"),i.fontMetrics=new Zae(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),i}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(i){return r.applyEffect(i)})},e.prototype.applyEffect=function(t){this.ctx.save(),Hae(t)&&(this.ctx.globalAlpha=t.opacity),Qae(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),DE(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return ai(this,void 0,void 0,function(){var r;return Kr(this,function(i){switch(i.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return ai(this,void 0,void 0,function(){return Kr(this,function(r){switch(r.label){case 0:if(xr(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,i){var s=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+i);else{var a=d2(t.text);a.reduce(function(o,A){return s.ctx.fillText(A,o,t.bounds.top+i),o+s.ctx.measureText(A).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(a){return a==="normal"||a==="small-caps"}).join(""),i=aoe(t.fontFamily).join(", "),s=Eu(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,s,i].join(" "),i,s]},e.prototype.renderTextNode=function(t,r){return ai(this,void 0,void 0,function(){var i,s,a,o,A,l,c,u,h=this;return Kr(this,function(f){return i=this.createFontStyle(r),s=i[0],a=i[1],o=i[2],this.ctx.font=s,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",A=this.fontMetrics.getMetrics(a,o),l=A.baseline,c=A.middle,u=r.paintOrder,t.textBounds.forEach(function(d){u.forEach(function(g){switch(g){case 0:h.ctx.fillStyle=Ir(r.color),h.renderTextWithLetterSpacing(d,r.letterSpacing,l);var m=r.textShadow;
vendor: 5,336 bytes, line 19382
19382m.length&&d.text.trim().length&&(m.slice(0).reverse().forEach(function(p){h.ctx.shadowColor=Ir(p.color),h.ctx.shadowOffsetX=p.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=p.offsetY.number*h.options.scale,h.ctx.shadowBlur=p.blur.number,h.renderTextWithLetterSpacing(d,r.letterSpacing,l)}),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),r.textDecorationLine.length&&(h.ctx.fillStyle=Ir(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(p){switch(p){case 1:h.ctx.fillRect(d.bounds.left,Math.round(d.bounds.top+l),d.bounds.width,1);break;case 2:h.ctx.fillRect(d.bounds.left,Math.round(d.bounds.top),d.bounds.width,1);break;case 3:h.ctx.fillRect(d.bounds.left,Math.ceil(d.bounds.top+c),d.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&d.text.trim().length&&(h.ctx.strokeStyle=Ir(r.webkitTextStrokeColor),h.ctx.lineWidth=r.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(d.text,d.bounds.left,d.bounds.top+l)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,i){if(i&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var s=Of(t),a=Lf(r);this.path(a),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,t.intrinsicWidth,t.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return ai(this,void 0,void 0,function(){var r,i,s,a,o,A,w,w,l,c,u,h,b,f,d,U,g,m,p,w,C,b,U;return Kr(this,function(F){switch(F.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,i=t.curves,s=r.styles,a=0,o=r.textNodes,F.label=1;case 1:return a<o.length?(A=o[a],[4,this.renderTextNode(A,s)]):[3,4];case 2:F.sent(),F.label=3;case 3:return a++,[3,1];case 4:if(!(r instanceof yE))return[3,8];F.label=5;case 5:return F.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return w=F.sent(),this.renderReplacedElement(r,i,w),[3,8];case 7:return F.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof vE&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof wE))return[3,12];F.label=9;case 9:return F.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return w=F.sent(),this.renderReplacedElement(r,i,w),[3,12];case 11:return F.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof _E&&r.tree?(l=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,l.render(r.tree)]):[3,14];case 13:c=F.sent(),r.width&&r.height&&this.ctx.drawImage(c,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),F.label=14;case 14:if(r instanceof p2&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===Rf?r.checked&&(this.ctx.save(),this.path([new ct(r.bounds.left+u*.39363,r.bounds.top+u*.79),new ct(r.bounds.left+u*.16,r.bounds.top+u*.5549),new ct(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new ct(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new ct(r.bounds.left+u*.72983,r.bounds.top+u*.23),new ct(r.bounds.left+u*.84,r.bounds.top+u*.34085),new ct(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=Ir(Z4),this.ctx.fill(),this.ctx.restore()):r.type===Uf&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=Ir(Z4),this.ctx.fill(),this.ctx.restore())),noe(r)&&r.value.length){switch(h=this.createFontStyle(s),b=h[0],f=h[1],d=this.fontMetrics.getMetrics(b,f).baseline,this.ctx.font=b,this.ctx.fillStyle=Ir(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=ioe(r.styles.textAlign),U=Of(r),g=0,r.styles.textAlign){case 1:g+=U.width/2;break;case 2:g+=U.width;break}m=U.add(g,0,0,-U.height/2+1),this.ctx.save(),this.path([new ct(U.left,U.top),new ct(U.left+U.width,U.top),new ct(U.left+U.width,U.top+U.height),new ct(U.left,U.top+U.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Pc(r.value,m),s.letterSpacing,d),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!xr(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(p=r.styles.listStyleImage,p.type!==0)return[3,18];w=void 0,C=p.url,F.label=15;case 15:return F.trys.push([15,17,,18]),[4,this.context.cache.match(C)];case 16:return w=F.sent(),this.ctx.drawImage(w,r.bounds.left-(w.width+10),r.bounds.top),[3,18];case 17:return F.sent(),this.context.logger.error("Error loading list-style-image "+C),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(b=this.createFontStyle(s)[0],this.ctx.font=b,this.ctx.fillStyle=Ir(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",U=new Ra(r.bounds.left,r.bounds.top+Gn(r.styles.paddingTop,r.bounds.width),r.bounds.width,L4(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Pc(t.listValue,U),s.letterSpacing,L4(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),F.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return ai(this,void 0,void 0,function(){var r,i,p,s,a,p,o,A,p,l,c,p,u,h,p,f,d,p,g,m,p;return Kr(this,function(w){switch(w.label){case 0:if(xr(t.element.container.flags,16))debugger;
vendor: 8,246 bytes, line 19382
19382return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:w.sent(),r=0,i=t.negativeZIndex,w.label=2;case 2:return r<i.length?(p=i[r],[4,this.renderStack(p)]):[3,5];case 3:w.sent(),w.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:w.sent(),s=0,a=t.nonInlineLevel,w.label=7;case 7:return s<a.length?(p=a[s],[4,this.renderNode(p)]):[3,10];case 8:w.sent(),w.label=9;case 9:return s++,[3,7];case 10:o=0,A=t.nonPositionedFloats,w.label=11;case 11:return o<A.length?(p=A[o],[4,this.renderStack(p)]):[3,14];case 12:w.sent(),w.label=13;case 13:return o++,[3,11];case 14:l=0,c=t.nonPositionedInlineLevel,w.label=15;case 15:return l<c.length?(p=c[l],[4,this.renderStack(p)]):[3,18];case 16:w.sent(),w.label=17;case 17:return l++,[3,15];case 18:u=0,h=t.inlineLevel,w.label=19;case 19:return u<h.length?(p=h[u],[4,this.renderNode(p)]):[3,22];case 20:w.sent(),w.label=21;case 21:return u++,[3,19];case 22:f=0,d=t.zeroOrAutoZIndexOrTransformedOrOpacity,w.label=23;case 23:return f<d.length?(p=d[f],[4,this.renderStack(p)]):[3,26];case 24:w.sent(),w.label=25;case 25:return f++,[3,23];case 26:g=0,m=t.positiveZIndex,w.label=27;case 27:return g<m.length?(p=m[g],[4,this.renderStack(p)]):[3,30];case 28:w.sent(),w.label=29;case 29:return g++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(i,s){var a=Ji(i)?i.start:i;s===0?r.ctx.moveTo(a.x,a.y):r.ctx.lineTo(a.x,a.y),Ji(i)&&r.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(t,r,i,s){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},e.prototype.resizeImage=function(t,r,i){var s;if(t.width===r&&t.height===i)return t;var a=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=a.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,i);var A=o.getContext("2d");return A.drawImage(t,0,0,t.width,t.height,0,0,r,i),o},e.prototype.renderBackgroundImage=function(t){return ai(this,void 0,void 0,function(){var r,i,s,a,o,A;return Kr(this,function(l){switch(l.label){case 0:r=t.styles.backgroundImage.length-1,i=function(c){var u,h,f,R,ue,Ce,Y,se,O,d,R,ue,Ce,Y,se,g,m,p,w,C,b,U,F,D,O,I,R,V,re,Y,se,ge,ue,Ce,ae,we,Pe,$e,yt,Dt,Be,De;return Kr(this,function(je){switch(je.label){case 0:if(c.type!==0)return[3,5];u=void 0,h=c.url,je.label=1;case 1:return je.trys.push([1,3,,4]),[4,s.context.cache.match(h)];case 2:return u=je.sent(),[3,4];case 3:return je.sent(),s.context.logger.error("Error loading background-image "+h),[3,4];case 4:return u&&(f=zp(t,r,[u.width,u.height,u.width/u.height]),R=f[0],ue=f[1],Ce=f[2],Y=f[3],se=f[4],O=s.ctx.createPattern(s.resizeImage(u,Y,se),"repeat"),s.renderRepeat(R,O,ue,Ce)),[3,6];case 5:Qre(c)?(d=zp(t,r,[null,null,null]),R=d[0],ue=d[1],Ce=d[2],Y=d[3],se=d[4],g=Lre(c.angle,Y,se),m=g[0],p=g[1],w=g[2],C=g[3],b=g[4],U=document.createElement("canvas"),U.width=Y,U.height=se,F=U.getContext("2d"),D=F.createLinearGradient(p,C,w,b),N4(c.stops,m).forEach(function(Ke){return D.addColorStop(Ke.stop,Ir(Ke.color))}),F.fillStyle=D,F.fillRect(0,0,Y,se),Y>0&&se>0&&(O=s.ctx.createPattern(U,"repeat"),s.renderRepeat(R,O,ue,Ce))):Hre(c)&&(I=zp(t,r,[null,null,null]),R=I[0],V=I[1],re=I[2],Y=I[3],se=I[4],ge=c.position.length===0?[u2]:c.position,ue=Gn(ge[0],Y),Ce=Gn(ge[ge.length-1],se),ae=Ore(c,ue,Ce,Y,se),we=ae[0],Pe=ae[1],we>0&&Pe>0&&($e=s.ctx.createRadialGradient(V+ue,re+Ce,0,V+ue,re+Ce,we),N4(c.stops,we*2).forEach(function(Ke){return $e.addColorStop(Ke.stop,Ir(Ke.color))}),s.path(R),s.ctx.fillStyle=$e,we!==Pe?(yt=t.bounds.left+.5*t.bounds.width,Dt=t.bounds.top+.5*t.bounds.height,Be=Pe/we,De=1/Be,s.ctx.save(),s.ctx.translate(yt,Dt),s.ctx.transform(1,0,0,Be,0,0),s.ctx.translate(-yt,-Dt),s.ctx.fillRect(V,De*(re-Dt)+Dt,Y,se*De),s.ctx.restore()):s.ctx.fill())),je.label=6;case 6:return r--,[2]}})},s=this,a=0,o=t.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return a<o.length?(A=o[a],[5,i(A)]):[3,4];case 2:l.sent(),l.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,i){return ai(this,void 0,void 0,function(){return Kr(this,function(s){return this.path(uy(i,r)),this.ctx.fillStyle=Ir(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,i,s){return ai(this,void 0,void 0,function(){var a,o;return Kr(this,function(A){switch(A.label){case 0:return r<3?[4,this.renderSolidBorder(t,i,s)]:[3,2];case 1:return A.sent(),[2];case 2:return a=zae(s,i),this.path(a),this.ctx.fillStyle=Ir(t),this.ctx.fill(),o=Wae(s,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return ai(this,void 0,void 0,function(){var r,i,s,a,o,A,l,c,u=this;return Kr(this,function(h){switch(h.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,i=!go(r.backgroundColor)||r.backgroundImage.length,s=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],a=roe(rl(r.backgroundClip,0),t.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),go(r.backgroundColor)||(this.ctx.fillStyle=Ir(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:h.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){u.ctx.save();var d=Df(t.curves),g=f.inset?0:eoe,m=Vae(d,-g+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(u.path(d),u.ctx.clip(),u.mask(m)):(u.mask(d),u.ctx.clip(),u.path(m)),u.ctx.shadowOffsetX=f.offsetX.number+g,u.ctx.shadowOffsetY=f.offsetY.number,u.ctx.shadowColor=Ir(f.color),u.ctx.shadowBlur=f.blur.number,u.ctx.fillStyle=f.inset?Ir(f.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),h.label=2;case 2:o=0,A=0,l=s,h.label=3;case 3:return A<l.length?(c=l[A],c.style!==0&&!go(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return h.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,3)];case 6:return h.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,t.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,t.curves)];case 10:h.sent(),h.label=11;case 11:o++,h.label=12;case 12:return A++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,i,s,a){return ai(this,void 0,void 0,function(){var o,A,l,c,u,h,f,d,g,m,p,w,C,b,U,F,U,F;return Kr(this,function(D){return this.ctx.save(),o=Kae(s,i),A=uy(s,i),a===2&&(this.path(A),this.ctx.clip()),Ji(A[0])?(l=A[0].start.x,c=A[0].start.y):(l=A[0].x,c=A[0].y),Ji(A[1])?(u=A[1].end.x,h=A[1].end.y):(u=A[1].x,h=A[1].y),i===0||i===2?f=Math.abs(l-u):f=Math.abs(c-h),this.ctx.beginPath(),a===3?this.formatPath(o):this.formatPath(A.slice(0,2)),d=r<3?r*3:r*2,g=r<3?r*2:r,a===3&&(d=r,g=r),m=!0,f<=d*2?m=!1:f<=d*2+g?(p=f/(2*d+g),d*=p,g*=p):(w=Math.floor((f+g)/(d+g)),C=(f-w*d)/(w-1),b=(f-(w+1)*d)/w,g=b<=0||Math.abs(g-C)<Math.abs(g-b)?C:b),m&&(a===3?this.ctx.setLineDash([0,d+g]):this.ctx.setLineDash([d,g])),a===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=Ir(t),this.ctx.stroke(),this.ctx.setLineDash([]),a===2&&(Ji(A[0])&&(U=A[3],F=A[0],this.ctx.beginPath(),this.formatPath([new ct(U.end.x,U.end.y),new ct(F.start.x,F.start.y)]),this.ctx.stroke()),Ji(A[1])&&(U=A[1],F=A[2],this.ctx.beginPath(),this.formatPath([new ct(U.end.x,U.end.y),new ct(F.start.x,F.start.y)]),this.ctx.stroke())),this.ctx.restore(
vendor: 8,333 bytes, line 19382
19382),[2]})})},e.prototype.render=function(t){return ai(this,void 0,void 0,function(){var r;return Kr(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Ir(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=Gae(t),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}($E),noe=function(n){return n instanceof CE||n instanceof bE?!0:n instanceof p2&&n.type!==Uf&&n.type!==Rf},roe=function(n,e){switch(n){case 0:return Df(e);case 2:return Pae(e);case 1:default:return Lf(e)}},ioe=function(n){switch(n){case 1:return"center";case 2:return"right";case 0:default:return"left"}},soe=["-apple-system","system-ui"],aoe=function(n){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?n.filter(function(e){return soe.indexOf(e)===-1}):n},ooe=function(n){Ns(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),i}return e.prototype.render=function(t){return ai(this,void 0,void 0,function(){var r,i;return Kr(this,function(s){switch(s.label){case 0:return r=K1(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Aoe(r)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Ir(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}($E),Aoe=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(n))})},loe=function(){function n(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return n.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,fh([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},n.prototype.getTime=function(){return Date.now()-this.start},n.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,fh([this.id,this.getTime()+"ms"],e))},n.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,fh([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},n.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,fh([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},n.instances={},n}(),coe=function(){function n(e,t){var r;this.windowBounds=t,this.instanceName="#"+n.instanceCount++,this.logger=new loe({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new Fae(this,e)}return n.instanceCount=1,n}(),uoe=function(n,e){return e===void 0&&(e={}),hoe(n,e)};typeof window<"u"&&NE.setContext(window);var hoe=function(n,e){return ai(void 0,void 0,void 0,function(){var t,r,i,s,a,o,A,l,c,u,h,f,d,g,m,p,w,C,b,U,D,F,D,O,I,R,V,re,Y,se,ge,ue,Ce,ae,we,Pe,$e,yt,Dt,Be;return Kr(this,function(De){switch(De.label){case 0:if(!n||typeof n!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=n.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return i={allowTaint:(O=e.allowTaint)!==null&&O!==void 0?O:!1,imageTimeout:(I=e.imageTimeout)!==null&&I!==void 0?I:15e3,proxy:e.proxy,useCORS:(R=e.useCORS)!==null&&R!==void 0?R:!1},s=U1({logging:(V=e.logging)!==null&&V!==void 0?V:!0,cache:e.cache},i),a={windowWidth:(re=e.windowWidth)!==null&&re!==void 0?re:r.innerWidth,windowHeight:(Y=e.windowHeight)!==null&&Y!==void 0?Y:r.innerHeight,scrollX:(se=e.scrollX)!==null&&se!==void 0?se:r.pageXOffset,scrollY:(ge=e.scrollY)!==null&&ge!==void 0?ge:r.pageYOffset},o=new Ra(a.scrollX,a.scrollY,a.windowWidth,a.windowHeight),A=new coe(s,o),l=(ue=e.foreignObjectRendering)!==null&&ue!==void 0?ue:!1,c={allowTaint:(Ce=e.allowTaint)!==null&&Ce!==void 0?Ce:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},A.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new Ay(A,n,c),h=u.clonedReferenceElement,h?[4,u.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=De.sent(),d=m2(h)||fae(h)?Vte(h.ownerDocument):ld(A,h),g=d.width,m=d.height,p=d.left,w=d.top,C=foe(A,h,e.backgroundColor),b={canvas:e.canvas,backgroundColor:C,scale:(we=(ae=e.scale)!==null&&ae!==void 0?ae:r.devicePixelRatio)!==null&&we!==void 0?we:1,x:((Pe=e.x)!==null&&Pe!==void 0?Pe:0)+p,y:(($e=e.y)!==null&&$e!==void 0?$e:0)+w,width:(yt=e.width)!==null&&yt!==void 0?yt:Math.ceil(g),height:(Dt=e.height)!==null&&Dt!==void 0?Dt:Math.ceil(m)},l?(A.logger.debug("Document cloned, using foreign object rendering"),D=new ooe(A,b),[4,D.render(h)]):[3,3];case 2:return U=De.sent(),[3,5];case 3:return A.logger.debug("Document cloned, element located at "+p+","+w+" with size "+g+"x"+m+" using computed rendering"),A.logger.debug("Starting DOM parsing"),F=EE(A,h),C===F.styles.backgroundColor&&(F.styles.backgroundColor=Ca.TRANSPARENT),A.logger.debug("Starting renderer for element at "+b.x+","+b.y+" with size "+b.width+"x"+b.height),D=new toe(A,b),[4,D.render(F)];case 4:U=De.sent(),De.label=5;case 5:return(!((Be=e.removeContainer)!==null&&Be!==void 0)||Be)&&(Ay.destroy(f)||A.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),A.logger.debug("Finished rendering"),[2,U]}})})},foe=function(n,e,t){var r=e.ownerDocument,i=r.documentElement?Lc(n,getComputedStyle(r.documentElement).backgroundColor):Ca.TRANSPARENT,s=r.body?Lc(n,getComputedStyle(r.body).backgroundColor):Ca.TRANSPARENT,a=typeof t=="string"?Lc(n,t):t===null?Ca.TRANSPARENT:4294967295;return e===r.documentElement?go(i)?go(s)?a:s:i:a};const doe=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,
19382130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,
19382116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];function poe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function fy(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function moe(n,e,t){return e&&fy(n.prototype,e),t&&fy(n,t),n}/** 19383* KalmanFilter 19384* @class 19385* @author Wouter Bulten 19386* @see {@link http://github.com/wouterbulten/kalmanjs}
19387* @version Version: 1.0.0-beta 19388* @copyright Copyright 2015-2018 Wouter Bulten 19389* @license MIT License 19390* @preserve 19391*/var goe=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.R,r=t===void 0?1:t,i=e.Q,s=i===void 0?1:i,a=e.A,o=a===void 0?1:a,A=e.B,l=A===void 0?0:A,c=e.C,u=c===void 0?1:c;poe(this,n),this.R=r,this.Q=s,this.A=o,this.C=u,this.B=l,this.cov=NaN,this.x=NaN}return moe(n,[{key:"filter",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(isNaN(this.x))this.x=1/this.C*t,this.cov=1/this.C*this.Q*(1/this.C);else{var i=this.predict(r),s=this.uncertainty(),a=s*this.C*(1/(this.C*s*this.C+this.Q));this.x=i+a*(t-this.C*i),this.cov=s-a*this.C*s}return this.x}},{key:"predict",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.A*this.x+this.B*t}},{key:"uncertainty",value:function(){return this.A*this.cov*this.A+this.R}},{key:"lastMeasurement",value:function(){return this.x}},{key:"setMeasurementNoise",value:function(t){this.Q=t}},{key:"setProcessNoise",value:function(t){this.R=t}}]),n}(),Lh=goe,QE={name:"GalleriaItem",extends:lu,emits:["start-slideshow","stop-slideshow","update:activeIndex"],props:{circular:{type:Boolean,default:!1},activeIndex:{type:Number,default:0},value:{type:Array,default:null},showItemNavigators:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},slideShowActive:{type:Boolean,default:!0},changeItemOnIndicatorHover:{type:Boolean,default:!0},autoPlay:{type:Boolean,default:!1},templates:{type:null,default:null},id:{type:String,default:null}},mounted(){this.autoPlay&&this.$emit("start-slideshow")},methods:{next(){let n=this.activeIndex+1,e=this.circular&&this.value.length-1===this.activeIndex?0:n;this.$emit("update:activeIndex",e)},prev(){let n=this.activeIndex!==0?this.activeIndex-1:0,e=this.circular&&this.activeIndex===0?this.value.length-1:n;this.$emit("update:activeIndex",e)},stopSlideShow(){this.slideShowActive&&this.stopSlideShow&&this.$emit("stop-slideshow")},navBackward(n){this.stopSlideShow(),this.prev(),n&&n.cancelable&&n.preventDefault()},navForward(n){this.stopSlideShow(),this.next(),n&&n.cancelable&&n.preventDefault()},onIndicatorClick(n){this.stopSlideShow(),this.$emit("update:activeIndex",n)},onIndicatorMouseEnter(n){this.changeItemOnIndicatorHover&&(this.stopSlideShow(),this.$emit("update:activeIndex",n))},onIndicatorKeyDown(n,e){switch(n.code){case"Enter":case"Space":this.stopSlideShow(),this.$emit("update:activeIndex",e),n.preventDefault();break;case"ArrowDown":case"ArrowUp":n.preventDefault();break}},isIndicatorItemActive(n){return this.activeIndex===n},isNavBackwardDisabled(){return!this.circular&&this.activeIndex===0},isNavForwardDisabled(){return!this.circular&&this.activeIndex===this.value.length-1},ariaSlideNumber(n){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g,n):void 0},ariaPageLabel(n){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,n):void 0}},computed:{activeItem(){return this.value[this.activeIndex]},navBackwardClass(){return["p-galleria-item-prev p-galleria-item-nav p-link",{"p-disabled":this.isNavBackwardDisabled()}]},navForwardClass(){return["p-galleria-item-next p-galleria-item-nav p-link",{"p-disabled":this.isNavForwardDisabled()}]},ariaSlideLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slide:void 0}},components:{ChevronLeftIcon:gy,ChevronRightIcon:yy},directives:{ripple:Pf}};const yoe=["disabled"],voe=["id","aria-label","aria-roledescription"],woe=["disabled"],xoe=["aria-label","aria-selected","aria-controls","onClick","onMouseenter","onKeydown"],boe={key:0,type:"button",tabindex:"-1",class:"p-link"};function Coe(n,e,t,r,i,s){const a=Au("ripple");return jt(),Hn("div",bn({class:"p-galleria-item-wrapper"},n.ptm("itemWrapper")),[Sn("div",bn({class:"p-galleria-item-container"},n.ptm("itemContainer")),[t.showItemNavigators?aA((jt(),Hn("button",bn({key:0,type:"button",class:s.navBackwardClass,onClick:e[0]||(e[0]=o=>s.navBackward(o)),disabled:s.isNavBackwardDisabled()},n.ptm("previousItemButton")),[(jt(),$r(ws(t.templates.previousitemicon||"ChevronLeftIcon"),bn({class:"p-galleria-item-prev-icon"},n.ptm("previousItemIcon")),null,16))],16,yoe)),[[a]]):tr("",!0),Sn("div",bn({id:t.id+"_item_"+t.activeIndex,class:"p-galleria-item",role:"group","aria-label":s.ariaSlideNumber(t.activeIndex+1),"aria-roledescription":s.ariaSlideLabel},n.ptm("item")),[t.templates.item?(jt(),$r(ws(t.templates.item),{key:0,item:s.activeItem},null,8,["item"])):tr("",!0)],16,voe),t.showItemNavigators?aA((jt(),Hn("button",bn({key:1,type:"button",class:s.navForwardClass,onClick:e[1]||(e[1]=o=>s.navForward(o)),disabled:s.isNavForwardDisabled()},n.ptm("nextItemButton")),[(jt(),$r(ws(t.templates.nextitemicon||"ChevronRightIcon"),bn({class:"p-galleria-item-next-icon"},n.ptm("nextItemIcon")),null,16))],16,woe)),[[a]]):tr("",!0),t.templates.caption?(jt(),Hn("div",bn({ke
19391y:2,class:"p-galleria-caption"},n.ptm("caption")),[t.templates.caption?(jt(),$r(ws(t.templates.caption),{key:0,item:s.activeItem},null,8,["item"])):tr("",!0)],16)):tr("",!0)],16),t.showIndicators?(jt(),Hn("ul",bn({key:0,class:"p-galleria-indicators p-reset"},n.ptm("indicators")),[(jt(!0),Hn(py,null,my(t.value,(o,A)=>(jt(),Hn("li",bn({key:`p-galleria-indicator-${A}`,class:["p-galleria-indicator",{"p-highlight":s.isIndicatorItemActive(A)}],tabindex:"0","aria-label":s.ariaPageLabel(A+1),"aria-selected":t.activeIndex===A,"aria-controls":t.id+"_item_"+A,onClick:l=>s.onIndicatorClick(A),onMouseenter:l=>s.onIndicatorMouseEnter(A),onKeydown:l=>s.onIndicatorKeyDown(l,A)},n.ptm("indicator")),[t.templates.indicator?tr("",!0):(jt(),Hn("button",boe)),t.templates.indicator?(jt(),$r(ws(t.templates.indicator),{key:1,index:A},null,8,["index"])):tr("",!0)],16,xoe))),128))],16)):tr("",!0)],16)}QE.render=Coe;var HE={name:"GalleriaThumbnails",extends:lu,emits:["stop-slideshow","update:activeIndex"],props:{containerId:{type:String,default:null},value:{type:Array,default:null},numVisible:{type:Number,default:3},activeIndex:{type:Number,default:0},isVertical:{type:Boolean,default:!1},slideShowActive:{type:Boolean,default:!1},circular:{type:Boolean,default:!1},responsiveOptions:{type:Array,default:null},contentHeight:{type:String,default:"300px"},showThumbnailNavigators:{type:Boolean,default:!0},templates:{type:null,default:null},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},startPos:null,thumbnailsStyle:null,sortedResponsiveOptions:null,data(){return{d_numVisible:this.numVisible,d_oldNumVisible:this.numVisible,d_activeIndex:this.activeIndex,d_oldActiveItemIndex:this.activeIndex,totalShiftedItems:0,page:0}},watch:{numVisible(n,e){this.d_numVisible=n,this.d_oldNumVisible=e},activeIndex(n,e){this.d_activeIndex=n,this.d_oldActiveItemIndex=e}},mounted(){this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners()},updated(){let n=this.totalShiftedItems;(this.d_oldNumVisible!==this.d_numVisible||this.d_oldActiveItemIndex!==this.d_activeIndex)&&(this.d_activeIndex<=this.getMedianItemIndex()?n=0:this.value.length-this.d_numVisible+this.getMedianItemIndex()<this.d_activeIndex?n=this.d_numVisible-this.value.length:this.value.length-this.d_numVisible<this.d_activeIndex&&this.d_numVisible%2===0?n=this.d_activeIndex*-1+this.getMedianItemIndex()+1:n=this.d_activeIndex*-1+this.getMedianItemIndex(),n!==this.totalShiftedItems&&(this.totalShiftedItems=n),this.$refs.itemsContainer.style.transform=this.isVertical?`translate3d(0, ${n*(100/this.d_numVisible)}%, 0)`:`translate3d(${n*(100/this.d_numVisible)}%, 0, 0)`,this.d_oldActiveItemIndex!==this.d_activeIndex&&(si.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.d_oldActiveItemIndex=this.d_activeIndex,this.d_oldNumVisible=this.d_numVisible)},beforeUnmount(){this.responsiveOptions&&this.unbindDocumentListeners(),this.thumbnailsStyle&&this.thumbnailsStyle.parentNode.removeChild(this.thumbnailsStyle)},methods:{step(n){let e=this.totalShiftedItems+n;n<0&&-1*e+this.d_numVisible>this.value.length-1?e=this.d_numVisible-this.value.length:n>0&&e>0&&(e=0),this.circular&&(n<0&&this.value.length-1===this.d_activeIndex?e=0:n>0&&this.d_activeIndex===0&&(e=this.d_numVisible-this.value.length)),this.$refs.itemsContainer&&(si.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical?`translate3d(0, ${e*(100/this.d_numVisible)}%, 0)`:`translate3d(${e*(100/this.d_numVisible)}%, 0, 0)`,this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=e},stopSlideShow(){this.slideShowActive&&this.stopSlideShow&&this.$emit("stop-slideshow")},getMedianItemIndex(){let n=Math.floor(this.d_numVisible/2);return this.d_numVisible%2?n:n-1},navBackward(n){this.stopSlideShow();let e=this.d_activeIndex!==0?this.d_activeIndex-1:0,t=e+this.totalShiftedItems;this.d_numVisible-t-1>this.getMedianItemIndex()&&(-1*this.totalShiftedItems!==0||this.circular)&&this.step(1);let r=this.circular&&this.d_activeIndex===0?this.value.length-1:e;this.$emit("update:activeIndex",r),n.cancelable&&n.preventDefault()},navForward(n){this.stopSlideShow();let e=this.d_activeIndex===this.value.length-1?this.value.length-1:this.d_activeIndex+1;e+this.totalShiftedItems>this.getMedianItemIndex()&&(-1*this.totalShiftedItems<this.getTotalPageNumber()-1||this.circular)&&this.step(-1);let t=this.circular&&this.value.length-1===this.d_activeIndex?0:e;this.$emit("update:activeIndex",t),n.cancelable&&n.preventDefault()},onItemClick(n){this.stopSlideShow();let e=n;if(e!==this.d_activeIndex){const t=e+this.totalShiftedItems;let r=0;e<this.d_activeIndex?(r=this.d_numVisible-t-1-this.getMedianItemIndex(),r>0&&-1*this.totalShiftedItems!==0&&this.step(r)):(r=this.getMedianItemIndex()-t,r<0&&-1*this.totalShiftedItems<this.getTotalPageNumber()-1&&this.step(r)),this.$emit("update:activeIndex",e)}},onThumbnailKeydown(n,e){switch((n.code==="Enter"||n.code==="Space")&&(this.onItemClick(e),n.preventDefault()),n.code){case"ArrowRight":this.onRightKey();break;case"ArrowLeft":this.onLeftKey();break;case"Home":this.onHomeKey(),n.preventDefault();break;case"End":this.onEndKey(),n.preventDefault();break;case"ArrowUp":case"ArrowDown":n.preventDefault();break;case"Tab":this.onTabKey();break}},onRightKey(){const n=si.find(this.$refs.itemsContainer,".p-galleria-thumbn
19391ail-item"),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,e+1===n.length?n.length-1:e+1)},onLeftKey(){const n=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(n,n-1<=0?0:n-1)},onHomeKey(){const n=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(n,0)},onEndKey(){const n=si.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item"),e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,n.length-1)},onTabKey(){const n=[...si.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item")],e=n.findIndex(i=>si.hasClass(i,"p-galleria-thumbnail-item-current")),t=si.findSingle(this.$refs.itemsContainer,'.p-galleria-thumbnail-item > [tabindex="0"'),r=n.findIndex(i=>i===t.parentElement);n[r].children[0].tabIndex="-1",n[e].children[0].tabIndex="0"},findFocusedIndicatorIndex(){const n=[...si.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item")],e=si.findSingle(this.$refs.itemsContainer,'.p-galleria-thumbnail-item > [tabindex="0"]');return n.findIndex(t=>t===e.parentElement)},changedFocusedIndicator(n,e){const t=si.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item");t[n].children[0].tabIndex="-1",t[e].children[0].tabIndex="0",t[e].children[0].focus()},onTransitionEnd(){this.$refs.itemsContainer&&(si.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="")},onTouchStart(n){let e=n.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},onTouchMove(n){n.cancelable&&n.preventDefault()},onTouchEnd(n){let e=n.changedTouches[0];this.isVertical?this.changePageOnTouch(n,e.pageY-this.startPos.y):this.changePageOnTouch(n,e.pageX-this.startPos.x)},changePageOnTouch(n,e){e<0?this.navForward(n):this.navBackward(n)},getTotalPageNumber(){return this.value.length>this.d_numVisible?this.value.length-this.d_numVisible+1:0},createStyle(){this.thumbnailsStyle||(this.thumbnailsStyle=document.createElement("style"),this.thumbnailsStyle.type="text/css",document.body.appendChild(this.thumbnailsStyle));let n=` 19392 #${this.containerId} .p-galleria-thumbnail-item { 19393 flex: 1 0 ${100/this.d_numVisible}% 19394 } 19395 `;if(this.responsiveOptions){this.sortedResponsiveOptions=[...this.responsiveOptions],this.sortedResponsiveOptions.sort((e,t)=>{const r=e.breakpoint,i=t.breakpoint;let s=null;return r==null&&i!=null?s=-1:r!=null&&i==null?s=1:r==null&&i==null?s=0:typeof r=="string"&&typeof i=="string"?s=r.localeCompare(i,void 0,{numeric:!0}):s=r<i?-1:r>i?1:0,-1*s});for(let e=0;e<this.sortedResponsiveOptions.length;e++){let t=this.sortedResponsiveOptions[e];n+=` 19396 @media screen and (max-width: ${t.breakpoint}) { 19397 #${this.containerId} .p-galleria-thumbnail-item { 19398 flex: 1 0 ${100/t.numVisible}% 19399 } 19400 } 19401 `}}this.thumbnailsStyle.innerHTML=n},calculatePosition(){if(this.$refs.itemsContainer&&this.sortedResponsiveOptions){let n=window.innerWidth,e={numVisible:this.numVisible};for(let t=0;t<this.sortedResponsiveOptions.length;t++){let r=this.sortedResponsiveOptions[t];parseInt(r.breakpoint,10)>=n&&(e=r)}this.d_numVisible!==e.numVisible&&(this.d_numVisible=e.numVisible)}},bindDocumentListeners(){this.documentResizeListener||(this.documentResizeListener=()=>{this.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},isNavBackwardDisabled(){return!this.circular&&this.d_activeIndex===0||this.value.length<=this.d_numVisible},isNavForwardDisabled(){return!this.circular&&this.d_activeIndex===this.value.length-1||this.value.length<=this.d_numVisible},firstItemAciveIndex(){return this.totalShiftedItems*-1},lastItemActiveIndex(){return this.firstItemAciveIndex()+this.d_numVisible-1},isItemActive(n){return this.firstItemAciveIndex()<=n&&this.lastItemActiveIndex()>=n},ariaPageLabel(n){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,n):void 0}}
19401,computed:{navBackwardClass(){return["p-galleria-thumbnail-prev p-link",{"p-disabled":this.isNavBackwardDisabled()}]},navForwardClass(){return["p-galleria-thumbnail-next p-link",{"p-disabled":this.isNavForwardDisabled()}]},ariaPrevButtonLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.prevPageLabel:void 0},ariaNextButtonLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.nextPageLabel:void 0}},components:{ChevronLeftIcon:gy,ChevronRightIcon:yy,ChevronUpIcon:tS,ChevronDownIcon:nS},directives:{ripple:Pf}};const _oe=["disabled","aria-label"],Boe=["aria-selected","aria-controls","onKeydown"],Eoe=["tabindex","aria-label","aria-current","onClick"],Soe=["disabled","aria-label"];function Toe(n,e,t,r,i,s){const a=Au("ripple");return jt(),Hn("div",bn({class:"p-galleria-thumbnail-wrapper"},n.ptm("thumbnailWrapper")),[Sn("div",bn({class:"p-galleria-thumbnail-container"},n.ptm("thumbnailContainer")),[t.showThumbnailNavigators?aA((jt(),Hn("button",bn({key:0,class:s.navBackwardClass,disabled:s.isNavBackwardDisabled(),type:"button","aria-label":s.ariaPrevButtonLabel,onClick:e[0]||(e[0]=o=>s.navBackward(o))},{...t.prevButtonProps,...n.ptm("previousThumbnailButton")}),[(jt(),$r(ws(t.templates.previousthumbnailicon||(t.isVertical?"ChevronUpIcon":"ChevronLeftIcon")),bn({class:"p-galleria-thumbnail-prev-icon"},n.ptm("previousThumbnailIcon")),null,16))],16,_oe)),[[a]]):tr("",!0),Sn("div",bn({class:"p-galleria-thumbnail-items-container",style:{height:t.isVertical?t.contentHeight:""}},n.ptm("thumbnailItemsContainer")),[Sn("div",bn({ref:"itemsContainer",class:"p-galleria-thumbnail-items",role:"tablist",onTransitionend:e[1]||(e[1]=(...o)=>s.onTransitionEnd&&s.onTransitionEnd(...o)),onTouchstart:e[2]||(e[2]=o=>s.onTouchStart(o)),onTouchmove:e[3]||(e[3]=o=>s.onTouchMove(o)),onTouchend:e[4]||(e[4]=o=>s.onTouchEnd(o))},n.ptm("thumbnailItems")),[(jt(!0),Hn(py,null,my(t.value,(o,A)=>(jt(),Hn("div",bn({key:`p-galleria-thumbnail-item-${A}`,class:["p-galleria-thumbnail-item",{"p-galleria-thumbnail-item-current":t.activeIndex===A,"p-galleria-thumbnail-item-active":s.isItemActive(A),"p-galleria-thumbnail-item-start":s.firstItemAciveIndex()===A,"p-galleria-thumbnail-item-end":s.lastItemActiveIndex()===A}],role:"tab","aria-selected":t.activeIndex===A,"aria-controls":t.containerId+"_item_"+A,onKeydown:l=>s.onThumbnailKeydown(l,A)},n.ptm("thumbnailItem")),[Sn("div",bn({class:"p-galleria-thumbnail-item-content",tabindex:t.activeIndex===A?"0":"-1","aria-label":s.ariaPageLabel(A+1),"aria-current":t.activeIndex===A?"page":void 0,onClick:l=>s.onItemClick(A)},n.ptm("thumbnailItemContent")),[t.templates.thumbnail?(jt(),$r(ws(t.templates.thumbnail),{key:0,item:o},null,8,["item"])):tr("",!0)],16,Eoe)],16,Boe))),128))],16)],16),t.showThumbnailNavigators?aA((jt(),Hn("button",bn({key:1,class:s.navForwardClass,disabled:s.isNavForwardDisabled(),type:"button","aria-label":s.ariaNextButtonLabel,onClick:e[5]||(e[5]=o=>s.navForward(o))},{...t.nextButtonProps,...n.ptm("nextThumbnailButton")}),[(jt(),$r(ws(t.templates.nextthumbnailicon||(t.isVertical?"ChevronDownIcon":"ChevronRightIcon")),bn({class:"p-galleria-thumbnail-next-icon"},n.ptm("nextThumbnailIcon")),null,16))],16,Soe)),[[a]]):tr("",!0)],16)],16)}HE.render=Toe;var VE={name:"GalleriaContent",extends:lu,inheritAttrs:!1,interval:null,emits:["activeitem-change","mask-hide"],data(){return{id:this.$attrs.id||KE(),activeIndex:this.$attrs.activeIndex,numVisible:this.$attrs.numVisible,slideShowActive:!1}},watch:{"$attrs.value":function(n){n&&n.length<this.numVisible&&(this.numVisible=n.length)},"$attrs.activeIndex":function(n){this.activeIndex=n},"$attrs.numVisible":function(n){this.numVisible=n},"$attrs.autoPlay":function(n){n?this.startSlideShow():this.stopSlideShow()}},updated(){this.$emit("activeitem-change",this.activeIndex)},beforeUnmount(){this.slideShowActive&&this.stopSlideShow()},methods:{isAutoPlayActive(){return this.slideShowActive},startSlideShow(){this.interval=setInterval(()=>{let n=this.$attrs.circular&&this.$attrs.value.length-1===this.activeIndex?0:this.activeIndex+1;this.activeIndex=n},this.$attrs.transitionInterval),this.slideShowActive=!0},stopSlideShow(){this.interval&&clearInterval(this.interval),this.slideShowActive=!1},getPositionClass(n,e){const r=["top","left","bottom","right"].find(i=>i===e);return r?`${n}-${r}`:""},isVertical(){return this.$attrs.thumbnailsPosition==="left"||this.$attrs.thumbnailsPosition==="right"}},computed:{galleriaClass(){const n=this.$attrs.showThumbnails&&this.getPositionClass("p-galleria-thumbn
19401ails",this.$attrs.thumbnailsPosition),e=this.$attrs.showIndicators&&this.getPositionClass("p-galleria-indicators",this.$attrs.indicatorsPosition);return["p-galleria p-component",{"p-galleria-fullscreen":this.$attrs.fullScreen,"p-galleria-indicator-onitem":this.$attrs.showIndicatorsOnItem,"p-galleria-item-nav-onhover":this.$attrs.showItemNavigatorsOnHover&&!this.$attrs.fullScreen},n,e,this.$attrs.containerClass]},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{GalleriaItem:QE,GalleriaThumbnails:HE,TimesIcon:YE},directives:{ripple:Pf}};const Ioe=["id"],Foe=["aria-label"],Roe=["aria-live"];function Uoe(n,e,t,r,i,s){const a=tf("GalleriaItem"),o=tf("GalleriaThumbnails"),A=Au("ripple");return n.$attrs.value&&n.$attrs.value.length>0?(jt(),Hn("div",bn({key:0,id:i.id,class:s.galleriaClass,style:n.$attrs.containerStyle},{...n.$attrs.containerProps,...n.ptm("root")}),[n.$attrs.fullScreen?aA((jt(),Hn("button",bn({key:0,autofocus:"",type:"button",class:"p-galleria-close p-link","aria-label":s.closeAriaLabel,onClick:e[0]||(e[0]=l=>n.$emit("mask-hide"))},n.ptm("closeButton")),[(jt(),$r(ws(n.$attrs.templates.closeicon||"TimesIcon"),bn({class:"p-galleria-close-icon"},n.ptm("closeIcon")),null,16))],16,Foe)),[[A]]):tr("",!0),n.$attrs.templates&&n.$attrs.templates.header?(jt(),Hn("div",bn({key:1,class:"p-galleria-header"},n.ptm("header")),[(jt(),$r(ws(n.$attrs.templates.header)))],16)):tr("",!0),Sn("div",bn({class:"p-galleria-content","aria-live":n.$attrs.autoPlay?"polite":"off"},n.ptm("content")),[Ya(a,{id:i.id,activeIndex:i.activeIndex,"onUpdate:activeIndex":e[1]||(e[1]=l=>i.activeIndex=l),slideShowActive:i.slideShowActive,"onUpdate:slideShowActive":e[2]||(e[2]=l=>i.slideShowActive=l),value:n.$attrs.value,circular:n.$attrs.circular,templates:n.$attrs.templates,showIndicators:n.$attrs.showIndicators,changeItemOnIndicatorHover:n.$attrs.changeItemOnIndicatorHover,showItemNavigators:n.$attrs.showItemNavigators,autoPlay:n.$attrs.autoPlay,onStartSlideshow:s.startSlideShow,onStopSlideshow:s.stopSlideShow,pt:n.pt},null,8,["id","activeIndex","slideShowActive","value","circular","templates","showIndicators","changeItemOnIndicatorHover","showItemNavigators","autoPlay","onStartSlideshow","onStopSlideshow","pt"]),n.$attrs.showThumbnails?(jt(),$r(o,{key:0,activeIndex:i.activeIndex,"onUpdate:activeIndex":e[3]||(e[3]=l=>i.activeIndex=l),slideShowActive:i.slideShowActive,"onUpdate:slideShowActive":e[4]||(e[4]=l=>i.slideShowActive=l),containerId:i.id,value:n.$attrs.value,templates:n.$attrs.templates,numVisible:i.numVisible,responsiveOptions:n.$attrs.responsiveOptions,circular:n.$attrs.circular,isVertical:s.isVertical(),contentHeight:n.$attrs.verticalThumbnailViewPortHeight,showThumbnailNavigators:n.$attrs.showThumbnailNavigators,prevButtonProps:n.$attrs.prevButtonProps,nextButtonProps:n.$attrs.nextButtonProps,onStopSlideshow:s.stopSlideShow,pt:n.pt},null,8,["activeIndex","slideShowActive","containerId","value","templates","numVisible","responsiveOptions","circular","isVertical","contentHeight","showThumbnailNavigators","prevButtonProps","nextButtonProps","onStopSlideshow","pt"])):tr("",!0)],16,Roe),n.$attrs.templates&&n.$attrs.templates.footer?(jt(),Hn("div",bn({key:2,class:"p-galleria-footer"},n.ptm("footer")),[(jt(),$r(ws(n.$attrs.templates.footer)))],16)):tr("",!0)],16,Ioe)):tr("",!0)}VE.render=Uoe;var GE={name:"Galleria",extends:lu,inheritAttrs:!1,emits:["update:activeIndex","update:visible"],props:{id:{type:String,default:null},value:{type:Array,default:null},activeIndex:{type:Number,default:0},fullScreen:{type:Boolean,default:!1},visible:{type:Boolean,default:!1},numVisible:{type:Number,default:3},responsiveOptions:{type:Array,default:null},showItemNavigators:{type:Boolean,default:!1},showThumbnailNavigators:{type:Boolean,default:!0},showItemNavigatorsOnHover:{type:Boolean,default:!1},changeItemOnIndicatorHover:{type:Boolean,default:!1},circular:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},transitionInterval:{type:Number,default:4e3},showThumbnails:{type:Boolean,default:!0},thumbnailsPosition:{type:String,default:"bottom"},verticalThumbnailViewPortHeight:{type:String,default:"300px"},showIndicators:{type:Boolean,default:!1},showIndicatorsOnItem:{type:Boolean,default:!1},indicatorsPosition:{type:String,default:"bottom"},baseZIndex:{type:Number,default:0},maskClass:{type:String,default:null},containerStyle:{type:null,default:null},containerClass:{type:null,default:null},containerProps:{type:null,default:null},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},container:null,mask:null,data(){return{containerVisible:this.visible}},updated(){this.fullScreen&&this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.fullScreen&&si.removeClass(document.body,"p-overflow-hidden"),this.mask=null,this.container&&(vd.
19401clear(this.container),this.container=null)},methods:{onBeforeEnter(n){vd.set("modal",n,this.baseZIndex||this.$primevue.config.zIndex.modal)},onEnter(n){this.mask.style.zIndex=String(parseInt(n.style.zIndex,10)-1),si.addClass(document.body,"p-overflow-hidden"),this.focus()},onBeforeLeave(){si.addClass(this.mask,"p-component-overlay-leave")},onAfterLeave(n){vd.clear(n),this.containerVisible=!1,si.removeClass(document.body,"p-overflow-hidden")},onActiveItemChange(n){this.activeIndex!==n&&this.$emit("update:activeIndex",n)},maskHide(){this.$emit("update:visible",!1)},containerRef(n){this.container=n},maskRef(n){this.mask=n},focus(){let n=this.container.$el.querySelector("[autofocus]");n&&n.focus()}},computed:{maskContentClass(){return["p-galleria-mask p-component-overlay p-component-overlay-enter",this.maskClass,{"p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]}},components:{GalleriaContent:VE,Portal:eS},directives:{focustrap:qE}};const Moe=["role","aria-modal"];function Noe(n,e,t,r,i,s){const a=tf("GalleriaContent"),o=tf("Portal"),A=Au("focustrap");return t.fullScreen?(jt(),$r(o,{key:0},{default:il(()=>[i.containerVisible?(jt(),Hn("div",bn({key:0,ref:s.maskRef,class:s.maskContentClass,role:t.fullScreen?"dialog":"region","aria-modal":t.fullScreen?"true":void 0},n.ptm("mask")),[Ya(XE,{name:"p-galleria",onBeforeEnter:s.onBeforeEnter,onEnter:s.onEnter,onBeforeLeave:s.onBeforeLeave,onAfterLeave:s.onAfterLeave,appear:""},{default:il(()=>[t.visible?aA((jt(),$r(a,bn({key:0,ref:s.containerRef,onMaskHide:s.maskHide,templates:n.$slots,onActiveitemChange:s.onActiveItemChange,pt:n.pt},n.$props),null,16,["onMaskHide","templates","onActiveitemChange","pt"])),[[A]]):tr("",!0)]),_:1},8,["onBeforeEnter","onEnter","onBeforeLeave","onAfterLeave"])],16,Moe)):tr("",!0)]),_:1})):(jt(),$r(a,bn({key:1,templates:n.$slots,onActiveitemChange:s.onActiveItemChange,pt:n.pt},n.$props),null,16,["templates","onActiveitemChange","pt"]))}function Doe(n,e){e===void 0&&(e={});var t=e.insertAt;if(!(!n||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}var Loe=` 19402.p-galleria-content { 19403 display: flex; 19404 flex-direction: column; 19405} 19406.p-galleria-item-wrapper { 19407 display: flex; 19408 flex-direction: column; 19409 position: relative; 19410} 19411.p-galleria-item-container { 19412 position: relative; 19413 display: flex; 19414 height: 100%; 19415} 19416.p-galleria-item-nav { 19417 position: absolute; 19418 top: 50%; 19419 margin-top: -0.5rem; 19420 display: inline-flex; 19421 justify-content: center; 19422 align-items: center; 19423 overflow: hidden; 19424} 19425.p-galleria-item-prev { 19426 left: 0; 19427 border-top-left-radius: 0; 19428 border-bottom-left-radius: 0; 19429} 19430.p-galleria-item-next { 19431 right: 0; 19432 border-top-right-radius: 0; 19433 border-bottom-right-radius: 0; 19434} 19435.p-galleria-item { 19436 display: flex; 19437 justify-content: center; 19438 align-items: center; 19439 height: 100%; 19440 width: 100%; 19441} 19442.p-galleria-item-nav-onhover .p-galleria-item-nav { 19443 pointer-events: none; 19444 opacity: 0; 19445 transition: opacity 0.2s ease-in-out; 19446} 19447.p-galleria-item-nav-onhover .p-galleria-item-wrapper:hover .p-galleria-item-nav { 19448 pointer-events: all; 19449 opacity: 1; 19450} 19451.p-galleria-item-nav-onhover .p-galleria-item-wrapper:hover .p-galleria-item-nav.p-disabled { 19452 pointer-events: none; 19453} 19454.p-galleria-caption { 19455 position: absolute; 19456 bottom: 0; 19457 left: 0; 19458 width: 100%; 19459} 19460 19461/* Thumbnails */ 19462.p-galleria-thumbnail-wrapper { 19463 display: flex; 19464 flex-direction: column; 19465 overflow: auto; 19466 flex-shrink: 0; 19467} 19468.p-galleria-thumbnail-prev, 19469.p-galleria-thumbnail-next { 19470 align-self: center; 19471 flex: 0 0 auto; 19472 display: flex; 19473 justify-content: center; 19474 align-items: center; 19475 overflow: hidden; 19476 position: relative; 19477} 19478.p-galleria-thumbnail-prev span, 19479.p-galleria-thumbnail-next span { 19480 display: flex; 19481 justify-content: center;
19482 align-items: center; 19483} 19484.p-galleria-thumbnail-container { 19485 display: flex; 19486 flex-direction: row; 19487} 19488.p-galleria-thumbnail-items-container { 19489 overflow: hidden; 19490 width: 100%; 19491} 19492.p-galleria-thumbnail-items { 19493 display: flex; 19494} 19495.p-galleria-thumbnail-item { 19496 overflow: auto; 19497 display: flex; 19498 align-items: center; 19499 justify-content: center; 19500 cursor: pointer; 19501 opacity: 0.5; 19502} 19503.p-galleria-thumbnail-item:hover { 19504 opacity: 1; 19505 transition: opacity 0.3s; 19506} 19507.p-galleria-thumbnail-item-current { 19508 opacity: 1; 19509} 19510 19511/* Positions */ 19512/* Thumbnails */ 19513.p-galleria-thumbnails-left .p-galleria-content, 19514.p-galleria-thumbnails-right .p-galleria-content { 19515 flex-direction: row; 19516} 19517.p-galleria-thumbnails-left .p-galleria-item-wrapper, 19518.p-galleria-thumbnails-right .p-galleria-item-wrapper { 19519 flex-direction: row; 19520} 19521.p-galleria-thumbnails-left .p-galleria-item-wrapper, 19522.p-galleria-thumbnails-top .p-galleria-item-wrapper { 19523 order: 2; 19524} 19525.p-galleria-thumbnails-left .p-galleria-thumbnail-wrapper, 19526.p-galleria-thumbnails-top .p-galleria-thumbnail-wrapper { 19527 order: 1; 19528} 19529.p-galleria-thumbnails-left .p-galleria-thumbnail-container, 19530.p-galleria-thumbnails-right .p-galleria-thumbnail-container { 19531 flex-direction: column; 19532 flex-grow: 1; 19533} 19534.p-galleria-thumbnails-left .p-galleria-thumbnail-items, 19535.p-galleria-thumbnails-right .p-galleria-thumbnail-items { 19536 flex-direction: column; 19537 height: 100%; 19538} 19539 19540/* Indicators */ 19541.p-galleria-indicators { 19542 display: flex; 19543 align-items: center; 19544 justify-content: center; 19545} 19546.p-galleria-indicator > button { 19547 display: inline-flex; 19548 align-items: center; 19549} 19550.p-galleria-indicators-left .p-galleria-item-wrapper, 19551.p-galleria-indicators-right .p-galleria-item-wrapper { 19552 flex-direction: row; 19553 align-items: center; 19554} 19555.p-galleria-indicators-left .p-galleria-item-container, 19556.p-galleria-indicators-top .p-galleria-item-container { 19557 order: 2; 19558} 19559.p-galleria-indicators-left .p-galleria-indicators, 19560.p-galleria-indicators-top .p-galleria-indicators { 19561 order: 1; 19562} 19563.p-galleria-indicators-left .p-galleria-indicators, 19564.p-galleria-indicators-right .p-galleria-indicators { 19565 flex-direction: column; 19566} 19567.p-galleria-indicator-onitem .p-galleria-indicators { 19568 position: absolute; 19569 display: flex; 19570} 19571.p-galleria-indicator-onitem.p-galleria-indicators-top .p-galleria-indicators { 19572 top: 0; 19573 left: 0; 19574 width: 100%; 19575 align-items: flex-start; 19576} 19577.p-galleria-indicator-onitem.p-galleria-indicators-right .p-galleria-indicators { 19578 right: 0; 19579 top: 0; 19580 height: 100%; 19581 align-items: flex-end; 19582} 19583.p-galleria-indicator-onitem.p-galleria-indicators-bottom .p-galleria-indicators { 19584 bottom: 0; 19585 left: 0; 19586 width: 100%; 19587 align-items: flex-end; 19588} 19589.p-galleria-indicator-onitem.p-galleria-indicators-left .p-galleria-indicators { 19590 left: 0; 19591 top: 0; 19592 height: 100%; 19593 align-items: flex-start; 19594} 19595 19596/* FullScreen */ 19597.p-galleria-mask { 19598 position: fixed; 19599 top: 0; 19600 left: 0; 19601 width: 100%; 19602 height: 100%; 19603 display: flex; 19604 align-items: center; 19605 justify-content: center; 19606} 19607.p-galleria-close { 19608 position: absolute; 19609 top: 0; 19610 right: 0; 19611 display: flex; 19612 justify-content: center; 19613 align-items: center; 19614 overflow: hidden; 19615} 19616.p-galleria-mask .p-galleria-item-nav { 19617 position: fixed; 19618 top: 50%; 19619 margin-top: -0.5rem; 19620} 19621 19622/* Animation */ 19623.p-galleria-enter-active { 19624 transition: all 150ms cubic-bezier(0, 0, 0.2, 1); 19625} 19626.p-galleria-leave-active { 19627 transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); 19628} 19629.p-galleria-enter-from, 19630.p-galleria-leave-to { 19631 opacity: 0; 19632 transform: scale(0.7); 19633} 19634.p-galleria-enter-active .p-galleria-item-nav { 19635 opacity: 0; 19636} 19637 19638/* Keyboard Support */ 19639.p-items-hidden .p-galleria-thumbnail-item { 19640 visibility: hidden; 19641} 19642.p-items-hidden .p-galleria-thumbnail-item.p-galleria-thumbnail-item-active { 19643 visibility: visible; 19644} 19645`;Doe(Loe);GE.render=Noe;const Ooe={class:"vto-bg"},Poe={class:"container-lg"},koe={class:"row justify-content-center inner-box mx-0 my-4"},$oe={class:"col-md-7 d-flex justify-content-center"},Qoe={class:"card tryon-card"},Hoe=["width","height"],Voe=["width","height"],Goe={key:0,class:"no-camera-detected"},zoe={class:"content"},Woe=["src"],Koe={class:"row mx-0 gx-2 px-3 mt-3"},Xoe={class:"col-lg-6 col-md-12 col-sm-6 col-12 mt-lg-0 mt-md-2 mt-sm-0 mt-2"},joe={key:0,class:"col-md-5"},Yoe={class:"row justify-content-start mb-4"},qoe={class:"col-md-12"},Joe={class:"mb-3 mt-5 text-black"},Zoe={key:0},eAe={key:1},tAe={class:"d-flex gap-3 justify-content-center mb-4"},nAe=478,Wp=10,Kp=1.15,Xp=63.5,rAe=100,iAe={__name:"Index",setup(n){const e={midEye:168,leftEye:143,noseBottom:2,rightEye:372,noseBridge:197},t=ni(720),r=ni(720),i=ni(null),s=[{id:1,basePath:"/glasses3dmodels/glasses-01",scale:.009,positionOffset:{y:5}},{id:2,basePath:"/glasses3dmodels/glasses-02",scale:.315,positionOffset:{y:-10}},{id:3,basePath:"/glasses3dmodels/glasses-03",scale:.4,positionOffset:{y:-35}},{id:4,basePath:"/glasses3dmodels/glasses-07",scale:.6,positionOffset:{y:-5}}],a=ni(0),o=ni([{breakpoint:"1100px",numVisible:1},{breakpoint:"767px",numVisible:3},{breakpoint:"575px",numVisible:1}]),A=new Lh,l=ni(null),c=ni(null),u=ni(null),h=ni(!0),f=ni(!1),d=ni(!1),g=ni(0),m=ni(!1),p=ni(!1);let w,C,b,U,F,D,O,I,R=ni(null),V,re=null;const Y=async()=>
19645{if(F=null,R.value=null,V=null,h.value){O=new $te(u.value,"user",null,t.value,r.value),f.value=!0;try{await O.start(),f.value=!1,m.value=!1,F=new Qf(t.value/-2,t.value/2,r.value/2,r.value/-2,1,2e3),F.position.x=t.value/2,F.position.y=-r.value/2,F.position.z=-(r.value/2)*2,F.lookAt({x:t.value/2,y:-r.value/2,z:0,isVector3:!0}),C.setClearColor(0,0),C.render(w,F),a.value!=null&&ue(s[a.value])}catch(ae){console.error("No camera detected:",ae),f.value=!1,m.value=!0}}else await O.stop(),F=new oi(75,t.value/r.value,.1,100),F.position.set(0,0,1.5),F.lookAt(w.position),C.setSize(t.value,r.value),C.setClearColor(3381708,1),new fU(F,C.domElement),C.render(w,F),a.value!=null&&ue(s[a.value])},se=async()=>{var ae,we,Pe,$e,yt,Dt,Be,De,je,Ke,xt;if(!(!w||!F)){if(h.value){if(!V)return;let It=null;try{const qe=(ae=await(D==null?void 0:D.estimateFaces(u.value)))!=null?ae:null;It=(we=qe==null?void 0:qe[0])!=null?we:null}catch(qe){p.value=!0,console.error(qe)}if(!It)return;I&&(w.remove(I),I=null);const ht=It.keypoints.map((qe,Ve)=>({...qe,x:re[Ve][0].filter(qe.x),y:re[Ve][1].filter(qe.y),z:re[Ve][2].filter(qe.z)})),pt=V.scene,Pt=ht[e.midEye],bt=ht[e.leftEye],Z=ht[e.noseBottom],cn=ht[e.rightEye],Rt=ht[e.noseBridge];let kt=Math.atan2(Math.sqrt((bt.y-cn.y)**2),Math.sqrt((bt.x-cn.x)**2));bt.y>cn.y&&(kt=-kt);let st=Math.PI-Math.atan2(Math.sqrt((bt.z-cn.z)**2),Math.sqrt((bt.x-cn.x)**2));bt.z>cn.z&&(st=-st);let Tt=-Math.atan2(Math.sqrt((Pt.z-Z.z)**2),Math.sqrt((Pt.y-Z.y)**2));Pt.z>Z.z&&(Tt=-Tt),Tt-=.1,pt.rotation.z=kt,pt.rotation.y=st,pt.rotation.x=Tt;const lt=new Is;lt.setAttribute("position",new Gs(ht.map(qe=>[qe.x,qe.y,qe.z]).flat(),3)),lt.setIndex(doe),lt.translate(-It.box.xMin-It.box.width/2,-It.box.yMin-It.box.height/2,0);const G=new no({color:16777215});G.colorWrite=!1,I=new Ci(lt,G),I.renderOrder=0,I.scale.x=Kp,I.scale.y=-Kp,I.scale.z=Kp,I.position.x=Rt.x,I.position.y=-Rt.y,I.position.z=Rt.z;const L=new Ae;pt.getWorldDirection(L),I.position.add(L.multiplyScalar(-140)),w.add(I),pt.up.x=Rt.x-Z.x,pt.up.y=-(Rt.y-Z.y),pt.up.z=Rt.z-Z.z;const he=Math.sqrt(pt.up.x**2+pt.up.y**2+pt.up.z**2);pt.up.x/=he,pt.up.y/=he,pt.up.z/=he,pt.position.x=Pt.x+(($e=(Pe=R.value.positionOffset)==null?void 0:Pe.x)!=null?$e:0),pt.position.y=-Pt.y+((Dt=(yt=R.value.positionOffset)==null?void 0:yt.y)!=null?Dt:0),pt.position.z=Pt.z+((De=(Be=R.value.positionOffset)==null?void 0:Be.z)!=null?De:0),pt.position.add(L.multiplyScalar(-.1));const Te=Math.sqrt((bt.x-cn.x)**2+(bt.y-cn.y)**2+(bt.z-cn.z)**2),Ne=.02937297*bt.z+-.0498125*Pt.z+.02667038*cn.z+.07083651200968522,xe=A.filter(Te/Ne);g.value<rAe?g.value++:i.value||(i.value=xe),pt.scale.x=Te*R.value.scale*(((je=i.value)!=null?je:0)/Xp),pt.scale.y=Te*R.value.scale*(((Ke=i.value)!=null?Ke:0)/Xp),pt.scale.z=Te*R.value.scale*(((xt=i.value)!=null?xt:0)/Xp)}C.render(w,F)}},ge=()=>{if(!(!w||!w.children))for(var ae=w.children.length-1;ae>=0;ae--){var we=w.children[ae];we.type=="Group"&&w.remove(we)}},ue=ae=>{if(f.value)return;d.value=!0,R.value=ae,ge();let we=new EU;we.setPath(ae.basePath+"/"),we.load("scene.gltf",Pe=>{V=Pe,V.scene.position.set(0,0,0),V.scene.scale.set(ae.scale,ae.scale,ae.scale),V.scene.renderOrder=1,w.add(V.scene),d.value=!1})},Ce=async()=>{const ae=(await uoe(l.value,{onclone:function(Pe){Pe.getElementById("canvas").style.transform="scale(-1, 1)"}})).toDataURL(),we=document.createElement("a");we.href=ae,we.download="triedonglasses.png",we.click()};return jE(async()=>{w=new PT,C=new uU({canvas:c.value,alpha:!0,preserveDrawingBuffer:!0}),b=new Lm(16777215,1),b.position.set(10,10,10),w.add(b),U=new Lm(16777215,1),U.position.set(10,10,-10),w.add(U),C.setAnimationLoop(se),Y(),f.value=!0,D=await zH(Ml.MediaPipeFaceMesh,{runtime:"mediapipe",modelType:"heavy",solutionPath:"https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh",refineLandmarks:!0}),f.value=!1,re=[];for(let ae=0;ae<nAe;ae++)re.push([new Lh({Q:Wp}),new Lh({Q:Wp}),new Lh({Q:Wp})])}),(ae,we)=>{var Pe;return jt(),Hn("section",Ooe,[Sn("div",Poe,[Sn("div",koe,[Sn("div",$oe,[Sn("div",Qoe,[Sn("div",{ref_key:"tryOnUI",ref:l,class:"d-flex justify-content-center position-relative"}
19645,[Sn("video",{ref_key:"webcamVideo",ref:u,id:"webcamVideo",autoplay:"",playsinline:"",width:t.value,height:r.value,class:"z-0"},null,8,Hoe),Sn("canvas",{ref_key:"canvas",ref:c,id:"canvas",width:t.value,height:r.value,class:Oh(["position-absolute z-1",{"glass-canvas":!h.value}])},null,10,Voe),m.value&&h.value?(jt(),Hn("div",Goe,we[5]||(we[5]=[Sn("div",{class:"no-cam-content"},[Sn("i",{class:"bi bi-camera-video-off"}),Sn("h4",null,"No Camera Found"),Sn("p",null,"Please enable your webcam to continue.")],-1)]))):tr("",!0),d.value?(jt(),Hn("div",{key:1,class:Oh(["glasses-loading-container",{active:d.value}])},[Sn("div",zoe,[Ya(Pa(ZE),{class:"glasses-loading-spinner"}),we[6]||(we[6]=Sn("span",null,"Loading glasses...",-1))])],2)):tr("",!0)],512),Ya(Pa(GE),{value:s,"num-visible":3,circular:"","responsive-options":o.value,"active-index":a.value,"onUpdate:activeIndex":[we[1]||(we[1]=$e=>a.value=$e),we[2]||(we[2]=$e=>{ue(s[a.value])})]},{thumbnail:il(({item:$e})=>[Sn("img",{src:`${$e.basePath}/glasses.png`,class:"img-fluid"},null,8,Woe)]),footer:il(()=>[Sn("div",Koe,[Sn("div",{class:Oh(h.value?"col-lg-6 col-md-12 col-sm-6 col-12":"col-lg-12")},[Ya(Pa(OB),{modelValue:h.value,"onUpdate:modelValue":[we[0]||(we[0]=$e=>h.value=$e),Y],"on-label":"Currently Wearing","off-label":"Try On Glasses",class:"w-100 tw-text-sm p-button-sm p-button-success","on-icon":"bi-eyeglasses","off-icon":"bi-eyeglasses"},null,8,["modelValue"])],2),Sn("div",Xoe,[h.value?(jt(),$r(Pa(g2),{key:0,label:"Take Snapshot",icon:"pi pi-camera",onClick:Ce,class:"w-100",size:"small"})):tr("",!0)])])]),_:1},8,["responsive-options","active-index"])])]),h.value?(jt(),Hn("div",joe,[Sn("div",Yoe,[Sn("div",qoe,[p.value?(jt(),$r(Pa(y2),{key:0,severity:"error",icon:"bi-exclamation-circle",class:"mb-5"},{default:il(()=>we[7]||(we[7]=[Su(" An error occurred during face detection. Please try to refresh the page. ")])),_:1,__:[7]})):tr("",!0),Ya(Pa(y2),{severity:"info",icon:"bi-info-circle",class:"mb-5"},{default:il(()=>we[8]||(we[8]=[Su(" When measuring your Pupillary Distance, make sure your face is facing the camera and is stable until the measurement finishes. ")])),_:1,__:[8]}),Sn("label",Joe,[we[9]||(we[9]=Su(" Resize Pupillary Distance ( ")),i.value==null?(jt(),Hn("span",Zoe," calculating ")):(jt(),Hn("span",eAe,dy((Pe=i.value)==null?void 0:Pe.toFixed(1))+"mm ",1)),we[10]||(we[10]=Su(" ) "))]),Ya(Pa(JE),{min:50,max:75,modelValue:i.value,"onUpdate:modelValue":we[3]||(we[3]=$e=>i.value=$e),step:.1},null,8,["modelValue"])])]),Sn("div",tAe,[Ya(Pa(g2),{label:"Read Pupillary Distance",icon:"pi pi-eye",size:"small",class:"px-5",disabled:!i.value,onClick:we[4]||(we[4]=$e=>{i.value=null,g.value=0})},null,8,["disabled"])])])):tr("",!0)])])])}}},vAe=rS(iAe,[["__scopeId","data-v-2186d290"]]);export{vAe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.