From 9f162d473b28d53268407c48cd7021d0874a852c Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 5 Jun 2021 17:51:46 -0400 Subject: [PATCH] modularize build platform --- CHANGELOG.md | 4 +- demo/facematch.js | 5 +- demo/index.js | 6 +- dist/human.esm-nobundle.js | 27 +- dist/human.esm-nobundle.js.map | 4 +- dist/human.esm.js | 827 +++++++++++------------ dist/human.esm.js.map | 4 +- dist/human.js | 827 +++++++++++------------ dist/human.node-gpu.js | 78 ++- dist/human.node-wasm.js | 78 ++- dist/human.node.js | 78 ++- dist/tfjs.esm.js | 11 +- dist/tfjs.esm.js.map | 2 +- server/build.js | 104 +-- server/build.log | 42 +- server/lint.js | 23 + server/tfjs-tsconfig.json | 33 - server/typedoc.js | 28 + server/typings.js | 33 + src/config.ts | 13 +- src/embedding/embedding.ts | 2 +- src/faceres/faceres.ts | 2 +- src/human.ts | 38 +- src/object/nanodet.ts | 2 +- src/segmentation/blur.ts | 29 - src/segmentation/segmentation.ts | 41 +- test/test-node-gpu.js | 5 +- test/test-node-wasm.js | 5 +- test/test-node.js | 5 +- test/test.log | 289 ++++---- tsconfig.json | 18 +- typedoc/interfaces/config.html | 5 +- types/src/config.d.ts | 5 +- types/src/segmentation/segmentation.d.ts | 2 +- wiki | 2 +- 35 files changed, 1372 insertions(+), 1305 deletions(-) create mode 100644 server/lint.js delete mode 100644 server/tfjs-tsconfig.json create mode 100644 server/typedoc.js create mode 100644 server/typings.js delete mode 100644 src/segmentation/blur.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 490d4f2f..25eca82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,7 @@ Repository: **** ### **HEAD -> main** 2021/06/05 mandic00@live.com - -### **origin/main** 2021/06/05 mandic00@live.com - +- minor git corruption - unified build - enable body segmentation and background replacement - work on body segmentation diff --git a/demo/facematch.js b/demo/facematch.js index dcaffc78..cd4d2982 100644 --- a/demo/facematch.js +++ b/demo/facematch.js @@ -27,9 +27,8 @@ const userConfig = { hand: { enabled: false }, gesture: { enabled: false }, body: { enabled: false }, - filter: { - enabled: false, - }, + filter: { enabled: true }, + segmentation: { enabled: false }, }; const human = new Human(userConfig); // new instance of human diff --git a/demo/index.js b/demo/index.js index c3027418..c6203fdd 100644 --- a/demo/index.js +++ b/demo/index.js @@ -31,6 +31,7 @@ let userConfig = { warmup: 'none', backend: 'humangl', wasmPath: 'https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.6.0/dist/', + segmentation: { enabled: true }, /* async: false, cacheSensitivity: 0, @@ -210,10 +211,9 @@ async function drawResults(input) { // draw fps chart await menu.process.updateChart('FPS', ui.detectFPS); - // get updated canvas if missing or if we want buffering, but skip if segmentation is enabled - if (userConfig.segmentation.enabled) { + if (userConfig.segmentation.enabled && ui.buffered) { // refresh segmentation if using buffered output result.canvas = await human.segmentation(input, ui.background, userConfig); - } else if (!result.canvas || ui.buffered) { + } else if (!result.canvas || ui.buffered) { // refresh with input if using buffered output or if missing canvas const image = await human.image(input); result.canvas = image.canvas; human.tf.dispose(image.tensor); diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js index 06904636..25df7013 100644 --- a/dist/human.esm-nobundle.js +++ b/dist/human.esm-nobundle.js @@ -1,18 +1,17 @@ - /* - Human library - homepage: - author: ' - */ - -var iA=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var aA=(A,e)=>{for(var t in e)iA(A,t,{get:e[t],enumerable:!0})},p=(A,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pe(e))!be.call(A,o)&&o!=="default"&&iA(A,o,{get:()=>e[o],enumerable:!(t=ue(e,o))||t.enumerable});return A};var xA=(A,e,t)=>{if(!e.has(A))throw TypeError("Cannot "+t)};var C=(A,e,t)=>(xA(A,e,"read from private field"),t?t.call(A):e.get(A)),K=(A,e,t)=>{if(e.has(A))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(A):e.set(A,t)},_=(A,e,t,o)=>(xA(A,e,"write to private field"),o?o.call(A,t):e.set(A,t),t);function L(A,e){let t=A.endsWith("/")?"":"/",n=e.startsWith(".")||e.startsWith("/")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("file:")?`${e}`:`${A}${t}${e}`;if(!n.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${n} Expecting JSON file`);return n}function g(...A){let e=new Date,t=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`;A&&console.log(t,"Human:",...A)}var I=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function U(...A){let e=t=>t&&typeof t=="object";return A.reduce((t,o)=>(Object.keys(o||{}).forEach(n=>{let x=t[n],a=o[n];Array.isArray(x)&&Array.isArray(a)?t[n]=x.concat(...a):e(x)&&e(a)?t[n]=U(x,a):t[n]=a}),t),{})}var yA={backend:"webgl",modelBasePath:"../models/",wasmPath:"../node_modules/@tensorflow/tfjs-backend-wasm/dist/",debug:!0,async:!0,warmup:"full",cacheSensitivity:.75,skipFrame:!1,filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!0,maxDetected:15,skipFrames:15,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:11,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:17,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:1,minConfidence:.2,skipFrames:1},hand:{enabled:!0,rotation:!0,skipFrames:18,minConfidence:.1,iouThreshold:.1,maxDetected:2,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"mb3-centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:19},segmentation:{enabled:!1,modelPath:"selfie.json"}};function lA(){let A,e;if(typeof navigator!="undefined"){let t=navigator.userAgent.match(/\(([^()]+)\)/g);if(t&&t[0]){let o=t[0].match(/\(([^()]+)\)/g);A=o?o[0].replace(/\(|\)/g,""):"",e=navigator.userAgent.replace(t[0],""),A[1]&&(e=e.replace(t[1],"")),e=e.replace(/ /g," ")}}else typeof process!="undefined"&&(A=`${process.platform} ${process.arch}`,e=`NodeJS ${process.version}`);return{platform:A,agent:e}}var s={};aA(s,{data:()=>Pe,version:()=>ve});p(s,c2);p(s,d2);p(s,f2);p(s,m2);p(s,h2);p(s,u2);import*as cA from"@tensorflow/tfjs/package.json";import*as dA from"@tensorflow/tfjs-core/package.json";import*as fA from"@tensorflow/tfjs-data/package.json";import*as mA from"@tensorflow/tfjs-layers/package.json";import*as hA from"@tensorflow/tfjs-converter/package.json";import{version_cpu as ge}from"@tensorflow/tfjs-backend-cpu/dist/index.js";import{version_webgl as Me}from"@tensorflow/tfjs-backend-webgl/dist/index.js";import{version_wasm as Te}from"@tensorflow/tfjs-backend-wasm/dist/index.js";import*as c2 from"@tensorflow/tfjs-core/dist/index.js";import*as d2 from"@tensorflow/tfjs-layers/dist/index.js";import*as f2 from"@tensorflow/tfjs-converter/dist/index.js";import*as Pe from"@tensorflow/tfjs-data/dist/index.js";import*as m2 from"@tensorflow/tfjs-backend-cpu/dist/index.js";import*as h2 from"@tensorflow/tfjs-backend-webgl/dist/index.js";import*as u2 from"@tensorflow/tfjs-backend-wasm/dist/index.js";var ve={tfjs:(cA==null?void 0:cA.version)||void 0,"tfjs-core":(dA==null?void 0:dA.version)||void 0,"tfjs-data":(fA==null?void 0:fA.version)||void 0,"tfjs-layers":(mA==null?void 0:mA.version)||void 0,"tfjs-converter":(hA==null?void 0:hA.version)||void 0,"tfjs-backend-cpu":ge||void 0,"tfjs-backend-webgl":Me||void 0,"tfjs-backend-wasm":Te||void 0};var J={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function uA(){if(!s.findBackend(J.name)){g("backend registration:",J.name);try{J.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(J.width,J.height):document.createElement("canvas")}catch(A){g("error: cannot create canvas:",A);return}try{J.gl=J.canvas.getContext("webgl2",J.webGLattr)}catch(A){g("error: cannot get WebGL2 context:",A);return}try{s.setWebGLContext(2,J.gl)}catch(A){g("error: cannot set WebGL2 context:",A);return}try{let A=new s.GPGPUContext(J.gl);s.registerBackend(J.name,()=>new s.MathBackendWebGL(A),J.priority)}catch(A){g("error: cannot register WebGL backend:",A);return}try{s.getKernelsForBackend("webgl").forEach(e=>{let t={...e,backendName:J.name};s.registerKernel(t)})}catch(A){g("error: cannot update WebGL backend registration:",A);return}try{s.ENV.set("WEBGL_VERSION",2)}catch(A){g("error: cannot set WebGL backend flags:",A);return}g("backend registered:",J.name)}}function pA(A,e){let t=[A.startPoint[0]*e[0],A.startPoint[1]*e[1]],o=[A.endPoint[0]*e[0],A.endPoint[1]*e[1]];return{startPoint:t,endPoint:o}}function E0(A){return[Math.abs(A.endPoint[0]-A.startPoint[0]),Math.abs(A.endPoint[1]-A.startPoint[1])]}function m0(A){return[A.startPoint[0]+(A.endPoint[0]-A.startPoint[0])/2,A.startPoint[1]+(A.endPoint[1]-A.startPoint[1])/2]}function h0(A,e,t){let o=e.shape[1],n=e.shape[2],x=[[A.startPoint[1]/o,A.startPoint[0]/n,A.endPoint[1]/o,A.endPoint[0]/n]];return s.image.cropAndResize(e,x,[0],t)}function L0(A,e=1.5){let t=m0(A),o=E0(A),n=[e*o[0]/2,e*o[1]/2],x=[t[0]-n[0],t[1]-n[1]],a=[t[0]+n[0],t[1]+n[1]];return{startPoint:x,endPoint:a,landmarks:A.landmarks}}function H0(A){let e=m0(A),t=E0(A),n=Math.max(...t)/2,x=[Math.round(e[0]-n),Math.round(e[1]-n)],a=[Math.round(e[0]+n),Math.round(e[1]+n)];return{startPoint:x,endPoint:a,landmarks:A.landmarks}}function a5(A){let e=A.map(x=>x[0]),t=A.map(x=>x[1]),o=[Math.min(...e),Math.min(...t)],n=[Math.max(...e),Math.max(...t)];return{startPoint:o,endPoint:n,landmarks:A}}var bA=A=>({startPoint:s.slice(A,[0,0],[-1,2]),endPoint:s.slice(A,[0,2],[-1,2])});var Z0=[[1,0,0],[0,1,0],[0,0,1]];function ze(A){return A-2*Math.PI*Math.floor((A+Math.PI)/(2*Math.PI))}function x5(A,e){let t=Math.PI/2-Math.atan2(-(e[1]-A[1]),e[0]-A[0]);return ze(t)}function gA(A,e){return[[1,0,A],[0,1,e],[0,0,1]]}function r0(A,e){let t=0;for(let o=0;o{let i=s.image.resizeBilinear(e,[this.inputSize,this.inputSize]).div(127.5).sub(.5),c=this.model.execute(i),l;if(Array.isArray(c)){let d=c.sort((R,W)=>R.size-W.size),m=s.concat([d[0],d[2]],2),z=s.concat([d[1],d[3]],2);l=s.concat([z,m],1).squeeze(0)}else l=s.squeeze(c);let f=Re(l,this.anchors,[this.inputSize,this.inputSize]),h=s.slice(l,[0,0],[-1,1]),E=s.sigmoid(h).squeeze().dataSync();return[l,f,E]}),x=await s.image.nonMaxSuppressionAsync(o,n,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),a=x.arraySync();x.dispose();let r=[];for(let y=0;ythis.config.face.detector.minConfidence){let c=s.slice(o,[a[y],0],[1,-1]),l=bA(c);c.dispose();let f=this.anchorsData[a[y]],h=s.tidy(()=>s.slice(t,[a[y],zA-1],[1,-1]).squeeze().reshape([zA,-1]));r.push({box:l,landmarks:h,anchor:f,confidence:i})}}return t.dispose(),o.dispose(),{boxes:r,scaleFactor:[e.shape[2]/this.inputSize,e.shape[1]/this.inputSize]}}};async function RA(A){let e=await s.loadGraphModel(L(A.modelBasePath,A.face.detector.modelPath),{fromTFHub:A.face.detector.modelPath.includes("tfhub.dev")}),t=new EA(e,A);return!e||!e.modelUrl?g("load model failed:",A.face.detector.modelPath):A.debug&&g("load model:",e.modelUrl),t}var t0={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},y5=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],R0=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],l0=[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,130,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,116,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];var je=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],we=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],Se=[33,133,362,263,1,78,308],w2=je.map(A=>R0[A]),S2=we.map(A=>R0[A]),W2=Se.map(A=>R0[A]);var l5=t0.leftEyeLower0,c5=t0.rightEyeLower0,u0={leftBounds:[l5[0],l5[l5.length-1]],rightBounds:[c5[0],c5[c5.length-1]]},X0={count:468,mouth:13,symmetryLine:[13,t0.midwayBetweenEyes[0]]},jA={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},p0={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function F0(A,e,t,o){for(let n=0;n[x[0]/this.meshSize*(l[0]-this.meshSize/2),x[1]/this.meshSize*(l[1]-this.meshSize/2),l[2]]),r=o!==0?V0(o,[0,0]):Z0,y=o!==0?a.map(l=>[...PA(l,r),l[2]]):a,i=o!==0?TA(n):Z0,c=[...m0({startPoint:t.startPoint,endPoint:t.endPoint}),1];return y.map(l=>[Math.round(l[0]+r0(c,i[0])),Math.round(l[1]+r0(c,i[1])),Math.round(l[2])])}getLeftToRightEyeDepthDifference(e){let t=e[u0.leftBounds[0]][2],o=e[u0.rightBounds[0]][2];return t-o}getEyeBox(e,t,o,n,x=!1){let a=H0(L0(a5([e[o],e[n]]),this.irisEnlarge)),r=E0(a),y=s.image.cropAndResize(t,[[a.startPoint[1]/this.meshSize,a.startPoint[0]/this.meshSize,a.endPoint[1]/this.meshSize,a.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return x&&s.ENV.flags.IS_BROWSER&&(y=s.image.flipLeftRight(y)),{box:a,boxSize:r,crop:y}}getEyeCoords(e,t,o,n=!1){let x=[];for(let a=0;a{let i=a;return y===2?i=n:y===4&&(i=x),[r[0],r[1],i]})}async predict(e,t){let o=!1,n;if((this.skipped===0||this.skipped>t.face.detector.skipFrames||!t.face.mesh.enabled||!t.skipFrame)&&(n=await this.boundingBoxDetector.getBoundingBoxes(e),this.skipped=0),t.skipFrame&&this.skipped++,!t.skipFrame||n&&n.boxes&&(!t.face.mesh.enabled||n.boxes.length!==this.detectedFaces&&this.detectedFaces!==t.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let a of n.boxes)this.storedBoxes.push({startPoint:a.box.startPoint.dataSync(),endPoint:a.box.endPoint.dataSync(),landmarks:a.landmarks.arraySync(),confidence:a.confidence});this.storedBoxes.length>0&&(o=!0)}if(o){if(!n||!n.boxes||n.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let a=0;a{a.box.startPoint.dispose(),a.box.endPoint.dispose(),a.landmarks.dispose()});let x=s.tidy(()=>this.storedBoxes.map((a,r)=>{let y,i=0,c;if(t.face.detector.rotation&&t.face.mesh.enabled&&s.ENV.flags.IS_BROWSER){let[R,W]=a.landmarks.length>=X0.count?X0.symmetryLine:jA.symmetryLine;i=x5(a.landmarks[R],a.landmarks[W]);let M=m0({startPoint:a.startPoint,endPoint:a.endPoint}),u=[M[0]/e.shape[2],M[1]/e.shape[1]],T=s.image.rotateWithOffset(e,i,0,u);c=V0(-i,M),t.face.mesh.enabled?y=h0({startPoint:a.startPoint,endPoint:a.endPoint},T,[this.meshSize,this.meshSize]).div(255):y=h0({startPoint:a.startPoint,endPoint:a.endPoint},T,[this.boxSize,this.boxSize]).div(255)}else{c=Z0;let R=e.clone();t.face.mesh.enabled?y=h0({startPoint:a.startPoint,endPoint:a.endPoint},R,[this.meshSize,this.meshSize]).div(255):y=h0({startPoint:a.startPoint,endPoint:a.endPoint},R,[this.boxSize,this.boxSize]).div(255)}if(!t.face.mesh.enabled)return{mesh:[],box:a,faceConfidence:null,boxConfidence:a.confidence,confidence:a.confidence,image:y};let[,l,f]=this.meshDetector.execute(y),h=l.dataSync()[0];if(h=X0.count?X0.symmetryLine:jA.symmetryLine;i=x5(a.landmarks[R],a.landmarks[W]);let M=m0({startPoint:a.startPoint,endPoint:a.endPoint}),u=[M[0]/e.shape[2],M[1]/e.shape[1]],T=s.image.rotateWithOffset(e.toFloat(),i,0,u);c=V0(-i,M),y=h0({startPoint:a.startPoint,endPoint:a.endPoint},T,[this.meshSize,this.meshSize]).div(255)}let w={mesh:m,box:a,faceConfidence:h,boxConfidence:a.confidence,image:y};return this.storedBoxes[r]={...H0(a),confidence:a.confidence,faceConfidence:h},w}));return t.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(a=>a.confidence>t.face.detector.minConfidence)),this.detectedFaces=x.length,x}};var V=[null,null,null],f5;async function wA(A,e){let t=await f5.predict(A,e),o=[],n=0;for(let x of t||[]){if(!x||x.isDisposedInternal)continue;let a=x.mesh.map(c=>[c[0]/(A.shape[2]||0),c[1]/(A.shape[1]||0),c[2]/f5.meshSize]),r={};if(x.mesh&&x.mesh.length>0)for(let c of Object.keys(t0))r[c]=t0[c].map(l=>x.mesh[l]);let y=x.box?[Math.trunc(Math.max(0,x.box.startPoint[0])),Math.trunc(Math.max(0,x.box.startPoint[1])),Math.trunc(Math.min(A.shape[2]||0,x.box.endPoint[0])-Math.max(0,x.box.startPoint[0])),Math.trunc(Math.min(A.shape[1]||0,x.box.endPoint[1])-Math.max(0,x.box.startPoint[1]))]:[0,0,0,0],i=x.box?[x.box.startPoint[0]/(A.shape[2]||0),x.box.startPoint[1]/(A.shape[1]||0),(x.box.endPoint[0]-x.box.startPoint[0])/(A.shape[2]||0),(x.box.endPoint[1]-x.box.startPoint[1])/(A.shape[1]||0)]:[0,0,0,0];o.push({id:n++,score:Math.round(100*x.faceConfidence||100*x.boxConfidence||0)/100,boxScore:Math.round(100*x.boxConfidence)/100,faceScore:Math.round(100*x.faceConfidence)/100,box:y,boxRaw:i,mesh:x.mesh,meshRaw:a,annotations:r,image:x.image,tensor:x.image}),x.coords&&x.coords.dispose()}return o}async function m5(A){return!V[0]&&A.face.enabled||!V[1]&&A.face.mesh.enabled||!V[2]&&A.face.iris.enabled?(V=await Promise.all([!V[0]&&A.face.enabled?RA(A):null,!V[1]&&A.face.mesh.enabled?s.loadGraphModel(L(A.modelBasePath,A.face.mesh.modelPath),{fromTFHub:A.face.mesh.modelPath.includes("tfhub.dev")}):null,!V[2]&&A.face.iris.enabled?s.loadGraphModel(L(A.modelBasePath,A.face.iris.modelPath),{fromTFHub:A.face.iris.modelPath.includes("tfhub.dev")}):null]),A.face.mesh.enabled&&(!V[1]||!V[1].modelUrl?g("load model failed:",A.face.mesh.modelPath):A.debug&&g("load model:",V[1].modelUrl)),A.face.iris.enabled&&(!V[2]||!V[2].modelUrl?g("load model failed:",A.face.iris.modelPath):A.debug&&g("load model:",V[2].modelUrl))):A.debug&&(V[0]&&g("cached model:",V[0].model.modelUrl),V[1]&&g("cached model:",V[1].modelUrl),V[2]&&g("cached model:",V[2].modelUrl)),f5=new d5(V[0],V[1],V[2]),V}var SA=l0,WA=R0;var We=["angry","disgust","fear","happy","sad","surprise","neutral"],$,C0=[],kA=0,h5=Number.MAX_SAFE_INTEGER,u5=[.2989,.587,.114];async function p5(A){return $?A.debug&&g("cached model:",$.modelUrl):($=await s.loadGraphModel(L(A.modelBasePath,A.face.emotion.modelPath)),!$||!$.modelUrl?g("load model failed:",A.face.emotion.modelPath):A.debug&&g("load model:",$.modelUrl)),$}async function b5(A,e,t,o){return $?h50?(h5++,C0[t]):(h5=0,new Promise(async n=>{let x=s.image.resizeBilinear(A,[$.inputs[0].shape[2],$.inputs[0].shape[1]],!1),[a,r,y]=s.split(x,3,3);x.dispose();let i=s.mul(a,u5[0]),c=s.mul(r,u5[1]),l=s.mul(y,u5[2]);a.dispose(),r.dispose(),y.dispose();let f=s.addN([i,c,l]);i.dispose(),c.dispose(),l.dispose();let h=s.tidy(()=>f.sub(.5).mul(2));f.dispose();let E=[];if(e.face.emotion.enabled){let d=await $.predict(h),m=d.dataSync();s.dispose(d);for(let z=0;ze.face.emotion.minConfidence&&E.push({score:Math.min(.99,Math.trunc(100*m[z])/100),emotion:We[z]});E.sort((z,w)=>w.score-z.score)}h.dispose(),C0[t]=E,kA=o,n(E)})):null}var A0,q0=[],IA=0,g5=Number.MAX_SAFE_INTEGER;async function M5(A){let e=L(A.modelBasePath,A.face.description.modelPath);return A0?A.debug&&g("cached model:",e):(A0=await s.loadGraphModel(e),A0?A.debug&&g("load model:",e):g("load model failed:",A.face.description.modelPath)),A0}function T5(A,e,t=2){if(!A||!e||(A==null?void 0:A.length)===0||(e==null?void 0:e.length)===0||(A==null?void 0:A.length)!==(e==null?void 0:e.length))return 0;let o=5*A.map((x,a)=>Math.abs(A[a]-e[a])**t).reduce((x,a)=>x+a,0)**(1/t);return Math.max(0,100-o)/100}function NA(A,e,t=0){let o={similarity:0,name:"",source:"",embedding:[]};if(!A||!e||!Array.isArray(A)||!Array.isArray(e))return o;for(let n of e)if(n.embedding&&n.name){let x=T5(A,n.embedding);x>t&&x>o.similarity&&(o={...n,similarity:x})}return o}function P5(A){return s.tidy(()=>{let t=A.image||A.tensor||A;if(!(t instanceof s.Tensor))return null;let o=[[.05,.15,.85,.85]];return A0.inputs[0].shape?(t.shape.length===3?s.image.cropAndResize(s.expandDims(t,0),o,[0],[A0.inputs[0].shape[2],A0.inputs[0].shape[1]]):s.image.cropAndResize(t,o,[0],[A0.inputs[0].shape[2],A0.inputs[0].shape[1]])).mul(255):null})}async function v5(A,e,t,o){var n,x;return A0?g50?(g5++,q0[t]):(g5=0,new Promise(async a=>{let r=P5(A),y,i={age:0,gender:"unknown",genderScore:0,descriptor:[]};e.face.description.enabled&&(y=await A0.predict(r)),s.dispose(r),y&&(s.tidy(()=>{let c=y.find(d=>d.shape[1]===1).dataSync(),l=Math.trunc(200*Math.abs(c[0]-.5))/100;l>e.face.description.minConfidence&&(i.gender=c[0]<=.5?"female":"male",i.genderScore=Math.min(.99,l));let f=y.find(d=>d.shape[1]===100).argMax(1).dataSync()[0],h=y.find(d=>d.shape[1]===100).dataSync();i.age=Math.round(h[f-1]>h[f+1]?10*f-100*h[f-1]:10*f+100*h[f+1])/10;let E=y.find(d=>d.shape[1]===1024);i.descriptor=[...E.dataSync()]}),y.forEach(c=>s.dispose(c))),q0[t]=i,IA=o,a(i)})):null}var ke=A=>{let e=(l,f)=>Math.atan2(l[1]-f[1],l[0]-f[0]);if(!A.annotations.rightEyeIris||!A.annotations.leftEyeIris)return{bearing:0,strength:0};let t=[0,-.1],o=1,n=A.mesh[33][2]>A.mesh[263][2],x=n?A.mesh[473]:A.mesh[468],a=n?[(A.mesh[133][0]+A.mesh[33][0])/2,(A.mesh[133][1]+A.mesh[33][1])/2]:[(A.mesh[263][0]+A.mesh[362][0])/2,(A.mesh[263][1]+A.mesh[362][1])/2],r=n?[A.mesh[133][0]-A.mesh[33][0],A.mesh[23][1]-A.mesh[27][1]]:[A.mesh[263][0]-A.mesh[362][0],A.mesh[253][1]-A.mesh[257][1]],y=[(a[0]-x[0])/r[0]-t[0],o*(x[1]-a[1])/r[1]-t[1]],i=Math.sqrt(y[0]**2+y[1]**2);return i=Math.min(i,A.boxRaw[2]/2,A.boxRaw[3]/2),{bearing:(e([0,0],y)+Math.PI/2)%Math.PI,strength:i}},Ie=(A,e)=>{let t=m=>{let z=Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2]);return m[0]/=z,m[1]/=z,m[2]/=z,m},o=(m,z)=>{let w=m[0]-z[0],R=m[1]-z[1],W=m[2]-z[2];return[w,R,W]},n=(m,z)=>{let w=m[1]*z[2]-m[2]*z[1],R=m[2]*z[0]-m[0]*z[2],W=m[0]*z[1]-m[1]*z[0];return[w,R,W]},x=m=>{let[z,w,R,W,M,u,T,P,b]=m,k,Z,N;return W<1?W>-1?(N=Math.asin(W),Z=Math.atan2(-T,z),k=Math.atan2(-u,M)):(N=-Math.PI/2,Z=-Math.atan2(P,b),k=0):(N=Math.PI/2,Z=Math.atan2(P,b),k=0),{pitch:2*-k,yaw:2*-Z,roll:2*-N}},a=m=>{let z=(R,W,M,u)=>Math.atan2(u-W,M-R);return{pitch:z(m[10][1],m[10][2],m[152][1],m[152][2]),yaw:z(m[33][0],m[33][2],m[263][0],m[263][2]),roll:z(m[33][0],m[33][1],m[263][0],m[263][1])}},r=A.meshRaw;if(!r||r.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let y=Math.max(A.boxRaw[2]*e[0],A.boxRaw[3]*e[1])/1.5,i=[r[10],r[152],r[234],r[454]].map(m=>[m[0]*e[0]/y,m[1]*e[1]/y,m[2]]),c=t(o(i[1],i[0])),l=t(o(i[3],i[2])),f=t(n(l,c));l=n(c,f);let h=[l[0],l[1],l[2],c[0],c[1],c[2],f[0],f[1],f[2]],E=x(h),d=r.length===478?ke(A):{bearing:0,strength:0};return{angle:E,matrix:h,gaze:d}},z5=async(A,e)=>{var c,l,f,h,E,d;let t,o,n,x,a,r,y=[];A.state="run:face",t=I();let i=await wA(e,A.config);if(A.performance.face=Math.trunc(I()-t),!e.shape||e.shape.length!==4)return[];if(!i)return[];for(let m=0;m(A[e]=t,A),{}),Ne=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Oe=Ne.map(([A,e])=>[w0[A],w0[e]]),LA=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function HA(A){let e=A.reduce(({maxX:t,maxY:o,minX:n,minY:x},{position:{x:a,y:r}})=>({maxX:Math.max(t,a),maxY:Math.max(o,r),minX:Math.min(n,a),minY:Math.min(x,r)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY]}function ZA(A,[e,t],[o,n]){let x=e/o,a=t/n,r=(i,c)=>({id:c,score:i.score,boxRaw:[i.box[0]/n,i.box[1]/o,i.box[2]/n,i.box[3]/o],box:[Math.trunc(i.box[0]*a),Math.trunc(i.box[1]*x),Math.trunc(i.box[2]*a),Math.trunc(i.box[3]*x)],keypoints:i.keypoints.map(({score:l,part:f,position:h})=>({score:l,part:f,position:[Math.trunc(h.x*a),Math.trunc(h.y*x)],positionRaw:[h.x/o,h.y/o]}))});return A.map((i,c)=>r(i,c))}var E5=class{constructor(e,t){this.priorityQueue=new Array(e),this.numberOfElements=-1,this.getElementValue=t}enqueue(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)}dequeue(){let e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(e){for(;e>0&&this.less(Math.floor(e/2),e);)this.exchange(e,Math.floor(e/2)),e=Math.floor(e/2)}sink(e){for(;2*e<=this.numberOfElements;){let t=2*e;if(tt?t:A}function VA(A,e,t,o){let n=t-A,x=o-e;return n*n+x*x}function S5(A,e){return{x:A.x+e.x,y:A.y+e.y}}var B0=1,b0=16,Le=50**2;function XA(A,e,t,o,n,x,a=2){let r=z=>({y:x.get(z.y,z.x,A),x:x.get(z.y,z.x,x.shape[2]/2+A)}),y=(z,w,R)=>({y:w5(Math.round(z.y/b0),0,w-1),x:w5(Math.round(z.x/b0),0,R-1)}),[i,c]=o.shape,l=y(e.position,i,c),f=r(l),E=S5(e.position,f);for(let z=0;z[w0[f],w0[h]]),a=x.map(([,f])=>f),r=x.map(([f])=>f),y=e.shape[2],i=a.length,c=new Array(y),l=j5(A.part,b0,t);c[A.part.id]={score:A.score,part:j0[A.part.id],position:l};for(let f=i-1;f>=0;--f){let h=a[f],E=r[f];c[h]&&!c[E]&&(c[E]=XA(f,c[h],E,e,t,n))}for(let f=0;fe){r=!1;break}if(!r)break}return r}function Ve(A,e){let[t,o,n]=e.shape,x=new E5(t*o*n,({score:a})=>a);for(let a=0;a{var a;let x=(a=n[o])==null?void 0:a.position;return x?VA(t,e,x.y,x.x)<=Le:!1})}function Xe(A,e){return e.reduce((o,{position:n,score:x},a)=>(FA(A,n,a)||(o+=x),o),0)/e.length}function CA(A,e,t,o,n,x){let a=[],r=Ve(x,e);for(;a.lengthh.score>x);let l=Xe(a,c),f=HA(c);l>x&&a.push({keypoints:c,box:f,score:Math.round(100*l)/100})}return a}var Y,Fe=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function W5(A,e){let t=s.tidy(()=>{if(!Y.inputs[0].shape)return[];let r=s.image.resizeBilinear(A,[Y.inputs[0].shape[2],Y.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),i=Y.execute(r,Fe).map(c=>s.squeeze(c,[0]));return i[1]=i[1].sigmoid(),i}),o=await Promise.all(t.map(a=>a.buffer()));for(let a of t)a.dispose();let n=await CA(o[0],o[1],o[2],o[3],e.body.maxDetected,e.body.minConfidence);return Y.inputs[0].shape?ZA(n,[A.shape[1],A.shape[2]],[Y.inputs[0].shape[2],Y.inputs[0].shape[1]]):[]}async function k5(A){return Y?A.debug&&g("cached model:",Y.modelUrl):(Y=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!Y||!Y.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",Y.modelUrl)),Y}function U0(A){return[Math.abs(A.endPoint[0]-A.startPoint[0]),Math.abs(A.endPoint[1]-A.startPoint[1])]}function S0(A){return[A.startPoint[0]+(A.endPoint[0]-A.startPoint[0])/2,A.startPoint[1]+(A.endPoint[1]-A.startPoint[1])/2]}function qA(A,e,t){let o=e.shape[1],n=e.shape[2],x=[[A.startPoint[1]/o,A.startPoint[0]/n,A.endPoint[1]/o,A.endPoint[0]/n]];return s.image.cropAndResize(e,x,[0],t)}function BA(A,e){let t=[A.startPoint[0]*e[0],A.startPoint[1]*e[1]],o=[A.endPoint[0]*e[0],A.endPoint[1]*e[1]],n=A.palmLandmarks.map(x=>[x[0]*e[0],x[1]*e[1]]);return{startPoint:t,endPoint:o,palmLandmarks:n,confidence:A.confidence}}function J0(A,e=1.5){let t=S0(A),o=U0(A),n=[e*o[0]/2,e*o[1]/2],x=[t[0]-n[0],t[1]-n[1]],a=[t[0]+n[0],t[1]+n[1]];return{startPoint:x,endPoint:a,palmLandmarks:A.palmLandmarks}}function Y0(A){let e=S0(A),t=U0(A),n=Math.max(...t)/2,x=[e[0]-n,e[1]-n],a=[e[0]+n,e[1]+n];return{startPoint:x,endPoint:a,palmLandmarks:A.palmLandmarks}}var UA=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var I5=class{constructor(e){var t;this.model=e,this.anchors=UA.map(o=>[o.x,o.y]),this.anchorsTensor=s.tensor2d(this.anchors),this.inputSize=(t=this.model)==null?void 0:t.inputs[0].shape[2],this.inputSizeTensor=s.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=s.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(e){return s.tidy(()=>{let t=s.slice(e,[0,0],[-1,2]),o=s.slice(e,[0,2],[-1,2]),n=s.add(s.div(t,this.inputSizeTensor),this.anchorsTensor),x=s.div(o,this.doubleInputSizeTensor),a=s.mul(s.sub(n,x),this.inputSizeTensor),r=s.mul(s.add(n,x),this.inputSizeTensor);return s.concat2d([a,r],1)})}normalizeLandmarks(e,t){return s.tidy(()=>{let o=s.add(s.div(e.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[t]);return s.mul(o,this.inputSizeTensor)})}async getBoxes(e,t){let o=this.model.predict(e),n=s.squeeze(o);o.dispose();let x=s.tidy(()=>s.sigmoid(s.slice(n,[0,0],[-1,1])).squeeze()),a=x.dataSync(),r=s.slice(n,[0,1],[-1,4]),y=this.normalizeBoxes(r);r.dispose();let i=await s.image.nonMaxSuppressionAsync(y,a,t.hand.maxDetected,t.hand.iouThreshold,t.hand.minConfidence),c=i.arraySync();x.dispose(),i.dispose();let l=[];for(let f of c)if(a[f]>=t.hand.minConfidence){let h=s.slice(y,[f,0],[1,-1]),E=s.slice(n,[f,5],[1,14]),d=s.tidy(()=>this.normalizeLandmarks(E,f).reshape([-1,2]));E.dispose(),l.push({box:h,palmLandmarks:d,confidence:a[f]})}return n.dispose(),y.dispose(),l}async estimateHandBounds(e,t){let o=e.shape[1],n=e.shape[2],x=s.tidy(()=>e.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),a=await this.getBoxes(x,t);x.dispose();let r=[];if(!a||a.length===0)return r;for(let y of a){let i=y.box.dataSync(),c=i.slice(0,2),l=i.slice(2,4),f=y.palmLandmarks.arraySync();y.box.dispose(),y.palmLandmarks.dispose(),r.push(BA({startPoint:c,endPoint:l,palmLandmarks:f,confidence:y.confidence},[n/this.inputSize,o/this.inputSize]))}return r}};function Ce(A){return A-2*Math.PI*Math.floor((A+Math.PI)/(2*Math.PI))}function JA(A,e){let t=Math.PI/2-Math.atan2(-(e[1]-A[1]),e[0]-A[0]);return Ce(t)}var YA=(A,e)=>[[1,0,A],[0,1,e],[0,0,1]];function i0(A,e){let t=0;for(let o=0;oa[0]),o=e.map(a=>a[1]),n=[Math.min(...t),Math.min(...o)],x=[Math.max(...t),Math.max(...o)];return{startPoint:n,endPoint:x}}getBoxForPalmLandmarks(e,t){let o=e.map(x=>O5([...x,1],t)),n=this.calculateLandmarksBoundingBox(o);return J0(Y0(n),Be)}getBoxForHandLandmarks(e){let t=this.calculateLandmarksBoundingBox(e),o=J0(Y0(t),KA);o.palmLandmarks=[];for(let n=0;n[a[0]*(h[0]-this.inputSize/2),a[1]*(h[1]-this.inputSize/2),a[2]*h[2]]),y=N5(o,[0,0]),i=r.map(h=>[...O5(h,y),h[2]]),c=DA(n),l=[...S0(t),1],f=[i0(l,c[0]),i0(l,c[1])];return i.map(h=>[Math.trunc(h[0]+f[0]),Math.trunc(h[1]+f[1]),Math.trunc(h[2])])}async estimateHands(e,t){let o=!1,n;(this.skipped===0||this.skipped>t.hand.skipFrames||!t.hand.landmarks||!t.skipFrame)&&(n=await this.handDetector.estimateHandBounds(e,t),this.skipped=0),t.skipFrame&&this.skipped++,n&&n.length>0&&(n.length!==this.detectedHands&&this.detectedHands!==t.hand.maxDetected||!t.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...n],this.storedBoxes.length>0&&(o=!0));let x=[];for(let a=0;a=t.hand.minConfidence){let R=s.reshape(z,[-1,3]),W=R.arraySync();z.dispose(),R.dispose();let M=this.transformRawCoords(W,h,y,f),u=this.getBoxForHandLandmarks(M);this.storedBoxes[a]={...u,confidence:w};let T={landmarks:M,confidence:w,box:{topLeft:u.startPoint,bottomRight:u.endPoint}};x.push(T)}else this.storedBoxes[a]=null;z.dispose()}else{let y=J0(Y0(r),KA),i={confidence:r.confidence,box:{topLeft:y.startPoint,bottomRight:y.endPoint}};x.push(i)}}return this.storedBoxes=this.storedBoxes.filter(a=>a!==null),this.detectedHands=x.length,x}};var _A={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},a0,x0,$A;async function H5(A,e){let t=await $A.estimateHands(A,e);if(!t)return[];let o=[];for(let n=0;nt[n].landmarks[c]);let a=t[n].landmarks,r=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],y=[0,0,0,0];if(a&&a.length>0){for(let i of a)i[0]r[2]&&(r[2]=i[0]),i[1]>r[3]&&(r[3]=i[1]);r[2]-=r[0],r[3]-=r[1],y=[r[0]/(A.shape[2]||0),r[1]/(A.shape[1]||0),r[2]/(A.shape[2]||0),r[3]/(A.shape[1]||0)]}else r=t[n].box?[Math.trunc(Math.max(0,t[n].box.topLeft[0])),Math.trunc(Math.max(0,t[n].box.topLeft[1])),Math.trunc(Math.min(A.shape[2]||0,t[n].box.bottomRight[0])-Math.max(0,t[n].box.topLeft[0])),Math.trunc(Math.min(A.shape[1]||0,t[n].box.bottomRight[1])-Math.max(0,t[n].box.topLeft[1]))]:[0,0,0,0],y=[t[n].box.topLeft[0]/(A.shape[2]||0),t[n].box.topLeft[1]/(A.shape[1]||0),(t[n].box.bottomRight[0]-t[n].box.topLeft[0])/(A.shape[2]||0),(t[n].box.bottomRight[1]-t[n].box.topLeft[1])/(A.shape[1]||0)];o.push({id:n,score:Math.round(100*t[n].confidence)/100,box:r,boxRaw:y,keypoints:a,annotations:x})}return o}async function Z5(A){!a0||!x0?([a0,x0]=await Promise.all([A.hand.enabled?s.loadGraphModel(L(A.modelBasePath,A.hand.detector.modelPath),{fromTFHub:A.hand.detector.modelPath.includes("tfhub.dev")}):null,A.hand.landmarks?s.loadGraphModel(L(A.modelBasePath,A.hand.skeleton.modelPath),{fromTFHub:A.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),A.hand.enabled&&(!a0||!a0.modelUrl?g("load model failed:",A.hand.detector.modelPath):A.debug&&g("load model:",a0.modelUrl),!x0||!x0.modelUrl?g("load model failed:",A.hand.skeleton.modelPath):A.debug&&g("load model:",x0.modelUrl))):(A.debug&&g("cached model:",a0.modelUrl),A.debug&&g("cached model:",x0.modelUrl));let e=new I5(a0);return $A=new L5(e,x0),[a0,x0]}var Ae=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],ee=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var q;async function G0(A){return q?A.debug&&g("cached model:",q.modelUrl):(q=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),q.width=parseInt(q.signature.inputs["input_1:0"].tensorShape.dim[2].size),q.height=parseInt(q.signature.inputs["input_1:0"].tensorShape.dim[1].size),!q||!q.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",q.modelUrl)),q}async function V5(A,e){var d;if(!q)return[];if(!e.body.enabled)return[];let t={width:A.shape[2]||0,height:A.shape[1]||0},o=s.image.resizeBilinear(A,[q.width,q.height],!1),n=s.div(o,[255]);o.dispose();let x=await q.predict(n),a=((d=x.find(m=>m.size===195||m.size===155))==null?void 0:d.dataSync())||[];x.forEach(m=>m.dispose()),n.dispose();let r=[],y=(a==null?void 0:a.length)===195?Ae:ee,i=5;for(let m=0;mm.position[0]),l=r.map(m=>m.position[1]),f=[Math.min(...c),Math.min(...l),Math.max(...c)-Math.min(...c),Math.max(...l)-Math.min(...c)],h=[0,0,0,0],E=r.reduce((m,z)=>z.score>m?z.score:m,0);return[{id:0,score:E,box:f,boxRaw:h,keypoints:r}]}var B,n0=[],X5=[0,0,0,0],F5=[0,0,0,0],D0=0,C5=Number.MAX_SAFE_INTEGER,Ye=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","pelvis","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"];async function te(A){return B?A.debug&&g("cached model:",B.modelUrl):(B=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!B||!B.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",B.modelUrl)),B}function Ge(A,e){let[t,o]=A.shape;return s.tidy(()=>{let n=(r,y)=>s.sub(r,s.mul(s.div(r,s.scalar(y,"int32")),s.scalar(y,"int32"))),x=s.reshape(A,[o*t]),a=s.max(x,0).dataSync()[0];if(a>e){let r=s.argMax(x,0),y=n(r,t).dataSync()[0],i=s.div(r,s.scalar(t,"int32")).dataSync()[0];return[y,i,a]}return[0,0,a]})}async function q5(A,e){return C50?(C5++,[{id:0,score:D0,box:X5,boxRaw:F5,keypoints:n0}]):(C5=0,new Promise(async t=>{let o=s.tidy(()=>{if(!B.inputs[0].shape)return null;let i=s.image.resizeBilinear(A,[B.inputs[0].shape[2],B.inputs[0].shape[1]],!1);return s.mul(i,2).sub(1)}),n;if(e.body.enabled&&(n=await B.predict(o)),o.dispose(),n){n0.length=0;let i=n.squeeze();s.dispose(n);let c=i.unstack(2);s.dispose(i);for(let l=0;le.body.minConfidence&&n0.push({score:Math.round(100*E)/100,part:Ye[l],positionRaw:[f/B.inputs[0].shape[2],h/B.inputs[0].shape[1]],position:[Math.round(A.shape[2]*f/B.inputs[0].shape[2]),Math.round(A.shape[1]*h/B.inputs[0].shape[1])]})}c.forEach(l=>s.dispose(l))}D0=n0.reduce((i,c)=>c.score>i?c.score:i,0);let x=n0.map(i=>i.position[0]),a=n0.map(i=>i.position[1]);X5=[Math.min(...x),Math.min(...a),Math.max(...x)-Math.min(...x),Math.max(...a)-Math.min(...a)];let r=n0.map(i=>i.positionRaw[0]),y=n0.map(i=>i.positionRaw[1]);F5=[Math.min(...r),Math.min(...y),Math.max(...r)-Math.min(...r),Math.max(...y)-Math.min(...y)],t([{id:0,score:D0,box:X5,boxRaw:F5,keypoints:n0}])}))}var e0,o0=[],B5=[0,0,0,0],U5=[0,0,0,0],g0=0,J5=Number.MAX_SAFE_INTEGER,De=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"];async function Y5(A){return e0?A.debug&&g("cached model:",e0.modelUrl):(e0=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!e0||!e0.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",e0.modelUrl)),e0}async function G5(A,e){return J50?(J5++,[{id:0,score:g0,box:B5,boxRaw:U5,keypoints:o0}]):(J5=0,new Promise(async t=>{let o=s.tidy(()=>{if(!e0.inputs[0].shape)return null;let i=s.image.resizeBilinear(A,[e0.inputs[0].shape[2],e0.inputs[0].shape[1]],!1);return s.cast(i,"int32")}),n;if(e.body.enabled&&(n=await e0.predict(o)),o.dispose(),n){o0.length=0;let i=n.arraySync();s.dispose(n);let c=i[0][0];for(let l=0;le.body.minConfidence&&o0.push({score:Math.round(100*g0)/100,part:De[l],positionRaw:[c[l][1],c[l][0]],position:[Math.round((A.shape[2]||0)*c[l][1]),Math.round((A.shape[1]||0)*c[l][0])]})}g0=o0.reduce((i,c)=>c.score>i?c.score:i,0);let x=o0.map(i=>i.position[0]),a=o0.map(i=>i.position[1]);B5=[Math.min(...x),Math.min(...a),Math.max(...x)-Math.min(...x),Math.max(...a)-Math.min(...a)];let r=o0.map(i=>i.positionRaw[0]),y=o0.map(i=>i.positionRaw[1]);U5=[Math.min(...r),Math.min(...y),Math.max(...r)-Math.min(...r),Math.max(...y)-Math.min(...y)],t([{id:0,score:g0,box:B5,boxRaw:U5,keypoints:o0}])}))}var M0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var G,D5=[],K5=Number.MAX_SAFE_INTEGER,K0=2.5;async function Q5(A){if(G)A.debug&&g("cached model:",G.modelUrl);else{G=await s.loadGraphModel(L(A.modelBasePath,A.object.modelPath));let e=Object.values(G.modelSignature.inputs);if(G.inputSize=Array.isArray(e)?parseInt(e[0].tensorShape.dim[2].size):null,!G.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${A.object.modelPath}`);!G||!G.modelUrl?g("load model failed:",A.object.modelPath):A.debug&&g("load model:",G.modelUrl)}return G}async function Ke(A,e,t,o){let n=0,x=[];for(let i of[1,2,4])s.tidy(()=>{var m,z;let c=i*13,l=(m=A.find(w=>w.shape[1]===c**2&&w.shape[2]===M0.length))==null?void 0:m.squeeze(),f=(z=A.find(w=>w.shape[1]===c**2&&w.shape[2]o.object.minConfidence&&R!==61){let M=(.5+Math.trunc(w%c))/c,u=(.5+Math.trunc(w/c))/c,T=E[w].map(F=>F*(c/i/e)),[P,b]=[M-K0/i*T[0],u-K0/i*T[1]],[k,Z]=[M+K0/i*T[2]-P,u+K0/i*T[3]-b],N=[P,b,k,Z];N=N.map(F=>Math.max(0,Math.min(F,1)));let O=[N[0]*t[0],N[1]*t[1],N[2]*t[0],N[3]*t[1]],v={id:n++,score:Math.round(100*W)/100,class:R+1,label:M0[R].label,box:O.map(F=>Math.trunc(F)),boxRaw:N};x.push(v)}}});A.forEach(i=>s.dispose(i));let a=x.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),r=x.map(i=>i.score),y=[];if(a&&a.length>0){let i=await s.image.nonMaxSuppressionAsync(a,r,o.object.maxDetected,o.object.iouThreshold,o.object.minConfidence);y=i.dataSync(),s.dispose(i)}return x=x.filter((i,c)=>y.includes(c)).sort((i,c)=>c.score-i.score),x}async function _5(A,e){return K50?(K5++,D5):(K5=0,new Promise(async t=>{let o=[A.shape[2],A.shape[1]],n=s.image.resizeBilinear(A,[G.inputSize,G.inputSize],!1),x=n.div(255),a=x.transpose([0,3,1,2]);x.dispose(),n.dispose();let r;e.object.enabled&&(r=await G.predict(a)),a.dispose();let y=await Ke(r,G.inputSize,o,e);D5=y,t(y)}))}var D,$5=[],AA=Number.MAX_SAFE_INTEGER;async function eA(A){if(D)A.debug&&g("cached model:",D.modelUrl);else{D=await s.loadGraphModel(L(A.modelBasePath,A.object.modelPath));let e=Object.values(D.modelSignature.inputs);if(D.inputSize=Array.isArray(e)?parseInt(e[0].tensorShape.dim[2].size):null,!D.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${A.object.modelPath}`);!D||!D.modelUrl?g("load model failed:",A.object.modelPath):A.debug&&g("load model:",D.modelUrl)}return D}async function Qe(A,e,t,o){if(!A)return[];let n=[],x=A.arraySync(),a=s.squeeze(A);A.dispose();let r=s.split(a,6,1);a.dispose();let i=s.stack([r[1],r[0],r[3],r[2]],1).squeeze(),c=r[4].squeeze(),l=r[5].squeeze();r.forEach(d=>d.dispose());let f=await s.image.nonMaxSuppressionAsync(i,c,o.object.maxDetected,o.object.iouThreshold,o.object.minConfidence);i.dispose(),c.dispose(),l.dispose();let h=f.dataSync();f.dispose();let E=0;for(let d of h){let m=Math.trunc(100*x[0][d][4])/100,z=x[0][d][5],w=M0[z].label,R=[x[0][d][0]/e,x[0][d][1]/e,x[0][d][2]/e,x[0][d][3]/e],W=[Math.trunc(R[0]*t[0]),Math.trunc(R[1]*t[1]),Math.trunc(R[2]*t[0]),Math.trunc(R[3]*t[1])];n.push({id:E++,score:m,class:z,label:w,box:W,boxRaw:R})}return n}async function tA(A,e){return AA0?(AA++,$5):(AA=0,new Promise(async t=>{let o=[A.shape[2],A.shape[1]],n=s.image.resizeBilinear(A,[D.inputSize,D.inputSize]),x=e.object.enabled?D.execute(n,["tower_0/detections"]):null;n.dispose();let a=await Qe(x,D.inputSize,o,e);$5=a,t(a)}))}var ne=A=>{if(!A)return[];let e=[];for(let t=0;ty.part==="leftWrist"),n=A[t].keypoints.find(y=>y.part==="rightWrist"),x=A[t].keypoints.find(y=>y.part==="nose");x&&o&&n&&o.position.yy.part==="leftShoulder"),r=A[t].keypoints.find(y=>y.part==="rightShoulder");a&&r&&e.push({body:t,gesture:`leaning ${a.position.y>r.position.y?"left":"right"}`})}return e},oe=A=>{if(!A)return[];let e=[];for(let t=0;t0){let o=A[t].mesh[33][2]-A[t].mesh[263][2];Math.abs(o)<10?e.push({face:t,gesture:"facing center"}):e.push({face:t,gesture:`facing ${o<0?"left":"right"}`}),Math.abs(A[t].mesh[374][1]-A[t].mesh[386][1])/Math.abs(A[t].mesh[443][1]-A[t].mesh[450][1])<.2&&e.push({face:t,gesture:"blink left eye"}),Math.abs(A[t].mesh[145][1]-A[t].mesh[159][1])/Math.abs(A[t].mesh[223][1]-A[t].mesh[230][1])<.2&&e.push({face:t,gesture:"blink right eye"});let a=Math.min(100,500*Math.abs(A[t].mesh[13][1]-A[t].mesh[14][1])/Math.abs(A[t].mesh[10][1]-A[t].mesh[152][1]));a>10&&e.push({face:t,gesture:`mouth ${Math.trunc(a)}% open`});let r=A[t].mesh[152][2];Math.abs(r)>10&&e.push({face:t,gesture:`head ${r<0?"up":"down"}`})}return e},se=A=>{if(!A)return[];let e=[];for(let t=0;t.06||l>.06)&&(i=!1),f>.06&&e.push({iris:t,gesture:"looking right"}),l>.06&&e.push({iris:t,gesture:"looking left"});let h=Math.abs(A[t].mesh[145][1]-A[t].annotations.rightEyeIris[0][1])/A[t].box[3],E=Math.abs(A[t].mesh[374][1]-A[t].annotations.leftEyeIris[0][1])/A[t].box[3];(E<.01||h<.01||E>.022||h>.022)&&(i=!1),(E<.01||h<.01)&&e.push({iris:t,gesture:"looking down"}),(E>.022||h>.022)&&e.push({iris:t,gesture:"looking up"}),i&&e.push({iris:t,gesture:"looking center"})}return e},re=A=>{if(!A)return[];let e=[];for(let t=0;t0){let n=o.reduce((a,r)=>a.position[2]a.position[1](i[f]=0,l))},n=function(r,y){let i=A.createShader(y);if(A.shaderSource(i,r),A.compileShader(i),!A.getShaderParameter(i,A.COMPILE_STATUS))throw new Error("Filter: GL compile failed",A.getShaderInfoLog(i));return i};this.uniform={},this.attribute={};let x=n(e,A.VERTEX_SHADER),a=n(t,A.FRAGMENT_SHADER);if(this.id=A.createProgram(),A.attachShader(this.id,x),A.attachShader(this.id,a),A.linkProgram(this.id),!A.getProgramParameter(this.id,A.LINK_STATUS))throw new Error("Filter: GL link failed",A.getProgramInfoLog(this.id));A.useProgram(this.id),o(e,"attribute",this.attribute);for(let r in this.attribute)this.attribute[r]=A.getAttribLocation(this.id,r);o(e,"uniform",this.uniform),o(t,"uniform",this.uniform);for(let r in this.uniform)this.uniform[r]=A.getUniformLocation(this.id,r)}function ie(A){A||(A={});let e=0,t=null,o=!1,n=-1,x=[null,null],a=[],r=-1,y=-1,i=null,c=null,l={},f=A.canvas||document.createElement("canvas"),h={},E={INTERMEDIATE:1},d=f.getContext("webgl");if(!d)throw new Error("Filter: getContext() failed");this.addFilter=function(M){let u=Array.prototype.slice.call(arguments,1),T=l[M];a.push({func:T,args:u})},this.reset=function(){a=[]};let m=function(M,u){if(!(M===r&&u===y)){if(f.width=M,r=M,f.height=u,y=u,!i){let T=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);i=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,i),d.bufferData(d.ARRAY_BUFFER,T,d.STATIC_DRAW),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}d.viewport(0,0,r,y),x=[null,null]}},z=function(M,u){let T=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,T);let P=d.createRenderbuffer();d.bindRenderbuffer(d.RENDERBUFFER,P);let b=d.createTexture();return d.bindTexture(d.TEXTURE_2D,b),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,M,u,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,b,0),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null),{fbo:T,texture:b}},w=function(M){return x[M]=x[M]||z(r,y),x[M]},R=function(M=null){var b,k;let u=null,T=null,P=!1;e===0?u=t:u=(b=w(n))==null?void 0:b.texture,e++,o&&!(M&E.INTERMEDIATE)?(T=null,P=e%2==0):(n=(n+1)%2,T=(k=w(n))==null?void 0:k.fbo),d.bindTexture(d.TEXTURE_2D,u),d.bindFramebuffer(d.FRAMEBUFFER,T),d.uniform1f(c.uniform.flipY,P?-1:1),d.drawArrays(d.TRIANGLES,0,6)};this.apply=function(M){if(m(M.width,M.height),e=0,t||(t=d.createTexture()),d.bindTexture(d.TEXTURE_2D,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,M),a.length===0)return R(),f;for(let u=0;u + author: ' + */ +var aA=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var xA=(A,e)=>{for(var t in e)aA(A,t,{get:e[t],enumerable:!0})},u=(A,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of be(e))!ge.call(A,o)&&o!=="default"&&aA(A,o,{get:()=>e[o],enumerable:!(t=pe(e,o))||t.enumerable});return A};var yA=(A,e,t)=>{if(!e.has(A))throw TypeError("Cannot "+t)};var C=(A,e,t)=>(yA(A,e,"read from private field"),t?t.call(A):e.get(A)),K=(A,e,t)=>{if(e.has(A))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(A):e.set(A,t)},_=(A,e,t,o)=>(yA(A,e,"write to private field"),o?o.call(A,t):e.set(A,t),t);function L(A,e){let t=A.endsWith("/")?"":"/",n=e.startsWith(".")||e.startsWith("/")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("file:")?`${e}`:`${A}${t}${e}`;if(!n.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${n} Expecting JSON file`);return n}function g(...A){let e=new Date,t=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`;A&&console.log(t,"Human:",...A)}var I=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function U(...A){let e=t=>t&&typeof t=="object";return A.reduce((t,o)=>(Object.keys(o||{}).forEach(n=>{let x=t[n],r=o[n];Array.isArray(x)&&Array.isArray(r)?t[n]=x.concat(...r):e(x)&&e(r)?t[n]=U(x,r):t[n]=r}),t),{})}var lA={backend:"webgl",modelBasePath:"../models/",wasmPath:"../node_modules/@tensorflow/tfjs-backend-wasm/dist/",debug:!0,async:!0,warmup:"full",cacheSensitivity:.75,skipFrame:!1,filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!0,maxDetected:15,skipFrames:15,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:11,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:17,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:1,minConfidence:.2,skipFrames:1},hand:{enabled:!0,rotation:!0,skipFrames:18,minConfidence:.1,iouThreshold:.1,maxDetected:2,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"mb3-centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:19},segmentation:{enabled:!1,modelPath:"selfie.json"}};function cA(){let A,e;if(typeof navigator!="undefined"){let t=navigator.userAgent.match(/\(([^()]+)\)/g);if(t&&t[0]){let o=t[0].match(/\(([^()]+)\)/g);A=o?o[0].replace(/\(|\)/g,""):"",e=navigator.userAgent.replace(t[0],""),A[1]&&(e=e.replace(t[1],"")),e=e.replace(/ /g," ")}}else typeof process!="undefined"&&(A=`${process.platform} ${process.arch}`,e=`NodeJS ${process.version}`);return{platform:A,agent:e}}var s={};xA(s,{data:()=>ve,version:()=>ze});u(s,c2);u(s,d2);u(s,f2);u(s,m2);u(s,h2);u(s,u2);import*as dA from"@tensorflow/tfjs/package.json";import*as fA from"@tensorflow/tfjs-core/package.json";import*as mA from"@tensorflow/tfjs-data/package.json";import*as hA from"@tensorflow/tfjs-layers/package.json";import*as uA from"@tensorflow/tfjs-converter/package.json";import{version_cpu as Me}from"@tensorflow/tfjs-backend-cpu/dist/index.js";import{version_webgl as Te}from"@tensorflow/tfjs-backend-webgl/dist/index.js";import{version_wasm as Pe}from"@tensorflow/tfjs-backend-wasm/dist/index.js";import*as c2 from"@tensorflow/tfjs-core/dist/index.js";import*as d2 from"@tensorflow/tfjs-layers/dist/index.js";import*as f2 from"@tensorflow/tfjs-converter/dist/index.js";import*as ve from"@tensorflow/tfjs-data/dist/index.js";import*as m2 from"@tensorflow/tfjs-backend-cpu/dist/index.js";import*as h2 from"@tensorflow/tfjs-backend-webgl/dist/index.js";import*as u2 from"@tensorflow/tfjs-backend-wasm/dist/index.js";var ze={tfjs:(dA==null?void 0:dA.version)||void 0,"tfjs-core":(fA==null?void 0:fA.version)||void 0,"tfjs-data":(mA==null?void 0:mA.version)||void 0,"tfjs-layers":(hA==null?void 0:hA.version)||void 0,"tfjs-converter":(uA==null?void 0:uA.version)||void 0,"tfjs-backend-cpu":Me||void 0,"tfjs-backend-webgl":Te||void 0,"tfjs-backend-wasm":Pe||void 0};var J={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function pA(){if(!s.findBackend(J.name)){g("backend registration:",J.name);try{J.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(J.width,J.height):document.createElement("canvas")}catch(A){g("error: cannot create canvas:",A);return}try{J.gl=J.canvas.getContext("webgl2",J.webGLattr)}catch(A){g("error: cannot get WebGL2 context:",A);return}try{s.setWebGLContext(2,J.gl)}catch(A){g("error: cannot set WebGL2 context:",A);return}try{let A=new s.GPGPUContext(J.gl);s.registerBackend(J.name,()=>new s.MathBackendWebGL(A),J.priority)}catch(A){g("error: cannot register WebGL backend:",A);return}try{s.getKernelsForBackend("webgl").forEach(e=>{let t={...e,backendName:J.name};s.registerKernel(t)})}catch(A){g("error: cannot update WebGL backend registration:",A);return}try{s.ENV.set("WEBGL_VERSION",2)}catch(A){g("error: cannot set WebGL backend flags:",A);return}g("backend registered:",J.name)}}function bA(A,e){let t=[A.startPoint[0]*e[0],A.startPoint[1]*e[1]],o=[A.endPoint[0]*e[0],A.endPoint[1]*e[1]];return{startPoint:t,endPoint:o}}function E0(A){return[Math.abs(A.endPoint[0]-A.startPoint[0]),Math.abs(A.endPoint[1]-A.startPoint[1])]}function h0(A){return[A.startPoint[0]+(A.endPoint[0]-A.startPoint[0])/2,A.startPoint[1]+(A.endPoint[1]-A.startPoint[1])/2]}function u0(A,e,t){let o=e.shape[1],n=e.shape[2],x=[[A.startPoint[1]/o,A.startPoint[0]/n,A.endPoint[1]/o,A.endPoint[0]/n]];return s.image.cropAndResize(e,x,[0],t)}function L0(A,e=1.5){let t=h0(A),o=E0(A),n=[e*o[0]/2,e*o[1]/2],x=[t[0]-n[0],t[1]-n[1]],r=[t[0]+n[0],t[1]+n[1]];return{startPoint:x,endPoint:r,landmarks:A.landmarks}}function H0(A){let e=h0(A),t=E0(A),n=Math.max(...t)/2,x=[Math.round(e[0]-n),Math.round(e[1]-n)],r=[Math.round(e[0]+n),Math.round(e[1]+n)];return{startPoint:x,endPoint:r,landmarks:A.landmarks}}function a5(A){let e=A.map(x=>x[0]),t=A.map(x=>x[1]),o=[Math.min(...e),Math.min(...t)],n=[Math.max(...e),Math.max(...t)];return{startPoint:o,endPoint:n,landmarks:A}}var gA=A=>({startPoint:s.slice(A,[0,0],[-1,2]),endPoint:s.slice(A,[0,2],[-1,2])});var Z0=[[1,0,0],[0,1,0],[0,0,1]];function Ee(A){return A-2*Math.PI*Math.floor((A+Math.PI)/(2*Math.PI))}function x5(A,e){let t=Math.PI/2-Math.atan2(-(e[1]-A[1]),e[0]-A[0]);return Ee(t)}function MA(A,e){return[[1,0,A],[0,1,e],[0,0,1]]}function r0(A,e){let t=0;for(let o=0;o{let i=s.image.resizeBilinear(e,[this.inputSize,this.inputSize]).div(127.5).sub(.5),c=this.model.execute(i),l;if(Array.isArray(c)){let d=c.sort((R,W)=>R.size-W.size),m=s.concat([d[0],d[2]],2),z=s.concat([d[1],d[3]],2);l=s.concat([z,m],1).squeeze(0)}else l=s.squeeze(c);let f=je(l,this.anchors,[this.inputSize,this.inputSize]),h=s.slice(l,[0,0],[-1,1]),E=s.sigmoid(h).squeeze().dataSync();return[l,f,E]}),x=await s.image.nonMaxSuppressionAsync(o,n,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),r=x.arraySync();x.dispose();let a=[];for(let y=0;ythis.config.face.detector.minConfidence){let c=s.slice(o,[r[y],0],[1,-1]),l=gA(c);c.dispose();let f=this.anchorsData[r[y]],h=s.tidy(()=>s.slice(t,[r[y],EA-1],[1,-1]).squeeze().reshape([EA,-1]));a.push({box:l,landmarks:h,anchor:f,confidence:i})}}return t.dispose(),o.dispose(),{boxes:a,scaleFactor:[e.shape[2]/this.inputSize,e.shape[1]/this.inputSize]}}};async function jA(A){let e=await s.loadGraphModel(L(A.modelBasePath,A.face.detector.modelPath),{fromTFHub:A.face.detector.modelPath.includes("tfhub.dev")}),t=new RA(e,A);return!e||!e.modelUrl?g("load model failed:",A.face.detector.modelPath):A.debug&&g("load model:",e.modelUrl),t}var t0={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},y5=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],R0=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],l0=[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,130,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,116,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];var we=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],Se=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],We=[33,133,362,263,1,78,308],w2=we.map(A=>R0[A]),S2=Se.map(A=>R0[A]),W2=We.map(A=>R0[A]);var l5=t0.leftEyeLower0,c5=t0.rightEyeLower0,p0={leftBounds:[l5[0],l5[l5.length-1]],rightBounds:[c5[0],c5[c5.length-1]]},X0={count:468,mouth:13,symmetryLine:[13,t0.midwayBetweenEyes[0]]},wA={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},b0={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function F0(A,e,t,o){for(let n=0;n[x[0]/this.meshSize*(l[0]-this.meshSize/2),x[1]/this.meshSize*(l[1]-this.meshSize/2),l[2]]),a=o!==0?V0(o,[0,0]):Z0,y=o!==0?r.map(l=>[...vA(l,a),l[2]]):r,i=o!==0?PA(n):Z0,c=[...h0({startPoint:t.startPoint,endPoint:t.endPoint}),1];return y.map(l=>[Math.round(l[0]+r0(c,i[0])),Math.round(l[1]+r0(c,i[1])),Math.round(l[2])])}getLeftToRightEyeDepthDifference(e){let t=e[p0.leftBounds[0]][2],o=e[p0.rightBounds[0]][2];return t-o}getEyeBox(e,t,o,n,x=!1){let r=H0(L0(a5([e[o],e[n]]),this.irisEnlarge)),a=E0(r),y=s.image.cropAndResize(t,[[r.startPoint[1]/this.meshSize,r.startPoint[0]/this.meshSize,r.endPoint[1]/this.meshSize,r.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return x&&s.ENV.flags.IS_BROWSER&&(y=s.image.flipLeftRight(y)),{box:r,boxSize:a,crop:y}}getEyeCoords(e,t,o,n=!1){let x=[];for(let r=0;r{let i=r;return y===2?i=n:y===4&&(i=x),[a[0],a[1],i]})}async predict(e,t){let o=!1,n;if((this.skipped===0||this.skipped>t.face.detector.skipFrames||!t.face.mesh.enabled||!t.skipFrame)&&(n=await this.boundingBoxDetector.getBoundingBoxes(e),this.skipped=0),t.skipFrame&&this.skipped++,!t.skipFrame||n&&n.boxes&&(!t.face.mesh.enabled||n.boxes.length!==this.detectedFaces&&this.detectedFaces!==t.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let r of n.boxes)this.storedBoxes.push({startPoint:r.box.startPoint.dataSync(),endPoint:r.box.endPoint.dataSync(),landmarks:r.landmarks.arraySync(),confidence:r.confidence});this.storedBoxes.length>0&&(o=!0)}if(o){if(!n||!n.boxes||n.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let r=0;r{r.box.startPoint.dispose(),r.box.endPoint.dispose(),r.landmarks.dispose()});let x=s.tidy(()=>this.storedBoxes.map((r,a)=>{let y,i=0,c;if(t.face.detector.rotation&&t.face.mesh.enabled&&s.ENV.flags.IS_BROWSER){let[R,W]=r.landmarks.length>=X0.count?X0.symmetryLine:wA.symmetryLine;i=x5(r.landmarks[R],r.landmarks[W]);let M=h0({startPoint:r.startPoint,endPoint:r.endPoint}),p=[M[0]/e.shape[2],M[1]/e.shape[1]],T=s.image.rotateWithOffset(e,i,0,p);c=V0(-i,M),t.face.mesh.enabled?y=u0({startPoint:r.startPoint,endPoint:r.endPoint},T,[this.meshSize,this.meshSize]).div(255):y=u0({startPoint:r.startPoint,endPoint:r.endPoint},T,[this.boxSize,this.boxSize]).div(255)}else{c=Z0;let R=e.clone();t.face.mesh.enabled?y=u0({startPoint:r.startPoint,endPoint:r.endPoint},R,[this.meshSize,this.meshSize]).div(255):y=u0({startPoint:r.startPoint,endPoint:r.endPoint},R,[this.boxSize,this.boxSize]).div(255)}if(!t.face.mesh.enabled)return{mesh:[],box:r,faceConfidence:null,boxConfidence:r.confidence,confidence:r.confidence,image:y};let[,l,f]=this.meshDetector.execute(y),h=l.dataSync()[0];if(h=X0.count?X0.symmetryLine:wA.symmetryLine;i=x5(r.landmarks[R],r.landmarks[W]);let M=h0({startPoint:r.startPoint,endPoint:r.endPoint}),p=[M[0]/e.shape[2],M[1]/e.shape[1]],T=s.image.rotateWithOffset(e.toFloat(),i,0,p);c=V0(-i,M),y=u0({startPoint:r.startPoint,endPoint:r.endPoint},T,[this.meshSize,this.meshSize]).div(255)}let w={mesh:m,box:r,faceConfidence:h,boxConfidence:r.confidence,image:y};return this.storedBoxes[a]={...H0(r),confidence:r.confidence,faceConfidence:h},w}));return t.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(r=>r.confidence>t.face.detector.minConfidence)),this.detectedFaces=x.length,x}};var V=[null,null,null],f5;async function SA(A,e){let t=await f5.predict(A,e),o=[],n=0;for(let x of t||[]){if(!x||x.isDisposedInternal)continue;let r=x.mesh.map(c=>[c[0]/(A.shape[2]||0),c[1]/(A.shape[1]||0),c[2]/f5.meshSize]),a={};if(x.mesh&&x.mesh.length>0)for(let c of Object.keys(t0))a[c]=t0[c].map(l=>x.mesh[l]);let y=x.box?[Math.trunc(Math.max(0,x.box.startPoint[0])),Math.trunc(Math.max(0,x.box.startPoint[1])),Math.trunc(Math.min(A.shape[2]||0,x.box.endPoint[0])-Math.max(0,x.box.startPoint[0])),Math.trunc(Math.min(A.shape[1]||0,x.box.endPoint[1])-Math.max(0,x.box.startPoint[1]))]:[0,0,0,0],i=x.box?[x.box.startPoint[0]/(A.shape[2]||0),x.box.startPoint[1]/(A.shape[1]||0),(x.box.endPoint[0]-x.box.startPoint[0])/(A.shape[2]||0),(x.box.endPoint[1]-x.box.startPoint[1])/(A.shape[1]||0)]:[0,0,0,0];o.push({id:n++,score:Math.round(100*x.faceConfidence||100*x.boxConfidence||0)/100,boxScore:Math.round(100*x.boxConfidence)/100,faceScore:Math.round(100*x.faceConfidence)/100,box:y,boxRaw:i,mesh:x.mesh,meshRaw:r,annotations:a,image:x.image,tensor:x.image}),x.coords&&x.coords.dispose()}return o}async function m5(A){return!V[0]&&A.face.enabled||!V[1]&&A.face.mesh.enabled||!V[2]&&A.face.iris.enabled?(V=await Promise.all([!V[0]&&A.face.enabled?jA(A):null,!V[1]&&A.face.mesh.enabled?s.loadGraphModel(L(A.modelBasePath,A.face.mesh.modelPath),{fromTFHub:A.face.mesh.modelPath.includes("tfhub.dev")}):null,!V[2]&&A.face.iris.enabled?s.loadGraphModel(L(A.modelBasePath,A.face.iris.modelPath),{fromTFHub:A.face.iris.modelPath.includes("tfhub.dev")}):null]),A.face.mesh.enabled&&(!V[1]||!V[1].modelUrl?g("load model failed:",A.face.mesh.modelPath):A.debug&&g("load model:",V[1].modelUrl)),A.face.iris.enabled&&(!V[2]||!V[2].modelUrl?g("load model failed:",A.face.iris.modelPath):A.debug&&g("load model:",V[2].modelUrl))):A.debug&&(V[0]&&g("cached model:",V[0].model.modelUrl),V[1]&&g("cached model:",V[1].modelUrl),V[2]&&g("cached model:",V[2].modelUrl)),f5=new d5(V[0],V[1],V[2]),V}var WA=l0,kA=R0;var ke=["angry","disgust","fear","happy","sad","surprise","neutral"],$,C0=[],IA=0,h5=Number.MAX_SAFE_INTEGER,u5=[.2989,.587,.114];async function p5(A){return $?A.debug&&g("cached model:",$.modelUrl):($=await s.loadGraphModel(L(A.modelBasePath,A.face.emotion.modelPath)),!$||!$.modelUrl?g("load model failed:",A.face.emotion.modelPath):A.debug&&g("load model:",$.modelUrl)),$}async function b5(A,e,t,o){return $?h50?(h5++,C0[t]):(h5=0,new Promise(async n=>{let x=s.image.resizeBilinear(A,[$.inputs[0].shape[2],$.inputs[0].shape[1]],!1),[r,a,y]=s.split(x,3,3);x.dispose();let i=s.mul(r,u5[0]),c=s.mul(a,u5[1]),l=s.mul(y,u5[2]);r.dispose(),a.dispose(),y.dispose();let f=s.addN([i,c,l]);i.dispose(),c.dispose(),l.dispose();let h=s.tidy(()=>f.sub(.5).mul(2));f.dispose();let E=[];if(e.face.emotion.enabled){let d=await $.predict(h),m=d.dataSync();s.dispose(d);for(let z=0;ze.face.emotion.minConfidence&&E.push({score:Math.min(.99,Math.trunc(100*m[z])/100),emotion:ke[z]});E.sort((z,w)=>w.score-z.score)}h.dispose(),C0[t]=E,IA=o,n(E)})):null}var A0,q0=[],NA=0,g5=Number.MAX_SAFE_INTEGER;async function M5(A){let e=L(A.modelBasePath,A.face.description.modelPath);return A0?A.debug&&g("cached model:",e):(A0=await s.loadGraphModel(e),A0?A.debug&&g("load model:",e):g("load model failed:",A.face.description.modelPath)),A0}function T5(A,e,t=2){if(!A||!e||(A==null?void 0:A.length)===0||(e==null?void 0:e.length)===0||(A==null?void 0:A.length)!==(e==null?void 0:e.length))return 0;let o=5*A.map((x,r)=>Math.abs(A[r]-e[r])**t).reduce((x,r)=>x+r,0)**(1/t);return Math.max(0,100-o)/100}function OA(A,e,t=0){let o={similarity:0,name:"",source:"",embedding:[]};if(!A||!e||!Array.isArray(A)||!Array.isArray(e))return o;for(let n of e)if(n.embedding&&n.name){let x=T5(A,n.embedding);x>t&&x>o.similarity&&(o={...n,similarity:x})}return o}function P5(A){return s.tidy(()=>{let t=A.image||A.tensor||A;if(!(t instanceof s.Tensor))return null;let o=[[.05,.15,.85,.85]];return A0.inputs[0].shape?(t.shape.length===3?s.image.cropAndResize(s.expandDims(t,0),o,[0],[A0.inputs[0].shape[2],A0.inputs[0].shape[1]]):s.image.cropAndResize(t,o,[0],[A0.inputs[0].shape[2],A0.inputs[0].shape[1]])).mul(255):null})}async function v5(A,e,t,o){var n,x;return A0?g50?(g5++,q0[t]):(g5=0,new Promise(async r=>{let a=P5(A),y,i={age:0,gender:"unknown",genderScore:0,descriptor:[]};e.face.description.enabled&&(y=await A0.predict(a)),s.dispose(a),y&&(s.tidy(()=>{let c=y.find(d=>d.shape[1]===1).dataSync(),l=Math.trunc(200*Math.abs(c[0]-.5))/100;l>e.face.description.minConfidence&&(i.gender=c[0]<=.5?"female":"male",i.genderScore=Math.min(.99,l));let f=y.find(d=>d.shape[1]===100).argMax(1).dataSync()[0],h=y.find(d=>d.shape[1]===100).dataSync();i.age=Math.round(h[f-1]>h[f+1]?10*f-100*h[f-1]:10*f+100*h[f+1])/10;let E=y.find(d=>d.shape[1]===1024);i.descriptor=[...E.dataSync()]}),y.forEach(c=>s.dispose(c))),q0[t]=i,NA=o,r(i)})):null}var Ie=A=>{let e=(l,f)=>Math.atan2(l[1]-f[1],l[0]-f[0]);if(!A.annotations.rightEyeIris||!A.annotations.leftEyeIris)return{bearing:0,strength:0};let t=[0,-.1],o=1,n=A.mesh[33][2]>A.mesh[263][2],x=n?A.mesh[473]:A.mesh[468],r=n?[(A.mesh[133][0]+A.mesh[33][0])/2,(A.mesh[133][1]+A.mesh[33][1])/2]:[(A.mesh[263][0]+A.mesh[362][0])/2,(A.mesh[263][1]+A.mesh[362][1])/2],a=n?[A.mesh[133][0]-A.mesh[33][0],A.mesh[23][1]-A.mesh[27][1]]:[A.mesh[263][0]-A.mesh[362][0],A.mesh[253][1]-A.mesh[257][1]],y=[(r[0]-x[0])/a[0]-t[0],o*(x[1]-r[1])/a[1]-t[1]],i=Math.sqrt(y[0]**2+y[1]**2);return i=Math.min(i,A.boxRaw[2]/2,A.boxRaw[3]/2),{bearing:(e([0,0],y)+Math.PI/2)%Math.PI,strength:i}},Ne=(A,e)=>{let t=m=>{let z=Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2]);return m[0]/=z,m[1]/=z,m[2]/=z,m},o=(m,z)=>{let w=m[0]-z[0],R=m[1]-z[1],W=m[2]-z[2];return[w,R,W]},n=(m,z)=>{let w=m[1]*z[2]-m[2]*z[1],R=m[2]*z[0]-m[0]*z[2],W=m[0]*z[1]-m[1]*z[0];return[w,R,W]},x=m=>{let[z,w,R,W,M,p,T,P,b]=m,k,Z,N;return W<1?W>-1?(N=Math.asin(W),Z=Math.atan2(-T,z),k=Math.atan2(-p,M)):(N=-Math.PI/2,Z=-Math.atan2(P,b),k=0):(N=Math.PI/2,Z=Math.atan2(P,b),k=0),{pitch:2*-k,yaw:2*-Z,roll:2*-N}},r=m=>{let z=(R,W,M,p)=>Math.atan2(p-W,M-R);return{pitch:z(m[10][1],m[10][2],m[152][1],m[152][2]),yaw:z(m[33][0],m[33][2],m[263][0],m[263][2]),roll:z(m[33][0],m[33][1],m[263][0],m[263][1])}},a=A.meshRaw;if(!a||a.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let y=Math.max(A.boxRaw[2]*e[0],A.boxRaw[3]*e[1])/1.5,i=[a[10],a[152],a[234],a[454]].map(m=>[m[0]*e[0]/y,m[1]*e[1]/y,m[2]]),c=t(o(i[1],i[0])),l=t(o(i[3],i[2])),f=t(n(l,c));l=n(c,f);let h=[l[0],l[1],l[2],c[0],c[1],c[2],f[0],f[1],f[2]],E=x(h),d=a.length===478?Ie(A):{bearing:0,strength:0};return{angle:E,matrix:h,gaze:d}},z5=async(A,e)=>{var c,l,f,h,E,d;let t,o,n,x,r,a,y=[];A.state="run:face",t=I();let i=await SA(e,A.config);if(A.performance.face=Math.trunc(I()-t),!e.shape||e.shape.length!==4)return[];if(!i)return[];for(let m=0;m(A[e]=t,A),{}),Oe=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Le=Oe.map(([A,e])=>[w0[A],w0[e]]),HA=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function ZA(A){let e=A.reduce(({maxX:t,maxY:o,minX:n,minY:x},{position:{x:r,y:a}})=>({maxX:Math.max(t,r),maxY:Math.max(o,a),minX:Math.min(n,r),minY:Math.min(x,a)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY]}function VA(A,[e,t],[o,n]){let x=e/o,r=t/n,a=(i,c)=>({id:c,score:i.score,boxRaw:[i.box[0]/n,i.box[1]/o,i.box[2]/n,i.box[3]/o],box:[Math.trunc(i.box[0]*r),Math.trunc(i.box[1]*x),Math.trunc(i.box[2]*r),Math.trunc(i.box[3]*x)],keypoints:i.keypoints.map(({score:l,part:f,position:h})=>({score:l,part:f,position:[Math.trunc(h.x*r),Math.trunc(h.y*x)],positionRaw:[h.x/o,h.y/o]}))});return A.map((i,c)=>a(i,c))}var E5=class{constructor(e,t){this.priorityQueue=new Array(e),this.numberOfElements=-1,this.getElementValue=t}enqueue(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)}dequeue(){let e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(e){for(;e>0&&this.less(Math.floor(e/2),e);)this.exchange(e,Math.floor(e/2)),e=Math.floor(e/2)}sink(e){for(;2*e<=this.numberOfElements;){let t=2*e;if(tt?t:A}function XA(A,e,t,o){let n=t-A,x=o-e;return n*n+x*x}function S5(A,e){return{x:A.x+e.x,y:A.y+e.y}}var B0=1,g0=16,He=50**2;function FA(A,e,t,o,n,x,r=2){let a=z=>({y:x.get(z.y,z.x,A),x:x.get(z.y,z.x,x.shape[2]/2+A)}),y=(z,w,R)=>({y:w5(Math.round(z.y/g0),0,w-1),x:w5(Math.round(z.x/g0),0,R-1)}),[i,c]=o.shape,l=y(e.position,i,c),f=a(l),E=S5(e.position,f);for(let z=0;z[w0[f],w0[h]]),r=x.map(([,f])=>f),a=x.map(([f])=>f),y=e.shape[2],i=r.length,c=new Array(y),l=j5(A.part,g0,t);c[A.part.id]={score:A.score,part:j0[A.part.id],position:l};for(let f=i-1;f>=0;--f){let h=r[f],E=a[f];c[h]&&!c[E]&&(c[E]=FA(f,c[h],E,e,t,n))}for(let f=0;fe){a=!1;break}if(!a)break}return a}function Xe(A,e){let[t,o,n]=e.shape,x=new E5(t*o*n,({score:r})=>r);for(let r=0;r{var r;let x=(r=n[o])==null?void 0:r.position;return x?XA(t,e,x.y,x.x)<=He:!1})}function Fe(A,e){return e.reduce((o,{position:n,score:x},r)=>(CA(A,n,r)||(o+=x),o),0)/e.length}function qA(A,e,t,o,n,x){let r=[],a=Xe(x,e);for(;r.lengthh.score>x);let l=Fe(r,c),f=ZA(c);l>x&&r.push({keypoints:c,box:f,score:Math.round(100*l)/100})}return r}var Y,Ce=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function W5(A,e){let t=s.tidy(()=>{if(!Y.inputs[0].shape)return[];let a=s.image.resizeBilinear(A,[Y.inputs[0].shape[2],Y.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),i=Y.execute(a,Ce).map(c=>s.squeeze(c,[0]));return i[1]=i[1].sigmoid(),i}),o=await Promise.all(t.map(r=>r.buffer()));for(let r of t)r.dispose();let n=await qA(o[0],o[1],o[2],o[3],e.body.maxDetected,e.body.minConfidence);return Y.inputs[0].shape?VA(n,[A.shape[1],A.shape[2]],[Y.inputs[0].shape[2],Y.inputs[0].shape[1]]):[]}async function k5(A){return Y?A.debug&&g("cached model:",Y.modelUrl):(Y=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!Y||!Y.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",Y.modelUrl)),Y}function U0(A){return[Math.abs(A.endPoint[0]-A.startPoint[0]),Math.abs(A.endPoint[1]-A.startPoint[1])]}function S0(A){return[A.startPoint[0]+(A.endPoint[0]-A.startPoint[0])/2,A.startPoint[1]+(A.endPoint[1]-A.startPoint[1])/2]}function BA(A,e,t){let o=e.shape[1],n=e.shape[2],x=[[A.startPoint[1]/o,A.startPoint[0]/n,A.endPoint[1]/o,A.endPoint[0]/n]];return s.image.cropAndResize(e,x,[0],t)}function UA(A,e){let t=[A.startPoint[0]*e[0],A.startPoint[1]*e[1]],o=[A.endPoint[0]*e[0],A.endPoint[1]*e[1]],n=A.palmLandmarks.map(x=>[x[0]*e[0],x[1]*e[1]]);return{startPoint:t,endPoint:o,palmLandmarks:n,confidence:A.confidence}}function J0(A,e=1.5){let t=S0(A),o=U0(A),n=[e*o[0]/2,e*o[1]/2],x=[t[0]-n[0],t[1]-n[1]],r=[t[0]+n[0],t[1]+n[1]];return{startPoint:x,endPoint:r,palmLandmarks:A.palmLandmarks}}function Y0(A){let e=S0(A),t=U0(A),n=Math.max(...t)/2,x=[e[0]-n,e[1]-n],r=[e[0]+n,e[1]+n];return{startPoint:x,endPoint:r,palmLandmarks:A.palmLandmarks}}var JA=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var I5=class{constructor(e){var t;this.model=e,this.anchors=JA.map(o=>[o.x,o.y]),this.anchorsTensor=s.tensor2d(this.anchors),this.inputSize=(t=this.model)==null?void 0:t.inputs[0].shape[2],this.inputSizeTensor=s.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=s.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(e){return s.tidy(()=>{let t=s.slice(e,[0,0],[-1,2]),o=s.slice(e,[0,2],[-1,2]),n=s.add(s.div(t,this.inputSizeTensor),this.anchorsTensor),x=s.div(o,this.doubleInputSizeTensor),r=s.mul(s.sub(n,x),this.inputSizeTensor),a=s.mul(s.add(n,x),this.inputSizeTensor);return s.concat2d([r,a],1)})}normalizeLandmarks(e,t){return s.tidy(()=>{let o=s.add(s.div(e.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[t]);return s.mul(o,this.inputSizeTensor)})}async getBoxes(e,t){let o=this.model.predict(e),n=s.squeeze(o);o.dispose();let x=s.tidy(()=>s.sigmoid(s.slice(n,[0,0],[-1,1])).squeeze()),r=x.dataSync(),a=s.slice(n,[0,1],[-1,4]),y=this.normalizeBoxes(a);a.dispose();let i=await s.image.nonMaxSuppressionAsync(y,r,t.hand.maxDetected,t.hand.iouThreshold,t.hand.minConfidence),c=i.arraySync();x.dispose(),i.dispose();let l=[];for(let f of c)if(r[f]>=t.hand.minConfidence){let h=s.slice(y,[f,0],[1,-1]),E=s.slice(n,[f,5],[1,14]),d=s.tidy(()=>this.normalizeLandmarks(E,f).reshape([-1,2]));E.dispose(),l.push({box:h,palmLandmarks:d,confidence:r[f]})}return n.dispose(),y.dispose(),l}async estimateHandBounds(e,t){let o=e.shape[1],n=e.shape[2],x=s.tidy(()=>e.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),r=await this.getBoxes(x,t);x.dispose();let a=[];if(!r||r.length===0)return a;for(let y of r){let i=y.box.dataSync(),c=i.slice(0,2),l=i.slice(2,4),f=y.palmLandmarks.arraySync();y.box.dispose(),y.palmLandmarks.dispose(),a.push(UA({startPoint:c,endPoint:l,palmLandmarks:f,confidence:y.confidence},[n/this.inputSize,o/this.inputSize]))}return a}};function qe(A){return A-2*Math.PI*Math.floor((A+Math.PI)/(2*Math.PI))}function YA(A,e){let t=Math.PI/2-Math.atan2(-(e[1]-A[1]),e[0]-A[0]);return qe(t)}var GA=(A,e)=>[[1,0,A],[0,1,e],[0,0,1]];function i0(A,e){let t=0;for(let o=0;or[0]),o=e.map(r=>r[1]),n=[Math.min(...t),Math.min(...o)],x=[Math.max(...t),Math.max(...o)];return{startPoint:n,endPoint:x}}getBoxForPalmLandmarks(e,t){let o=e.map(x=>O5([...x,1],t)),n=this.calculateLandmarksBoundingBox(o);return J0(Y0(n),Ue)}getBoxForHandLandmarks(e){let t=this.calculateLandmarksBoundingBox(e),o=J0(Y0(t),QA);o.palmLandmarks=[];for(let n=0;n<_A.length;n++)o.palmLandmarks.push(e[_A[n]].slice(0,2));return o}transformRawCoords(e,t,o,n){let x=U0(t),r=[x[0]/this.inputSize,x[1]/this.inputSize,(x[0]+x[1])/this.inputSize/2],a=e.map(h=>[r[0]*(h[0]-this.inputSize/2),r[1]*(h[1]-this.inputSize/2),r[2]*h[2]]),y=N5(o,[0,0]),i=a.map(h=>[...O5(h,y),h[2]]),c=KA(n),l=[...S0(t),1],f=[i0(l,c[0]),i0(l,c[1])];return i.map(h=>[Math.trunc(h[0]+f[0]),Math.trunc(h[1]+f[1]),Math.trunc(h[2])])}async estimateHands(e,t){let o=!1,n;(this.skipped===0||this.skipped>t.hand.skipFrames||!t.hand.landmarks||!t.skipFrame)&&(n=await this.handDetector.estimateHandBounds(e,t),this.skipped=0),t.skipFrame&&this.skipped++,n&&n.length>0&&(n.length!==this.detectedHands&&this.detectedHands!==t.hand.maxDetected||!t.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...n],this.storedBoxes.length>0&&(o=!0));let x=[];for(let r=0;r=t.hand.minConfidence){let R=s.reshape(z,[-1,3]),W=R.arraySync();z.dispose(),R.dispose();let M=this.transformRawCoords(W,h,y,f),p=this.getBoxForHandLandmarks(M);this.storedBoxes[r]={...p,confidence:w};let T={landmarks:M,confidence:w,box:{topLeft:p.startPoint,bottomRight:p.endPoint}};x.push(T)}else this.storedBoxes[r]=null;z.dispose()}else{let y=J0(Y0(a),QA),i={confidence:a.confidence,box:{topLeft:y.startPoint,bottomRight:y.endPoint}};x.push(i)}}return this.storedBoxes=this.storedBoxes.filter(r=>r!==null),this.detectedHands=x.length,x}};var $A={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},a0,x0,Ae;async function H5(A,e){let t=await Ae.estimateHands(A,e);if(!t)return[];let o=[];for(let n=0;nt[n].landmarks[c]);let r=t[n].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],y=[0,0,0,0];if(r&&r.length>0){for(let i of r)i[0]a[2]&&(a[2]=i[0]),i[1]>a[3]&&(a[3]=i[1]);a[2]-=a[0],a[3]-=a[1],y=[a[0]/(A.shape[2]||0),a[1]/(A.shape[1]||0),a[2]/(A.shape[2]||0),a[3]/(A.shape[1]||0)]}else a=t[n].box?[Math.trunc(Math.max(0,t[n].box.topLeft[0])),Math.trunc(Math.max(0,t[n].box.topLeft[1])),Math.trunc(Math.min(A.shape[2]||0,t[n].box.bottomRight[0])-Math.max(0,t[n].box.topLeft[0])),Math.trunc(Math.min(A.shape[1]||0,t[n].box.bottomRight[1])-Math.max(0,t[n].box.topLeft[1]))]:[0,0,0,0],y=[t[n].box.topLeft[0]/(A.shape[2]||0),t[n].box.topLeft[1]/(A.shape[1]||0),(t[n].box.bottomRight[0]-t[n].box.topLeft[0])/(A.shape[2]||0),(t[n].box.bottomRight[1]-t[n].box.topLeft[1])/(A.shape[1]||0)];o.push({id:n,score:Math.round(100*t[n].confidence)/100,box:a,boxRaw:y,keypoints:r,annotations:x})}return o}async function Z5(A){!a0||!x0?([a0,x0]=await Promise.all([A.hand.enabled?s.loadGraphModel(L(A.modelBasePath,A.hand.detector.modelPath),{fromTFHub:A.hand.detector.modelPath.includes("tfhub.dev")}):null,A.hand.landmarks?s.loadGraphModel(L(A.modelBasePath,A.hand.skeleton.modelPath),{fromTFHub:A.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),A.hand.enabled&&(!a0||!a0.modelUrl?g("load model failed:",A.hand.detector.modelPath):A.debug&&g("load model:",a0.modelUrl),!x0||!x0.modelUrl?g("load model failed:",A.hand.skeleton.modelPath):A.debug&&g("load model:",x0.modelUrl))):(A.debug&&g("cached model:",a0.modelUrl),A.debug&&g("cached model:",x0.modelUrl));let e=new I5(a0);return Ae=new L5(e,x0),[a0,x0]}var ee=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],te=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var q;async function G0(A){return q?A.debug&&g("cached model:",q.modelUrl):(q=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),q.width=parseInt(q.signature.inputs["input_1:0"].tensorShape.dim[2].size),q.height=parseInt(q.signature.inputs["input_1:0"].tensorShape.dim[1].size),!q||!q.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",q.modelUrl)),q}async function V5(A,e){var d;if(!q)return[];if(!e.body.enabled)return[];let t={width:A.shape[2]||0,height:A.shape[1]||0},o=s.image.resizeBilinear(A,[q.width,q.height],!1),n=s.div(o,[255]);o.dispose();let x=await q.predict(n),r=((d=x.find(m=>m.size===195||m.size===155))==null?void 0:d.dataSync())||[];x.forEach(m=>m.dispose()),n.dispose();let a=[],y=(r==null?void 0:r.length)===195?ee:te,i=5;for(let m=0;mm.position[0]),l=a.map(m=>m.position[1]),f=[Math.min(...c),Math.min(...l),Math.max(...c)-Math.min(...c),Math.max(...l)-Math.min(...c)],h=[0,0,0,0],E=a.reduce((m,z)=>z.score>m?z.score:m,0);return[{id:0,score:E,box:f,boxRaw:h,keypoints:a}]}var B,n0=[],X5=[0,0,0,0],F5=[0,0,0,0],D0=0,C5=Number.MAX_SAFE_INTEGER,Ge=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","pelvis","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"];async function ne(A){return B?A.debug&&g("cached model:",B.modelUrl):(B=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!B||!B.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",B.modelUrl)),B}function De(A,e){let[t,o]=A.shape;return s.tidy(()=>{let n=(a,y)=>s.sub(a,s.mul(s.div(a,s.scalar(y,"int32")),s.scalar(y,"int32"))),x=s.reshape(A,[o*t]),r=s.max(x,0).dataSync()[0];if(r>e){let a=s.argMax(x,0),y=n(a,t).dataSync()[0],i=s.div(a,s.scalar(t,"int32")).dataSync()[0];return[y,i,r]}return[0,0,r]})}async function q5(A,e){return C50?(C5++,[{id:0,score:D0,box:X5,boxRaw:F5,keypoints:n0}]):(C5=0,new Promise(async t=>{let o=s.tidy(()=>{if(!B.inputs[0].shape)return null;let i=s.image.resizeBilinear(A,[B.inputs[0].shape[2],B.inputs[0].shape[1]],!1);return s.mul(i,2).sub(1)}),n;if(e.body.enabled&&(n=await B.predict(o)),o.dispose(),n){n0.length=0;let i=n.squeeze();s.dispose(n);let c=i.unstack(2);s.dispose(i);for(let l=0;le.body.minConfidence&&n0.push({score:Math.round(100*E)/100,part:Ge[l],positionRaw:[f/B.inputs[0].shape[2],h/B.inputs[0].shape[1]],position:[Math.round(A.shape[2]*f/B.inputs[0].shape[2]),Math.round(A.shape[1]*h/B.inputs[0].shape[1])]})}c.forEach(l=>s.dispose(l))}D0=n0.reduce((i,c)=>c.score>i?c.score:i,0);let x=n0.map(i=>i.position[0]),r=n0.map(i=>i.position[1]);X5=[Math.min(...x),Math.min(...r),Math.max(...x)-Math.min(...x),Math.max(...r)-Math.min(...r)];let a=n0.map(i=>i.positionRaw[0]),y=n0.map(i=>i.positionRaw[1]);F5=[Math.min(...a),Math.min(...y),Math.max(...a)-Math.min(...a),Math.max(...y)-Math.min(...y)],t([{id:0,score:D0,box:X5,boxRaw:F5,keypoints:n0}])}))}var e0,o0=[],B5=[0,0,0,0],U5=[0,0,0,0],M0=0,J5=Number.MAX_SAFE_INTEGER,Ke=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"];async function Y5(A){return e0?A.debug&&g("cached model:",e0.modelUrl):(e0=await s.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!e0||!e0.modelUrl?g("load model failed:",A.body.modelPath):A.debug&&g("load model:",e0.modelUrl)),e0}async function G5(A,e){return J50?(J5++,[{id:0,score:M0,box:B5,boxRaw:U5,keypoints:o0}]):(J5=0,new Promise(async t=>{let o=s.tidy(()=>{if(!e0.inputs[0].shape)return null;let i=s.image.resizeBilinear(A,[e0.inputs[0].shape[2],e0.inputs[0].shape[1]],!1);return s.cast(i,"int32")}),n;if(e.body.enabled&&(n=await e0.predict(o)),o.dispose(),n){o0.length=0;let i=n.arraySync();s.dispose(n);let c=i[0][0];for(let l=0;le.body.minConfidence&&o0.push({score:Math.round(100*M0)/100,part:Ke[l],positionRaw:[c[l][1],c[l][0]],position:[Math.round((A.shape[2]||0)*c[l][1]),Math.round((A.shape[1]||0)*c[l][0])]})}M0=o0.reduce((i,c)=>c.score>i?c.score:i,0);let x=o0.map(i=>i.position[0]),r=o0.map(i=>i.position[1]);B5=[Math.min(...x),Math.min(...r),Math.max(...x)-Math.min(...x),Math.max(...r)-Math.min(...r)];let a=o0.map(i=>i.positionRaw[0]),y=o0.map(i=>i.positionRaw[1]);U5=[Math.min(...a),Math.min(...y),Math.max(...a)-Math.min(...a),Math.max(...y)-Math.min(...y)],t([{id:0,score:M0,box:B5,boxRaw:U5,keypoints:o0}])}))}var T0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var G,D5=[],K5=Number.MAX_SAFE_INTEGER,K0=2.5;async function Q5(A){if(G)A.debug&&g("cached model:",G.modelUrl);else{G=await s.loadGraphModel(L(A.modelBasePath,A.object.modelPath));let e=Object.values(G.modelSignature.inputs);if(G.inputSize=Array.isArray(e)?parseInt(e[0].tensorShape.dim[2].size):null,!G.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${A.object.modelPath}`);!G||!G.modelUrl?g("load model failed:",A.object.modelPath):A.debug&&g("load model:",G.modelUrl)}return G}async function Qe(A,e,t,o){let n=0,x=[];for(let i of[1,2,4])s.tidy(()=>{var m,z;let c=i*13,l=(m=A.find(w=>w.shape[1]===c**2&&w.shape[2]===T0.length))==null?void 0:m.squeeze(),f=(z=A.find(w=>w.shape[1]===c**2&&w.shape[2]o.object.minConfidence&&R!==61){let M=(.5+Math.trunc(w%c))/c,p=(.5+Math.trunc(w/c))/c,T=E[w].map(F=>F*(c/i/e)),[P,b]=[M-K0/i*T[0],p-K0/i*T[1]],[k,Z]=[M+K0/i*T[2]-P,p+K0/i*T[3]-b],N=[P,b,k,Z];N=N.map(F=>Math.max(0,Math.min(F,1)));let O=[N[0]*t[0],N[1]*t[1],N[2]*t[0],N[3]*t[1]],v={id:n++,score:Math.round(100*W)/100,class:R+1,label:T0[R].label,box:O.map(F=>Math.trunc(F)),boxRaw:N};x.push(v)}}});A.forEach(i=>s.dispose(i));let r=x.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=x.map(i=>i.score),y=[];if(r&&r.length>0){let i=await s.image.nonMaxSuppressionAsync(r,a,o.object.maxDetected,o.object.iouThreshold,o.object.minConfidence);y=i.dataSync(),s.dispose(i)}return x=x.filter((i,c)=>y.includes(c)).sort((i,c)=>c.score-i.score),x}async function _5(A,e){return K50?(K5++,D5):(K5=0,new Promise(async t=>{let o=[A.shape[2],A.shape[1]],n=s.image.resizeBilinear(A,[G.inputSize,G.inputSize],!1),x=n.div(255),r=x.transpose([0,3,1,2]);x.dispose(),n.dispose();let a;e.object.enabled&&(a=await G.predict(r)),r.dispose();let y=await Qe(a,G.inputSize,o,e);D5=y,t(y)}))}var D,$5=[],AA=Number.MAX_SAFE_INTEGER;async function eA(A){if(D)A.debug&&g("cached model:",D.modelUrl);else{D=await s.loadGraphModel(L(A.modelBasePath,A.object.modelPath));let e=Object.values(D.modelSignature.inputs);if(D.inputSize=Array.isArray(e)?parseInt(e[0].tensorShape.dim[2].size):null,!D.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${A.object.modelPath}`);!D||!D.modelUrl?g("load model failed:",A.object.modelPath):A.debug&&g("load model:",D.modelUrl)}return D}async function _e(A,e,t,o){if(!A)return[];let n=[],x=A.arraySync(),r=s.squeeze(A);A.dispose();let a=s.split(r,6,1);r.dispose();let i=s.stack([a[1],a[0],a[3],a[2]],1).squeeze(),c=a[4].squeeze(),l=a[5].squeeze();a.forEach(d=>d.dispose());let f=await s.image.nonMaxSuppressionAsync(i,c,o.object.maxDetected,o.object.iouThreshold,o.object.minConfidence);i.dispose(),c.dispose(),l.dispose();let h=f.dataSync();f.dispose();let E=0;for(let d of h){let m=Math.trunc(100*x[0][d][4])/100,z=x[0][d][5],w=T0[z].label,R=[x[0][d][0]/e,x[0][d][1]/e,x[0][d][2]/e,x[0][d][3]/e],W=[Math.trunc(R[0]*t[0]),Math.trunc(R[1]*t[1]),Math.trunc(R[2]*t[0]),Math.trunc(R[3]*t[1])];n.push({id:E++,score:m,class:z,label:w,box:W,boxRaw:R})}return n}async function tA(A,e){return AA0?(AA++,$5):(AA=0,new Promise(async t=>{let o=[A.shape[2],A.shape[1]],n=s.image.resizeBilinear(A,[D.inputSize,D.inputSize]),x=e.object.enabled?D.execute(n,["tower_0/detections"]):null;n.dispose();let r=await _e(x,D.inputSize,o,e);$5=r,t(r)}))}var oe=A=>{if(!A)return[];let e=[];for(let t=0;ty.part==="leftWrist"),n=A[t].keypoints.find(y=>y.part==="rightWrist"),x=A[t].keypoints.find(y=>y.part==="nose");x&&o&&n&&o.position.yy.part==="leftShoulder"),a=A[t].keypoints.find(y=>y.part==="rightShoulder");r&&a&&e.push({body:t,gesture:`leaning ${r.position.y>a.position.y?"left":"right"}`})}return e},se=A=>{if(!A)return[];let e=[];for(let t=0;t0){let o=A[t].mesh[33][2]-A[t].mesh[263][2];Math.abs(o)<10?e.push({face:t,gesture:"facing center"}):e.push({face:t,gesture:`facing ${o<0?"left":"right"}`}),Math.abs(A[t].mesh[374][1]-A[t].mesh[386][1])/Math.abs(A[t].mesh[443][1]-A[t].mesh[450][1])<.2&&e.push({face:t,gesture:"blink left eye"}),Math.abs(A[t].mesh[145][1]-A[t].mesh[159][1])/Math.abs(A[t].mesh[223][1]-A[t].mesh[230][1])<.2&&e.push({face:t,gesture:"blink right eye"});let r=Math.min(100,500*Math.abs(A[t].mesh[13][1]-A[t].mesh[14][1])/Math.abs(A[t].mesh[10][1]-A[t].mesh[152][1]));r>10&&e.push({face:t,gesture:`mouth ${Math.trunc(r)}% open`});let a=A[t].mesh[152][2];Math.abs(a)>10&&e.push({face:t,gesture:`head ${a<0?"up":"down"}`})}return e},re=A=>{if(!A)return[];let e=[];for(let t=0;t.06||l>.06)&&(i=!1),f>.06&&e.push({iris:t,gesture:"looking right"}),l>.06&&e.push({iris:t,gesture:"looking left"});let h=Math.abs(A[t].mesh[145][1]-A[t].annotations.rightEyeIris[0][1])/A[t].box[3],E=Math.abs(A[t].mesh[374][1]-A[t].annotations.leftEyeIris[0][1])/A[t].box[3];(E<.01||h<.01||E>.022||h>.022)&&(i=!1),(E<.01||h<.01)&&e.push({iris:t,gesture:"looking down"}),(E>.022||h>.022)&&e.push({iris:t,gesture:"looking up"}),i&&e.push({iris:t,gesture:"looking center"})}return e},ie=A=>{if(!A)return[];let e=[];for(let t=0;t0){let n=o.reduce((r,a)=>r.position[2]r.position[1](i[f]=0,l))},n=function(a,y){let i=A.createShader(y);if(A.shaderSource(i,a),A.compileShader(i),!A.getShaderParameter(i,A.COMPILE_STATUS))throw new Error("Filter: GL compile failed",A.getShaderInfoLog(i));return i};this.uniform={},this.attribute={};let x=n(e,A.VERTEX_SHADER),r=n(t,A.FRAGMENT_SHADER);if(this.id=A.createProgram(),A.attachShader(this.id,x),A.attachShader(this.id,r),A.linkProgram(this.id),!A.getProgramParameter(this.id,A.LINK_STATUS))throw new Error("Filter: GL link failed",A.getProgramInfoLog(this.id));A.useProgram(this.id),o(e,"attribute",this.attribute);for(let a in this.attribute)this.attribute[a]=A.getAttribLocation(this.id,a);o(e,"uniform",this.uniform),o(t,"uniform",this.uniform);for(let a in this.uniform)this.uniform[a]=A.getUniformLocation(this.id,a)}function ae(A){A||(A={});let e=0,t=null,o=!1,n=-1,x=[null,null],r=[],a=-1,y=-1,i=null,c=null,l={},f=A.canvas||document.createElement("canvas"),h={},E={INTERMEDIATE:1},d=f.getContext("webgl");if(!d)throw new Error("Filter: getContext() failed");this.addFilter=function(M){let p=Array.prototype.slice.call(arguments,1),T=l[M];r.push({func:T,args:p})},this.reset=function(){r=[]};let m=function(M,p){if(!(M===a&&p===y)){if(f.width=M,a=M,f.height=p,y=p,!i){let T=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);i=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,i),d.bufferData(d.ARRAY_BUFFER,T,d.STATIC_DRAW),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}d.viewport(0,0,a,y),x=[null,null]}},z=function(M,p){let T=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,T);let P=d.createRenderbuffer();d.bindRenderbuffer(d.RENDERBUFFER,P);let b=d.createTexture();return d.bindTexture(d.TEXTURE_2D,b),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,M,p,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,b,0),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null),{fbo:T,texture:b}},w=function(M){return x[M]=x[M]||z(a,y),x[M]},R=function(M=null){var b,k;let p=null,T=null,P=!1;e===0?p=t:p=(b=w(n))==null?void 0:b.texture,e++,o&&!(M&E.INTERMEDIATE)?(T=null,P=e%2==0):(n=(n+1)%2,T=(k=w(n))==null?void 0:k.fbo),d.bindTexture(d.TEXTURE_2D,p),d.bindFramebuffer(d.FRAMEBUFFER,T),d.uniform1f(c.uniform.flipY,P?-1:1),d.drawArrays(d.TRIANGLES,0,6)};this.apply=function(M){if(m(M.width,M.height),e=0,t||(t=d.createTexture()),d.bindTexture(d.TEXTURE_2D,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,M),r.length===0)return R(),f;for(let p=0;p0,x=A.naturalHeight||A.videoHeight||A.height||A.shape&&A.shape[2]>0;if(!n||!x)return{tensor:null,canvas:j};let a=n,r=x;if(a>Q0&&(a=Q0,r=a*x/n),r>Q0&&(r=Q0,a=r*n/x),e.filter.width>0?a=e.filter.width:e.filter.height>0&&(a=n*(e.filter.height/x)),e.filter.height>0?r=e.filter.height:e.filter.width>0&&(r=x*(e.filter.width/n)),!a||!r)throw new Error("Human: Input cannot determine dimension");(!j||(j==null?void 0:j.width)!==a||(j==null?void 0:j.height)!==r)&&(j=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,r):document.createElement("canvas"),(j==null?void 0:j.width)!==a&&(j.width=a),(j==null?void 0:j.height)!==r&&(j.height=r));let y=j.getContext("2d");if(A instanceof ImageData?y.putImageData(A,0,0):e.filter.flip&&typeof y.translate!="undefined"?(y.translate(n,0),y.scale(-1,1),y.drawImage(A,0,0,n,x,0,0,j==null?void 0:j.width,j==null?void 0:j.height),y.setTransform(1,0,0,1,0,0)):y.drawImage(A,0,0,n,x,0,0,j==null?void 0:j.width,j==null?void 0:j.height),e.filter.enabled){if((!X||!H||j.width!==H.width||(j==null?void 0:j.height)!==(H==null?void 0:H.height))&&(H=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(j==null?void 0:j.width,j==null?void 0:j.height):document.createElement("canvas"),(H==null?void 0:H.width)!==(j==null?void 0:j.width)&&(H.width=j==null?void 0:j.width),(H==null?void 0:H.height)!==(j==null?void 0:j.height)&&(H.height=j==null?void 0:j.height),X=s.ENV.flags.IS_BROWSER?new ie({canvas:H}):null),!X)return{tensor:null,canvas:j};X.reset(),X.addFilter("brightness",e.filter.brightness),e.filter.contrast!==0&&X.addFilter("contrast",e.filter.contrast),e.filter.sharpness!==0&&X.addFilter("sharpen",e.filter.sharpness),e.filter.blur!==0&&X.addFilter("blur",e.filter.blur),e.filter.saturation!==0&&X.addFilter("saturation",e.filter.saturation),e.filter.hue!==0&&X.addFilter("hue",e.filter.hue),e.filter.negative&&X.addFilter("negative"),e.filter.sepia&&X.addFilter("sepia"),e.filter.vintage&&X.addFilter("brownie"),e.filter.sepia&&X.addFilter("sepia"),e.filter.kodachrome&&X.addFilter("kodachrome"),e.filter.technicolor&&X.addFilter("technicolor"),e.filter.polaroid&&X.addFilter("polaroid"),e.filter.pixelate!==0&&X.addFilter("pixelate",e.filter.pixelate),X.apply(j)}else H=j,X&&(X=null);let i;if(H.data){let c=[H.height,H.width,3];i=s.tensor3d(H.data,c,"int32")}else if(H instanceof ImageData)i=s.browser?s.browser.fromPixels(H):null;else if(e.backend==="webgl"||e.backend==="humangl"){let c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,r):document.createElement("canvas");c.width=a,c.height=r;let l=c.getContext("2d");l==null||l.drawImage(H,0,0),i=s.browser?s.browser.fromPixels(c):null}else{let c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,r):document.createElement("canvas");c.width=a,c.height=r;let l=c.getContext("2d");l==null||l.drawImage(H,0,0);let f=l==null?void 0:l.getImageData(0,0,a,r);i=s.browser?s.browser.fromPixels(f):null}if(i){let c=i.toFloat();t=c.expandDims(0),i.dispose(),c.dispose()}}let o=e.filter.return?H:null;return{tensor:t,canvas:o}}var sA={};aA(sA,{all:()=>e2,body:()=>ye,canvas:()=>A2,face:()=>xe,gesture:()=>ae,hand:()=>le,object:()=>ce,options:()=>y0,person:()=>$e});var y0={color:"rgba(173, 216, 230, 0.6)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 14px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!0,drawPolygons:!0,drawGaze:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!0},_0=A=>Math.round(A*180/Math.PI);function nA(A,e,t,o=0,n){A.fillStyle=n.useDepth&&o?`rgba(${127.5+2*o}, ${127.5-2*o}, 255, 0.3)`:n.color,A.beginPath(),A.arc(e,t,n.pointSize,0,2*Math.PI),A.fill()}function W0(A,e,t,o,n,x){if(A.beginPath(),x.useCurves){let a=(e+e+o)/2,r=(t+t+n)/2;A.ellipse(a,r,o/2,n/2,0,0,2*Math.PI)}else A.lineWidth=x.lineWidth,A.moveTo(e+x.roundRect,t),A.lineTo(e+o-x.roundRect,t),A.quadraticCurveTo(e+o,t,e+o,t+x.roundRect),A.lineTo(e+o,t+n-x.roundRect),A.quadraticCurveTo(e+o,t+n,e+o-x.roundRect,t+n),A.lineTo(e+x.roundRect,t+n),A.quadraticCurveTo(e,t+n,e,t+n-x.roundRect),A.lineTo(e,t+x.roundRect),A.quadraticCurveTo(e,t,e+x.roundRect,t),A.closePath();A.stroke()}function oA(A,e=[],t){if(!(e===void 0||e.length===0)){A.beginPath(),A.moveTo(e[0][0],e[0][1]);for(let o of e){let n=o[2]||0;A.strokeStyle=t.useDepth&&n?`rgba(${127.5+2*n}, ${127.5-2*n}, 255, 0.3)`:t.color,A.fillStyle=t.useDepth&&n?`rgba(${127.5+2*n}, ${127.5-2*n}, 255, 0.3)`:t.color,A.lineTo(o[0],Math.round(o[1]))}A.stroke(),t.fillPolygons&&(A.closePath(),A.fill())}}function k0(A,e=[],t){if(!(e===void 0||e.length===0)){if(!t.useCurves||e.length<=2){oA(A,e,t);return}A.moveTo(e[0][0],e[0][1]);for(let o=0;o1&&y[1].length>0){let i=r[1]>0?`#${r[1]}`:"",c=`${r[0]} ${i}: ${y[1]}`;o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText(c,8,2+x*o.lineHeight)),n.fillStyle=o.labelColor,n.fillText(c,6,0+x*o.lineHeight),x+=1}}}async function xe(A,e,t){var x,a,r,y;let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n)for(let i of e){n.font=o.font,n.strokeStyle=o.color,n.fillStyle=o.color,o.drawBoxes&&W0(n,i.box[0],i.box[1],i.box[2],i.box[3],o);let c=[];if(c.push(`face: ${Math.trunc(100*i.score)}%`),i.genderScore&&c.push(`${i.gender||""} ${Math.trunc(100*i.genderScore)}%`),i.age&&c.push(`age: ${i.age||""}`),i.iris&&c.push(`distance: ${i.iris}`),i.emotion&&i.emotion.length>0){let l=i.emotion.map(f=>`${Math.trunc(100*f.score)}% ${f.emotion}`);l.length>3&&(l.length=3),c.push(l.join(" "))}i.rotation&&i.rotation.angle&&i.rotation.gaze&&(i.rotation.angle.roll&&c.push(`roll: ${_0(i.rotation.angle.roll)}\xB0 yaw:${_0(i.rotation.angle.yaw)}\xB0 pitch:${_0(i.rotation.angle.pitch)}\xB0`),i.rotation.gaze.bearing&&c.push(`gaze: ${_0(i.rotation.gaze.bearing)}\xB0`)),c.length===0&&c.push("face"),n.fillStyle=o.color;for(let l=c.length-1;l>=0;l--){let f=Math.max(i.box[0],0),h=l*o.lineHeight+i.box[1];o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText(c[l],f+5,h+16)),n.fillStyle=o.labelColor,n.fillText(c[l],f+4,h+15)}if(n.lineWidth=1,i.mesh&&i.mesh.length>0){if(o.drawPoints)for(let l of i.mesh)nA(n,l[0],l[1],l[2],o);if(o.drawPolygons){n.lineWidth=1;for(let l=0;li.mesh[h]);oA(n,f,o)}if(i.annotations&&i.annotations.leftEyeIris){n.strokeStyle=o.useDepth?"rgba(255, 200, 255, 0.3)":o.color,n.beginPath();let l=Math.abs(i.annotations.leftEyeIris[3][0]-i.annotations.leftEyeIris[1][0])/2,f=Math.abs(i.annotations.leftEyeIris[4][1]-i.annotations.leftEyeIris[2][1])/2;n.ellipse(i.annotations.leftEyeIris[0][0],i.annotations.leftEyeIris[0][1],l,f,0,0,2*Math.PI),n.stroke(),o.fillPolygons&&(n.fillStyle=o.useDepth?"rgba(255, 255, 200, 0.3)":o.color,n.fill())}if(i.annotations&&i.annotations.rightEyeIris){n.strokeStyle=o.useDepth?"rgba(255, 200, 255, 0.3)":o.color,n.beginPath();let l=Math.abs(i.annotations.rightEyeIris[3][0]-i.annotations.rightEyeIris[1][0])/2,f=Math.abs(i.annotations.rightEyeIris[4][1]-i.annotations.rightEyeIris[2][1])/2;n.ellipse(i.annotations.rightEyeIris[0][0],i.annotations.rightEyeIris[0][1],l,f,0,0,2*Math.PI),n.stroke(),o.fillPolygons&&(n.fillStyle=o.useDepth?"rgba(255, 255, 200, 0.3)":o.color,n.fill())}if(o.drawGaze&&((a=(x=i.rotation)==null?void 0:x.gaze)==null?void 0:a.strength)&&((y=(r=i.rotation)==null?void 0:r.gaze)==null?void 0:y.bearing)&&i.annotations.leftEyeIris&&i.annotations.rightEyeIris&&i.annotations.leftEyeIris[0]&&i.annotations.rightEyeIris[0]){n.strokeStyle="pink",n.beginPath();let l=[i.annotations.leftEyeIris[0][0]+Math.sin(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[3],i.annotations.leftEyeIris[0][1]+Math.cos(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[2]];n.moveTo(i.annotations.leftEyeIris[0][0],i.annotations.leftEyeIris[0][1]),n.lineTo(l[0],l[1]);let f=[i.annotations.rightEyeIris[0][0]+Math.sin(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[3],i.annotations.rightEyeIris[0][1]+Math.cos(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[2]];n.moveTo(i.annotations.rightEyeIris[0][0],i.annotations.rightEyeIris[0][1]),n.lineTo(f[0],f[1]),n.stroke()}}}}}async function ye(A,e,t){var x;let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round";for(let a=0;ai.part==="leftShoulder"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightShoulder"),r&&y.push([r.position[0],r.position[1]]),k0(n,y,o),y.length=0,r=e[a].keypoints.find(i=>i.part==="rightShoulder"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightHip"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftHip"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftShoulder"),r&&y.push([r.position[0],r.position[1]]),y.length===4&&oA(n,y,o),y.length=0,r=e[a].keypoints.find(i=>i.part==="leftHip"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftKnee"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftAnkle"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftHeel"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftFoot"),r&&y.push([r.position[0],r.position[1]]),k0(n,y,o),y.length=0,r=e[a].keypoints.find(i=>i.part==="rightHip"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightKnee"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightAnkle"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightHeel"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightFoot"),r&&y.push([r.position[0],r.position[1]]),k0(n,y,o),y.length=0,r=e[a].keypoints.find(i=>i.part==="leftShoulder"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftElbow"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftWrist"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="leftPalm"),r&&y.push([r.position[0],r.position[1]]),k0(n,y,o),y.length=0,r=e[a].keypoints.find(i=>i.part==="rightShoulder"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightElbow"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightWrist"),r&&y.push([r.position[0],r.position[1]]),r=e[a].keypoints.find(i=>i.part==="rightPalm"),r&&y.push([r.position[0],r.position[1]]),k0(n,y,o)}}}}async function le(A,e,t){let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round",n.font=o.font;for(let x of e){if(o.drawBoxes&&(n.strokeStyle=o.color,n.fillStyle=o.color,W0(n,x.box[0],x.box[1],x.box[2],x.box[3],o),o.drawLabels&&(o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText("hand",x.box[0]+3,1+x.box[1]+o.lineHeight,x.box[2])),n.fillStyle=o.labelColor,n.fillText("hand",x.box[0]+2,0+x.box[1]+o.lineHeight,x.box[2])),n.stroke()),o.drawPoints&&x.keypoints&&x.keypoints.length>0)for(let a of x.keypoints)n.fillStyle=o.useDepth?`rgba(${127.5+2*a[2]}, ${127.5-2*a[2]}, 255, 0.5)`:o.color,nA(n,a[0],a[1],0,o);if(o.drawLabels){let a=(r,y)=>{n.fillStyle=o.useDepth?`rgba(${127.5+2*r[r.length-1][2]}, ${127.5-2*r[r.length-1][2]}, 255, 0.5)`:o.color,n.fillText(y,r[r.length-1][0]+4,r[r.length-1][1]+4)};n.font=o.font,a(x.annotations.indexFinger,"index"),a(x.annotations.middleFinger,"middle"),a(x.annotations.ringFinger,"ring"),a(x.annotations.pinky,"pinky"),a(x.annotations.thumb,"thumb"),a(x.annotations.palmBase,"palm")}if(o.drawPolygons){let a=r=>{if(!!r)for(let y=0;y0?y-1:0][0],r[y>0?y-1:0][1]),n.lineTo(r[y][0],r[y][1]),n.stroke()};n.lineWidth=o.lineWidth,a(x.annotations.indexFinger),a(x.annotations.middleFinger),a(x.annotations.ringFinger),a(x.annotations.pinky),a(x.annotations.thumb)}}}}async function ce(A,e,t){let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round",n.font=o.font;for(let x of e)if(o.drawBoxes){if(n.strokeStyle=o.color,n.fillStyle=o.color,W0(n,x.box[0],x.box[1],x.box[2],x.box[3],o),o.drawLabels){let a=`${Math.round(100*x.score)}% ${x.label}`;o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText(a,x.box[0]+3,1+x.box[1]+o.lineHeight,x.box[2])),n.fillStyle=o.labelColor,n.fillText(a,x.box[0]+2,0+x.box[1]+o.lineHeight,x.box[2])}n.stroke()}}}async function $e(A,e,t){let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round",n.font=o.font;for(let x=0;xv.box[0]&&T.box[0]v.box[1]&&T.box[1]+T.box[3]P.body.box[0]&&v.box[0]+v.box[2]P.body.box[1]&&v.box[1]+v.box[3]P.body.box[0]&&v.box[1]+v.box[3]>P.body.box[1]&&v.box[1]+v.box[3]{v&&v.length===4&&(b.push(v[0],v[0]+v[2]),k.push(v[1],v[1]+v[3]))};Z((z=P.face)==null?void 0:z.box),Z((w=P.body)==null?void 0:w.box),Z((W=(R=P.hands)==null?void 0:R.left)==null?void 0:W.box),Z((u=(M=P.hands)==null?void 0:M.right)==null?void 0:u.box);let N=Math.min(...b),O=Math.min(...k);P.box=[N,O,Math.max(...b)-N,Math.max(...k)-O],n&&n.length===4&&(P.boxRaw=[P.box[0]/n[2],P.box[1]/n[1],P.box[2]/n[2],P.box[3]/n[1]]),a.push(P)}return a}var S={face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0};function fe(A){var n,x,a,r,y,i,c,l,f,h,E,d,m,z,w,R,W,M,u,T,P;let e=Date.now()-A.timestamp,t=e<1e3?8-Math.log(e):1;if(S.canvas=A.canvas,!S.body||A.body.length!==S.body.length)S.body=JSON.parse(JSON.stringify(A.body));else for(let b=0;b((t-1)*S.body[b].box[v]+O)/t),Z=A.body[b].boxRaw.map((O,v)=>((t-1)*S.body[b].boxRaw[v]+O)/t),N=A.body[b].keypoints.map((O,v)=>({score:O.score,part:O.part,position:[S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].position[0]+O.position[0])/t:O.position[0],S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].position[1]+O.position[1])/t:O.position[1]],positionRaw:[S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].positionRaw[0]+O.positionRaw[0])/t:O.position[0],S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].positionRaw[1]+O.positionRaw[1])/t:O.position[1]]}));S.body[b]={...A.body[b],box:k,boxRaw:Z,keypoints:N}}if(!S.hand||A.hand.length!==S.hand.length)S.hand=JSON.parse(JSON.stringify(A.hand));else for(let b=0;b((t-1)*S.hand[b].box[s0]+F)/t),Z=A.hand[b].boxRaw.map((F,s0)=>((t-1)*S.hand[b].boxRaw[s0]+F)/t),N=A.hand[b].keypoints.map((F,s0)=>F.map((f0,z0)=>((t-1)*S.hand[b].keypoints[s0][z0]+f0)/t)),O=Object.keys(A.hand[b].annotations),v={};for(let F of O)v[F]=A.hand[b].annotations[F].map((s0,f0)=>s0.map((z0,i5)=>((t-1)*S.hand[b].annotations[F][f0][i5]+z0)/t));S.hand[b]={...A.hand[b],box:k,boxRaw:Z,keypoints:N,annotations:v}}if(!S.face||A.face.length!==S.face.length)S.face=JSON.parse(JSON.stringify(A.face));else for(let b=0;b((t-1)*S.face[b].box[v]+O)/t),Z=A.face[b].boxRaw.map((O,v)=>((t-1)*S.face[b].boxRaw[v]+O)/t),N={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};N.matrix=(n=A.face[b].rotation)==null?void 0:n.matrix,N.angle={roll:((t-1)*(((a=(x=S.face[b].rotation)==null?void 0:x.angle)==null?void 0:a.roll)||0)+(((y=(r=A.face[b].rotation)==null?void 0:r.angle)==null?void 0:y.roll)||0))/t,yaw:((t-1)*(((c=(i=S.face[b].rotation)==null?void 0:i.angle)==null?void 0:c.yaw)||0)+(((f=(l=A.face[b].rotation)==null?void 0:l.angle)==null?void 0:f.yaw)||0))/t,pitch:((t-1)*(((E=(h=S.face[b].rotation)==null?void 0:h.angle)==null?void 0:E.pitch)||0)+(((m=(d=A.face[b].rotation)==null?void 0:d.angle)==null?void 0:m.pitch)||0))/t},N.gaze={bearing:((t-1)*(((w=(z=S.face[b].rotation)==null?void 0:z.gaze)==null?void 0:w.bearing)||0)+(((W=(R=A.face[b].rotation)==null?void 0:R.gaze)==null?void 0:W.bearing)||0))/t,strength:((t-1)*(((u=(M=S.face[b].rotation)==null?void 0:M.gaze)==null?void 0:u.strength)||0)+(((P=(T=A.face[b].rotation)==null?void 0:T.gaze)==null?void 0:P.strength)||0))/t},S.face[b]={...A.face[b],rotation:N,box:k,boxRaw:Z}}if(!S.object||A.object.length!==S.object.length)S.object=JSON.parse(JSON.stringify(A.object));else for(let b=0;b((t-1)*S.object[b].box[O]+N)/t),Z=A.object[b].boxRaw.map((N,O)=>((t-1)*S.object[b].boxRaw[O]+N)/t);S.object[b]={...A.object[b],box:k,boxRaw:Z}}let o=A.persons;if(!S.persons||o.length!==S.persons.length)S.persons=JSON.parse(JSON.stringify(o));else for(let b=0;b((t-1)*S.persons[b].box[Z]+k)/t);return S.gesture=A.gesture,S.performance=A.performance,S}var Q,rA=!1;async function $0(A){return Q?A.debug&&g("cached model:",Q.modelUrl):(Q=await s.loadGraphModel(L(A.modelBasePath,A.segmentation.modelPath)),!Q||!Q.modelUrl?g("load model failed:",A.segmentation.modelPath):A.debug&&g("load model:",Q.modelUrl)),Q}async function t2(A,e){var h,E,d,m;if(!e.segmentation.enabled||!A.tensor||!A.canvas||!Q||!Q.inputs[0].shape)return null;let t=s.image.resizeBilinear(A.tensor,[Q.inputs[0].shape[1],Q.inputs[0].shape[2]],!1),o=t.div(255),n=Q.predict(o);s.dispose(t),s.dispose(o);let x=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(A.canvas.width,A.canvas.height):document.createElement("canvas");x.width=A.canvas.width,x.height=A.canvas.height;let a=s.squeeze(n,0),r;if(a.shape[2]===2){let z=a.softmax(),[w,R]=s.unstack(z,2),W=R.expandDims(2),M=W.expandDims(0);s.dispose(z),s.dispose(w),s.dispose(R);let u=s.image.cropAndResize(M,[[0,0,.5,.5]],[0],[(h=A.tensor)==null?void 0:h.shape[1],(E=A.tensor)==null?void 0:E.shape[2]]);r=u.squeeze(0),s.dispose(u),s.dispose(W),s.dispose(M)}else r=s.image.resizeBilinear(a,[(d=A.tensor)==null?void 0:d.shape[1],(m=A.tensor)==null?void 0:m.shape[2]]);s.browser&&await s.browser.toPixels(r,x),s.dispose(r),s.dispose(a),s.dispose(n);let y=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(A.canvas.width,A.canvas.height):document.createElement("canvas");y.width=A.canvas.width,y.height=A.canvas.height;let i=y.getContext("2d");i.filter="blur(8px",await i.drawImage(x,0,0);let c=i.getImageData(0,0,A.canvas.width,A.canvas.height).data,l=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(A.canvas.width,A.canvas.height):document.createElement("canvas");l.width=A.canvas.width,l.height=A.canvas.height;let f=l.getContext("2d");return await f.drawImage(A.canvas,0,0),f.globalCompositeOperation="darken",f.filter="blur(8px)",await f.drawImage(x,0,0),f.globalCompositeOperation="source-over",f.filter="none",A.canvas=l,c}async function me(A,e,t){var x;if(rA)return null;rA=!0,t.segmentation.enabled||(t.segmentation.enabled=!0),Q||await $0(t);let o=T0(A,t),n=await t2(o,t);if(s.dispose(o.tensor),e&&n){let a=T0(e,t),r=a.canvas;s.dispose(a.tensor);let y=o.canvas,i=(x=y.getContext("2d"))==null?void 0:x.getImageData(0,0,y.width,y.height).data,c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(y.width,y.height):document.createElement("canvas");c.width=y.width,c.height=y.height;let l=c.getContext("2d");l.globalCompositeOperation="copy",l.drawImage(r,0,0,c.width,c.height);let f=l.getImageData(0,0,c.width,c.height);for(let h=0;h0,x=A.naturalHeight||A.videoHeight||A.height||A.shape&&A.shape[2]>0;if(!n||!x)return{tensor:null,canvas:j};let r=n,a=x;if(r>Q0&&(r=Q0,a=r*x/n),a>Q0&&(a=Q0,r=a*n/x),e.filter.width>0?r=e.filter.width:e.filter.height>0&&(r=n*(e.filter.height/x)),e.filter.height>0?a=e.filter.height:e.filter.width>0&&(a=x*(e.filter.width/n)),!r||!a)throw new Error("Human: Input cannot determine dimension");(!j||(j==null?void 0:j.width)!==r||(j==null?void 0:j.height)!==a)&&(j=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(r,a):document.createElement("canvas"),(j==null?void 0:j.width)!==r&&(j.width=r),(j==null?void 0:j.height)!==a&&(j.height=a));let y=j.getContext("2d");if(A instanceof ImageData?y.putImageData(A,0,0):e.filter.flip&&typeof y.translate!="undefined"?(y.translate(n,0),y.scale(-1,1),y.drawImage(A,0,0,n,x,0,0,j==null?void 0:j.width,j==null?void 0:j.height),y.setTransform(1,0,0,1,0,0)):y.drawImage(A,0,0,n,x,0,0,j==null?void 0:j.width,j==null?void 0:j.height),e.filter.enabled){if((!X||!H||j.width!==H.width||(j==null?void 0:j.height)!==(H==null?void 0:H.height))&&(H=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(j==null?void 0:j.width,j==null?void 0:j.height):document.createElement("canvas"),(H==null?void 0:H.width)!==(j==null?void 0:j.width)&&(H.width=j==null?void 0:j.width),(H==null?void 0:H.height)!==(j==null?void 0:j.height)&&(H.height=j==null?void 0:j.height),X=s.ENV.flags.IS_BROWSER?new ae({canvas:H}):null),!X)return{tensor:null,canvas:j};X.reset(),X.addFilter("brightness",e.filter.brightness),e.filter.contrast!==0&&X.addFilter("contrast",e.filter.contrast),e.filter.sharpness!==0&&X.addFilter("sharpen",e.filter.sharpness),e.filter.blur!==0&&X.addFilter("blur",e.filter.blur),e.filter.saturation!==0&&X.addFilter("saturation",e.filter.saturation),e.filter.hue!==0&&X.addFilter("hue",e.filter.hue),e.filter.negative&&X.addFilter("negative"),e.filter.sepia&&X.addFilter("sepia"),e.filter.vintage&&X.addFilter("brownie"),e.filter.sepia&&X.addFilter("sepia"),e.filter.kodachrome&&X.addFilter("kodachrome"),e.filter.technicolor&&X.addFilter("technicolor"),e.filter.polaroid&&X.addFilter("polaroid"),e.filter.pixelate!==0&&X.addFilter("pixelate",e.filter.pixelate),X.apply(j)}else H=j,X&&(X=null);let i;if(H.data){let c=[H.height,H.width,3];i=s.tensor3d(H.data,c,"int32")}else if(H instanceof ImageData)i=s.browser?s.browser.fromPixels(H):null;else if(e.backend==="webgl"||e.backend==="humangl"){let c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(r,a):document.createElement("canvas");c.width=r,c.height=a;let l=c.getContext("2d");l==null||l.drawImage(H,0,0),i=s.browser?s.browser.fromPixels(c):null}else{let c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(r,a):document.createElement("canvas");c.width=r,c.height=a;let l=c.getContext("2d");l==null||l.drawImage(H,0,0);let f=l==null?void 0:l.getImageData(0,0,r,a);i=s.browser?s.browser.fromPixels(f):null}if(i){let c=i.toFloat();t=c.expandDims(0),i.dispose(),c.dispose()}}let o=e.filter.return?H:null;return{tensor:t,canvas:o}}var sA={};xA(sA,{all:()=>t2,body:()=>le,canvas:()=>e2,face:()=>ye,gesture:()=>xe,hand:()=>ce,object:()=>de,options:()=>y0,person:()=>A2});var y0={color:"rgba(173, 216, 230, 0.6)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 14px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!0,drawPolygons:!0,drawGaze:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!0},_0=A=>Math.round(A*180/Math.PI);function nA(A,e,t,o=0,n){A.fillStyle=n.useDepth&&o?`rgba(${127.5+2*o}, ${127.5-2*o}, 255, 0.3)`:n.color,A.beginPath(),A.arc(e,t,n.pointSize,0,2*Math.PI),A.fill()}function W0(A,e,t,o,n,x){if(A.beginPath(),x.useCurves){let r=(e+e+o)/2,a=(t+t+n)/2;A.ellipse(r,a,o/2,n/2,0,0,2*Math.PI)}else A.lineWidth=x.lineWidth,A.moveTo(e+x.roundRect,t),A.lineTo(e+o-x.roundRect,t),A.quadraticCurveTo(e+o,t,e+o,t+x.roundRect),A.lineTo(e+o,t+n-x.roundRect),A.quadraticCurveTo(e+o,t+n,e+o-x.roundRect,t+n),A.lineTo(e+x.roundRect,t+n),A.quadraticCurveTo(e,t+n,e,t+n-x.roundRect),A.lineTo(e,t+x.roundRect),A.quadraticCurveTo(e,t,e+x.roundRect,t),A.closePath();A.stroke()}function oA(A,e=[],t){if(!(e===void 0||e.length===0)){A.beginPath(),A.moveTo(e[0][0],e[0][1]);for(let o of e){let n=o[2]||0;A.strokeStyle=t.useDepth&&n?`rgba(${127.5+2*n}, ${127.5-2*n}, 255, 0.3)`:t.color,A.fillStyle=t.useDepth&&n?`rgba(${127.5+2*n}, ${127.5-2*n}, 255, 0.3)`:t.color,A.lineTo(o[0],Math.round(o[1]))}A.stroke(),t.fillPolygons&&(A.closePath(),A.fill())}}function k0(A,e=[],t){if(!(e===void 0||e.length===0)){if(!t.useCurves||e.length<=2){oA(A,e,t);return}A.moveTo(e[0][0],e[0][1]);for(let o=0;o1&&y[1].length>0){let i=a[1]>0?`#${a[1]}`:"",c=`${a[0]} ${i}: ${y[1]}`;o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText(c,8,2+x*o.lineHeight)),n.fillStyle=o.labelColor,n.fillText(c,6,0+x*o.lineHeight),x+=1}}}async function ye(A,e,t){var x,r,a,y;let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n)for(let i of e){n.font=o.font,n.strokeStyle=o.color,n.fillStyle=o.color,o.drawBoxes&&W0(n,i.box[0],i.box[1],i.box[2],i.box[3],o);let c=[];if(c.push(`face: ${Math.trunc(100*i.score)}%`),i.genderScore&&c.push(`${i.gender||""} ${Math.trunc(100*i.genderScore)}%`),i.age&&c.push(`age: ${i.age||""}`),i.iris&&c.push(`distance: ${i.iris}`),i.emotion&&i.emotion.length>0){let l=i.emotion.map(f=>`${Math.trunc(100*f.score)}% ${f.emotion}`);l.length>3&&(l.length=3),c.push(l.join(" "))}i.rotation&&i.rotation.angle&&i.rotation.gaze&&(i.rotation.angle.roll&&c.push(`roll: ${_0(i.rotation.angle.roll)}\xB0 yaw:${_0(i.rotation.angle.yaw)}\xB0 pitch:${_0(i.rotation.angle.pitch)}\xB0`),i.rotation.gaze.bearing&&c.push(`gaze: ${_0(i.rotation.gaze.bearing)}\xB0`)),c.length===0&&c.push("face"),n.fillStyle=o.color;for(let l=c.length-1;l>=0;l--){let f=Math.max(i.box[0],0),h=l*o.lineHeight+i.box[1];o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText(c[l],f+5,h+16)),n.fillStyle=o.labelColor,n.fillText(c[l],f+4,h+15)}if(n.lineWidth=1,i.mesh&&i.mesh.length>0){if(o.drawPoints)for(let l of i.mesh)nA(n,l[0],l[1],l[2],o);if(o.drawPolygons){n.lineWidth=1;for(let l=0;li.mesh[h]);oA(n,f,o)}if(i.annotations&&i.annotations.leftEyeIris){n.strokeStyle=o.useDepth?"rgba(255, 200, 255, 0.3)":o.color,n.beginPath();let l=Math.abs(i.annotations.leftEyeIris[3][0]-i.annotations.leftEyeIris[1][0])/2,f=Math.abs(i.annotations.leftEyeIris[4][1]-i.annotations.leftEyeIris[2][1])/2;n.ellipse(i.annotations.leftEyeIris[0][0],i.annotations.leftEyeIris[0][1],l,f,0,0,2*Math.PI),n.stroke(),o.fillPolygons&&(n.fillStyle=o.useDepth?"rgba(255, 255, 200, 0.3)":o.color,n.fill())}if(i.annotations&&i.annotations.rightEyeIris){n.strokeStyle=o.useDepth?"rgba(255, 200, 255, 0.3)":o.color,n.beginPath();let l=Math.abs(i.annotations.rightEyeIris[3][0]-i.annotations.rightEyeIris[1][0])/2,f=Math.abs(i.annotations.rightEyeIris[4][1]-i.annotations.rightEyeIris[2][1])/2;n.ellipse(i.annotations.rightEyeIris[0][0],i.annotations.rightEyeIris[0][1],l,f,0,0,2*Math.PI),n.stroke(),o.fillPolygons&&(n.fillStyle=o.useDepth?"rgba(255, 255, 200, 0.3)":o.color,n.fill())}if(o.drawGaze&&((r=(x=i.rotation)==null?void 0:x.gaze)==null?void 0:r.strength)&&((y=(a=i.rotation)==null?void 0:a.gaze)==null?void 0:y.bearing)&&i.annotations.leftEyeIris&&i.annotations.rightEyeIris&&i.annotations.leftEyeIris[0]&&i.annotations.rightEyeIris[0]){n.strokeStyle="pink",n.beginPath();let l=[i.annotations.leftEyeIris[0][0]+Math.sin(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[3],i.annotations.leftEyeIris[0][1]+Math.cos(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[2]];n.moveTo(i.annotations.leftEyeIris[0][0],i.annotations.leftEyeIris[0][1]),n.lineTo(l[0],l[1]);let f=[i.annotations.rightEyeIris[0][0]+Math.sin(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[3],i.annotations.rightEyeIris[0][1]+Math.cos(i.rotation.gaze.bearing)*i.rotation.gaze.strength*i.box[2]];n.moveTo(i.annotations.rightEyeIris[0][0],i.annotations.rightEyeIris[0][1]),n.lineTo(f[0],f[1]),n.stroke()}}}}}async function le(A,e,t){var x;let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round";for(let r=0;ri.part==="leftShoulder"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightShoulder"),a&&y.push([a.position[0],a.position[1]]),k0(n,y,o),y.length=0,a=e[r].keypoints.find(i=>i.part==="rightShoulder"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightHip"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftHip"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftShoulder"),a&&y.push([a.position[0],a.position[1]]),y.length===4&&oA(n,y,o),y.length=0,a=e[r].keypoints.find(i=>i.part==="leftHip"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftKnee"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftAnkle"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftHeel"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftFoot"),a&&y.push([a.position[0],a.position[1]]),k0(n,y,o),y.length=0,a=e[r].keypoints.find(i=>i.part==="rightHip"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightKnee"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightAnkle"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightHeel"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightFoot"),a&&y.push([a.position[0],a.position[1]]),k0(n,y,o),y.length=0,a=e[r].keypoints.find(i=>i.part==="leftShoulder"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftElbow"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftWrist"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="leftPalm"),a&&y.push([a.position[0],a.position[1]]),k0(n,y,o),y.length=0,a=e[r].keypoints.find(i=>i.part==="rightShoulder"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightElbow"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightWrist"),a&&y.push([a.position[0],a.position[1]]),a=e[r].keypoints.find(i=>i.part==="rightPalm"),a&&y.push([a.position[0],a.position[1]]),k0(n,y,o)}}}}async function ce(A,e,t){let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round",n.font=o.font;for(let x of e){if(o.drawBoxes&&(n.strokeStyle=o.color,n.fillStyle=o.color,W0(n,x.box[0],x.box[1],x.box[2],x.box[3],o),o.drawLabels&&(o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText("hand",x.box[0]+3,1+x.box[1]+o.lineHeight,x.box[2])),n.fillStyle=o.labelColor,n.fillText("hand",x.box[0]+2,0+x.box[1]+o.lineHeight,x.box[2])),n.stroke()),o.drawPoints&&x.keypoints&&x.keypoints.length>0)for(let r of x.keypoints)n.fillStyle=o.useDepth?`rgba(${127.5+2*r[2]}, ${127.5-2*r[2]}, 255, 0.5)`:o.color,nA(n,r[0],r[1],0,o);if(o.drawLabels){let r=(a,y)=>{n.fillStyle=o.useDepth?`rgba(${127.5+2*a[a.length-1][2]}, ${127.5-2*a[a.length-1][2]}, 255, 0.5)`:o.color,n.fillText(y,a[a.length-1][0]+4,a[a.length-1][1]+4)};n.font=o.font,r(x.annotations.indexFinger,"index"),r(x.annotations.middleFinger,"middle"),r(x.annotations.ringFinger,"ring"),r(x.annotations.pinky,"pinky"),r(x.annotations.thumb,"thumb"),r(x.annotations.palmBase,"palm")}if(o.drawPolygons){let r=a=>{if(!!a)for(let y=0;y0?y-1:0][0],a[y>0?y-1:0][1]),n.lineTo(a[y][0],a[y][1]),n.stroke()};n.lineWidth=o.lineWidth,r(x.annotations.indexFinger),r(x.annotations.middleFinger),r(x.annotations.ringFinger),r(x.annotations.pinky),r(x.annotations.thumb)}}}}async function de(A,e,t){let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round",n.font=o.font;for(let x of e)if(o.drawBoxes){if(n.strokeStyle=o.color,n.fillStyle=o.color,W0(n,x.box[0],x.box[1],x.box[2],x.box[3],o),o.drawLabels){let r=`${Math.round(100*x.score)}% ${x.label}`;o.shadowColor&&o.shadowColor!==""&&(n.fillStyle=o.shadowColor,n.fillText(r,x.box[0]+3,1+x.box[1]+o.lineHeight,x.box[2])),n.fillStyle=o.labelColor,n.fillText(r,x.box[0]+2,0+x.box[1]+o.lineHeight,x.box[2])}n.stroke()}}}async function A2(A,e,t){let o=U(y0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let n=A.getContext("2d");if(!!n){n.lineJoin="round",n.font=o.font;for(let x=0;xv.box[0]&&T.box[0]v.box[1]&&T.box[1]+T.box[3]P.body.box[0]&&v.box[0]+v.box[2]P.body.box[1]&&v.box[1]+v.box[3]P.body.box[0]&&v.box[1]+v.box[3]>P.body.box[1]&&v.box[1]+v.box[3]{v&&v.length===4&&(b.push(v[0],v[0]+v[2]),k.push(v[1],v[1]+v[3]))};Z((z=P.face)==null?void 0:z.box),Z((w=P.body)==null?void 0:w.box),Z((W=(R=P.hands)==null?void 0:R.left)==null?void 0:W.box),Z((p=(M=P.hands)==null?void 0:M.right)==null?void 0:p.box);let N=Math.min(...b),O=Math.min(...k);P.box=[N,O,Math.max(...b)-N,Math.max(...k)-O],n&&n.length===4&&(P.boxRaw=[P.box[0]/n[2],P.box[1]/n[1],P.box[2]/n[2],P.box[3]/n[1]]),r.push(P)}return r}var S={face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0};function me(A){var n,x,r,a,y,i,c,l,f,h,E,d,m,z,w,R,W,M,p,T,P;let e=Date.now()-A.timestamp,t=e<1e3?8-Math.log(e):1;if(S.canvas=A.canvas,!S.body||A.body.length!==S.body.length)S.body=JSON.parse(JSON.stringify(A.body));else for(let b=0;b((t-1)*S.body[b].box[v]+O)/t),Z=A.body[b].boxRaw.map((O,v)=>((t-1)*S.body[b].boxRaw[v]+O)/t),N=A.body[b].keypoints.map((O,v)=>({score:O.score,part:O.part,position:[S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].position[0]+O.position[0])/t:O.position[0],S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].position[1]+O.position[1])/t:O.position[1]],positionRaw:[S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].positionRaw[0]+O.positionRaw[0])/t:O.position[0],S.body[b].keypoints[v]?((t-1)*S.body[b].keypoints[v].positionRaw[1]+O.positionRaw[1])/t:O.position[1]]}));S.body[b]={...A.body[b],box:k,boxRaw:Z,keypoints:N}}if(!S.hand||A.hand.length!==S.hand.length)S.hand=JSON.parse(JSON.stringify(A.hand));else for(let b=0;b((t-1)*S.hand[b].box[s0]+F)/t),Z=A.hand[b].boxRaw.map((F,s0)=>((t-1)*S.hand[b].boxRaw[s0]+F)/t),N=A.hand[b].keypoints.map((F,s0)=>F.map((m0,z0)=>((t-1)*S.hand[b].keypoints[s0][z0]+m0)/t)),O=Object.keys(A.hand[b].annotations),v={};for(let F of O)v[F]=A.hand[b].annotations[F].map((s0,m0)=>s0.map((z0,i5)=>((t-1)*S.hand[b].annotations[F][m0][i5]+z0)/t));S.hand[b]={...A.hand[b],box:k,boxRaw:Z,keypoints:N,annotations:v}}if(!S.face||A.face.length!==S.face.length)S.face=JSON.parse(JSON.stringify(A.face));else for(let b=0;b((t-1)*S.face[b].box[v]+O)/t),Z=A.face[b].boxRaw.map((O,v)=>((t-1)*S.face[b].boxRaw[v]+O)/t),N={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};N.matrix=(n=A.face[b].rotation)==null?void 0:n.matrix,N.angle={roll:((t-1)*(((r=(x=S.face[b].rotation)==null?void 0:x.angle)==null?void 0:r.roll)||0)+(((y=(a=A.face[b].rotation)==null?void 0:a.angle)==null?void 0:y.roll)||0))/t,yaw:((t-1)*(((c=(i=S.face[b].rotation)==null?void 0:i.angle)==null?void 0:c.yaw)||0)+(((f=(l=A.face[b].rotation)==null?void 0:l.angle)==null?void 0:f.yaw)||0))/t,pitch:((t-1)*(((E=(h=S.face[b].rotation)==null?void 0:h.angle)==null?void 0:E.pitch)||0)+(((m=(d=A.face[b].rotation)==null?void 0:d.angle)==null?void 0:m.pitch)||0))/t},N.gaze={bearing:((t-1)*(((w=(z=S.face[b].rotation)==null?void 0:z.gaze)==null?void 0:w.bearing)||0)+(((W=(R=A.face[b].rotation)==null?void 0:R.gaze)==null?void 0:W.bearing)||0))/t,strength:((t-1)*(((p=(M=S.face[b].rotation)==null?void 0:M.gaze)==null?void 0:p.strength)||0)+(((P=(T=A.face[b].rotation)==null?void 0:T.gaze)==null?void 0:P.strength)||0))/t},S.face[b]={...A.face[b],rotation:N,box:k,boxRaw:Z}}if(!S.object||A.object.length!==S.object.length)S.object=JSON.parse(JSON.stringify(A.object));else for(let b=0;b((t-1)*S.object[b].box[O]+N)/t),Z=A.object[b].boxRaw.map((N,O)=>((t-1)*S.object[b].boxRaw[O]+N)/t);S.object[b]={...A.object[b],box:k,boxRaw:Z}}let o=A.persons;if(!S.persons||o.length!==S.persons.length)S.persons=JSON.parse(JSON.stringify(o));else for(let b=0;b((t-1)*S.persons[b].box[Z]+k)/t);return S.gesture=A.gesture,S.performance=A.performance,S}var Q,rA=!1;async function $0(A){return Q?A.debug&&g("cached model:",Q.modelUrl):(Q=await s.loadGraphModel(L(A.modelBasePath,A.segmentation.modelPath)),!Q||!Q.modelUrl?g("load model failed:",A.segmentation.modelPath):A.debug&&g("load model:",Q.modelUrl)),Q}async function iA(A){var E,d;let e=((E=A.tensor)==null?void 0:E.shape[1])||0,t=((d=A.tensor)==null?void 0:d.shape[2])||0;if(!A.tensor||!Q||!Q.inputs[0].shape)return null;let o=s.image.resizeBilinear(A.tensor,[Q.inputs[0].shape[1],Q.inputs[0].shape[2]],!1),n=o.div(255),x=Q.predict(n);s.dispose(o),s.dispose(n);let r=s.squeeze(x,0),a;if(r.shape[2]===2){let m=r.softmax(),[z,w]=s.unstack(m,2),R=w.expandDims(2),W=R.expandDims(0);s.dispose(m),s.dispose(z),s.dispose(w);let M=s.image.cropAndResize(W,[[0,0,.5,.5]],[0],[e,t]);a=M.squeeze(0),s.dispose(M),s.dispose(R),s.dispose(W)}else a=s.image.resizeBilinear(r,[e,t]);if(typeof document=="undefined")return a.dataSync();let y=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(e,t):document.createElement("canvas");y.width=e,y.height=t,s.browser&&await s.browser.toPixels(a,y),s.dispose(a),s.dispose(r),s.dispose(x);let i=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(e,t):document.createElement("canvas");i.width=e,i.height=t;let c=i.getContext("2d");c.filter="blur(8px",await c.drawImage(y,0,0);let l=c.getImageData(0,0,e,t).data,f=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(e,t):document.createElement("canvas");f.width=e,f.height=t;let h=f.getContext("2d");return A.canvas&&await h.drawImage(A.canvas,0,0),h.globalCompositeOperation="darken",h.filter="blur(8px)",await h.drawImage(y,0,0),h.globalCompositeOperation="source-over",h.filter="none",A.canvas=f,l}async function he(A,e,t){var x;if(rA)return null;rA=!0,Q||await $0(t);let o=c0(A,t),n=await iA(o);if(s.dispose(o.tensor),e&&n){let r=c0(e,t),a=r.canvas;s.dispose(r.tensor);let y=o.canvas,i=(x=y.getContext("2d"))==null?void 0:x.getImageData(0,0,y.width,y.height).data,c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(y.width,y.height):document.createElement("canvas");c.width=y.width,c.height=y.height;let l=c.getContext("2d");l.globalCompositeOperation="copy",l.drawImage(a,0,0,c.width,c.height);let f=l.getImageData(0,0,c.width,c.height);for(let h=0;h{if(!C(this,I0))return;let t=this.tf.engine().state.numTensors,o=C(this,P0);_(this,P0,t);let n=t-o;n!==0&&g(...e,n)};K(this,t5,e=>{if(!C(this,N0))return null;if(!e)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(e instanceof s.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(t){return"backend not loaded"}return null});K(this,O0,async(e=!1)=>{var t;if(this.config.backend&&this.config.backend.length>0&&e||this.tf.getBackend()!==this.config.backend){let o=I();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&g("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&g("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&g("wasm path:",this.config.wasmPath),typeof((t=this.tf)==null?void 0:t.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let n=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),x=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&g(`wasm execution: ${n?"SIMD":"no SIMD"} ${x?"multithreaded":"singlethreaded"}`),this.config.debug&&!n&&g("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&uA();try{await this.tf.setBackend(this.config.backend)}catch(n){g("error: cannot set backend:",this.config.backend,n)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&this.config.deallocate&&(g("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let n=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&g(`gl version:${n.getParameter(n.VERSION)} renderer:${n.getParameter(n.RENDERER)}`)}await this.tf.ready(),this.performance.backend=Math.trunc(I()-o)}});this.next=e=>fe(e||this.result);K(this,n5,async e=>{if(this.config.cacheSensitivity===0)return!1;let t=32,o=e.resizeBilinear([Math.trunc(e.shape[1]/t),Math.trunc(e.shape[2]/t)]),n=o.dataSync(),x=0;for(let y=0;y10*this.config.cacheSensitivity?0:a),r});K(this,o5,async()=>{let e=(n,x="application/octet-stream")=>fetch(`data:${x};base64,${n}`).then(a=>a.blob()),t,o;switch(this.config.warmup){case"face":t=await e(A5);break;case"full":t=await e(e5);break;default:t=null}if(t){let n=await createImageBitmap(t);o=await this.detect(n,this.config),n.close()}return o});K(this,s5,async()=>new Promise(e=>{let t,o=0;switch(this.config.warmup){case"face":o=256,t="data:image/jpeg;base64,"+A5;break;case"full":case"body":o=1200,t="data:image/jpeg;base64,"+e5;break;default:t=null}let n=new Image;n.onload=async()=>{let x=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(o,o):document.createElement("canvas");x.width=n.naturalWidth,x.height=n.naturalHeight;let a=x.getContext("2d");a==null||a.drawImage(n,0,0);let r=await this.detect(x,this.config);e(r)},t?n.src=t:e(null)}));K(this,r5,async()=>{let e=n=>Buffer.from(n,"base64"),t;if(this.config.warmup==="face"&&(t=e(A5)),(this.config.warmup==="body"||this.config.warmup==="full")&&(t=e(e5)),!t)return null;let o;if(typeof s.node!="undefined"){let n=s.node.decodeJpeg(t),x=n.expandDims(0);this.tf.dispose(n),o=await this.detect(x,this.config),this.tf.dispose(x)}else this.config.debug&&g("Warmup tfjs-node not loaded");return o});this.config=U(yA,e||{}),this.tf=s,this.draw=sA,this.version=he,this.state="idle",_(this,P0,0),_(this,I0,!1),_(this,N0,!1),_(this,c0,!0),_(this,v0,0),this.performance={backend:0,load:0,image:0,frames:0,cached:0,changed:0,total:0,draw:0},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,movenet:null,handpose:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null,segmentation:null},this.image=t=>T0(t,this.config),this.faceTriangulation=SA,this.faceUVMap=WA,this.sysinfo=lA(),_(this,d0,1)}similarity(e,t){return T5(e,t)}segmentation(e,t){return me(e,t,this.config)}enhance(e){return P5(e)}match(e,t,o=0){return NA(e,t,o)}async load(e){this.state="load";let t=I();e&&(this.config=U(this.config,e)),C(this,c0)&&(this.config.debug&&g(`version: ${this.version}`),this.config.debug&&g(`tfjs version: ${this.tf.version_core}`),this.config.debug&&g("platform:",this.sysinfo.platform),this.config.debug&&g("agent:",this.sysinfo.agent),await C(this,O0).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&g("configuration:",this.config),this.config.debug&&g("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.efficientpose,this.models.movenet,this.models.nanodet,this.models.centernet,this.models.faceres,this.models.segmentation]=await Promise.all([this.models.face||(this.config.face.enabled?m5(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?p5(this.config):null),this.models.handpose||(this.config.hand.enabled?Z5(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?k5(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?G0(this.config):null),this.models.efficientpose||(this.config.body.enabled&&this.config.body.modelPath.includes("efficientpose")?te(this.config):null),this.models.movenet||(this.config.body.enabled&&this.config.body.modelPath.includes("movenet")?Y5(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?Q5(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?eA(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?M5(this.config):null),this.models.segmentation||(this.config.segmentation.enabled?$0(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await m5(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await p5(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await Z5(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await k5(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await G0(this.config)),this.config.body.enabled&&!this.models.efficientpose&&this.config.body.modelPath.includes("efficientpose")&&(this.models.efficientpose=await G0(this.config)),this.config.body.enabled&&!this.models.movenet&&this.config.body.modelPath.includes("movenet")&&(this.models.movenet=await Y5(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await Q5(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await eA(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await M5(this.config)),this.config.segmentation.enabled&&!this.models.segmentation&&(this.models.segmentation=await $0(this.config))),C(this,c0)&&(this.config.debug&&g("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),_(this,c0,!1));let o=Math.trunc(I()-t);o>(this.performance.load||0)&&(this.performance.load=o)}async detect(e,t){return new Promise(async o=>{this.state="config";let n;this.config=U(this.config,t),this.state="check";let x=C(this,t5).call(this,e);x&&(g(x,e),o({error:x}));let a=I();await C(this,O0).call(this),await this.load(),n=I();let r=T0(e,this.config);if(!r||!r.tensor){g("could not convert input to tensor"),o({error:"could not convert input to tensor"});return}this.performance.image=Math.trunc(I()-n),this.analyze("Get Image:"),n=I(),this.config.skipFrame=await C(this,n5).call(this,r.tensor),this.performance.frames||(this.performance.frames=0),this.performance.cached||(this.performance.cached=0),this.performance.frames++,this.config.skipFrame&&this.performance.cached++,this.performance.changed=Math.trunc(I()-n),this.analyze("Check Changed:");let y,i,c,l,f;this.config.async?(y=this.config.face.enabled?z5(this,r.tensor):[],this.performance.face&&delete this.performance.face):(this.state="run:face",n=I(),y=this.config.face.enabled?await z5(this,r.tensor):[],f=Math.trunc(I()-n),f>0&&(this.performance.face=f)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?i=this.config.body.enabled?W5(r.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?i=this.config.body.enabled?V5(r.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?i=this.config.body.enabled?q5(r.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(i=this.config.body.enabled?G5(r.tensor,this.config):[]),this.performance.body&&delete this.performance.body):(this.state="run:body",n=I(),this.config.body.modelPath.includes("posenet")?i=this.config.body.enabled?await W5(r.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?i=this.config.body.enabled?await V5(r.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?i=this.config.body.enabled?await q5(r.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(i=this.config.body.enabled?await G5(r.tensor,this.config):[]),f=Math.trunc(I()-n),f>0&&(this.performance.body=f)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(c=this.config.hand.enabled?H5(r.tensor,this.config):[],this.performance.hand&&delete this.performance.hand):(this.state="run:hand",n=I(),c=this.config.hand.enabled?await H5(r.tensor,this.config):[],f=Math.trunc(I()-n),f>0&&(this.performance.hand=f)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?l=this.config.object.enabled?_5(r.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(l=this.config.object.enabled?tA(r.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(this.state="run:object",n=I(),this.config.object.modelPath.includes("nanodet")?l=this.config.object.enabled?await _5(r.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(l=this.config.object.enabled?await tA(r.tensor,this.config):[]),f=Math.trunc(I()-n),f>0&&(this.performance.object=f)),this.analyze("End Object:"),this.config.async&&([y,i,c,l]=await Promise.all([y,i,c,l]));let h=[];this.config.gesture.enabled&&(n=I(),h=[...oe(y),...ne(i),...re(c),...se(y)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=Math.trunc(I()-n)),this.performance.total=Math.trunc(I()-a),this.state="idle",this.result={face:y,body:i,hand:c,gesture:h,object:l,performance:this.performance,canvas:r.canvas,timestamp:Date.now(),get persons(){var E;return de(y,i,c,h,(E=r==null?void 0:r.tensor)==null?void 0:E.shape)}},s.dispose(r.tensor),o(this.result)})}async warmup(e){let t=I();if(e&&(this.config=U(this.config,e)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let o;typeof createImageBitmap=="function"?o=await C(this,o5).call(this):typeof Image!="undefined"?o=await C(this,s5).call(this):o=await C(this,r5).call(this);let n=I();return this.config.debug&&g("Warmup",this.config.warmup,Math.round(n-t),"ms",o),o}};P0=new WeakMap,I0=new WeakMap,N0=new WeakMap,c0=new WeakMap,d0=new WeakMap,v0=new WeakMap,t5=new WeakMap,O0=new WeakMap,n5=new WeakMap,o5=new WeakMap,s5=new WeakMap,r5=new WeakMap;export{o2 as Human,o2 as default}; +2Q==`;var ue="2.0.0";var P0,I0,N0,d0,f0,v0,t5,O0,n5,o5,s5,r5,o2=class{constructor(e){K(this,P0,void 0);K(this,I0,void 0);K(this,N0,void 0);K(this,d0,void 0);K(this,f0,void 0);K(this,v0,void 0);this.analyze=(...e)=>{if(!C(this,I0))return;let t=this.tf.engine().state.numTensors,o=C(this,P0);_(this,P0,t);let n=t-o;n!==0&&g(...e,n)};K(this,t5,e=>{if(!C(this,N0))return null;if(!e)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(e instanceof s.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(t){return"backend not loaded"}return null});K(this,O0,async(e=!1)=>{var t;if(this.config.backend&&this.config.backend.length>0&&e||this.tf.getBackend()!==this.config.backend){let o=I();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&g("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&g("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&g("wasm path:",this.config.wasmPath),typeof((t=this.tf)==null?void 0:t.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let n=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),x=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&g(`wasm execution: ${n?"SIMD":"no SIMD"} ${x?"multithreaded":"singlethreaded"}`),this.config.debug&&!n&&g("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&pA();try{await this.tf.setBackend(this.config.backend)}catch(n){g("error: cannot set backend:",this.config.backend,n)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&this.config.deallocate&&(g("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let n=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&g(`gl version:${n.getParameter(n.VERSION)} renderer:${n.getParameter(n.RENDERER)}`)}await this.tf.ready(),this.performance.backend=Math.trunc(I()-o)}});this.next=e=>me(e||this.result);K(this,n5,async e=>{if(this.config.cacheSensitivity===0)return!1;let t=32,o=e.resizeBilinear([Math.trunc(e.shape[1]/t),Math.trunc(e.shape[2]/t)]),n=o.dataSync(),x=0;for(let y=0;y10*this.config.cacheSensitivity?0:r),a});K(this,o5,async()=>{let e=(n,x="application/octet-stream")=>fetch(`data:${x};base64,${n}`).then(r=>r.blob()),t,o;switch(this.config.warmup){case"face":t=await e(A5);break;case"full":t=await e(e5);break;default:t=null}if(t){let n=await createImageBitmap(t);o=await this.detect(n,this.config),n.close()}return o});K(this,s5,async()=>new Promise(e=>{let t,o=0;switch(this.config.warmup){case"face":o=256,t="data:image/jpeg;base64,"+A5;break;case"full":case"body":o=1200,t="data:image/jpeg;base64,"+e5;break;default:t=null}let n=new Image;n.onload=async()=>{let x=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(o,o):document.createElement("canvas");x.width=n.naturalWidth,x.height=n.naturalHeight;let r=x.getContext("2d");r==null||r.drawImage(n,0,0);let a=await this.detect(x,this.config);e(a)},t?n.src=t:e(null)}));K(this,r5,async()=>{let e=n=>Buffer.from(n,"base64"),t;if(this.config.warmup==="face"&&(t=e(A5)),(this.config.warmup==="body"||this.config.warmup==="full")&&(t=e(e5)),!t)return null;let o;if(typeof s.node!="undefined"){let n=s.node.decodeJpeg(t),x=n.expandDims(0);this.tf.dispose(n),o=await this.detect(x,this.config),this.tf.dispose(x)}else this.config.debug&&g("Warmup tfjs-node not loaded");return o});this.config=U(lA,e||{}),this.tf=s,this.draw=sA,this.version=ue,this.state="idle",_(this,P0,0),_(this,I0,!1),_(this,N0,!1),_(this,d0,!0),_(this,v0,0),this.performance={backend:0,load:0,image:0,frames:0,cached:0,changed:0,total:0,draw:0},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,movenet:null,handpose:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null,segmentation:null},this.image=t=>c0(t,this.config),this.faceTriangulation=WA,this.faceUVMap=kA,this.sysinfo=cA(),_(this,f0,1)}similarity(e,t){return T5(e,t)}segmentation(e,t){return he(e,t,this.config)}enhance(e){return P5(e)}match(e,t,o=0){return OA(e,t,o)}async load(e){this.state="load";let t=I();e&&(this.config=U(this.config,e)),C(this,d0)&&(this.config.debug&&g(`version: ${this.version}`),this.config.debug&&g(`tfjs version: ${this.tf.version_core}`),this.config.debug&&g("platform:",this.sysinfo.platform),this.config.debug&&g("agent:",this.sysinfo.agent),await C(this,O0).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&g("configuration:",this.config),this.config.debug&&g("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.efficientpose,this.models.movenet,this.models.nanodet,this.models.centernet,this.models.faceres,this.models.segmentation]=await Promise.all([this.models.face||(this.config.face.enabled?m5(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?p5(this.config):null),this.models.handpose||(this.config.hand.enabled?Z5(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?k5(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?G0(this.config):null),this.models.efficientpose||(this.config.body.enabled&&this.config.body.modelPath.includes("efficientpose")?ne(this.config):null),this.models.movenet||(this.config.body.enabled&&this.config.body.modelPath.includes("movenet")?Y5(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?Q5(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?eA(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?M5(this.config):null),this.models.segmentation||(this.config.segmentation.enabled?$0(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await m5(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await p5(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await Z5(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await k5(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await G0(this.config)),this.config.body.enabled&&!this.models.efficientpose&&this.config.body.modelPath.includes("efficientpose")&&(this.models.efficientpose=await G0(this.config)),this.config.body.enabled&&!this.models.movenet&&this.config.body.modelPath.includes("movenet")&&(this.models.movenet=await Y5(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await Q5(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await eA(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await M5(this.config)),this.config.segmentation.enabled&&!this.models.segmentation&&(this.models.segmentation=await $0(this.config))),C(this,d0)&&(this.config.debug&&g("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),_(this,d0,!1));let o=Math.trunc(I()-t);o>(this.performance.load||0)&&(this.performance.load=o)}async detect(e,t){return new Promise(async o=>{this.state="config";let n,x;this.config=U(this.config,t),this.state="check";let r=C(this,t5).call(this,e);r&&(g(r,e),o({error:r}));let a=I();await C(this,O0).call(this),await this.load(),n=I();let y=c0(e,this.config);if(this.performance.image=Math.trunc(I()-n),this.analyze("Get Image:"),this.config.segmentation.enabled&&y&&y.tensor&&(this.analyze("Start Segmentation:"),this.state="run:segmentation",n=I(),await iA(y),x=Math.trunc(I()-n),x>0&&(this.performance.segmentation=x),y.canvas&&(y.tensor.dispose(),y=c0(y.canvas,this.config)),this.analyze("End Segmentation:")),!y||!y.tensor){g("could not convert input to tensor"),o({error:"could not convert input to tensor"});return}n=I(),this.config.skipFrame=await C(this,n5).call(this,y.tensor),this.performance.frames||(this.performance.frames=0),this.performance.cached||(this.performance.cached=0),this.performance.frames++,this.config.skipFrame&&this.performance.cached++,this.performance.changed=Math.trunc(I()-n),this.analyze("Check Changed:");let i,c,l,f;this.config.async?(i=this.config.face.enabled?z5(this,y.tensor):[],this.performance.face&&delete this.performance.face):(this.state="run:face",n=I(),i=this.config.face.enabled?await z5(this,y.tensor):[],x=Math.trunc(I()-n),x>0&&(this.performance.face=x)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?c=this.config.body.enabled?W5(y.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?c=this.config.body.enabled?V5(y.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?c=this.config.body.enabled?q5(y.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(c=this.config.body.enabled?G5(y.tensor,this.config):[]),this.performance.body&&delete this.performance.body):(this.state="run:body",n=I(),this.config.body.modelPath.includes("posenet")?c=this.config.body.enabled?await W5(y.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?c=this.config.body.enabled?await V5(y.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?c=this.config.body.enabled?await q5(y.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(c=this.config.body.enabled?await G5(y.tensor,this.config):[]),x=Math.trunc(I()-n),x>0&&(this.performance.body=x)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(l=this.config.hand.enabled?H5(y.tensor,this.config):[],this.performance.hand&&delete this.performance.hand):(this.state="run:hand",n=I(),l=this.config.hand.enabled?await H5(y.tensor,this.config):[],x=Math.trunc(I()-n),x>0&&(this.performance.hand=x)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?f=this.config.object.enabled?_5(y.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(f=this.config.object.enabled?tA(y.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(this.state="run:object",n=I(),this.config.object.modelPath.includes("nanodet")?f=this.config.object.enabled?await _5(y.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(f=this.config.object.enabled?await tA(y.tensor,this.config):[]),x=Math.trunc(I()-n),x>0&&(this.performance.object=x)),this.analyze("End Object:"),this.config.async&&([i,c,l,f]=await Promise.all([i,c,l,f]));let h=[];this.config.gesture.enabled&&(n=I(),h=[...se(i),...oe(c),...ie(l),...re(i)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=Math.trunc(I()-n)),this.performance.total=Math.trunc(I()-a),this.state="idle",this.result={face:i,body:c,hand:l,gesture:h,object:f,performance:this.performance,canvas:y.canvas,timestamp:Date.now(),get persons(){var E;return fe(i,c,l,h,(E=y==null?void 0:y.tensor)==null?void 0:E.shape)}},s.dispose(y.tensor),o(this.result)})}async warmup(e){let t=I();if(e&&(this.config=U(this.config,e)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let o;typeof createImageBitmap=="function"?o=await C(this,o5).call(this):typeof Image!="undefined"?o=await C(this,s5).call(this):o=await C(this,r5).call(this);let n=I();return this.config.debug&&g("Warmup",this.config.warmup,Math.round(n-t),"ms",o),o}};P0=new WeakMap,I0=new WeakMap,N0=new WeakMap,d0=new WeakMap,f0=new WeakMap,v0=new WeakMap,t5=new WeakMap,O0=new WeakMap,n5=new WeakMap,o5=new WeakMap,s5=new WeakMap,r5=new WeakMap;export{o2 as Human,o2 as default}; //# sourceMappingURL=human.esm-nobundle.js.map diff --git a/dist/human.esm-nobundle.js.map b/dist/human.esm-nobundle.js.map index 6c4dbae6..c60fa214 100644 --- a/dist/human.esm-nobundle.js.map +++ b/dist/human.esm-nobundle.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/helpers.ts", "../src/config.ts", "../src/sysinfo.ts", "../src/tfjs/tf-browser.ts", "../src/tfjs/backend.ts", "../src/blazeface/box.ts", "../src/blazeface/util.ts", "../src/blazeface/blazeface.ts", "../src/blazeface/coords.ts", "../src/blazeface/facepipeline.ts", "../src/blazeface/facemesh.ts", "../src/emotion/emotion.ts", "../src/faceres/faceres.ts", "../src/face.ts", "../src/posenet/keypoints.ts", "../src/posenet/utils.ts", "../src/posenet/poses.ts", "../src/posenet/posenet.ts", "../src/handpose/box.ts", "../src/handpose/anchors.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/handpose/handpose.ts", "../src/blazepose/annotations.ts", "../src/blazepose/blazepose.ts", "../src/efficientpose/efficientpose.ts", "../src/movenet/movenet.ts", "../src/object/labels.ts", "../src/object/nanodet.ts", "../src/object/centernet.ts", "../src/gesture/gesture.ts", "../src/image/imagefx.js", "../src/image/image.ts", "../src/draw/draw.ts", "../src/persons.ts", "../src/interpolate.ts", "../src/segmentation/segmentation.ts", "../src/sample.ts", "../src/human.ts"], - "sourcesContent": ["/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n\n// helper function: return min and max from input array\nexport const minmax = (data) => data.reduce((acc, val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n * @typedef Config\n */\nexport interface Config {\n /** Backend used for TFJS operations */\n backend: null | '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow',\n\n /** Path to *.wasm files if backend is set to `wasm` */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n cacheSensitivity: number;\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n skipFrame: boolean;\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n */\n filter: {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n },\n // type definition end\n\n /** Controlls gesture detection */\n gesture: {\n enabled: boolean,\n },\n\n /** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - return: return extracted face as tensor for futher user processing\n */\n face: {\n enabled: boolean,\n detector: {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n },\n mesh: {\n enabled: boolean,\n modelPath: string,\n },\n iris: {\n enabled: boolean,\n modelPath: string,\n },\n description: {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n },\n emotion: {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n },\n },\n\n /** Controlls and configures all body detection specific options\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n */\n body: {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n skipFrames: number,\n },\n\n /** Controlls and configures all hand detection specific options\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n */\n hand: {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath: string,\n },\n skeleton: {\n modelPath: string,\n },\n },\n\n /** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n */\n object: {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n },\n\n /** Controlls and configures all body segmentation module\n * if segmentation is enabled, output result.canvas will be augmented with masked image containing only person output\n *\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n */\n segmentation: {\n enabled: boolean,\n modelPath: string,\n },\n}\n\nconst config: Config = {\n backend: 'webgl', // select tfjs backend to use, leave empty to use default backend\n // can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl\n modelBasePath: '../models/', // base path for all models\n wasmPath: '../node_modules/@tensorflow/tfjs-backend-wasm/dist/', // path for wasm binaries, only used for backend: wasm\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n cacheSensitivity: 0.75, // cache sensitivity\n // values 0..1 where 0.01 means reset cache if input changed more than 1%\n // set to 0 to disable caching\n skipFrame: false, // internal & dynamic\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: true, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 15, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 15, // how many max frames to go without re-running the face bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head probably hasn't moved much\n // in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 11, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 17, // how max many frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'\n maxDetected: 1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet as other models detects single pose\n minConfidence: 0.2, // threshold for discarding a prediction\n skipFrames: 1, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n},\n\n hand: {\n enabled: true,\n rotation: true, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n skipFrames: 18, // how many max frames to go without re-running the hand bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand probably\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.1, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 2, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handdetect.json', // hand detector model, can be absolute path or relative to modelBasePath\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'mb3-centernet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'mb3-centernet' or 'nanodet'\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 19, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n },\n\n segmentation: {\n enabled: false, // if segmentation is enabled, output result.canvas will be augmented\n // with masked image containing only person output\n // segmentation is not triggered as part of detection and requires separate call to human.segmentation\n modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'selfie' or 'meet'\n },\n};\nexport { config as defaults };\n", "/**\n * Helper function that returns basic system info\n */\nexport function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "/**\n * Creates tfjs bundle used by Human browser build target\n */\n\n// simplified\n// { modules: 1250, moduleBytes: 4013323, imports: 7, importBytes: 2255, outputBytes: 2991826, outputFiles: 'dist/tfjs.esm.js' }\n// export * from '@tensorflow/tfjs/dist/index.js';\n// export * from '@tensorflow/tfjs-backend-wasm';\n\n// modular\n// { modules: 1253, moduleBytes: 4029357, imports: 7, importBytes: 2285, outputBytes: 2998298, outputFiles: 'dist/tfjs.esm.js' }\n\n// get versions of all packages.\nimport * as packageBundle from '@tensorflow/tfjs/package.json';\nimport * as packageCore from '@tensorflow/tfjs-core/package.json';\nimport * as packageData from '@tensorflow/tfjs-data/package.json';\nimport * as packageLayers from '@tensorflow/tfjs-layers/package.json';\nimport * as packageConverter from '@tensorflow/tfjs-converter/package.json';\n// for backends, get version from source so it can register backend during import\nimport { version_cpu } from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nimport { version_webgl } from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nimport { version_wasm } from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - compiled\nexport * from '@tensorflow/tfjs-core/dist/index.js';\nexport * from '@tensorflow/tfjs-layers/dist/index.js';\nexport * from '@tensorflow/tfjs-converter/dist/index.js';\nexport * as data from '@tensorflow/tfjs-data/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - sources\n/*\nexport * from '@tensorflow/tfjs-core/src/index';\nexport * from '@tensorflow/tfjs-layers/src/index';\nexport * from '@tensorflow/tfjs-converter/src/index';\nexport * as data from '@tensorflow/tfjs-data/src/index';\nexport * from '@tensorflow/tfjs-backend-cpu/src/index';\nexport * from '@tensorflow/tfjs-backend-webgl/src/index';\nexport * from '@tensorflow/tfjs-backend-wasm/src/index';\n*/\n\n// export versions\nexport const version = {\n tfjs: packageBundle?.version || undefined,\n 'tfjs-core': packageCore?.version || undefined,\n 'tfjs-data': packageData?.version || undefined,\n 'tfjs-layers': packageLayers?.version || undefined,\n 'tfjs-converter': packageConverter?.version || undefined,\n 'tfjs-backend-cpu': version_cpu || undefined,\n 'tfjs-backend-webgl': version_webgl || undefined,\n 'tfjs-backend-wasm': version_wasm || undefined,\n};\n// export const version = {};\n", "/**\n * Custom TFJS backend for Human based on WebGL\n * Not used by default\n */\n\nimport { log } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport const config = {\n name: 'humangl',\n priority: 99,\n canvas: null,\n gl: null,\n width: 1024,\n height: 1024,\n webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: false,\n desynchronized: true,\n },\n};\n\nexport function register(): void {\n if (!tf.findBackend(config.name)) {\n log('backend registration:', config.name);\n try {\n config.canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(config.width, config.height) : document.createElement('canvas');\n } catch (err) {\n log('error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas.getContext('webgl2', config.webGLattr);\n } catch (err) {\n log('error: cannot get WebGL2 context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('error: cannot set WebGL2 context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('error: cannot register WebGL backend:', err);\n return;\n }\n try {\n const kernels = tf.getKernelsForBackend('webgl');\n kernels.forEach((kernelConfig) => {\n const newKernelConfig = { ...kernelConfig, backendName: config.name };\n tf.registerKernel(newKernelConfig);\n });\n } catch (err) {\n log('error: cannot update WebGL backend registration:', err);\n return;\n }\n try {\n tf.ENV.set('WEBGL_VERSION', 2);\n // tf.ENV.set('WEBGL_MAX_TEXTURE_SIZE', config.gl.getParameter(config.gl.MAX_TEXTURE_SIZE));\n // tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true);\n // tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n } catch (err) {\n log('error: cannot set WebGL backend flags:', err);\n return;\n }\n log('backend registered:', config.name);\n }\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)];\n const endPoint = [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n}\n\nexport const disposeBox = (t) => {\n t.startPoint.dispose();\n t.endPoint.dispose();\n};\n\nexport const createBox = (startEndTensor) => ({\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n", "export const IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nexport function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport function radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\n\nexport function buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n\nexport function xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\n\nexport function generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors: Array<[number, number]> = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\nimport { Config } from '../config';\nimport { Tensor, GraphModel } from '../tfjs/types';\n\nconst keypointsCount = 6;\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nexport class BlazeFaceModel {\n model: GraphModel;\n anchorsData: [number, number][];\n anchors: Tensor;\n inputSize: number;\n config: Config;\n\n constructor(model, config: Config) {\n this.model = model;\n this.anchorsData = util.generateAnchors(model.inputs[0].shape[1]);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = model.inputs[0].shape[2];\n this.config = config;\n }\n\n async getBoundingBoxes(inputImage: Tensor) {\n // sanity check on input\n // @ts-ignore isDisposed is internal property\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [batch, boxes, scores] = tf.tidy(() => {\n const resizedImage = tf.image.resizeBilinear(inputImage, [this.inputSize, this.inputSize]);\n const normalizedImage = resizedImage.div(127.5).sub(0.5);\n const res = this.model.execute(normalizedImage);\n let batchOut;\n if (Array.isArray(res)) { // are we using tfhub or pinto converted model?\n const sorted = res.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n batchOut = concat.squeeze(0);\n } else {\n batchOut = tf.squeeze(res); // when using tfhub model\n }\n const boxesOut = decodeBounds(batchOut, this.anchors, [this.inputSize, this.inputSize]);\n const logits = tf.slice(batchOut, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze().dataSync();\n return [batchOut, boxesOut, scoresOut];\n });\n const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);\n const nms = nmsTensor.arraySync();\n nmsTensor.dispose();\n const annotatedBoxes: Array<{ box: { startPoint: Tensor, endPoint: Tensor }, landmarks: Tensor, anchor: number[], confidence: number }> = [];\n for (let i = 0; i < nms.length; i++) {\n const confidence = scores[nms[i]];\n if (confidence > this.config.face.detector.minConfidence) {\n const boundingBox = tf.slice(boxes, [nms[i], 0], [1, -1]);\n const localBox = box.createBox(boundingBox);\n boundingBox.dispose();\n const anchor = this.anchorsData[nms[i]];\n const landmarks = tf.tidy(() => tf.slice(batch, [nms[i], keypointsCount - 1], [1, -1]).squeeze().reshape([keypointsCount, -1]));\n annotatedBoxes.push({ box: localBox, landmarks, anchor, confidence });\n }\n }\n // boundingBoxes.forEach((t) => t.dispose());\n batch.dispose();\n boxes.dispose();\n // scores.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.inputSize, inputImage.shape[1] / this.inputSize],\n };\n }\n}\n\nexport async function load(config: Config) {\n const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });\n const blazeFace = new BlazeFaceModel(model, config);\n if (!model || !model.modelUrl) log('load model failed:', config.face.detector.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n return blazeFace;\n}\n", "export const MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\n\nexport const MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n // { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n // { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n\nexport const UV468 = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n\nexport const TRI468 = [\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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, 130, 33, 71, 21, 162,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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, 116, 73, 41, 72, 36, 203,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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];\n\nexport const TRI68 = [0, 1, 36, 0, 36, 17, 1, 2, 41, 1, 41, 36, 2, 3, 31, 2, 31, 41, 3, 4, 48, 3, 48, 31, 4, 5, 48, 5, 6, 48, 6, 7, 59, 6, 59, 48, 7, 8, 58, 7, 58, 59,\n 8, 9, 56, 8, 56, 57, 8, 57, 58, 9, 10, 55, 9, 55, 56, 10, 11, 54, 10, 54, 55, 11, 12, 54, 12, 13, 54, 13, 14, 35, 13, 35, 54, 14, 15, 46, 14, 46, 35, 15, 16,\n 45, 15, 45, 46, 16, 26, 45, 17, 36, 18, 18, 37, 19, 18, 36, 37, 19, 38, 20, 19, 37, 38, 20, 39, 21, 20, 38, 39, 21, 39, 27, 22, 42, 23, 22, 27, 42, 23, 43, 24,\n 23, 42, 43, 24, 44, 25, 24, 43, 44, 25, 45, 26, 25, 44, 45, 27, 39, 28, 27, 28, 42, 28, 39, 29, 28, 29, 42, 29, 31, 30, 29, 30, 35, 29, 40, 31, 29, 35, 47, 29,\n 39, 40, 29, 47, 42, 30, 31, 32, 30, 32, 33, 30, 33, 34, 30, 34, 35, 31, 50, 32, 31, 40, 41, 31, 48, 49, 31, 49, 50, 32, 51, 33, 32, 50, 51, 33, 51, 34, 34, 52,\n 35, 34, 51, 52, 35, 46, 47, 35, 52, 53, 35, 53, 54, 36, 41, 37, 37, 40, 38, 37, 41, 40, 38, 40, 39, 42, 47, 43, 43, 47, 44, 44, 46, 45, 44, 47, 46, 48, 60, 49,\n 48, 59, 60, 49, 61, 50, 49, 60, 61, 50, 62, 51, 50, 61, 62, 51, 62, 52, 52, 63, 53, 52, 62, 63, 53, 64, 54, 53, 63, 64, 54, 64, 55, 55, 65, 56, 55, 64, 65, 56,\n 66, 57, 56, 65, 66, 57, 66, 58, 58, 67, 59, 58, 66, 67, 59, 67, 60, 60, 67, 61, 61, 66, 62, 61, 67, 66, 62, 66, 63, 63, 65, 64, 63, 66, 65, 21, 27, 22];\n\nexport const TRI33 = [\n /* eyes */ 0, 8, 7, 7, 8, 1, 2, 10, 9, 9, 10, 3,\n /* brows */ 17, 0, 18, 18, 0, 7, 18, 7, 19, 19, 7, 1, 19, 1, 11, 19, 11, 20, 21, 3, 22, 21, 9, 3, 20, 9, 21, 20, 2, 9, 20, 11, 2,\n /* 4head */ 23, 17, 18, 25, 21, 22, 24, 19, 20, 24, 18, 19, 24, 20, 21, 24, 23, 18, 24, 21, 25,\n /* nose */ 11, 12, 4, 11, 4, 13, 1, 12, 11, 11, 13, 2, 12, 14, 4, 4, 14, 13,\n /* up-lip */ 14, 5, 15, 14, 15, 6, 12, 5, 14, 14, 6, 13,\n /* cheeks */ 8, 12, 1, 2, 13, 10, 8, 26, 12, 10, 13, 27, 26, 5, 12, 13, 6, 27, 0, 26, 8, 10, 27, 3,\n /* chin */ 5, 32, 16, 16, 32, 6, 5, 30, 32, 6, 32, 31,\n /* cont */ 26, 30, 5, 27, 6, 31, 0, 28, 26, 3, 27, 29, 17, 28, 0, 3, 29, 22, 23, 28, 17, 22, 29, 25, 28, 30, 26, 27, 31, 29,\n];\n\nexport const TRI7 = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68 = [\n /* cont */ 127, 234, 132, 58, 172, 150, 149, 148, 152, 377, 378, 379, 397, 288, 361, 454, 356,\n /* brows */ 70, 63, 105, 66, 107, 336, 296, 334, 293, 300,\n /* nose */ 168, 6, 195, 4, 98, 97, 2, 326, 327,\n /* eyes */ 33, 160, 158, 133, 153, 144, 362, 385, 387, 263, 373, 380,\n /* lip */ 57, 40, 37, 0, 267, 270, 287, 321, 314, 17, 84, 91,\n /* mouth */ 78, 81, 13, 311, 308, 402, 14, 178,\n];\n\nexport const VTX33 = [33, 133, 362, 263, 1, 62, 308, 159, 145, 386, 374, 6, 102, 331, 2, 13, 14, 70, 105, 107, 336, 334, 300, 54, 10, 284, 50, 280, 234, 454, 58, 288, 152];\n\nexport const VTX7 = [33, 133, 362, 263, 1, 78, 308];\n\nexport const UV68 = VTX68.map((x) => UV468[x]);\n\nexport const UV33 = VTX33.map((x) => UV468[x]);\n\nexport const UV7 = VTX7.map((x) => UV468[x]);\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as bounding from './box';\nimport * as util from './util';\nimport * as coords from './coords';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { BlazeFaceModel } from './blazeface';\n\nconst leftOutline = coords.MESH_ANNOTATIONS['leftEyeLower0'];\nconst rightOutline = coords.MESH_ANNOTATIONS['rightEyeLower0'];\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst meshLandmarks = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, coords.MESH_ANNOTATIONS['midwayBetweenEyes'][0]],\n};\n\nconst blazeFaceLandmarks = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates\n// Update the z coordinate to be an average of the original and the new.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = coords.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = coords.MESH_ANNOTATIONS[`${prefix}${key}`];\n if (!keys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nexport class Pipeline {\n storedBoxes: Array<{ startPoint: number[], endPoint: number[], landmarks: Array, confidence: number, faceConfidence?: number }>;\n boundingBoxDetector: BlazeFaceModel; // tf.GraphModel\n meshDetector: GraphModel; // tf.GraphModel\n irisModel: GraphModel; // tf.GraphModel\n boxSize: number;\n meshSize: number;\n irisSize: number;\n irisEnlarge: number;\n skipped: number;\n detectedFaces: number;\n\n constructor(boundingBoxDetector, meshDetector, irisModel) {\n // An array of facial bounding boxes.\n this.storedBoxes = [];\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.boxSize = boundingBoxDetector?.model?.inputs[0].shape[2] || 0;\n this.meshSize = meshDetector?.inputs[0].shape[2] || boundingBoxDetector?.model?.inputs[0].shape[2];\n this.irisSize = irisModel?.inputs[0].shape[1] || 0;\n this.irisEnlarge = 2.3;\n this.skipped = 0;\n this.detectedFaces = 0;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const coordsScaled = rawCoords.map((coord) => ([\n boxSize[0] / this.meshSize * (coord[0] - this.meshSize / 2),\n boxSize[1] / this.meshSize * (coord[1] - this.meshSize / 2),\n coord[2],\n ]));\n const coordsRotationMatrix = (angle !== 0) ? util.buildRotationMatrix(angle, [0, 0]) : util.IDENTITY_MATRIX;\n const coordsRotated = (angle !== 0) ? coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = (angle !== 0) ? util.invertTransformMatrix(rotationMatrix) : util.IDENTITY_MATRIX;\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n return coordsRotated.map((coord) => ([\n Math.round(coord[0] + util.dot(boxCenter, inverseRotationMatrix[0])),\n Math.round(coord[1] + util.dot(boxCenter, inverseRotationMatrix[1])),\n Math.round(coord[2]),\n ]));\n }\n\n // eslint-disable-next-line class-methods-use-this\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[eyeLandmarks.leftBounds[0]][2];\n const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(bounding.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshSize,\n box.startPoint[0] / this.meshSize, box.endPoint[1] / this.meshSize,\n box.endPoint[0] / this.meshSize,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip && tf.ENV.flags.IS_BROWSER) {\n crop = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords: Array<[number, number, number]> = [];\n for (let i = 0; i < irisLandmarks.numCoordinates; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip ? (1 - (x / this.irisSize)) : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(irisLandmarks.index) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n // eslint-disable-next-line class-methods-use-this\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeLower0`][irisLandmarks.lowerCenter]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n let useFreshBox = false;\n // run new detector every skipFrames unless we only want box to start with\n let detector;\n if ((this.skipped === 0) || (this.skipped > config.face.detector.skipFrames) || !config.face.mesh.enabled || !config.skipFrame) {\n detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n this.skipped = 0;\n }\n if (config.skipFrame) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (!config.skipFrame || (detector && detector.boxes && (!config.face.mesh.enabled || (detector.boxes.length !== this.detectedFaces) && (this.detectedFaces !== config.face.detector.maxDetected)))) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n for (const possible of detector.boxes) {\n this.storedBoxes.push({ startPoint: possible.box.startPoint.dataSync(), endPoint: possible.box.endPoint.dataSync(), landmarks: possible.landmarks.arraySync(), confidence: possible.confidence });\n }\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n\n if (useFreshBox) {\n if (!detector || !detector.boxes || (detector.boxes.length === 0)) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n return null;\n }\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const scaledBox = bounding.scaleBoxCoordinates({ startPoint: this.storedBoxes[i].startPoint, endPoint: this.storedBoxes[i].endPoint }, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const squarifiedBox = bounding.squarifyBox(enlargedBox);\n const landmarks = this.storedBoxes[i].landmarks;\n const confidence = this.storedBoxes[i].confidence;\n this.storedBoxes[i] = { ...squarifiedBox, confidence, landmarks };\n }\n }\n if (detector && detector.boxes) {\n detector.boxes.forEach((prediction) => {\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n });\n }\n const results = tf.tidy(() => this.storedBoxes.map((box, i) => {\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n let face;\n let angle = 0;\n let rotationMatrix;\n\n if (config.face.detector.rotation && config.face.mesh.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.boxSize, this.boxSize]).div(255);\n } else {\n rotationMatrix = util.IDENTITY_MATRIX;\n const clonedImage = input.clone();\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.boxSize, this.boxSize]).div(255);\n }\n\n // if we're not going to produce mesh, don't spend time with further processing\n if (!config.face.mesh.enabled) {\n const prediction = {\n mesh: [],\n box,\n faceConfidence: null,\n boxConfidence: box.confidence,\n confidence: box.confidence,\n image: face,\n };\n return prediction;\n }\n\n const [, confidence, contourCoords] = this.meshDetector.execute(face) as Array; // The first returned tensor represents facial contours which are already included in the coordinates.\n const faceConfidence = confidence.dataSync()[0] as number;\n if (faceConfidence < config.face.detector.minConfidence) {\n this.storedBoxes[i].confidence = faceConfidence; // reset confidence of cached box\n return null; // if below confidence just exit\n }\n const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n\n if (config.face.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1]);\n const eyePredictions = this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop])) as Tensor;\n const eyePredictionsData = eyePredictions.dataSync();\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', null);\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', null);\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged\n // So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n\n // override box from detection with one calculated from mesh\n const mesh = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n const storeConfidence = box.confidence;\n // @ts-ignore enlargeBox does not include confidence so we append it manually\n box = bounding.enlargeBox(bounding.calculateLandmarksBoundingBox(mesh), 1.5); // redefine box with mesh calculated one\n box.confidence = storeConfidence;\n\n // do rotation one more time with mesh keypoints if we want to return perfect image\n if (config.face.detector.rotation && config.face.mesh.enabled && config.face.description.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input.toFloat(), angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n }\n\n const prediction = {\n mesh,\n box,\n faceConfidence,\n boxConfidence: box.confidence,\n image: face,\n };\n\n // updated stored cache values\n this.storedBoxes[i] = { ...bounding.squarifyBox(box), confidence: box.confidence, faceConfidence };\n\n return prediction;\n }));\n\n // results = results.filter((a) => a !== null);\n // remove cache entries for detected boxes on low confidence\n if (config.face.mesh.enabled) this.storedBoxes = this.storedBoxes.filter((a) => a.confidence > config.face.detector.minConfidence);\n this.detectedFaces = results.length;\n\n return results;\n }\n}\n", "/**\n * FaceMesh & BlazeFace Module entry point\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as blazeface from './blazeface';\nimport * as facepipeline from './facepipeline';\nimport * as coords from './coords';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Face } from '../result';\nimport { Config } from '../config';\n\nlet faceModels: [blazeface.BlazeFaceModel | null, GraphModel | null, GraphModel | null] = [null, null, null];\nlet facePipeline;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const predictions = await facePipeline.predict(input, config);\n const results: Array = [];\n let id = 0;\n for (const prediction of (predictions || [])) {\n if (!prediction || prediction.isDisposedInternal) continue; // guard against disposed tensors on long running operations such as pause in middle of processing\n const meshRaw = prediction.mesh.map((pt) => [\n pt[0] / (input.shape[2] || 0),\n pt[1] / (input.shape[1] || 0),\n pt[2] / facePipeline.meshSize,\n ]);\n const annotations = {};\n if (prediction.mesh && prediction.mesh.length > 0) {\n for (const key of Object.keys(coords.MESH_ANNOTATIONS)) annotations[key] = coords.MESH_ANNOTATIONS[key].map((index) => prediction.mesh[index]);\n }\n const clampedBox: [number, number, number, number] = prediction.box ? [\n Math.trunc(Math.max(0, prediction.box.startPoint[0])),\n Math.trunc(Math.max(0, prediction.box.startPoint[1])),\n Math.trunc(Math.min((input.shape[2] || 0), prediction.box.endPoint[0]) - Math.max(0, prediction.box.startPoint[0])),\n Math.trunc(Math.min((input.shape[1] || 0), prediction.box.endPoint[1]) - Math.max(0, prediction.box.startPoint[1])),\n ] : [0, 0, 0, 0];\n const boxRaw: [number, number, number, number] = prediction.box ? [\n prediction.box.startPoint[0] / (input.shape[2] || 0),\n prediction.box.startPoint[1] / (input.shape[1] || 0),\n (prediction.box.endPoint[0] - prediction.box.startPoint[0]) / (input.shape[2] || 0),\n (prediction.box.endPoint[1] - prediction.box.startPoint[1]) / (input.shape[1] || 0),\n ] : [0, 0, 0, 0];\n results.push({\n id: id++,\n score: Math.round(100 * prediction.faceConfidence || 100 * prediction.boxConfidence || 0) / 100,\n boxScore: Math.round(100 * prediction.boxConfidence) / 100,\n faceScore: Math.round(100 * prediction.faceConfidence) / 100,\n box: clampedBox,\n boxRaw,\n mesh: prediction.mesh,\n meshRaw,\n annotations,\n image: prediction.image,\n tensor: prediction.image,\n });\n if (prediction.coords) prediction.coords.dispose();\n }\n return results;\n}\n\nexport async function load(config): Promise<[unknown, unknown, unknown]> {\n if ((!faceModels[0] && config.face.enabled) || (!faceModels[1] && config.face.mesh.enabled) || (!faceModels[2] && config.face.iris.enabled)) {\n // @ts-ignore type mismatch for GraphModel\n faceModels = await Promise.all([\n (!faceModels[0] && config.face.enabled) ? blazeface.load(config) : null,\n (!faceModels[1] && config.face.mesh.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.mesh.modelPath), { fromTFHub: config.face.mesh.modelPath.includes('tfhub.dev') }) : null,\n (!faceModels[2] && config.face.iris.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.iris.modelPath), { fromTFHub: config.face.iris.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.face.mesh.enabled) {\n if (!faceModels[1] || !faceModels[1]['modelUrl']) log('load model failed:', config.face.mesh.modelPath);\n else if (config.debug) log('load model:', faceModels[1]['modelUrl']);\n }\n if (config.face.iris.enabled) {\n if (!faceModels[2] || !faceModels[2]['modelUrl']) log('load model failed:', config.face.iris.modelPath);\n else if (config.debug) log('load model:', faceModels[2]['modelUrl']);\n }\n } else if (config.debug) {\n if (faceModels[0]) log('cached model:', faceModels[0].model['modelUrl']);\n if (faceModels[1]) log('cached model:', faceModels[1]['modelUrl']);\n if (faceModels[2]) log('cached model:', faceModels[2]['modelUrl']);\n }\n facePipeline = new facepipeline.Pipeline(faceModels[0], faceModels[1], faceModels[2]);\n return faceModels;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "/**\n * Emotion Module\n */\n\nimport { log, join } from '../helpers';\nimport { Config } from '../config';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nconst annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];\nlet model;\n// let last: Array<{ score: number, emotion: string }> = [];\nconst last: Array> = [];\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// tuning values\nconst rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale\n\nexport async function load(config: Config): Promise {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < config.face.emotion.skipFrames) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const normalize = tf.tidy(() => grayscale.sub(0.5).mul(2));\n grayscale.dispose();\n const obj: Array<{ score: number, emotion: string }> = [];\n if (config.face.emotion.enabled) {\n const emotionT = await model.predict(normalize); // result is already in range 0..1, no need for additional activation\n const data = emotionT.dataSync();\n tf.dispose(emotionT);\n for (let i = 0; i < data.length; i++) {\n if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n }\n normalize.dispose();\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * HSE-FaceRes Module\n * Returns Age, Gender, Descriptor\n * Implements Face simmilarity function\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\nconst last: Array<{\n age: number,\n gender: string,\n genderScore: number,\n descriptor: number[],\n}> = [];\n\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\ntype DB = Array<{ name: string, source: string, embedding: number[] }>;\n\nexport async function load(config: Config): Promise {\n const modelUrl = join(config.modelBasePath, config.face.description.modelPath);\n if (!model) {\n // @ts-ignore type mismatch for GraphModel\n model = await tf.loadGraphModel(modelUrl);\n if (!model) log('load model failed:', config.face.description.modelPath);\n else if (config.debug) log('load model:', modelUrl);\n } else if (config.debug) log('cached model:', modelUrl);\n return model;\n}\n\nexport function similarity(embedding1: Array, embedding2: Array, order = 2): number {\n if (!embedding1 || !embedding2) return 0;\n if (embedding1?.length === 0 || embedding2?.length === 0) return 0;\n if (embedding1?.length !== embedding2?.length) return 0;\n // general minkowski distance, euclidean distance is limited case where order is 2\n const distance = 5.0 * embedding1\n .map((val, i) => (Math.abs(embedding1[i] - embedding2[i]) ** order)) // distance squared\n .reduce((sum, now) => (sum + now), 0) // sum all distances\n ** (1 / order); // get root of\n const res = Math.max(0, 100 - distance) / 100.0;\n return res;\n}\n\nexport function match(embedding: Array, db: DB, threshold = 0) {\n let best = { similarity: 0, name: '', source: '', embedding: [] as number[] };\n if (!embedding || !db || !Array.isArray(embedding) || !Array.isArray(db)) return best;\n for (const f of db) {\n if (f.embedding && f.name) {\n const perc = similarity(embedding, f.embedding);\n if (perc > threshold && perc > best.similarity) best = { ...f, similarity: perc };\n }\n }\n return best;\n}\n\nexport function enhance(input): Tensor {\n const image = tf.tidy(() => {\n // input received from detector is already normalized to 0..1\n // input is also assumed to be straightened\n const tensor = input.image || input.tensor || input;\n if (!(tensor instanceof tf.Tensor)) return null;\n // do a tight crop of image and resize it to fit the model\n const box = [[0.05, 0.15, 0.85, 0.85]]; // empyrical values for top, left, bottom, right\n // const box = [[0.0, 0.0, 1.0, 1.0]]; // basically no crop for test\n if (!model.inputs[0].shape) return null; // model has no shape so no point continuing\n const crop = (tensor.shape.length === 3)\n ? tf.image.cropAndResize(tf.expandDims(tensor, 0), box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) // add batch dimension if missing\n : tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n\n /*\n // just resize to fit the embedding model instead of cropping\n const crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n */\n\n /*\n // convert to black&white to avoid colorization impact\n const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const [red, green, blue] = tf.split(crop, 3, 3);\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n const merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\n */\n\n /*\n // increase image pseudo-contrast 100%\n // (or do it per-channel so mean is done on each channel)\n // (or calculate histogram and do it based on histogram)\n const mean = merge.mean();\n const factor = 2;\n const contrast = merge.sub(mean).mul(factor).add(mean);\n */\n\n /*\n // normalize brightness from 0..1\n // silly way of creating pseudo-hdr of image\n const darken = crop.sub(crop.min());\n const lighten = darken.div(darken.max());\n */\n\n const norm = crop.mul(255);\n\n return norm;\n });\n return image;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < config.face.description.skipFrames) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const enhanced = enhance(image);\n\n let resT;\n const obj = {\n age: 0,\n gender: 'unknown',\n genderScore: 0,\n descriptor: [],\n };\n\n if (config.face.description.enabled) resT = await model.predict(enhanced);\n tf.dispose(enhanced);\n\n if (resT) {\n tf.tidy(() => {\n const gender = resT.find((t) => t.shape[1] === 1).dataSync();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > config.face.description.minConfidence) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderScore = Math.min(0.99, confidence);\n }\n const age = resT.find((t) => t.shape[1] === 100).argMax(1).dataSync()[0];\n const all = resT.find((t) => t.shape[1] === 100).dataSync();\n obj.age = Math.round(all[age - 1] > all[age + 1] ? 10 * age - 100 * all[age - 1] : 10 * age + 100 * all[age + 1]) / 10;\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]); // reshape large 1024-element descriptor to 128 x 8\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it which leaves us with 128-element descriptor\n\n obj.descriptor = [...desc.dataSync()];\n });\n resT.forEach((t) => tf.dispose(t));\n }\n\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * Module that analyzes person age\n * Obsolete\n */\n\nimport { log, now } from './helpers';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as facemesh from './blazeface/facemesh';\nimport * as emotion from './emotion/emotion';\nimport * as faceres from './faceres/faceres';\nimport { Face } from './result';\nimport { Tensor } from './tfjs/types';\n\n// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nconst calculateGaze = (face): { bearing: number, strength: number } => {\n const radians = (pt1, pt2) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points\n if (!face.annotations['rightEyeIris'] || !face.annotations['leftEyeIris']) return { bearing: 0, strength: 0 };\n\n const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes\n const eyeRatio = 1; // factor to normalize changes x vs y\n\n const left = face.mesh[33][2] > face.mesh[263][2]; // pick left or right eye depending which one is closer bazed on outsize point z axis\n const irisCenter = left ? face.mesh[473] : face.mesh[468];\n const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise\n ? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]\n : [(face.mesh[263][0] + face.mesh[362][0]) / 2, (face.mesh[263][1] + face.mesh[362][1]) / 2];\n const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions\n ? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]\n : [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];\n\n const eyeDiff = [ // x distance between extreme point and center point normalized with eye size\n (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],\n eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],\n ];\n let strength = Math.sqrt((eyeDiff[0] ** 2) + (eyeDiff[1] ** 2)); // vector length is a diagonal between two differences\n strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision\n const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees\n\n return { bearing, strength };\n};\n\nconst calculateFaceAngle = (face, imageSize): {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n} => {\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v) => { // normalize vector\n const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] /= length;\n v[1] /= length;\n v[2] /= length;\n return v;\n };\n const subVectors = (a, b) => { // vector subtraction (a - b)\n const x = a[0] - b[0];\n const y = a[1] - b[1];\n const z = a[2] - b[2];\n return [x, y, z];\n };\n const crossVectors = (a, b) => { // vector cross product (a x b)\n const x = a[1] * b[2] - a[2] * b[1];\n const y = a[2] * b[0] - a[0] * b[2];\n const z = a[0] * b[1] - a[1] * b[0];\n return [x, y, z];\n };\n // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf\n const rotationMatrixToEulerAngle = (r) => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;\n let thetaX; let thetaY; let thetaZ;\n if (r10 < 1) { // YZX calculation\n if (r10 > -1) {\n thetaZ = Math.asin(r10);\n thetaY = Math.atan2(-r20, r00);\n thetaX = Math.atan2(-r12, r11);\n } else {\n thetaZ = -Math.PI / 2;\n thetaY = -Math.atan2(r21, r22);\n thetaX = 0;\n }\n } else {\n thetaZ = Math.PI / 2;\n thetaY = Math.atan2(r21, r22);\n thetaX = 0;\n }\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n // simple Euler angle calculation based existing 3D mesh\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const meshToEulerAngle = (mesh) => {\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const angle = {\n // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center\n // pitch is face move up/down\n pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face\n // yaw is face turn left/right\n yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye\n // roll is face lean left/right\n roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye\n };\n return angle;\n };\n\n // initialize gaze and mesh\n const mesh = face.meshRaw;\n if (!mesh || mesh.length < 300) return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };\n\n const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;\n // top, bottom, left, right\n const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [\n // make the xyz coordinates proportional, independent of the image/box size\n pt[0] * imageSize[0] / size,\n pt[1] * imageSize[1] / size,\n pt[2],\n ]);\n\n const y_axis = normalize(subVectors(pts[1], pts[0]));\n let x_axis = normalize(subVectors(pts[3], pts[2]));\n const z_axis = normalize(crossVectors(x_axis, y_axis));\n // adjust x_axis to make sure that all axes are perpendicular to each other\n x_axis = crossVectors(y_axis, z_axis);\n\n // Rotation Matrix from Axis Vectors - http://renderdan.blogspot.com/2006/05/rotation-matrix-from-axis-vectors.html\n // 3x3 rotation matrix is flatten to array in row-major order. Note that the rotation represented by this matrix is inverted.\n const matrix: [number, number, number, number, number, number, number, number, number] = [\n x_axis[0], x_axis[1], x_axis[2],\n y_axis[0], y_axis[1], y_axis[2],\n z_axis[0], z_axis[1], z_axis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n\n // we have iris keypoints so we can calculate gaze direction\n const gaze = mesh.length === 478 ? calculateGaze(face) : { bearing: 0, strength: 0 };\n\n return { angle, matrix, gaze };\n};\n\nexport const detectFace = async (parent /* instance of human */, input: Tensor): Promise => {\n // run facemesh, includes blazeface and iris\n // eslint-disable-next-line no-async-promise-executor\n let timeStamp;\n let ageRes;\n let genderRes;\n let emotionRes;\n let embeddingRes;\n let descRes;\n const faceRes: Array = [];\n parent.state = 'run:face';\n timeStamp = now();\n const faces = await facemesh.predict(input, parent.config);\n parent.performance.face = Math.trunc(now() - timeStamp);\n if (!input.shape || input.shape.length !== 4) return [];\n if (!faces) return [];\n // for (const face of faces) {\n for (let i = 0; i < faces.length; i++) {\n parent.analyze('Get Face');\n\n // is something went wrong, skip the face\n // @ts-ignore possibly undefined\n if (!faces[i].image || faces[i].image['isDisposedInternal']) {\n log('Face object is disposed:', faces[i].image);\n continue;\n }\n\n const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Emotion:');\n if (parent.config.async) {\n emotionRes = parent.config.face.emotion.enabled ? emotion.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : {};\n } else {\n parent.state = 'run:emotion';\n timeStamp = now();\n emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : {};\n parent.performance.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Emotion:');\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Description:');\n if (parent.config.async) {\n descRes = parent.config.face.description.enabled ? faceres.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : [];\n } else {\n parent.state = 'run:description';\n timeStamp = now();\n descRes = parent.config.face.description.enabled ? await faceres.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : [];\n parent.performance.embedding = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Description:');\n\n // if async wait for results\n if (parent.config.async) {\n [ageRes, genderRes, emotionRes, embeddingRes, descRes] = await Promise.all([ageRes, genderRes, emotionRes, embeddingRes, descRes]);\n }\n\n parent.analyze('Finish Face:');\n\n // calculate iris distance\n // iris: array[ center, left, top, right, bottom]\n if (!parent.config.face.iris.enabled && faces[i]?.annotations?.leftEyeIris && faces[i]?.annotations?.rightEyeIris) {\n delete faces[i].annotations.leftEyeIris;\n delete faces[i].annotations.rightEyeIris;\n }\n const irisSize = (faces[i].annotations?.leftEyeIris && faces[i].annotations?.rightEyeIris)\n /* note: average human iris size is 11.7mm */\n ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2]\n : 0;\n\n // combine results\n faceRes.push({\n ...faces[i],\n id: i,\n age: descRes.age,\n gender: descRes.gender,\n genderScore: descRes.genderScore,\n embedding: descRes.descriptor,\n emotion: emotionRes,\n iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,\n rotation,\n tensor: parent.config.face.detector.return ? tf.squeeze(faces[i].image) : null,\n });\n // dispose original face tensor\n tf.dispose(faces[i].image);\n // delete temp face image\n if (faces[i].image) delete faces[i].image;\n\n parent.analyze('End Face');\n }\n parent.analyze('End FaceMesh:');\n if (parent.config.async) {\n if (parent.performance.face) delete parent.performance.face;\n if (parent.performance.age) delete parent.performance.age;\n if (parent.performance.gender) delete parent.performance.gender;\n if (parent.performance.emotion) delete parent.performance.emotion;\n }\n return faceRes;\n};\n", "export const partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\n\nexport const count = partNames.length; // 17 keypoints\n\nexport const partIds = partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\n\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\nexport const connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));\n\nexport const poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\n", "import * as kpt from './keypoints';\nimport { Body } from '../result';\n\nexport function eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\n\nexport function getBoundingBox(keypoints): [number, number, number, number] {\n const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n });\n return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];\n}\n\nexport function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]): Array {\n const scaleY = height / inputResolutionHeight;\n const scaleX = width / inputResolutionWidth;\n const scalePose = (pose, i) => ({\n id: i,\n score: pose.score,\n boxRaw: [pose.box[0] / inputResolutionWidth, pose.box[1] / inputResolutionHeight, pose.box[2] / inputResolutionWidth, pose.box[3] / inputResolutionHeight],\n box: [Math.trunc(pose.box[0] * scaleX), Math.trunc(pose.box[1] * scaleY), Math.trunc(pose.box[2] * scaleX), Math.trunc(pose.box[3] * scaleY)],\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: [Math.trunc(position.x * scaleX), Math.trunc(position.y * scaleY)],\n positionRaw: [position.x / inputResolutionHeight, position.y / inputResolutionHeight],\n })),\n });\n const scaledPoses = poses.map((pose, i) => scalePose(pose, i));\n return scaledPoses;\n}\n\n// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nexport class MaxHeap {\n priorityQueue: Array; // don't touch\n numberOfElements: number;\n getElementValue: unknown; // function call\n\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() { return this.numberOfElements === -1; }\n\n size() { return this.numberOfElements + 1; }\n\n all() { return this.priorityQueue.slice(0, this.numberOfElements + 1); }\n\n max() { return this.priorityQueue[0]; }\n\n swim(k) {\n while (k > 0 && this.less(Math.floor(k / 2), k)) {\n this.exchange(k, Math.floor(k / 2));\n k = Math.floor(k / 2);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n // @ts-ignore getter is of unknown type\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\n\nexport function getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.count),\n };\n}\n\nexport function getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\n\nexport function fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\n\nexport function clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\n\nexport function squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\n\nexport function addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\nexport function clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\n", "import * as utils from './utils';\nimport * as kpt from './keypoints';\n\nconst localMaximumRadius = 1;\nconst outputStride = 16;\nconst squaredNmsRadius = 50 ** 2;\n\nfunction traverse(edgeId, sourceKeypoint, targetId, scores, offsets, displacements, offsetRefineStep = 2) {\n const getDisplacement = (point) => ({\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, (displacements.shape[2] / 2) + edgeId),\n });\n const getStridedIndexNearPoint = (point, height, width) => ({\n y: utils.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: utils.clamp(Math.round(point.x / outputStride), 0, width - 1),\n });\n\n const [height, width] = scores.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, height, width);\n const displacement = getDisplacement(sourceKeypointIndices);\n const displacedPoint = utils.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const offsetPoint = utils.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetId, offsets);\n targetKeypoint = utils.addVectors(\n { x: targetKeypointIndices.x * outputStride, y: targetKeypointIndices.y * outputStride },\n { x: offsetPoint.x, y: offsetPoint.y },\n );\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scores.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetId);\n return { position: targetKeypoint, part: kpt.partNames[targetId], score };\n}\n\nexport function decodePose(root, scores, offsets, displacementsFwd, displacementsBwd) {\n const tuples = kpt.poseChain.map(([parentJoinName, childJoinName]) => ([kpt.partIds[parentJoinName], kpt.partIds[childJoinName]]));\n const edgesFwd = tuples.map(([, childJointId]) => childJointId);\n const edgesBwd = tuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2]; // [21,21,17]\n const numEdges = edgesFwd.length;\n const keypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const rootPoint = utils.getImageCoords(root.part, outputStride, offsets);\n keypoints[root.part.id] = {\n score: root.score,\n part: kpt.partNames[root.part.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceId = edgesFwd[edge];\n const targetId = edgesBwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceId = edgesBwd[edge];\n const targetId = edgesFwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsFwd);\n }\n }\n return keypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) break;\n }\n return localMaximum;\n}\n\nexport function buildPartWithScoreQueue(minConfidence, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new utils.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < minConfidence) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores)) queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n return queue;\n}\n\nfunction withinRadius(poses, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId]?.position;\n if (!correspondingKeypoint) return false;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, keypoints) {\n const notOverlappedKeypointScores = keypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / keypoints.length;\n}\n\nexport function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected, minConfidence) {\n const poses: Array<{ keypoints, box: [number, number, number, number], score: number }> = [];\n const queue = buildPartWithScoreQueue(minConfidence, scores);\n // Generate at most maxDetected object instances per image in decreasing root part score order.\n while (poses.length < maxDetected && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it is within a disk of `nmsRadius` pixels from the corresponding part of a previously detected instance.\n // @ts-ignore this one is tree walk\n const rootImageCoords = utils.getImageCoords(root.part, outputStride, offsets);\n // @ts-ignore this one is tree walk\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n let keypoints = decodePose(root, scores, offsets, displacementsFwd, displacementsBwd);\n keypoints = keypoints.filter((a) => a.score > minConfidence);\n const score = getInstanceScore(poses, keypoints);\n const box = utils.getBoundingBox(keypoints);\n if (score > minConfidence) poses.push({ keypoints, box, score: Math.round(100 * score) / 100 });\n }\n return poses;\n}\n", "/**\n * PoseNet module entry point\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as poses from './poses';\nimport * as util from './utils';\nimport { Body } from '../result';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const res = tf.tidy(() => {\n if (!model.inputs[0].shape) return [];\n const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = resized.toFloat().div(127.5).sub(1.0);\n const results: Array = model.execute(normalized, poseNetOutputs) as Array;\n const results3d = results.map((y) => tf.squeeze(y, [0]));\n results3d[1] = results3d[1].sigmoid(); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor) => tensor.buffer()));\n for (const t of res) t.dispose();\n\n const decoded = await poses.decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n if (!model.inputs[0].shape) return [];\n const scaled = util.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) as Body[];\n return scaled;\n}\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch for GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks, confidence: box.confidence };\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0],\n box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n", "export const anchors = [\n { x: 0.015625, y: 0.015625 },\n { x: 0.015625, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n];\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as anchors from './anchors';\nimport { Tensor, GraphModel } from '../tfjs/types';\n\nexport class HandDetector {\n model: GraphModel;\n anchors: number[][];\n anchorsTensor: Tensor;\n inputSize: number;\n inputSizeTensor: Tensor;\n doubleInputSizeTensor: Tensor;\n\n constructor(model) {\n this.model = model;\n this.anchors = anchors.anchors.map((anchor) => [anchor.x, anchor.y]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n // @ts-ignore model is not undefined here\n this.inputSize = this.model?.inputs[0].shape[2];\n this.inputSizeTensor = tf.tensor1d([this.inputSize, this.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([this.inputSize * 2, this.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoxes(input, config) {\n const batched = this.model.predict(input) as Tensor;\n const predictions = tf.squeeze(batched);\n batched.dispose();\n const scoresT = tf.tidy(() => tf.sigmoid(tf.slice(predictions, [0, 0], [-1, 1])).squeeze());\n const scores = scoresT.dataSync();\n const rawBoxes = tf.slice(predictions, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n rawBoxes.dispose();\n const filteredT = await tf.image.nonMaxSuppressionAsync(boxes, scores, config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const filtered = filteredT.arraySync();\n\n scoresT.dispose();\n filteredT.dispose();\n const hands: Array<{ box: Tensor, palmLandmarks: Tensor, confidence: number }> = [];\n for (const index of filtered) {\n if (scores[index] >= config.hand.minConfidence) {\n const matchingBox = tf.slice(boxes, [index, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(predictions, [index, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, index).reshape([-1, 2]));\n rawPalmLandmarks.dispose();\n hands.push({ box: matchingBox, palmLandmarks, confidence: scores[index] });\n }\n }\n predictions.dispose();\n boxes.dispose();\n return hands;\n }\n\n async estimateHandBounds(input, config): Promise<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }[]> {\n const inputHeight = input.shape[1];\n const inputWidth = input.shape[2];\n const image = tf.tidy(() => input.resizeBilinear([this.inputSize, this.inputSize]).div(127.5).sub(1));\n const predictions = await this.getBoxes(image, config);\n image.dispose();\n const hands: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }> = [];\n if (!predictions || predictions.length === 0) return hands;\n for (const prediction of predictions) {\n const boxes = prediction.box.dataSync();\n const startPoint = boxes.slice(0, 2);\n const endPoint = boxes.slice(2, 4);\n const palmLandmarks = prediction.palmLandmarks.arraySync();\n prediction.box.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(box.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks, confidence: prediction.confidence }, [inputWidth / this.inputSize, inputHeight / this.inputSize]));\n }\n return hands;\n }\n}\n", "export function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\nimport * as detector from './handdetector';\nimport { Tensor, GraphModel } from '../tfjs/types';\n\nconst palmBoxEnlargeFactor = 5; // default 3\nconst handBoxEnlargeFactor = 1.65; // default 1.65\nconst palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];\nconst palmLandmarksPalmBase = 0;\nconst palmLandmarksMiddleFingerBase = 2;\n\nexport class HandPipeline {\n handDetector: detector.HandDetector;\n handPoseModel: GraphModel;\n inputSize: number;\n storedBoxes: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number } | null>;\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, handPoseModel) {\n this.handDetector = handDetector;\n this.handPoseModel = handPoseModel;\n // @ts-ignore model is not undefined here\n this.inputSize = this.handPoseModel?.inputs[0].shape[2];\n this.storedBoxes = [];\n this.skipped = 0;\n this.detectedHands = 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n return box.enlargeBox(box.squarifyBox(boxAroundPalm), palmBoxEnlargeFactor);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = box.enlargeBox(box.squarifyBox(boundingBox), handBoxEnlargeFactor);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < palmLandmarkIds.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[palmLandmarkIds[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = box.getBoxSize(box2);\n const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.inputSize / 2),\n scaleFactor[1] * (coord[1] - this.inputSize / 2),\n scaleFactor[2] * coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...box.getBoxCenter(box2), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n Math.trunc(coord[0] + originalBoxCenter[0]),\n Math.trunc(coord[1] + originalBoxCenter[1]),\n Math.trunc(coord[2]),\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames unless we only want box to start with\n let boxes;\n\n // console.log(this.skipped, config.hand.skipFrames, !config.hand.landmarks, !config.skipFrame);\n if ((this.skipped === 0) || (this.skipped > config.hand.skipFrames) || !config.hand.landmarks || !config.skipFrame) {\n boxes = await this.handDetector.estimateHandBounds(image, config);\n this.skipped = 0;\n }\n if (config.skipFrame) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (boxes && (boxes.length > 0) && ((boxes.length !== this.detectedHands) && (this.detectedHands !== config.hand.maxDetected) || !config.hand.landmarks)) {\n this.detectedHands = 0;\n this.storedBoxes = [...boxes];\n // for (const possible of boxes) this.storedBoxes.push(possible);\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n const hands: Array<{ landmarks?: number[], confidence: number, box: { topLeft: number[], bottomRight: number[] } }> = [];\n\n // go through working set of boxes\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const currentBox = this.storedBoxes[i];\n if (!currentBox) continue;\n if (config.hand.landmarks) {\n const angle = config.hand.rotation ? util.computeRotation(currentBox.palmLandmarks[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0;\n const palmCenter = box.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation && tf.ENV.flags.IS_BROWSER ? tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone();\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = box.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const [confidenceT, keypoints] = await this.handPoseModel.predict(handImage) as Array;\n handImage.dispose();\n const confidence = confidenceT.dataSync()[0];\n confidenceT.dispose();\n if (confidence >= config.hand.minConfidence) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = keypointsReshaped.arraySync();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = { ...nextBoundingBox, confidence };\n const result = {\n landmarks: coords,\n confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n this.storedBoxes[i] = null;\n }\n keypoints.dispose();\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), handBoxEnlargeFactor);\n const enlarged = box.enlargeBox(box.squarifyBox(currentBox), handBoxEnlargeFactor);\n const result = {\n confidence: currentBox.confidence,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n return hands;\n }\n}\n", "/**\n * HandPose module entry point\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as handdetector from './handdetector';\nimport * as handpipeline from './handpipeline';\nimport { Hand } from '../result';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Config } from '../config';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n\nlet handDetectorModel: GraphModel | null;\nlet handPoseModel: GraphModel | null;\nlet handPipeline: handpipeline.HandPipeline;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: Array = [];\n for (let i = 0; i < predictions.length; i++) {\n const annotations = {};\n if (predictions[i].landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n // @ts-ignore landmarks are not undefined\n annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);\n }\n }\n\n const keypoints = predictions[i].landmarks as unknown as Array<[number, number, number]>;\n\n let box: [number, number, number, number] = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work\n let boxRaw: [number, number, number, number] = [0, 0, 0, 0];\n if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks\n for (const pt of keypoints) {\n if (pt[0] < box[0]) box[0] = pt[0];\n if (pt[1] < box[1]) box[1] = pt[1];\n if (pt[0] > box[2]) box[2] = pt[0];\n if (pt[1] > box[3]) box[3] = pt[1];\n }\n box[2] -= box[0];\n box[3] -= box[1];\n boxRaw = [box[0] / (input.shape[2] || 0), box[1] / (input.shape[1] || 0), box[2] / (input.shape[2] || 0), box[3] / (input.shape[1] || 0)];\n } else { // otherwise use box from prediction\n box = predictions[i].box ? [\n Math.trunc(Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.max(0, predictions[i].box.topLeft[1])),\n Math.trunc(Math.min((input.shape[2] || 0), predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.min((input.shape[1] || 0), predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])),\n ] : [0, 0, 0, 0];\n boxRaw = [\n (predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n ];\n }\n hands.push({ id: i, score: Math.round(100 * predictions[i].confidence) / 100, box, boxRaw, keypoints, annotations });\n }\n return hands;\n}\n\nexport async function load(config: Config): Promise<[unknown, unknown]> {\n if (!handDetectorModel || !handPoseModel) {\n // @ts-ignore type mismatch on GraphModel\n [handDetectorModel, handPoseModel] = await Promise.all([\n config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) : null,\n config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.hand.enabled) {\n if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector.modelPath);\n else if (config.debug) log('load model:', handDetectorModel['modelUrl']);\n if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton.modelPath);\n else if (config.debug) log('load model:', handPoseModel['modelUrl']);\n }\n } else {\n if (config.debug) log('cached model:', handDetectorModel['modelUrl']);\n if (config.debug) log('cached model:', handPoseModel['modelUrl']);\n }\n const handDetector = new handdetector.HandDetector(handDetectorModel);\n handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n return [handDetectorModel, handPoseModel];\n}\n", "export const full = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftPalm',\n 'rightPalm',\n 'leftIndex',\n 'rightIndex',\n 'leftPinky',\n 'rightPinky',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n 'leftHeel',\n 'rightHeel',\n 'leftFoot',\n 'rightFoot',\n 'midHip',\n 'forehead',\n 'leftThumb',\n 'leftHand',\n 'rightThumb',\n 'rightHand',\n];\n\nexport const upper = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'left:15',\n 'right:16',\n 'left:17',\n 'right:18',\n 'left:19',\n 'right:20',\n 'left:21',\n 'right:22',\n 'leftChest',\n 'rightChest',\n 'neck',\n 'forehead',\n 'left:27',\n 'right:28',\n 'left:29',\n 'right:30',\n];\n", "/**\n * BlazePose Module\n */\n\n// paper: https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as annotations from './annotations';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Body } from '../result';\nimport { Config } from '../config';\n\nlet model: GraphModel;\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch for Graphmodel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n model['width'] = parseInt(model['signature'].inputs['input_1:0'].tensorShape.dim[2].size);\n model['height'] = parseInt(model['signature'].inputs['input_1:0'].tensorShape.dim[1].size);\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if (!model) return [];\n if (!config.body.enabled) return [];\n const imgSize = { width: (image.shape[2] || 0), height: (image.shape[1] || 0) };\n const resize = tf.image.resizeBilinear(image, [model['width'], model['height']], false);\n const normalize = tf.div(resize, [255.0]);\n resize.dispose();\n const resT = await model.predict(normalize) as Array;\n const points = resT.find((t) => (t.size === 195 || t.size === 155))?.dataSync() || []; // order of output tensors may change between models, full has 195 and upper has 155 items\n resT.forEach((t) => t.dispose());\n normalize.dispose();\n const keypoints: Array<{ id, part, position: [number, number, number], positionRaw: [number, number, number], score, presence }> = [];\n const labels = points?.length === 195 ? annotations.full : annotations.upper; // full model has 39 keypoints, upper has 31 keypoints\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n keypoints.push({\n id: i,\n part: labels[i],\n position: [\n Math.trunc(imgSize.width * points[depth * i + 0] / 255), // return normalized x value istead of 0..255\n Math.trunc(imgSize.height * points[depth * i + 1] / 255), // return normalized y value istead of 0..255\n Math.trunc(points[depth * i + 2]) + 0, // fix negative zero\n ],\n positionRaw: [\n points[depth * i + 0] / 255, // return x value normalized to 0..1\n points[depth * i + 1] / 255, // return y value normalized to 0..1\n points[depth * i + 2] + 0, // fix negative zero\n ],\n score: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100, // reverse sigmoid value\n presence: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100, // reverse sigmoid value\n });\n }\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n const box: [number, number, number, number] = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...x),\n ];\n const boxRaw: [number, number, number, number] = [0, 0, 0, 0]; // not yet implemented\n const score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n return [{ id: 0, score, box, boxRaw, keypoints }];\n}\n", "/**\n * EfficientPose Module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { Body } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\n\ntype Keypoints = { score: number, part: string, position: [number, number], positionRaw: [number, number] };\n\nconst keypoints: Array = [];\nlet box: [number, number, number, number] = [0, 0, 0, 0];\nlet boxRaw: [number, number, number, number] = [0, 0, 0, 0];\nlet score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst bodyParts = ['head', 'neck', 'rightShoulder', 'rightElbow', 'rightWrist', 'chest', 'leftShoulder', 'leftElbow', 'leftWrist', 'pelvis', 'rightHip', 'rightKnee', 'rightAnkle', 'leftHip', 'leftKnee', 'leftAnkle'];\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch on GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// performs argmax and max functions on a 2d tensor\nfunction max2d(inputs, minScore) {\n const [width, height] = inputs.shape;\n return tf.tidy(() => {\n // modulus op implemented in tf\n const mod = (a, b) => tf.sub(a, tf.mul(tf.div(a, tf.scalar(b, 'int32')), tf.scalar(b, 'int32')));\n // combine all data\n const reshaped = tf.reshape(inputs, [height * width]);\n // get highest score\n const newScore = tf.max(reshaped, 0).dataSync()[0];\n if (newScore > minScore) {\n // skip coordinate calculation is score is too low\n const coords = tf.argMax(reshaped, 0);\n const x = mod(coords, width).dataSync()[0];\n const y = tf.div(coords, tf.scalar(width, 'int32')).dataSync()[0];\n return [x, y, newScore];\n }\n return [0, 0, newScore];\n });\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {\n skipped++;\n return [{ id: 0, score, box, boxRaw, keypoints }];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n if (!model.inputs[0].shape) return null;\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const enhance = tf.mul(resize, 2);\n const norm = enhance.sub(1);\n return norm;\n });\n\n let resT;\n if (config.body.enabled) resT = await model.predict(tensor);\n tensor.dispose();\n\n if (resT) {\n keypoints.length = 0;\n const squeeze = resT.squeeze();\n tf.dispose(resT);\n // body parts are basically just a stack of 2d tensors\n const stack = squeeze.unstack(2);\n tf.dispose(squeeze);\n // process each unstacked tensor as a separate body part\n for (let id = 0; id < stack.length; id++) {\n // actual processing to get coordinates and score\n const [x, y, partScore] = max2d(stack[id], config.body.minConfidence);\n if (score > config.body.minConfidence) {\n keypoints.push({\n score: Math.round(100 * partScore) / 100,\n part: bodyParts[id],\n positionRaw: [ // normalized to 0..1\n // @ts-ignore model is not undefined here\n x / model.inputs[0].shape[2], y / model.inputs[0].shape[1],\n ],\n position: [ // normalized to input image size\n // @ts-ignore model is not undefined here\n Math.round(image.shape[2] * x / model.inputs[0].shape[2]), Math.round(image.shape[1] * y / model.inputs[0].shape[1]),\n ],\n });\n }\n }\n stack.forEach((s) => tf.dispose(s));\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = keypoints.map((a) => a.positionRaw[0]);\n const yRaw = keypoints.map((a) => a.positionRaw[1]);\n boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n resolve([{ id: 0, score, box, boxRaw, keypoints }]);\n });\n}\n", "/**\n * EfficientPose Module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { Body } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\n\ntype Keypoints = { score: number, part: string, position: [number, number], positionRaw: [number, number] };\n\nconst keypoints: Array = [];\nlet box: [number, number, number, number] = [0, 0, 0, 0];\nlet boxRaw: [number, number, number, number] = [0, 0, 0, 0];\nlet score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst bodyParts = ['nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder', 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist', 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle'];\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch on GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {\n skipped++;\n return [{ id: 0, score, box, boxRaw, keypoints }];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n if (!model.inputs[0].shape) return null;\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const cast = tf.cast(resize, 'int32');\n return cast;\n });\n\n let resT;\n if (config.body.enabled) resT = await model.predict(tensor);\n tensor.dispose();\n\n if (resT) {\n keypoints.length = 0;\n const res = resT.arraySync();\n tf.dispose(resT);\n const kpt = res[0][0];\n for (let id = 0; id < kpt.length; id++) {\n score = kpt[id][2];\n if (score > config.body.minConfidence) {\n keypoints.push({\n score: Math.round(100 * score) / 100,\n part: bodyParts[id],\n positionRaw: [ // normalized to 0..1\n kpt[id][1],\n kpt[id][0],\n ],\n position: [ // normalized to input image size\n Math.round((image.shape[2] || 0) * kpt[id][1]),\n Math.round((image.shape[1] || 0) * kpt[id][0]),\n ],\n });\n }\n }\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = keypoints.map((a) => a.positionRaw[0]);\n const yRaw = keypoints.map((a) => a.positionRaw[1]);\n boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n resolve([{ id: 0, score, box, boxRaw, keypoints }]);\n });\n}\n", "/**\n * CoCo Labels used by object detection modules\n */\nexport const labels = [\n { class: 1, label: 'person' },\n { class: 2, label: 'bicycle' },\n { class: 3, label: 'car' },\n { class: 4, label: 'motorcycle' },\n { class: 5, label: 'airplane' },\n { class: 6, label: 'bus' },\n { class: 7, label: 'train' },\n { class: 8, label: 'truck' },\n { class: 9, label: 'boat' },\n { class: 10, label: 'traffic light' },\n { class: 11, label: 'fire hydrant' },\n { class: 12, label: 'stop sign' },\n { class: 13, label: 'parking meter' },\n { class: 14, label: 'bench' },\n { class: 15, label: 'bird' },\n { class: 16, label: 'cat' },\n { class: 17, label: 'dog' },\n { class: 18, label: 'horse' },\n { class: 19, label: 'sheep' },\n { class: 20, label: 'cow' },\n { class: 21, label: 'elephant' },\n { class: 22, label: 'bear' },\n { class: 23, label: 'zebra' },\n { class: 24, label: 'giraffe' },\n { class: 25, label: 'backpack' },\n { class: 26, label: 'umbrella' },\n { class: 27, label: 'handbag' },\n { class: 28, label: 'tie' },\n { class: 29, label: 'suitcase' },\n { class: 30, label: 'frisbee' },\n { class: 31, label: 'skis' },\n { class: 32, label: 'snowboard' },\n { class: 33, label: 'sports ball' },\n { class: 34, label: 'kite' },\n { class: 35, label: 'baseball bat' },\n { class: 36, label: 'baseball glove' },\n { class: 37, label: 'skateboard' },\n { class: 38, label: 'surfboard' },\n { class: 39, label: 'tennis racket' },\n { class: 40, label: 'bottle' },\n { class: 41, label: 'wine glass' },\n { class: 42, label: 'cup' },\n { class: 43, label: 'fork' },\n { class: 44, label: 'knife' },\n { class: 45, label: 'spoon' },\n { class: 46, label: 'bowl' },\n { class: 47, label: 'banana' },\n { class: 48, label: 'apple' },\n { class: 49, label: 'sandwich' },\n { class: 50, label: 'orange' },\n { class: 51, label: 'broccoli' },\n { class: 52, label: 'carrot' },\n { class: 53, label: 'hot dog' },\n { class: 54, label: 'pizza' },\n { class: 55, label: 'donut' },\n { class: 56, label: 'cake' },\n { class: 57, label: 'chair' },\n { class: 58, label: 'couch' },\n { class: 59, label: 'potted plant' },\n { class: 60, label: 'bed' },\n { class: 61, label: 'dining table' },\n { class: 62, label: 'toilet' },\n { class: 63, label: 'tv' },\n { class: 64, label: 'laptop' },\n { class: 65, label: 'mouse' },\n { class: 66, label: 'remote' },\n { class: 67, label: 'keyboard' },\n { class: 68, label: 'cell phone' },\n { class: 69, label: 'microwave' },\n { class: 70, label: 'oven' },\n { class: 71, label: 'toaster' },\n { class: 72, label: 'sink' },\n { class: 73, label: 'refrigerator' },\n { class: 74, label: 'book' },\n { class: 75, label: 'clock' },\n { class: 76, label: 'vase' },\n { class: 77, label: 'scissors' },\n { class: 78, label: 'teddy bear' },\n { class: 79, label: 'hair drier' },\n { class: 80, label: 'toothbrush' },\n];\n", "/**\n * NanoDet object detection module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport { Item } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model;\nlet last: Array = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config: Config): Promise {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res, inputSize, outputShape, config) {\n let id = 0;\n let results: Array = [];\n for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects\n // find scores, boxes, classes\n tf.tidy(() => { // wrap in tidy to automatically deallocate temp tensors\n const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();\n const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();\n const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdx = boxesMax.argMax(2).arraySync(); // what we need is indexes of features with highest scores, not values itself\n const scores = scoresT.arraySync(); // optionally use exponential scores or just as-is\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > config.object.minConfidence && j !== 61) {\n const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1\n const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1\n const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores\n const [x, y] = [\n cx - (scaleBox / strideSize * boxOffset[0]),\n cy - (scaleBox / strideSize * boxOffset[1]),\n ];\n const [w, h] = [\n cx + (scaleBox / strideSize * boxOffset[2]) - x,\n cy + (scaleBox / strideSize * boxOffset[3]) - y,\n ];\n let boxRaw = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))); // fix out-of-bounds coords\n const box = [ // results normalized to input image pixels\n boxRaw[0] * outputShape[0],\n boxRaw[1] * outputShape[1],\n boxRaw[2] * outputShape[0],\n boxRaw[3] * outputShape[1],\n ];\n const result = {\n id: id++,\n // strideSize,\n score: Math.round(100 * score) / 100,\n class: j + 1,\n label: labels[j].label,\n // center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n // centerRaw: [cx, cy],\n box: (box.map((a) => Math.trunc(a))) as [number, number, number, number],\n boxRaw: boxRaw as [number, number, number, number],\n };\n results.push(result);\n }\n }\n }\n });\n }\n // deallocate tensors\n res.forEach((t) => tf.dispose(t));\n\n // normally nms is run on raw results, but since boxes need to be calculated this way we skip calulcation of\n // unnecessary boxes and run nms only on good candidates (basically it just does IOU analysis as scores are already filtered)\n const nmsBoxes = results.map((a) => [a.boxRaw[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); // switches coordinates from x,y to y,x as expected by tf.nms\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: Array = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = nms.dataSync();\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((a, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2], image.shape[1]];\n const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);\n const norm = resize.div(255);\n const transpose = norm.transpose([0, 3, 1, 2]);\n norm.dispose();\n resize.dispose();\n\n let objectT;\n if (config.object.enabled) objectT = await model.predict(transpose);\n transpose.dispose();\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * CenterNet object detection module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport { Item } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model;\nlet last: Item[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res: Tensor, inputSize, outputShape, config: Config) {\n if (!res) return [];\n const results: Array = [];\n const detections = res.arraySync();\n const squeezeT = tf.squeeze(res);\n res.dispose();\n const arr = tf.split(squeezeT, 6, 1); // x1, y1, x2, y2, score, class\n squeezeT.dispose();\n const stackT = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x\n const boxesT = stackT.squeeze();\n const scoresT = arr[4].squeeze();\n const classesT = arr[5].squeeze();\n arr.forEach((t) => t.dispose());\n const nmsT = await tf.image.nonMaxSuppressionAsync(boxesT, scoresT, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n boxesT.dispose();\n scoresT.dispose();\n classesT.dispose();\n const nms = nmsT.dataSync();\n nmsT.dispose();\n let i = 0;\n for (const id of nms) {\n const score = Math.trunc(100 * detections[0][id][4]) / 100;\n const classVal = detections[0][id][5];\n const label = labels[classVal].label;\n const boxRaw = [\n detections[0][id][0] / inputSize,\n detections[0][id][1] / inputSize,\n detections[0][id][2] / inputSize,\n detections[0][id][3] / inputSize,\n ] as [number, number, number, number];\n const box = [\n Math.trunc(boxRaw[0] * outputShape[0]),\n Math.trunc(boxRaw[1] * outputShape[1]),\n Math.trunc(boxRaw[2] * outputShape[0]),\n Math.trunc(boxRaw[3] * outputShape[1]),\n ] as [number, number, number, number];\n results.push({ id: i++, score, class: classVal, label, box, boxRaw });\n }\n return results;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const outputSize = [input.shape[2], input.shape[1]];\n const resize = tf.image.resizeBilinear(input, [model.inputSize, model.inputSize]);\n const objectT = config.object.enabled ? model.execute(resize, ['tower_0/detections']) : null;\n resize.dispose();\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * Gesture detection module\n */\n\nimport { Gesture } from '../result';\n\nexport const body = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ body: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n // raising hands\n const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));\n const rightWrist = res[i].keypoints.find((a) => (a.part === 'rightWrist'));\n const nose = res[i].keypoints.find((a) => (a.part === 'nose'));\n if (nose && leftWrist && rightWrist && (leftWrist.position.y < nose.position.y) && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise right hand' });\n\n // leaning\n const leftShoulder = res[i].keypoints.find((a) => (a.part === 'leftShoulder'));\n const rightShoulder = res[i].keypoints.find((a) => (a.part === 'rightShoulder'));\n if (leftShoulder && rightShoulder) gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position.y > rightShoulder.position.y) ? 'left' : 'right'}` });\n }\n return gestures;\n};\n\nexport const face = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ face: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 0) {\n const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];\n if (Math.abs(eyeFacing) < 10) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${eyeFacing < 0 ? 'left' : 'right'}` });\n const openLeft = Math.abs(res[i].mesh[374][1] - res[i].mesh[386][1]) / Math.abs(res[i].mesh[443][1] - res[i].mesh[450][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openLeft < 0.2) gestures.push({ face: i, gesture: 'blink left eye' });\n const openRight = Math.abs(res[i].mesh[145][1] - res[i].mesh[159][1]) / Math.abs(res[i].mesh[223][1] - res[i].mesh[230][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openRight < 0.2) gestures.push({ face: i, gesture: 'blink right eye' });\n const mouthOpen = Math.min(100, 500 * Math.abs(res[i].mesh[13][1] - res[i].mesh[14][1]) / Math.abs(res[i].mesh[10][1] - res[i].mesh[152][1]));\n if (mouthOpen > 10) gestures.push({ face: i, gesture: `mouth ${Math.trunc(mouthOpen)}% open` });\n const chinDepth = res[i].mesh[152][2];\n if (Math.abs(chinDepth) > 10) gestures.push({ face: i, gesture: `head ${chinDepth < 0 ? 'up' : 'down'}` });\n }\n }\n return gestures;\n};\n\nexport const iris = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ iris: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.rightEyeIris) continue;\n const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];\n const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1];\n const areaLeft = Math.abs(sizeXLeft * sizeYLeft);\n\n const sizeXRight = res[i].annotations.rightEyeIris[3][0] - res[i].annotations.rightEyeIris[1][0];\n const sizeYRight = res[i].annotations.rightEyeIris[4][1] - res[i].annotations.rightEyeIris[2][1];\n const areaRight = Math.abs(sizeXRight * sizeYRight);\n\n let center = false;\n const difference = Math.abs(areaLeft - areaRight) / Math.max(areaLeft, areaRight);\n if (difference < 0.25) {\n center = true;\n gestures.push({ iris: i, gesture: 'facing center' });\n }\n\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].box[2];\n const leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].box[2];\n if (leftIrisCenterX > 0.06 || rightIrisCenterX > 0.06) center = false;\n if (leftIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking right' });\n if (rightIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking left' });\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].box[3];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].box[3];\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01 || leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) center = false;\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) gestures.push({ iris: i, gesture: 'looking up' });\n\n // still center;\n if (center) gestures.push({ iris: i, gesture: 'looking center' });\n }\n return gestures;\n};\n\nexport const hand = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ hand: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: Array<{ name: string, position: number }> = [];\n for (const [finger, pos] of Object.entries(res[i]['annotations'])) {\n if (finger !== 'palmBase' && Array.isArray(pos)) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });\n }\n }\n return gestures;\n};\n", "/*\nWebGLImageFilter by Dominic Szablewski: \n*/\n\nfunction GLProgram(gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n const _vsh = _compile(vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(fragmentSource, gl.FRAGMENT_SHADER);\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n\n gl.useProgram(this.id);\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) this.attribute[a] = gl.getAttribLocation(this.id, a);\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = gl.getUniformLocation(this.id, u);\n}\n\n// export const GLImageFilter = function (params) {\nexport function GLImageFilter(params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _filter = {};\n const _canvas = params.canvas || document.createElement('canvas');\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n const DRAW = { INTERMEDIATE: 1 };\n const gl = _canvas.getContext('webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n // eslint-disable-next-line prefer-rest-params\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n _canvas.width = width;\n _width = width;\n _canvas.height = height;\n _height = height;\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n // eslint-disable-next-line no-unused-expressions\n (_vertexBuffer = gl.createBuffer(), gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer));\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n gl.viewport(0, 0, _width, _height);\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n return { fbo, texture };\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index] || _createFramebufferTexture(_width, _height);\n return _tempFramebuffers[index];\n };\n\n const _draw = function (flags = null) {\n let source = null;\n let target = null;\n let flipY = false;\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex)?.texture;\n }\n _drawCount++;\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex)?.fbo;\n }\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n // No filters? Just draw\n if (_filterChain.length === 0) {\n // const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n return _canvas;\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n // Compile shaders\n const SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n _currentProgram = new GLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n const program = _compileShader(_filter.blur.SHADER);\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n const program = _compileShader(_filter.pixelate.SHADER);\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n}\n", "/**\n * Image Processing module used by Human\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\nimport { Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\ntype Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\nconst maxSize = 2048;\n// internal temp canvases\nlet inCanvas;\nlet outCanvas;\n// instance of fximage\nlet fx;\n\n// process input image and return tensor\n// input can be tensor, imagedata, htmlimageelement, htmlvideoelement\n// input is resized and run through imagefx filter\nexport function process(input: Input, config: Config): { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement } {\n let tensor;\n if (!input) throw new Error('Human: Input is missing');\n // sanity checks since different browsers do not implement all dom elements\n if (\n !(input instanceof tf.Tensor)\n && !(typeof Image !== 'undefined' && input instanceof Image)\n && !(typeof ImageData !== 'undefined' && input instanceof ImageData)\n && !(typeof ImageBitmap !== 'undefined' && input instanceof ImageBitmap)\n && !(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n && !(typeof HTMLMediaElement !== 'undefined' && input instanceof HTMLMediaElement)\n && !(typeof HTMLVideoElement !== 'undefined' && input instanceof HTMLVideoElement)\n && !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)\n && !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)\n ) {\n throw new Error('Human: Input type is not recognized');\n }\n if (input instanceof tf.Tensor) {\n // if input is tensor, use as-is\n if (input.shape && input.shape.length === 4 && input.shape[0] === 1 && input.shape[3] === 3) tensor = tf.clone(input);\n else throw new Error(`Human: Input tensor shape must be [1, height, width, 3] and instead was ${input.shape}`);\n } else {\n // check if resizing will be needed\n const originalWidth = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n if (!originalWidth || !originalHeight) return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n let targetWidth = originalWidth;\n let targetHeight = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = targetWidth * originalHeight / originalWidth;\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = targetHeight * originalWidth / originalHeight;\n }\n\n // create our canvas and resize it if needed\n if (config.filter.width > 0) targetWidth = config.filter.width;\n else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);\n if (config.filter.height > 0) targetHeight = config.filter.height;\n else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('Human: Input cannot determine dimension');\n if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) {\n inCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n if (inCanvas?.width !== targetWidth) inCanvas.width = targetWidth;\n if (inCanvas?.height !== targetHeight) inCanvas.height = targetHeight;\n }\n\n // draw input to our canvas\n const ctx = inCanvas.getContext('2d');\n if (input instanceof ImageData) {\n ctx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof ctx.translate !== 'undefined') {\n ctx.translate(originalWidth, 0);\n ctx.scale(-1, 1);\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n ctx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n }\n }\n\n // imagefx transforms using gl\n if (config.filter.enabled) {\n if (!fx || !outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas?.height !== outCanvas?.height)) {\n outCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(inCanvas?.width, inCanvas?.height) : document.createElement('canvas');\n if (outCanvas?.width !== inCanvas?.width) outCanvas.width = inCanvas?.width;\n if (outCanvas?.height !== inCanvas?.height) outCanvas.height = inCanvas?.height;\n // log('created FX filter');\n fx = tf.ENV.flags.IS_BROWSER ? new fxImage.GLImageFilter({ canvas: outCanvas }) : null; // && (typeof document !== 'undefined')\n }\n if (!fx) return { tensor: null, canvas: inCanvas };\n fx.reset();\n fx.addFilter('brightness', config.filter.brightness); // must have at least one filter enabled\n if (config.filter.contrast !== 0) fx.addFilter('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.addFilter('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.addFilter('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.addFilter('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.addFilter('hue', config.filter.hue);\n if (config.filter.negative) fx.addFilter('negative');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.vintage) fx.addFilter('brownie');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.kodachrome) fx.addFilter('kodachrome');\n if (config.filter.technicolor) fx.addFilter('technicolor');\n if (config.filter.polaroid) fx.addFilter('polaroid');\n if (config.filter.pixelate !== 0) fx.addFilter('pixelate', config.filter.pixelate);\n fx.apply(inCanvas);\n // read pixel data\n /*\n const gl = outCanvas.getContext('webgl');\n if (gl) {\n const glBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 4);\n const pixBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 3);\n gl.readPixels(0, 0, outCanvas.width, outCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, glBuffer);\n // gl returns rbga while we only need rgb, so discarding alpha channel\n // gl returns starting point as lower left, so need to invert vertical\n let i = 0;\n for (let y = outCanvas.height - 1; y >= 0; y--) {\n for (let x = 0; x < outCanvas.width; x++) {\n const index = (x + y * outCanvas.width) * 4;\n pixBuffer[i++] = glBuffer[index + 0];\n pixBuffer[i++] = glBuffer[index + 1];\n pixBuffer[i++] = glBuffer[index + 2];\n }\n }\n outCanvas.data = pixBuffer;\n }\n */\n } else {\n outCanvas = inCanvas;\n if (fx) fx = null;\n }\n\n // create tensor from image\n let pixels;\n if (outCanvas.data) { // if we have data, just convert to tensor\n const shape = [outCanvas.height, outCanvas.width, 3];\n pixels = tf.tensor3d(outCanvas.data, shape, 'int32');\n } else if (outCanvas instanceof ImageData) { // if input is imagedata, just use it\n pixels = tf.browser ? tf.browser.fromPixels(outCanvas) : null;\n } else if (config.backend === 'webgl' || config.backend === 'humangl') { // tf kernel-optimized method to get imagedata\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n pixels = tf.browser ? tf.browser.fromPixels(tempCanvas) : null;\n } else { // cpu and wasm kernel does not implement efficient fromPixels method\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n const data = tempCtx?.getImageData(0, 0, targetWidth, targetHeight);\n pixels = tf.browser ? tf.browser.fromPixels(data) : null;\n }\n if (pixels) {\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n }\n const canvas = config.filter.return ? outCanvas : null;\n return { tensor, canvas };\n}\n", "/**\n * Module that implements helper draw functions, exposed as human.draw\n */\n\nimport { TRI468 as triangulation } from '../blazeface/coords';\nimport { mergeDeep, now } from '../helpers';\nimport type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';\n\n/**\n * Draw Options\n * Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n * -color: draw color\n * -labelColor: color for labels\n * -shadowColor: optional shadow color for labels\n * -font: font for labels\n * -lineHeight: line height for labels, used for multi-line labels,\n * -lineWidth: width of any lines,\n * -pointSize: size of any point,\n * -roundRect: for boxes, round corners by this many pixels,\n * -drawPoints: should points be drawn,\n * -drawLabels: should labels be drawn,\n * -drawBoxes: should boxes be drawn,\n * -drawPolygons: should polygons be drawn,\n * -fillPolygons: should drawn polygons be filled,\n * -useDepth: use z-axis coordinate as color shade,\n * -useCurves: draw polygons as cures or as lines,\n * -bufferedOutput: experimental: allows to call draw methods multiple times for each detection and interpolate results between results thus achieving smoother animations\n */\nexport interface DrawOptions {\n color: string,\n labelColor: string,\n shadowColor: string,\n font: string,\n lineHeight: number,\n lineWidth: number,\n pointSize: number,\n roundRect: number,\n drawPoints: boolean,\n drawLabels: boolean,\n drawBoxes: boolean,\n drawPolygons: boolean,\n drawGaze: boolean,\n fillPolygons: boolean,\n useDepth: boolean,\n useCurves: boolean,\n bufferedOutput: boolean,\n}\n\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.6)', // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)', // 'lightblue' with dark alpha channel\n shadowColor: 'black',\n font: 'small-caps 14px \"Segoe UI\"',\n lineHeight: 24,\n lineWidth: 6,\n pointSize: 2,\n roundRect: 28,\n drawPoints: false,\n drawLabels: true,\n drawBoxes: true,\n drawPolygons: true,\n drawGaze: true,\n fillPolygons: false,\n useDepth: true,\n useCurves: false,\n bufferedOutput: true,\n};\n\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nfunction point(ctx, x, y, z = 0, localOptions) {\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nfunction rect(ctx, x, y, width, height, localOptions) {\n ctx.beginPath();\n if (localOptions.useCurves) {\n const cx = (x + x + width) / 2;\n const cy = (y + y + height) / 2;\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.moveTo(x + localOptions.roundRect, y);\n ctx.lineTo(x + width - localOptions.roundRect, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);\n ctx.lineTo(x + width, y + height - localOptions.roundRect);\n ctx.quadraticCurveTo(x + width, y + height, x + width - localOptions.roundRect, y + height);\n ctx.lineTo(x + localOptions.roundRect, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - localOptions.roundRect);\n ctx.lineTo(x, y + localOptions.roundRect);\n ctx.quadraticCurveTo(x, y, x + localOptions.roundRect, y);\n ctx.closePath();\n }\n ctx.stroke();\n}\n\nfunction lines(ctx, points: [number, number, number?][] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n const z = pt[2] || 0;\n ctx.strokeStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.lineTo(pt[0], Math.round(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nfunction curves(ctx, points: [number, number, number?][] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n if (!localOptions.useCurves || points.length <= 2) {\n lines(ctx, points, localOptions);\n return;\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 0; i < points.length - 2; i++) {\n const xc = (points[i][0] + points[i + 1][0]) / 2;\n const yc = (points[i][1] + points[i + 1][1]) / 2;\n ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc);\n }\n ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport async function gesture(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.font = localOptions.font;\n ctx.fillStyle = localOptions.color;\n let i = 1;\n for (let j = 0; j < result.length; j++) {\n let where: unknown[] = []; // what&where is a record\n let what: unknown[] = []; // what&where is a record\n [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && ((what[1] as string).length > 0)) {\n const who = where[1] as number > 0 ? `#${where[1]}` : '';\n const label = `${where[0]} ${who}: ${what[1]}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 8, 2 + (i * localOptions.lineHeight));\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, 6, 0 + (i * localOptions.lineHeight));\n i += 1;\n }\n }\n}\n\nexport async function face(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n for (const f of result) {\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.drawBoxes) rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n // silly hack since fillText does not suport new line\n const labels:string[] = [];\n labels.push(`face: ${Math.trunc(100 * f.score)}%`);\n if (f.genderScore) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderScore)}%`);\n if (f.age) labels.push(`age: ${f.age || ''}`);\n if (f.iris) labels.push(`distance: ${f.iris}`);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n if (emotion.length > 3) emotion.length = 3;\n labels.push(emotion.join(' '));\n }\n if (f.rotation && f.rotation.angle && f.rotation.gaze) {\n if (f.rotation.angle.roll) labels.push(`roll: ${rad2deg(f.rotation.angle.roll)}\u00B0 yaw:${rad2deg(f.rotation.angle.yaw)}\u00B0 pitch:${rad2deg(f.rotation.angle.pitch)}\u00B0`);\n if (f.rotation.gaze.bearing) labels.push(`gaze: ${rad2deg(f.rotation.gaze.bearing)}\u00B0`);\n }\n if (labels.length === 0) labels.push('face');\n ctx.fillStyle = localOptions.color;\n for (let i = labels.length - 1; i >= 0; i--) {\n const x = Math.max(f.box[0], 0);\n const y = i * localOptions.lineHeight + f.box[1];\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(labels[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(labels[i], x + 4, y + 15);\n }\n ctx.lineWidth = 1;\n if (f.mesh && f.mesh.length > 0) {\n if (localOptions.drawPoints) {\n for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);\n // for (const pt of f.meshRaw) point(ctx, pt[0] * inCanvas.offsetWidth, pt[1] * inCanvas.offsetHeight, pt[2]);\n }\n if (localOptions.drawPolygons) {\n ctx.lineWidth = 1;\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [\n triangulation[i * 3 + 0],\n triangulation[i * 3 + 1],\n triangulation[i * 3 + 2],\n ].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n // iris: array[center, left, top, right, bottom]\n if (f.annotations && f.annotations['leftEyeIris']) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['leftEyeIris'][3][0] - f.annotations['leftEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['leftEyeIris'][4][1] - f.annotations['leftEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (f.annotations && f.annotations['rightEyeIris']) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['rightEyeIris'][3][0] - f.annotations['rightEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['rightEyeIris'][4][1] - f.annotations['rightEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (localOptions.drawGaze && f.rotation?.gaze?.strength && f.rotation?.gaze?.bearing && f.annotations['leftEyeIris'] && f.annotations['rightEyeIris'] && f.annotations['leftEyeIris'][0] && f.annotations['rightEyeIris'][0]) {\n ctx.strokeStyle = 'pink';\n ctx.beginPath();\n\n const leftGaze = [\n f.annotations['leftEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['leftEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1]);\n ctx.lineTo(leftGaze[0], leftGaze[1]);\n\n const rightGaze = [\n f.annotations['rightEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['rightEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1]);\n ctx.lineTo(rightGaze[0], rightGaze[1]);\n\n ctx.stroke();\n }\n }\n }\n }\n}\n\nexport async function body(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; i++) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n ctx.lineWidth = localOptions.lineWidth;\n ctx.font = localOptions.font;\n if (localOptions.drawBoxes && result[i].box && result[i].box?.length === 4) {\n // @ts-ignore box may not exist\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n // @ts-ignore box may not exist\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n // @ts-ignore box may not exist\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n }\n if (localOptions.drawPoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position[2] ? `rgba(${127.5 + (2 * (result[i].keypoints[pt].position[2] || 0))}, ${127.5 - (2 * (result[i].keypoints[pt].position[2] || 0))}, 255, 0.5)` : localOptions.color;\n point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions);\n }\n }\n if (localOptions.drawLabels) {\n ctx.font = localOptions.font;\n if (result[i].keypoints) {\n for (const pt of result[i].keypoints) {\n ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + (2 * pt.position[2])}, ${127.5 - (2 * pt.position[2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4);\n }\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints) {\n let part;\n const points: [number, number, number?][] = [];\n // shoulder line\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // torso main\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n if (points.length === 4) lines(ctx, points, localOptions); // only draw if we have complete torso\n // leg left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftKnee');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftAnkle');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftHeel');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftFoot');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // leg right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightKnee');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightAnkle');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightHeel');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightFoot');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // arm left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftElbow');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftWrist');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftPalm');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // arm right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightElbow');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightWrist');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightPalm');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // draw all\n }\n }\n}\n\nexport async function hand(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText('hand', h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText('hand', h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.keypoints && h.keypoints.length > 0) {\n for (const pt of h.keypoints) {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.5)` : localOptions.color;\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels) {\n const addHandLabel = (part, title) => {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[part.length - 1][2])}, ${127.5 - (2 * part[part.length - 1][2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);\n };\n ctx.font = localOptions.font;\n addHandLabel(h.annotations['indexFinger'], 'index');\n addHandLabel(h.annotations['middleFinger'], 'middle');\n addHandLabel(h.annotations['ringFinger'], 'ring');\n addHandLabel(h.annotations['pinky'], 'pinky');\n addHandLabel(h.annotations['thumb'], 'thumb');\n addHandLabel(h.annotations['palmBase'], 'palm');\n }\n if (localOptions.drawPolygons) {\n const addHandLine = (part) => {\n if (!part) return;\n for (let i = 0; i < part.length; i++) {\n ctx.beginPath();\n ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[i][2])}, ${127.5 - (2 * part[i][2])}, 255, 0.5)` : localOptions.color;\n ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);\n ctx.lineTo(part[i][0], part[i][1]);\n ctx.stroke();\n }\n };\n ctx.lineWidth = localOptions.lineWidth;\n addHandLine(h.annotations['indexFinger']);\n addHandLine(h.annotations['middleFinger']);\n addHandLine(h.annotations['ringFinger']);\n addHandLine(h.annotations['pinky']);\n addHandLine(h.annotations['thumb']);\n // addPart(h.annotations.palmBase);\n }\n }\n}\n\nexport async function object(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `${Math.round(100 * h.score)}% ${h.label}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function person(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n\n for (let i = 0; i < result.length; i++) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `person #${i}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function canvas(inCanvas: HTMLCanvasElement, outCanvas: HTMLCanvasElement) {\n if (!inCanvas || !outCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement) || !(outCanvas instanceof HTMLCanvasElement)) return;\n const outCtx = inCanvas.getContext('2d');\n outCtx?.drawImage(inCanvas, 0, 0);\n}\n\nexport async function all(inCanvas: HTMLCanvasElement, result: Result, drawOptions?: DrawOptions) {\n const timestamp = now();\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n\n face(inCanvas, result.face, localOptions);\n body(inCanvas, result.body, localOptions);\n hand(inCanvas, result.hand, localOptions);\n object(inCanvas, result.object, localOptions);\n // person(inCanvas, result.persons, localOptions);\n gesture(inCanvas, result.gesture, localOptions); // gestures do not have buffering\n\n /*\n if (!bufferedResult) bufferedResult = result; // first pass\n else if (localOptions.bufferedOutput) calcBuffered(result); // do results interpolation\n else bufferedResult = result; // or just use results as-is\n const promises: Promise[] = [];\n promises.push(face(inCanvas, bufferedResult.face, localOptions));\n promises.push(body(inCanvas, bufferedResult.body, localOptions));\n promises.push(hand(inCanvas, bufferedResult.hand, localOptions));\n promises.push(object(inCanvas, bufferedResult.object, localOptions));\n // promises.push(person(inCanvas, bufferedResult.persons, localOptions));\n promises.push(gesture(inCanvas, result.gesture, localOptions)); // gestures do not have buffering\n // await Promise.all(promises);\n */\n result.performance.draw = Math.trunc(now() - timestamp);\n}\n", "/**\n * Module that analyzes existing results and recombines them into a unified person object\n */\n\nimport { Face, Body, Hand, Gesture, Person } from './result';\n\nexport function join(faces: Array, bodies: Array, hands: Array, gestures: Array, shape: Array | undefined): Array {\n let id = 0;\n const persons: Array = [];\n for (const face of faces) { // person is defined primarily by face and then we append other objects as found\n const person: Person = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };\n for (const body of bodies) {\n if (face.box[0] > body.box[0] // x within body\n && face.box[0] < body.box[0] + body.box[2]\n && face.box[1] + face.box[3] > body.box[1] // y within body\n && face.box[1] + face.box[3] < body.box[1] + body.box[3]) {\n person.body = body;\n }\n }\n if (person.body) { // only try to join hands if body is found\n for (const hand of hands) {\n if (hand.box[0] + hand.box[2] > person.body.box[0] // x within body for left hand\n && hand.box[0] + hand.box[2] < person.body.box[0] + person.body.box[2]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for left hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.left = hand;\n }\n if (hand.box[0] < person.body.box[0] + person.body.box[2] // x within body for right hand\n && hand.box[0] > person.body.box[0]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for right hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.right = hand;\n }\n }\n }\n for (const gesture of gestures) { // append all gestures according to ids\n if (gesture['face'] !== undefined && gesture['face'] === face.id) person.gestures?.push(gesture);\n else if (gesture['iris'] !== undefined && gesture['iris'] === face.id) person.gestures?.push(gesture);\n else if (gesture['body'] !== undefined && gesture['body'] === person.body?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.left?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.right?.id) person.gestures?.push(gesture);\n }\n\n // create new overarching box from all boxes beloning to person\n const x: number[] = [];\n const y: number[] = [];\n const extractXY = (box) => { // extract all [x, y] coordinates from boxes [x, y, width, height]\n if (box && box.length === 4) {\n x.push(box[0], box[0] + box[2]);\n y.push(box[1], box[1] + box[3]);\n }\n };\n extractXY(person.face?.box);\n extractXY(person.body?.box);\n extractXY(person.hands?.left?.box);\n extractXY(person.hands?.right?.box);\n const minX = Math.min(...x);\n const minY = Math.min(...y);\n person.box = [minX, minY, Math.max(...x) - minX, Math.max(...y) - minY]; // create new overarching box\n\n // shape is known so we calculate boxRaw as well\n if (shape && shape.length === 4) person.boxRaw = [person.box[0] / shape[2], person.box[1] / shape[1], person.box[2] / shape[2], person.box[3] / shape[1]];\n\n persons.push(person);\n }\n return persons;\n}\n", "/**\n * Module that interpolates results for smoother animations\n */\n\nimport type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';\n\nconst bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };\n\nexport function calc(newResult: Result): Result {\n // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself\n // otherwise bufferedResult is a shallow clone of result plus updated local calculated values\n // thus mixing by-reference and by-value assignments to minimize memory operations\n\n const elapsed = Date.now() - newResult.timestamp;\n // curve fitted: buffer = 8 - ln(delay)\n // interpolation formula: current = ((buffer - 1) * previous + live) / buffer\n // - at 50ms delay buffer = ~4.1 => 28% towards live data\n // - at 250ms delay buffer = ~2.5 => 40% towards live data\n // - at 500ms delay buffer = ~1.8 => 55% towards live data\n // - at 750ms delay buffer = ~1.4 => 71% towards live data\n // - at 1sec delay buffer = 1 which means live data is used\n const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed) : 1;\n\n bufferedResult.canvas = newResult.canvas;\n\n // interpolate body results\n if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {\n bufferedResult.body = JSON.parse(JSON.stringify(newResult.body as Body[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.body.length; i++) {\n const box = newResult.body[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + b) / bufferedFactor) as [number, number, number, number];\n const boxRaw = newResult.body[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + b) / bufferedFactor) as [number, number, number, number];\n const keypoints = (newResult.body[i].keypoints // update keypoints\n .map((keypoint, j) => ({\n score: keypoint.score,\n part: keypoint.part,\n position: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[0] + keypoint.position[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[1] + keypoint.position[1]) / bufferedFactor : keypoint.position[1],\n ],\n positionRaw: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[0] + keypoint.positionRaw[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[1] + keypoint.positionRaw[1]) / bufferedFactor : keypoint.position[1],\n ],\n }))) as Array<{ score: number, part: string, position: [number, number, number?], positionRaw: [number, number, number?] }>;\n bufferedResult.body[i] = { ...newResult.body[i], box, boxRaw, keypoints }; // shallow clone plus updated values\n }\n }\n\n // interpolate hand results\n if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {\n bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand as Hand[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.hand.length; i++) {\n const box = (newResult.hand[i].box// update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];\n const boxRaw = (newResult.hand[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];\n const keypoints = newResult.hand[i].keypoints // update landmarks\n .map((landmark, j) => landmark\n .map((coord, k) => (((bufferedFactor - 1) * bufferedResult.hand[i].keypoints[j][k] + coord) / bufferedFactor)) as [number, number, number]);\n const keys = Object.keys(newResult.hand[i].annotations); // update annotations\n const annotations = {};\n for (const key of keys) {\n annotations[key] = newResult.hand[i].annotations[key]\n .map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor));\n }\n bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations }; // shallow clone plus updated values\n }\n }\n\n // interpolate face results\n if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {\n bufferedResult.face = JSON.parse(JSON.stringify(newResult.face as Face[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.face.length; i++) {\n const box = (newResult.face[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];\n const boxRaw = (newResult.face[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];\n const rotation: {\n matrix: [number, number, number, number, number, number, number, number, number],\n angle: { roll: number, yaw: number, pitch: number },\n gaze: { bearing: number, strength: number }\n } = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } };\n rotation.matrix = newResult.face[i].rotation?.matrix as [number, number, number, number, number, number, number, number, number];\n rotation.angle = {\n roll: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.roll || 0) + (newResult.face[i].rotation?.angle?.roll || 0)) / bufferedFactor,\n yaw: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.yaw || 0) + (newResult.face[i].rotation?.angle?.yaw || 0)) / bufferedFactor,\n pitch: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.pitch || 0) + (newResult.face[i].rotation?.angle?.pitch || 0)) / bufferedFactor,\n };\n rotation.gaze = {\n // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive\n bearing: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.bearing || 0) + (newResult.face[i].rotation?.gaze?.bearing || 0)) / bufferedFactor,\n strength: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.strength || 0) + (newResult.face[i].rotation?.gaze?.strength || 0)) / bufferedFactor,\n };\n bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate object detection results\n if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {\n bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as Item[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.object.length; i++) {\n const box = (newResult.object[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];\n const boxRaw = (newResult.object[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];\n bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate person results\n const newPersons = newResult.persons; // trigger getter function\n if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {\n bufferedResult.persons = JSON.parse(JSON.stringify(newPersons as Person[]));\n } else {\n for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow\n bufferedResult.persons[i].box = (newPersons[i].box\n .map((box, j) => ((bufferedFactor - 1) * bufferedResult.persons[i].box[j] + box) / bufferedFactor)) as [number, number, number, number];\n }\n }\n\n // just copy latest gestures without interpolation\n bufferedResult.gesture = newResult.gesture as Gesture[];\n bufferedResult.performance = newResult.performance;\n\n return bufferedResult;\n}\n", "/**\n * EfficientPose Module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n// import * as blur from './blur';\n\ntype Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\nlet model: GraphModel;\nlet busy = false;\n// let blurKernel;\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch on GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.segmentation.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n // if (!blurKernel) blurKernel = blur.getGaussianKernel(5, 1, 1);\n return model;\n}\n\nexport async function predict(input: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement }, config: Config): Promise {\n if (!config.segmentation.enabled || !input.tensor || !input.canvas) return null;\n if (!model || !model.inputs[0].shape) return null;\n const resizeInput = tf.image.resizeBilinear(input.tensor, [model.inputs[0].shape[1], model.inputs[0].shape[2]], false);\n const norm = resizeInput.div(255);\n const res = model.predict(norm) as Tensor;\n // meet output: 1,256,256,1\n // selfie output: 1,144,256,2\n tf.dispose(resizeInput);\n tf.dispose(norm);\n\n const overlay = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(input.canvas.width, input.canvas.height) : document.createElement('canvas');\n overlay.width = input.canvas.width;\n overlay.height = input.canvas.height;\n\n const squeeze = tf.squeeze(res, 0);\n let resizeOutput;\n if (squeeze.shape[2] === 2) {\n // model meet has two channels for fg and bg\n const softmax = squeeze.softmax();\n const [bg, fg] = tf.unstack(softmax, 2);\n const expand = fg.expandDims(2);\n const pad = expand.expandDims(0);\n tf.dispose(softmax);\n tf.dispose(bg);\n tf.dispose(fg);\n // running sofmax before unstack creates 2x2 matrix so we only take upper-left quadrant\n const crop = tf.image.cropAndResize(pad, [[0, 0, 0.5, 0.5]], [0], [input.tensor?.shape[1], input.tensor?.shape[2]]);\n // otherwise run softmax after unstack and use standard resize\n // resizeOutput = tf.image.resizeBilinear(expand, [input.tensor?.shape[1], input.tensor?.shape[2]]);\n resizeOutput = crop.squeeze(0);\n tf.dispose(crop);\n tf.dispose(expand);\n tf.dispose(pad);\n } else { // model selfie has a single channel that we can use directly\n resizeOutput = tf.image.resizeBilinear(squeeze, [input.tensor?.shape[1], input.tensor?.shape[2]]);\n }\n\n if (tf.browser) await tf.browser.toPixels(resizeOutput, overlay);\n tf.dispose(resizeOutput);\n tf.dispose(squeeze);\n tf.dispose(res);\n\n // get alpha channel data\n const alphaCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(input.canvas.width, input.canvas.height) : document.createElement('canvas'); // need one more copy since input may already have gl context so 2d context fails\n alphaCanvas.width = input.canvas.width;\n alphaCanvas.height = input.canvas.height;\n const ctxAlpha = alphaCanvas.getContext('2d') as CanvasRenderingContext2D;\n ctxAlpha.filter = 'blur(8px';\n await ctxAlpha.drawImage(overlay, 0, 0);\n const alpha = ctxAlpha.getImageData(0, 0, input.canvas.width, input.canvas.height).data;\n\n // get original canvas merged with overlay\n const original = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(input.canvas.width, input.canvas.height) : document.createElement('canvas'); // need one more copy since input may already have gl context so 2d context fails\n original.width = input.canvas.width;\n original.height = input.canvas.height;\n const ctx = original.getContext('2d') as CanvasRenderingContext2D;\n await ctx.drawImage(input.canvas, 0, 0);\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation // best options are: darken, color-burn, multiply\n ctx.globalCompositeOperation = 'darken';\n ctx.filter = 'blur(8px)'; // use css filter for bluring, can be done with gaussian blur manually instead\n await ctx.drawImage(overlay, 0, 0);\n ctx.globalCompositeOperation = 'source-over'; // reset\n ctx.filter = 'none'; // reset\n\n input.canvas = original;\n\n return alpha;\n}\n\nexport async function process(input: Input, background: Input | undefined, config: Config): Promise {\n if (busy) return null;\n busy = true;\n if (!config.segmentation.enabled) config.segmentation.enabled = true; // override config\n if (!model) await load(config);\n const img = image.process(input, config);\n const alpha = await predict(img, config);\n tf.dispose(img.tensor);\n\n if (background && alpha) {\n const tmp = image.process(background, config);\n const bg = tmp.canvas;\n tf.dispose(tmp.tensor);\n const fg = img.canvas;\n const fgData = fg.getContext('2d')?.getImageData(0, 0, fg.width, fg.height).data as Uint8ClampedArray;\n\n const c = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(fg.width, fg.height) : document.createElement('canvas');\n c.width = fg.width;\n c.height = fg.height;\n const ctx = c.getContext('2d') as CanvasRenderingContext2D;\n\n ctx.globalCompositeOperation = 'copy'; // reset\n ctx.drawImage(bg, 0, 0, c.width, c.height);\n const cData = ctx.getImageData(0, 0, c.width, c.height) as ImageData;\n for (let i = 0; i < c.width * c.height; i++) { // this should be done with globalCompositeOperation instead of looping through image data\n cData.data[4 * i + 0] = ((255 - alpha[4 * i + 0]) / 255.0 * cData.data[4 * i + 0]) + (alpha[4 * i + 0] / 255.0 * fgData[4 * i + 0]);\n cData.data[4 * i + 1] = ((255 - alpha[4 * i + 1]) / 255.0 * cData.data[4 * i + 1]) + (alpha[4 * i + 1] / 255.0 * fgData[4 * i + 1]);\n cData.data[4 * i + 2] = ((255 - alpha[4 * i + 2]) / 255.0 * cData.data[4 * i + 2]) + (alpha[4 * i + 2] / 255.0 * fgData[4 * i + 2]);\n cData.data[4 * i + 3] = ((255 - alpha[4 * i + 3]) / 255.0 * cData.data[4 * i + 3]) + (alpha[4 * i + 3] / 255.0 * fgData[4 * i + 3]);\n }\n ctx.putImageData(cData, 0, 0);\n img.canvas = c;\n }\n busy = false;\n return img.canvas;\n}\n", "/**\n * Embedded sample images used during warmup in dataURL format\n */\n\n// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA\nAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu\nbmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob\nIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgo\nKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AAEQgBAAE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HY9Zk4pNt9rR+rl6zi+OnS+WN57Rv1lXp/YrNaYtruL6zNPnGO3hxP6O5w/2\nf0HDuun09Yv55Le9afznqcOvO4tBreMTHu30unnva0bWt8on+70nDuE4OHYYx4Kbesz3tPrMuhGO\nIjpDOKrK9YVpsyiGUQnYGOyUgI2SlAIEmwMWMs9kTAMJYzDOYRMArmGErZhhMArlHmzmGMwDE3Ts\nbAbs4swj5pgFkSziVcM4BZEsolXDKAZwyhjCYBkACQhIAAAAAAAJAAAAAAAAAAAAAAAAAAAShIAA\nAAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA\nBAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2\nSbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T\nlBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/\n2Q==`;\n", "/**\n * Human main module\n */\n\nimport { log, now, mergeDeep } from './helpers';\nimport { Config, defaults } from './config';\nimport { Result, Gesture } from './result';\nimport * as sysinfo from './sysinfo';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as backend from './tfjs/backend';\nimport * as face from './face';\nimport * as facemesh from './blazeface/facemesh';\nimport * as faceres from './faceres/faceres';\nimport * as emotion from './emotion/emotion';\nimport * as posenet from './posenet/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as blazepose from './blazepose/blazepose';\nimport * as efficientpose from './efficientpose/efficientpose';\nimport * as movenet from './movenet/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as centernet from './object/centernet';\nimport * as gesture from './gesture/gesture';\nimport * as image from './image/image';\nimport * as draw from './draw/draw';\nimport * as persons from './persons';\nimport * as interpolate from './interpolate';\nimport * as segmentation from './segmentation/segmentation';\nimport * as sample from './sample';\nimport * as app from '../package.json';\nimport { Tensor } from './tfjs/types';\n\n// export types\nexport type { Config } from './config';\nexport type { Result, Face, Hand, Body, Item, Gesture, Person } from './result';\nexport type { DrawOptions } from './draw/draw';\n\n/** Defines all possible input types for **Human** detection\n * @typedef Input Type\n */\nexport type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\n/** Error message\n * @typedef Error Type\n */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS */\nexport type TensorFlow = typeof tf;\n\n/** Generic Model object type, holds instance of individual models */\ntype Model = unknown;\n\n/**\n * **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n *\n * @param userConfig: {@link Config}\n */\nexport class Human {\n /** Current version of Human library in *semver* format */\n version: string;\n /** Current configuration\n * - Details: {@link Config}\n */\n config: Config;\n /** Last known result of detect run\n * - Can be accessed anytime after initial detection\n */\n result: Result;\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n * - Progresses through: 'config', 'check', 'backend', 'load', 'run:', 'idle'\n */\n state: string;\n /** @internal: Instance of current image being processed */\n image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n /** @internal: Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n */\n tf: TensorFlow;\n /** Draw helper classes that can draw detected objects on canvas using specified draw styles\n * - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: {\n options: draw.DrawOptions,\n gesture: typeof draw.gesture,\n face: typeof draw.face,\n body: typeof draw.body,\n hand: typeof draw.hand,\n canvas: typeof draw.canvas,\n all: typeof draw.all,\n };\n /** @internal: Currently loaded models */\n models: {\n face: [Model, Model, Model] | null,\n posenet: Model | null,\n blazepose: Model | null,\n efficientpose: Model | null,\n movenet: Model | null,\n handpose: [Model, Model] | null,\n age: Model | null,\n gender: Model | null,\n emotion: Model | null,\n embedding: Model | null,\n nanodet: Model | null,\n centernet: Model | null,\n faceres: Model | null,\n segmentation: Model | null,\n };\n /** Reference face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** Refernce UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Platform and agent information detected by Human */\n sysinfo: { platform: string, agent: string };\n /** Performance object that contains values for all recently performed operations */\n performance: Record; // perf members are dynamically defined as needed\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n #firstRun: boolean;\n #lastInputSum: number;\n #lastCacheDiff: number;\n\n // definition end\n\n /**\n * Creates instance of Human library that is futher used for all operations\n * @param userConfig: {@link Config}\n */\n constructor(userConfig?: Config | Record) {\n this.config = mergeDeep(defaults, userConfig || {});\n this.tf = tf;\n this.draw = draw;\n this.version = app.version;\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.#firstRun = true;\n this.#lastCacheDiff = 0;\n this.performance = { backend: 0, load: 0, image: 0, frames: 0, cached: 0, changed: 0, total: 0, draw: 0 };\n // object that contains all initialized models\n this.models = {\n face: null,\n posenet: null,\n blazepose: null,\n efficientpose: null,\n movenet: null,\n handpose: null,\n age: null,\n gender: null,\n emotion: null,\n embedding: null,\n nanodet: null,\n centernet: null,\n faceres: null,\n segmentation: null,\n };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.image = (input: Input) => image.process(input, this.config);\n // export raw access to underlying models\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // include platform info\n this.sysinfo = sysinfo.info();\n this.#lastInputSum = 1;\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg) => {\n if (!this.#analyzeMemoryLeaks) return;\n const currentTensors = this.tf.engine().state.numTensors;\n const previousTensors = this.#numTensors;\n this.#numTensors = currentTensors;\n const leaked = currentTensors - previousTensors;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)\n * - Calculation is based on normalized Minkowski distance between\n *\n * @param embedding1: face descriptor as array of numbers\n * @param embedding2: face descriptor as array of numbers\n * @returns similarity: number\n */\n // eslint-disable-next-line class-methods-use-this\n similarity(embedding1: Array, embedding2: Array): number {\n return faceres.similarity(embedding1, embedding2);\n }\n\n /**\n * Segmentation method takes any input and returns processed canvas with body segmentation\n * Optional parameter background is used to fill the background with specific input\n * Segmentation is not triggered as part of detect process\n *\n * @param input: {@link Input}\n * @param background?: {@link Input}\n * @returns Canvas\n */\n segmentation(input: Input, background?: Input) {\n return segmentation.process(input, background, this.config);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n * @param input: Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n // @ts-ignore type mismach for Tensor\n return faceres.enhance(input);\n }\n\n /** Math method find best match between provided face descriptor and predefined database of known descriptors\n * @param faceEmbedding: face descriptor previsouly calculated on any face\n * @param db: array of mapping of face descriptors to known values\n * @param threshold: minimum score for matching to be considered in the result\n * @returns best match\n */\n // eslint-disable-next-line class-methods-use-this\n match(faceEmbedding: Array, db: Array<{ name: string, source: string, embedding: number[] }>, threshold = 0): { name: string, source: string, similarity: number, embedding: number[] } {\n return faceres.match(faceEmbedding, db, threshold);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n * @param userConfig?: {@link Config}\n */\n async load(userConfig?: Config | Record) {\n this.state = 'load';\n const timeStamp = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n\n if (this.#firstRun) { // print version info on first run and check for correct backend setup\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (this.config.debug) log('platform:', this.sysinfo.platform);\n if (this.config.debug) log('agent:', this.sysinfo.agent);\n\n await this.#checkBackend(true);\n if (this.tf.ENV.flags.IS_BROWSER) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n if (this.config.async) { // load models concurrently\n [\n // @ts-ignore async model loading is not correctly inferred\n this.models.face,\n this.models.emotion,\n // @ts-ignore async model loading is not correctly inferred\n this.models.handpose,\n this.models.posenet,\n this.models.blazepose,\n this.models.efficientpose,\n this.models.movenet,\n this.models.nanodet,\n this.models.centernet,\n this.models.faceres,\n this.models.segmentation,\n ] = await Promise.all([\n this.models.face || (this.config.face.enabled ? facemesh.load(this.config) : null),\n this.models.emotion || ((this.config.face.enabled && this.config.face.emotion.enabled) ? emotion.load(this.config) : null),\n this.models.handpose || (this.config.hand.enabled ? handpose.load(this.config) : null),\n this.models.posenet || (this.config.body.enabled && this.config.body.modelPath.includes('posenet') ? posenet.load(this.config) : null),\n this.models.blazepose || (this.config.body.enabled && this.config.body.modelPath.includes('blazepose') ? blazepose.load(this.config) : null),\n this.models.efficientpose || (this.config.body.enabled && this.config.body.modelPath.includes('efficientpose') ? efficientpose.load(this.config) : null),\n this.models.movenet || (this.config.body.enabled && this.config.body.modelPath.includes('movenet') ? movenet.load(this.config) : null),\n this.models.nanodet || (this.config.object.enabled && this.config.object.modelPath.includes('nanodet') ? nanodet.load(this.config) : null),\n this.models.centernet || (this.config.object.enabled && this.config.object.modelPath.includes('centernet') ? centernet.load(this.config) : null),\n this.models.faceres || ((this.config.face.enabled && this.config.face.description.enabled) ? faceres.load(this.config) : null),\n this.models.segmentation || (this.config.segmentation.enabled ? segmentation.load(this.config) : null),\n ]);\n } else { // load models sequentially\n if (this.config.face.enabled && !this.models.face) this.models.face = await facemesh.load(this.config);\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) this.models.emotion = await emotion.load(this.config);\n if (this.config.hand.enabled && !this.models.handpose) this.models.handpose = await handpose.load(this.config);\n if (this.config.body.enabled && !this.models.posenet && this.config.body.modelPath.includes('posenet')) this.models.posenet = await posenet.load(this.config);\n if (this.config.body.enabled && !this.models.blazepose && this.config.body.modelPath.includes('blazepose')) this.models.blazepose = await blazepose.load(this.config);\n if (this.config.body.enabled && !this.models.efficientpose && this.config.body.modelPath.includes('efficientpose')) this.models.efficientpose = await blazepose.load(this.config);\n if (this.config.body.enabled && !this.models.movenet && this.config.body.modelPath.includes('movenet')) this.models.movenet = await movenet.load(this.config);\n if (this.config.object.enabled && !this.models.nanodet && this.config.object.modelPath.includes('nanodet')) this.models.nanodet = await nanodet.load(this.config);\n if (this.config.object.enabled && !this.models.centernet && this.config.object.modelPath.includes('centernet')) this.models.centernet = await centernet.load(this.config);\n if (this.config.face.enabled && this.config.face.description.enabled && !this.models.faceres) this.models.faceres = await faceres.load(this.config);\n if (this.config.segmentation.enabled && !this.models.segmentation) this.models.segmentation = await segmentation.load(this.config);\n }\n\n if (this.#firstRun) { // print memory stats on first run\n if (this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors');\n this.#firstRun = false;\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.performance.load as number || 0)) this.performance.load = current;\n }\n\n // check if backend needs initialization if it changed\n /** @hidden */\n #checkBackend = async (force = false) => {\n if (this.config.backend && (this.config.backend.length > 0) && force || (this.tf.getBackend() !== this.config.backend)) {\n const timeStamp = now();\n this.state = 'backend';\n /* force backend reload\n if (this.config.backend in tf.engine().registry) {\n const backendFactory = tf.findBackendFactory(this.config.backend);\n tf.removeBackend(this.config.backend);\n tf.registerBackend(this.config.backend, backendFactory);\n } else {\n log('Backend not registred:', this.config.backend);\n }\n */\n\n if (this.config.backend && this.config.backend.length > 0) {\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && this.config.debug) log('running inside web worker');\n\n // force browser vs node backend\n if (this.tf.ENV.flags.IS_BROWSER && this.config.backend === 'tensorflow') this.config.backend = 'webgl';\n if (this.tf.ENV.flags.IS_NODE && (this.config.backend === 'webgl' || this.config.backend === 'humangl')) this.config.backend = 'tensorflow';\n\n if (this.config.debug) log('setting backend:', this.config.backend);\n\n if (this.config.backend === 'wasm') {\n if (this.config.debug) log('wasm path:', this.config.wasmPath);\n if (typeof this.tf?.setWasmPaths !== 'undefined') this.tf.setWasmPaths(this.config.wasmPath);\n else throw new Error('Human: WASM backend is not loaded');\n const simd = await this.tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await this.tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (this.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (this.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n if (this.config.backend === 'humangl') backend.register();\n try {\n await this.tf.setBackend(this.config.backend);\n } catch (err) {\n log('error: cannot set backend:', this.config.backend, err);\n }\n }\n this.tf.enableProdMode();\n // this.tf.enableDebugMode();\n if (this.tf.getBackend() === 'webgl' || this.tf.getBackend() === 'humangl') {\n this.tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n this.tf.ENV.set('WEBGL_CPU_FORWARD', true);\n this.tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n // if (!this.config.object.enabled) this.tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true); // safe to use 16bit precision\n if (typeof this.config['deallocate'] !== 'undefined' && this.config['deallocate']) { // hidden param\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n this.tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n const gl = await this.tf.backend().getGPGPUContext().gl;\n if (this.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n await this.tf.ready();\n this.performance.backend = Math.trunc(now() - timeStamp);\n }\n }\n\n /**\n * Runs interpolation using last known result and returns smoothened result\n * Interpolation is based on time since last known result so can be called independently\n *\n * @param result?: {@link Result} optional use specific result set to run interpolation on\n * @returns result: {@link Result}\n */\n next = (result?: Result) => interpolate.calc(result || this.result) as Result;\n\n // check if input changed sufficiently to trigger new detections\n /** @hidden */\n #skipFrame = async (input) => {\n if (this.config.cacheSensitivity === 0) return false;\n const resizeFact = 32;\n const reduced: Tensor = input.resizeBilinear([Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);\n // use tensor sum\n /*\n const sumT = this.tf.sum(reduced);\n const sum = sumT.dataSync()[0] as number;\n sumT.dispose();\n */\n // use js loop sum, faster than uploading tensor to gpu calculating and downloading back\n const reducedData = reduced.dataSync(); // raw image rgb array\n let sum = 0;\n for (let i = 0; i < reducedData.length / 3; i++) sum += reducedData[3 * i + 2]; // look only at green value of each pixel\n\n reduced.dispose();\n const diff = 100 * (Math.max(sum, this.#lastInputSum) / Math.min(sum, this.#lastInputSum) - 1);\n this.#lastInputSum = sum;\n // if previous frame was skipped, skip this frame if changed more than cacheSensitivity\n // if previous frame was not skipped, then look for cacheSensitivity or difference larger than one in previous frame to avoid resetting cache in subsequent frames unnecessarily\n const skipFrame = diff < Math.max(this.config.cacheSensitivity, this.#lastCacheDiff);\n // if difference is above 10x threshold, don't use last value to force reset cache for significant change of scenes or images\n this.#lastCacheDiff = diff > 10 * this.config.cacheSensitivity ? 0 : diff;\n return skipFrame;\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n *\n * @param input: Input\n * @param userConfig?: {@link Config}\n * @returns result: {@link Result}\n */\n async detect(input: Input, userConfig?: Config | Record): Promise {\n // detection happens inside a promise\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig) as Config;\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend\n await this.#checkBackend();\n\n // load models if enabled\n await this.load();\n\n /*\n // function disabled in favor of inputChanged\n // disable video optimization for inputs of type image, but skip if inside worker thread\n let previousVideoOptimized;\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (input && this.config.videoOptimized && (typeof window !== 'undefined') && (typeof WorkerGlobalScope !== 'undefined') && (\n (typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n || (typeof Image !== 'undefined' && input instanceof Image)\n || (typeof ImageData !== 'undefined' && input instanceof ImageData)\n || (typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap))\n ) {\n log('disabling video optimization');\n previousVideoOptimized = this.config.videoOptimized;\n this.config.videoOptimized = false;\n }\n */\n\n timeStamp = now();\n const process = image.process(input, this.config);\n if (!process || !process.tensor) {\n log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n this.performance.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n timeStamp = now();\n this.config.skipFrame = await this.#skipFrame(process.tensor);\n if (!this.performance.frames) this.performance.frames = 0;\n if (!this.performance.cached) this.performance.cached = 0;\n (this.performance.frames as number)++;\n if (this.config.skipFrame) this.performance.cached++;\n this.performance.changed = Math.trunc(now() - timeStamp);\n this.analyze('Check Changed:');\n\n // prepare where to store model results\n // keep them with weak typing as it can be promise or not\n let faceRes;\n let bodyRes;\n let handRes;\n let objectRes;\n let elapsedTime;\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n if (this.config.async) {\n faceRes = this.config.face.enabled ? face.detectFace(this, process.tensor) : [];\n if (this.performance.face) delete this.performance.face;\n } else {\n this.state = 'run:face';\n timeStamp = now();\n faceRes = this.config.face.enabled ? await face.detectFace(this, process.tensor) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.face = elapsedTime;\n }\n\n // run body: can be posenet, blazepose, efficientpose, movenet\n this.analyze('Start Body:');\n if (this.config.async) {\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(process.tensor, this.config) : [];\n if (this.performance.body) delete this.performance.body;\n } else {\n this.state = 'run:body';\n timeStamp = now();\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(process.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.body = elapsedTime;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n if (this.config.async) {\n handRes = this.config.hand.enabled ? handpose.predict(process.tensor, this.config) : [];\n if (this.performance.hand) delete this.performance.hand;\n } else {\n this.state = 'run:hand';\n timeStamp = now();\n handRes = this.config.hand.enabled ? await handpose.predict(process.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.hand = elapsedTime;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n if (this.config.async) {\n if (this.config.object.modelPath.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(process.tensor, this.config) : [];\n else if (this.config.object.modelPath.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(process.tensor, this.config) : [];\n if (this.performance.object) delete this.performance.object;\n } else {\n this.state = 'run:object';\n timeStamp = now();\n if (this.config.object.modelPath.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(process.tensor, this.config) : [];\n else if (this.config.object.modelPath.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(process.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.object = elapsedTime;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n\n // run gesture analysis last\n let gestureRes: Gesture[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.performance.gesture = Math.trunc(now() - timeStamp);\n else if (this.performance.gesture) delete this.performance.gesture;\n }\n\n // run segmentation\n /* not triggered as part of detect\n if (this.config.segmentation.enabled) {\n this.analyze('Start Segmentation:');\n this.state = 'run:segmentation';\n timeStamp = now();\n await segmentation.predict(process, this.config);\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.segmentation = elapsedTime;\n this.analyze('End Segmentation:');\n }\n */\n\n this.performance.total = Math.trunc(now() - timeStart);\n this.state = 'idle';\n this.result = {\n face: faceRes,\n body: bodyRes,\n hand: handRes,\n gesture: gestureRes,\n object: objectRes,\n performance: this.performance,\n canvas: process.canvas,\n timestamp: Date.now(),\n get persons() { return persons.join(faceRes, bodyRes, handRes, gestureRes, process?.tensor?.shape); },\n };\n\n // finally dispose input tensor\n tf.dispose(process.tensor);\n\n // log('Result:', result);\n resolve(this.result);\n });\n }\n\n /** @hidden */\n #warmupBitmap = async () => {\n const b64toBlob = (base64, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (this.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await this.detect(bitmap, this.config);\n bitmap.close();\n }\n return res;\n }\n\n /** @hidden */\n #warmupCanvas = async () => new Promise((resolve) => {\n let src;\n let size = 0;\n switch (this.config.warmup) {\n case 'face':\n size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n const img = new Image();\n img.onload = async () => {\n const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx?.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const res = await this.detect(canvas, this.config);\n resolve(res);\n };\n if (src) img.src = src;\n else resolve(null);\n });\n\n /** @hidden */\n #warmupNode = async () => {\n const atob = (str) => Buffer.from(str, 'base64');\n let img;\n if (this.config.warmup === 'face') img = atob(sample.face);\n if (this.config.warmup === 'body' || this.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n this.tf.dispose(data);\n // log('Input:', expanded);\n res = await this.detect(expanded, this.config);\n this.tf.dispose(expanded);\n } else {\n if (this.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await this.detect(input, this.config);\n */\n }\n return res;\n }\n\n /** Warmup metho pre-initializes all models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig?: Config\n */\n async warmup(userConfig?: Config | Record): Promise {\n const t0 = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n if (!this.config.warmup || this.config.warmup === 'none') return { error: 'null' };\n let res;\n if (typeof createImageBitmap === 'function') res = await this.#warmupBitmap();\n else if (typeof Image !== 'undefined') res = await this.#warmupCanvas();\n else res = await this.#warmupNode();\n const t1 = now();\n if (this.config.debug) log('Warmup', this.config.warmup, Math.round(t1 - t0), 'ms', res);\n return res;\n }\n}\n\n/**\n * Class Human is also available as default export\n */\nexport { Human as default };\n"], - "mappings": ";;;;;;;stBAKO,WAAc,EAAgB,EAAsB,CACzD,GAAM,GAAY,EAAO,SAAS,KAAO,GAAK,IAExC,EAAO,AADI,EAAK,WAAW,MAAQ,EAAK,WAAW,MAAQ,EAAK,WAAW,UAAY,EAAK,WAAW,WAAa,EAAK,WAAW,SAClH,GAAG,IAAS,GAAG,IAAS,IAAY,IAC5D,GAAI,CAAC,EAAK,oBAAoB,SAAS,SAAU,KAAM,IAAI,OAAM,2BAA2B,yBAC5F,MAAO,GAIF,cAAgB,EAAW,CAChC,GAAM,GAAK,GAAI,MACT,EAAK,GAAG,EAAG,WAAW,WAAW,SAAS,EAAG,QAAQ,EAAG,aAAa,WAAW,SAAS,EAAG,QAAQ,EAAG,aAAa,WAAW,SAAS,EAAG,QAAQ,EAAG,kBAAkB,WAAW,SAA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L,WACpD,AAAI,MAAO,QAAU,YAAa,EAAM,KAAM,QAAK,IAAL,WAC9C,EAAM,KAAM,QAAK,IAAL,WACjB,GAAM,GAAK,IACX,MAAI,MAAK,OAAO,OAAO,EAAI,SAAU,KAAK,OAAO,OAAQ,KAAK,MAAM,EAAK,GAAK,KAAM,GAC7E,IAjkBT,eACA,eACA,eACA,eACA,eACA,eA6DA,eAoIA,eAuEA,eAuNA,eAkBA,eAiCA", + "sourcesContent": ["/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n\n// helper function: return min and max from input array\nexport const minmax = (data) => data.reduce((acc, val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n * @typedef Config\n */\nexport interface Config {\n /** Backend used for TFJS operations */\n backend: null | '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow',\n\n /** Path to *.wasm files if backend is set to `wasm` */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n cacheSensitivity: number;\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n skipFrame: boolean;\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n */\n filter: {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n },\n // type definition end\n\n /** Controlls gesture detection */\n gesture: {\n enabled: boolean,\n },\n\n /** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - return: return extracted face as tensor for futher user processing\n */\n face: {\n enabled: boolean,\n detector: {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n },\n mesh: {\n enabled: boolean,\n modelPath: string,\n },\n iris: {\n enabled: boolean,\n modelPath: string,\n },\n description: {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n },\n emotion: {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n },\n },\n\n /** Controlls and configures all body detection specific options\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n */\n body: {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n skipFrames: number,\n },\n\n /** Controlls and configures all hand detection specific options\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n */\n hand: {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath: string,\n },\n skeleton: {\n modelPath: string,\n },\n },\n\n /** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n */\n object: {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n },\n\n /** Controlls and configures all body segmentation module\n * removes background from input containing person\n * if segmentation is enabled it will run as preprocessing task before any other model\n * alternatively leave it disabled and use it on-demand using human.segmentation method which can\n * remove background or replace it with user-provided background\n *\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n */\n segmentation: {\n enabled: boolean,\n modelPath: string,\n },\n}\n\nconst config: Config = {\n backend: 'webgl', // select tfjs backend to use, leave empty to use default backend\n // can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl\n modelBasePath: '../models/', // base path for all models\n wasmPath: '../node_modules/@tensorflow/tfjs-backend-wasm/dist/', // path for wasm binaries, only used for backend: wasm\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n cacheSensitivity: 0.75, // cache sensitivity\n // values 0..1 where 0.01 means reset cache if input changed more than 1%\n // set to 0 to disable caching\n skipFrame: false, // internal & dynamic\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: true, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 15, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 15, // how many max frames to go without re-running the face bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head probably hasn't moved much\n // in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 11, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 17, // how max many frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'\n maxDetected: 1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet as other models detects single pose\n minConfidence: 0.2, // threshold for discarding a prediction\n skipFrames: 1, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n},\n\n hand: {\n enabled: true,\n rotation: true, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n skipFrames: 18, // how many max frames to go without re-running the hand bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand probably\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.1, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 2, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handdetect.json', // hand detector model, can be absolute path or relative to modelBasePath\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'mb3-centernet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'mb3-centernet' or 'nanodet'\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 19, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n },\n\n segmentation: {\n enabled: false, // controlls and configures all body segmentation module\n // removes background from input containing person\n // if segmentation is enabled it will run as preprocessing task before any other model\n // alternatively leave it disabled and use it on-demand using human.segmentation method which can\n // remove background or replace it with user-provided background\n modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'selfie' or 'meet'\n },\n};\nexport { config as defaults };\n", "/**\n * Helper function that returns basic system info\n */\nexport function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "/**\n * Creates tfjs bundle used by Human browser build target\n */\n\n// simplified\n// { modules: 1250, moduleBytes: 4013323, imports: 7, importBytes: 2255, outputBytes: 2991826, outputFiles: 'dist/tfjs.esm.js' }\n// export * from '@tensorflow/tfjs/dist/index.js';\n// export * from '@tensorflow/tfjs-backend-wasm';\n\n// modular\n// { modules: 1253, moduleBytes: 4029357, imports: 7, importBytes: 2285, outputBytes: 2998298, outputFiles: 'dist/tfjs.esm.js' }\n\n// get versions of all packages.\nimport * as packageBundle from '@tensorflow/tfjs/package.json';\nimport * as packageCore from '@tensorflow/tfjs-core/package.json';\nimport * as packageData from '@tensorflow/tfjs-data/package.json';\nimport * as packageLayers from '@tensorflow/tfjs-layers/package.json';\nimport * as packageConverter from '@tensorflow/tfjs-converter/package.json';\n// for backends, get version from source so it can register backend during import\nimport { version_cpu } from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nimport { version_webgl } from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nimport { version_wasm } from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - compiled\nexport * from '@tensorflow/tfjs-core/dist/index.js';\nexport * from '@tensorflow/tfjs-layers/dist/index.js';\nexport * from '@tensorflow/tfjs-converter/dist/index.js';\nexport * as data from '@tensorflow/tfjs-data/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - sources\n/*\nexport * from '@tensorflow/tfjs-core/src/index';\nexport * from '@tensorflow/tfjs-layers/src/index';\nexport * from '@tensorflow/tfjs-converter/src/index';\nexport * as data from '@tensorflow/tfjs-data/src/index';\nexport * from '@tensorflow/tfjs-backend-cpu/src/index';\nexport * from '@tensorflow/tfjs-backend-webgl/src/index';\nexport * from '@tensorflow/tfjs-backend-wasm/src/index';\n*/\n\n// export versions\nexport const version = {\n tfjs: packageBundle?.version || undefined,\n 'tfjs-core': packageCore?.version || undefined,\n 'tfjs-data': packageData?.version || undefined,\n 'tfjs-layers': packageLayers?.version || undefined,\n 'tfjs-converter': packageConverter?.version || undefined,\n 'tfjs-backend-cpu': version_cpu || undefined,\n 'tfjs-backend-webgl': version_webgl || undefined,\n 'tfjs-backend-wasm': version_wasm || undefined,\n};\n// export const version = {};\n", "/**\n * Custom TFJS backend for Human based on WebGL\n * Not used by default\n */\n\nimport { log } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport const config = {\n name: 'humangl',\n priority: 99,\n canvas: null,\n gl: null,\n width: 1024,\n height: 1024,\n webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: false,\n desynchronized: true,\n },\n};\n\nexport function register(): void {\n if (!tf.findBackend(config.name)) {\n log('backend registration:', config.name);\n try {\n config.canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(config.width, config.height) : document.createElement('canvas');\n } catch (err) {\n log('error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas.getContext('webgl2', config.webGLattr);\n } catch (err) {\n log('error: cannot get WebGL2 context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('error: cannot set WebGL2 context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('error: cannot register WebGL backend:', err);\n return;\n }\n try {\n const kernels = tf.getKernelsForBackend('webgl');\n kernels.forEach((kernelConfig) => {\n const newKernelConfig = { ...kernelConfig, backendName: config.name };\n tf.registerKernel(newKernelConfig);\n });\n } catch (err) {\n log('error: cannot update WebGL backend registration:', err);\n return;\n }\n try {\n tf.ENV.set('WEBGL_VERSION', 2);\n // tf.ENV.set('WEBGL_MAX_TEXTURE_SIZE', config.gl.getParameter(config.gl.MAX_TEXTURE_SIZE));\n // tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true);\n // tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n } catch (err) {\n log('error: cannot set WebGL backend flags:', err);\n return;\n }\n log('backend registered:', config.name);\n }\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)];\n const endPoint = [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n}\n\nexport const disposeBox = (t) => {\n t.startPoint.dispose();\n t.endPoint.dispose();\n};\n\nexport const createBox = (startEndTensor) => ({\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n", "export const IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nexport function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport function radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\n\nexport function buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n\nexport function xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\n\nexport function generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors: Array<[number, number]> = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\nimport { Config } from '../config';\nimport { Tensor, GraphModel } from '../tfjs/types';\n\nconst keypointsCount = 6;\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nexport class BlazeFaceModel {\n model: GraphModel;\n anchorsData: [number, number][];\n anchors: Tensor;\n inputSize: number;\n config: Config;\n\n constructor(model, config: Config) {\n this.model = model;\n this.anchorsData = util.generateAnchors(model.inputs[0].shape[1]);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = model.inputs[0].shape[2];\n this.config = config;\n }\n\n async getBoundingBoxes(inputImage: Tensor) {\n // sanity check on input\n // @ts-ignore isDisposed is internal property\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [batch, boxes, scores] = tf.tidy(() => {\n const resizedImage = tf.image.resizeBilinear(inputImage, [this.inputSize, this.inputSize]);\n const normalizedImage = resizedImage.div(127.5).sub(0.5);\n const res = this.model.execute(normalizedImage);\n let batchOut;\n if (Array.isArray(res)) { // are we using tfhub or pinto converted model?\n const sorted = res.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n batchOut = concat.squeeze(0);\n } else {\n batchOut = tf.squeeze(res); // when using tfhub model\n }\n const boxesOut = decodeBounds(batchOut, this.anchors, [this.inputSize, this.inputSize]);\n const logits = tf.slice(batchOut, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze().dataSync();\n return [batchOut, boxesOut, scoresOut];\n });\n const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);\n const nms = nmsTensor.arraySync();\n nmsTensor.dispose();\n const annotatedBoxes: Array<{ box: { startPoint: Tensor, endPoint: Tensor }, landmarks: Tensor, anchor: number[], confidence: number }> = [];\n for (let i = 0; i < nms.length; i++) {\n const confidence = scores[nms[i]];\n if (confidence > this.config.face.detector.minConfidence) {\n const boundingBox = tf.slice(boxes, [nms[i], 0], [1, -1]);\n const localBox = box.createBox(boundingBox);\n boundingBox.dispose();\n const anchor = this.anchorsData[nms[i]];\n const landmarks = tf.tidy(() => tf.slice(batch, [nms[i], keypointsCount - 1], [1, -1]).squeeze().reshape([keypointsCount, -1]));\n annotatedBoxes.push({ box: localBox, landmarks, anchor, confidence });\n }\n }\n // boundingBoxes.forEach((t) => t.dispose());\n batch.dispose();\n boxes.dispose();\n // scores.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.inputSize, inputImage.shape[1] / this.inputSize],\n };\n }\n}\n\nexport async function load(config: Config) {\n const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });\n const blazeFace = new BlazeFaceModel(model, config);\n if (!model || !model.modelUrl) log('load model failed:', config.face.detector.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n return blazeFace;\n}\n", "export const MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\n\nexport const MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n // { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n // { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n\nexport const UV468 = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n\nexport const TRI468 = [\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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, 130, 33, 71, 21, 162,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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, 116, 73, 41, 72, 36, 203,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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,\n 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];\n\nexport const TRI68 = [0, 1, 36, 0, 36, 17, 1, 2, 41, 1, 41, 36, 2, 3, 31, 2, 31, 41, 3, 4, 48, 3, 48, 31, 4, 5, 48, 5, 6, 48, 6, 7, 59, 6, 59, 48, 7, 8, 58, 7, 58, 59,\n 8, 9, 56, 8, 56, 57, 8, 57, 58, 9, 10, 55, 9, 55, 56, 10, 11, 54, 10, 54, 55, 11, 12, 54, 12, 13, 54, 13, 14, 35, 13, 35, 54, 14, 15, 46, 14, 46, 35, 15, 16,\n 45, 15, 45, 46, 16, 26, 45, 17, 36, 18, 18, 37, 19, 18, 36, 37, 19, 38, 20, 19, 37, 38, 20, 39, 21, 20, 38, 39, 21, 39, 27, 22, 42, 23, 22, 27, 42, 23, 43, 24,\n 23, 42, 43, 24, 44, 25, 24, 43, 44, 25, 45, 26, 25, 44, 45, 27, 39, 28, 27, 28, 42, 28, 39, 29, 28, 29, 42, 29, 31, 30, 29, 30, 35, 29, 40, 31, 29, 35, 47, 29,\n 39, 40, 29, 47, 42, 30, 31, 32, 30, 32, 33, 30, 33, 34, 30, 34, 35, 31, 50, 32, 31, 40, 41, 31, 48, 49, 31, 49, 50, 32, 51, 33, 32, 50, 51, 33, 51, 34, 34, 52,\n 35, 34, 51, 52, 35, 46, 47, 35, 52, 53, 35, 53, 54, 36, 41, 37, 37, 40, 38, 37, 41, 40, 38, 40, 39, 42, 47, 43, 43, 47, 44, 44, 46, 45, 44, 47, 46, 48, 60, 49,\n 48, 59, 60, 49, 61, 50, 49, 60, 61, 50, 62, 51, 50, 61, 62, 51, 62, 52, 52, 63, 53, 52, 62, 63, 53, 64, 54, 53, 63, 64, 54, 64, 55, 55, 65, 56, 55, 64, 65, 56,\n 66, 57, 56, 65, 66, 57, 66, 58, 58, 67, 59, 58, 66, 67, 59, 67, 60, 60, 67, 61, 61, 66, 62, 61, 67, 66, 62, 66, 63, 63, 65, 64, 63, 66, 65, 21, 27, 22];\n\nexport const TRI33 = [\n /* eyes */ 0, 8, 7, 7, 8, 1, 2, 10, 9, 9, 10, 3,\n /* brows */ 17, 0, 18, 18, 0, 7, 18, 7, 19, 19, 7, 1, 19, 1, 11, 19, 11, 20, 21, 3, 22, 21, 9, 3, 20, 9, 21, 20, 2, 9, 20, 11, 2,\n /* 4head */ 23, 17, 18, 25, 21, 22, 24, 19, 20, 24, 18, 19, 24, 20, 21, 24, 23, 18, 24, 21, 25,\n /* nose */ 11, 12, 4, 11, 4, 13, 1, 12, 11, 11, 13, 2, 12, 14, 4, 4, 14, 13,\n /* up-lip */ 14, 5, 15, 14, 15, 6, 12, 5, 14, 14, 6, 13,\n /* cheeks */ 8, 12, 1, 2, 13, 10, 8, 26, 12, 10, 13, 27, 26, 5, 12, 13, 6, 27, 0, 26, 8, 10, 27, 3,\n /* chin */ 5, 32, 16, 16, 32, 6, 5, 30, 32, 6, 32, 31,\n /* cont */ 26, 30, 5, 27, 6, 31, 0, 28, 26, 3, 27, 29, 17, 28, 0, 3, 29, 22, 23, 28, 17, 22, 29, 25, 28, 30, 26, 27, 31, 29,\n];\n\nexport const TRI7 = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68 = [\n /* cont */ 127, 234, 132, 58, 172, 150, 149, 148, 152, 377, 378, 379, 397, 288, 361, 454, 356,\n /* brows */ 70, 63, 105, 66, 107, 336, 296, 334, 293, 300,\n /* nose */ 168, 6, 195, 4, 98, 97, 2, 326, 327,\n /* eyes */ 33, 160, 158, 133, 153, 144, 362, 385, 387, 263, 373, 380,\n /* lip */ 57, 40, 37, 0, 267, 270, 287, 321, 314, 17, 84, 91,\n /* mouth */ 78, 81, 13, 311, 308, 402, 14, 178,\n];\n\nexport const VTX33 = [33, 133, 362, 263, 1, 62, 308, 159, 145, 386, 374, 6, 102, 331, 2, 13, 14, 70, 105, 107, 336, 334, 300, 54, 10, 284, 50, 280, 234, 454, 58, 288, 152];\n\nexport const VTX7 = [33, 133, 362, 263, 1, 78, 308];\n\nexport const UV68 = VTX68.map((x) => UV468[x]);\n\nexport const UV33 = VTX33.map((x) => UV468[x]);\n\nexport const UV7 = VTX7.map((x) => UV468[x]);\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as bounding from './box';\nimport * as util from './util';\nimport * as coords from './coords';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { BlazeFaceModel } from './blazeface';\n\nconst leftOutline = coords.MESH_ANNOTATIONS['leftEyeLower0'];\nconst rightOutline = coords.MESH_ANNOTATIONS['rightEyeLower0'];\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst meshLandmarks = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, coords.MESH_ANNOTATIONS['midwayBetweenEyes'][0]],\n};\n\nconst blazeFaceLandmarks = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates\n// Update the z coordinate to be an average of the original and the new.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = coords.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = coords.MESH_ANNOTATIONS[`${prefix}${key}`];\n if (!keys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nexport class Pipeline {\n storedBoxes: Array<{ startPoint: number[], endPoint: number[], landmarks: Array, confidence: number, faceConfidence?: number }>;\n boundingBoxDetector: BlazeFaceModel; // tf.GraphModel\n meshDetector: GraphModel; // tf.GraphModel\n irisModel: GraphModel; // tf.GraphModel\n boxSize: number;\n meshSize: number;\n irisSize: number;\n irisEnlarge: number;\n skipped: number;\n detectedFaces: number;\n\n constructor(boundingBoxDetector, meshDetector, irisModel) {\n // An array of facial bounding boxes.\n this.storedBoxes = [];\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.boxSize = boundingBoxDetector?.model?.inputs[0].shape[2] || 0;\n this.meshSize = meshDetector?.inputs[0].shape[2] || boundingBoxDetector?.model?.inputs[0].shape[2];\n this.irisSize = irisModel?.inputs[0].shape[1] || 0;\n this.irisEnlarge = 2.3;\n this.skipped = 0;\n this.detectedFaces = 0;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const coordsScaled = rawCoords.map((coord) => ([\n boxSize[0] / this.meshSize * (coord[0] - this.meshSize / 2),\n boxSize[1] / this.meshSize * (coord[1] - this.meshSize / 2),\n coord[2],\n ]));\n const coordsRotationMatrix = (angle !== 0) ? util.buildRotationMatrix(angle, [0, 0]) : util.IDENTITY_MATRIX;\n const coordsRotated = (angle !== 0) ? coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = (angle !== 0) ? util.invertTransformMatrix(rotationMatrix) : util.IDENTITY_MATRIX;\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n return coordsRotated.map((coord) => ([\n Math.round(coord[0] + util.dot(boxCenter, inverseRotationMatrix[0])),\n Math.round(coord[1] + util.dot(boxCenter, inverseRotationMatrix[1])),\n Math.round(coord[2]),\n ]));\n }\n\n // eslint-disable-next-line class-methods-use-this\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[eyeLandmarks.leftBounds[0]][2];\n const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(bounding.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshSize,\n box.startPoint[0] / this.meshSize, box.endPoint[1] / this.meshSize,\n box.endPoint[0] / this.meshSize,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip && tf.ENV.flags.IS_BROWSER) {\n crop = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords: Array<[number, number, number]> = [];\n for (let i = 0; i < irisLandmarks.numCoordinates; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip ? (1 - (x / this.irisSize)) : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(irisLandmarks.index) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n // eslint-disable-next-line class-methods-use-this\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeLower0`][irisLandmarks.lowerCenter]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n let useFreshBox = false;\n // run new detector every skipFrames unless we only want box to start with\n let detector;\n if ((this.skipped === 0) || (this.skipped > config.face.detector.skipFrames) || !config.face.mesh.enabled || !config.skipFrame) {\n detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n this.skipped = 0;\n }\n if (config.skipFrame) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (!config.skipFrame || (detector && detector.boxes && (!config.face.mesh.enabled || (detector.boxes.length !== this.detectedFaces) && (this.detectedFaces !== config.face.detector.maxDetected)))) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n for (const possible of detector.boxes) {\n this.storedBoxes.push({ startPoint: possible.box.startPoint.dataSync(), endPoint: possible.box.endPoint.dataSync(), landmarks: possible.landmarks.arraySync(), confidence: possible.confidence });\n }\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n\n if (useFreshBox) {\n if (!detector || !detector.boxes || (detector.boxes.length === 0)) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n return null;\n }\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const scaledBox = bounding.scaleBoxCoordinates({ startPoint: this.storedBoxes[i].startPoint, endPoint: this.storedBoxes[i].endPoint }, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const squarifiedBox = bounding.squarifyBox(enlargedBox);\n const landmarks = this.storedBoxes[i].landmarks;\n const confidence = this.storedBoxes[i].confidence;\n this.storedBoxes[i] = { ...squarifiedBox, confidence, landmarks };\n }\n }\n if (detector && detector.boxes) {\n detector.boxes.forEach((prediction) => {\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n });\n }\n const results = tf.tidy(() => this.storedBoxes.map((box, i) => {\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n let face;\n let angle = 0;\n let rotationMatrix;\n\n if (config.face.detector.rotation && config.face.mesh.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.boxSize, this.boxSize]).div(255);\n } else {\n rotationMatrix = util.IDENTITY_MATRIX;\n const clonedImage = input.clone();\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.boxSize, this.boxSize]).div(255);\n }\n\n // if we're not going to produce mesh, don't spend time with further processing\n if (!config.face.mesh.enabled) {\n const prediction = {\n mesh: [],\n box,\n faceConfidence: null,\n boxConfidence: box.confidence,\n confidence: box.confidence,\n image: face,\n };\n return prediction;\n }\n\n const [, confidence, contourCoords] = this.meshDetector.execute(face) as Array; // The first returned tensor represents facial contours which are already included in the coordinates.\n const faceConfidence = confidence.dataSync()[0] as number;\n if (faceConfidence < config.face.detector.minConfidence) {\n this.storedBoxes[i].confidence = faceConfidence; // reset confidence of cached box\n return null; // if below confidence just exit\n }\n const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n\n if (config.face.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1]);\n const eyePredictions = this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop])) as Tensor;\n const eyePredictionsData = eyePredictions.dataSync();\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', null);\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', null);\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged\n // So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n\n // override box from detection with one calculated from mesh\n const mesh = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n const storeConfidence = box.confidence;\n // @ts-ignore enlargeBox does not include confidence so we append it manually\n box = bounding.enlargeBox(bounding.calculateLandmarksBoundingBox(mesh), 1.5); // redefine box with mesh calculated one\n box.confidence = storeConfidence;\n\n // do rotation one more time with mesh keypoints if we want to return perfect image\n if (config.face.detector.rotation && config.face.mesh.enabled && config.face.description.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input.toFloat(), angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n }\n\n const prediction = {\n mesh,\n box,\n faceConfidence,\n boxConfidence: box.confidence,\n image: face,\n };\n\n // updated stored cache values\n this.storedBoxes[i] = { ...bounding.squarifyBox(box), confidence: box.confidence, faceConfidence };\n\n return prediction;\n }));\n\n // results = results.filter((a) => a !== null);\n // remove cache entries for detected boxes on low confidence\n if (config.face.mesh.enabled) this.storedBoxes = this.storedBoxes.filter((a) => a.confidence > config.face.detector.minConfidence);\n this.detectedFaces = results.length;\n\n return results;\n }\n}\n", "/**\n * FaceMesh & BlazeFace Module entry point\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as blazeface from './blazeface';\nimport * as facepipeline from './facepipeline';\nimport * as coords from './coords';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Face } from '../result';\nimport { Config } from '../config';\n\nlet faceModels: [blazeface.BlazeFaceModel | null, GraphModel | null, GraphModel | null] = [null, null, null];\nlet facePipeline;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const predictions = await facePipeline.predict(input, config);\n const results: Array = [];\n let id = 0;\n for (const prediction of (predictions || [])) {\n if (!prediction || prediction.isDisposedInternal) continue; // guard against disposed tensors on long running operations such as pause in middle of processing\n const meshRaw = prediction.mesh.map((pt) => [\n pt[0] / (input.shape[2] || 0),\n pt[1] / (input.shape[1] || 0),\n pt[2] / facePipeline.meshSize,\n ]);\n const annotations = {};\n if (prediction.mesh && prediction.mesh.length > 0) {\n for (const key of Object.keys(coords.MESH_ANNOTATIONS)) annotations[key] = coords.MESH_ANNOTATIONS[key].map((index) => prediction.mesh[index]);\n }\n const clampedBox: [number, number, number, number] = prediction.box ? [\n Math.trunc(Math.max(0, prediction.box.startPoint[0])),\n Math.trunc(Math.max(0, prediction.box.startPoint[1])),\n Math.trunc(Math.min((input.shape[2] || 0), prediction.box.endPoint[0]) - Math.max(0, prediction.box.startPoint[0])),\n Math.trunc(Math.min((input.shape[1] || 0), prediction.box.endPoint[1]) - Math.max(0, prediction.box.startPoint[1])),\n ] : [0, 0, 0, 0];\n const boxRaw: [number, number, number, number] = prediction.box ? [\n prediction.box.startPoint[0] / (input.shape[2] || 0),\n prediction.box.startPoint[1] / (input.shape[1] || 0),\n (prediction.box.endPoint[0] - prediction.box.startPoint[0]) / (input.shape[2] || 0),\n (prediction.box.endPoint[1] - prediction.box.startPoint[1]) / (input.shape[1] || 0),\n ] : [0, 0, 0, 0];\n results.push({\n id: id++,\n score: Math.round(100 * prediction.faceConfidence || 100 * prediction.boxConfidence || 0) / 100,\n boxScore: Math.round(100 * prediction.boxConfidence) / 100,\n faceScore: Math.round(100 * prediction.faceConfidence) / 100,\n box: clampedBox,\n boxRaw,\n mesh: prediction.mesh,\n meshRaw,\n annotations,\n image: prediction.image,\n tensor: prediction.image,\n });\n if (prediction.coords) prediction.coords.dispose();\n }\n return results;\n}\n\nexport async function load(config): Promise<[unknown, unknown, unknown]> {\n if ((!faceModels[0] && config.face.enabled) || (!faceModels[1] && config.face.mesh.enabled) || (!faceModels[2] && config.face.iris.enabled)) {\n // @ts-ignore type mismatch for GraphModel\n faceModels = await Promise.all([\n (!faceModels[0] && config.face.enabled) ? blazeface.load(config) : null,\n (!faceModels[1] && config.face.mesh.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.mesh.modelPath), { fromTFHub: config.face.mesh.modelPath.includes('tfhub.dev') }) : null,\n (!faceModels[2] && config.face.iris.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.iris.modelPath), { fromTFHub: config.face.iris.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.face.mesh.enabled) {\n if (!faceModels[1] || !faceModels[1]['modelUrl']) log('load model failed:', config.face.mesh.modelPath);\n else if (config.debug) log('load model:', faceModels[1]['modelUrl']);\n }\n if (config.face.iris.enabled) {\n if (!faceModels[2] || !faceModels[2]['modelUrl']) log('load model failed:', config.face.iris.modelPath);\n else if (config.debug) log('load model:', faceModels[2]['modelUrl']);\n }\n } else if (config.debug) {\n if (faceModels[0]) log('cached model:', faceModels[0].model['modelUrl']);\n if (faceModels[1]) log('cached model:', faceModels[1]['modelUrl']);\n if (faceModels[2]) log('cached model:', faceModels[2]['modelUrl']);\n }\n facePipeline = new facepipeline.Pipeline(faceModels[0], faceModels[1], faceModels[2]);\n return faceModels;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "/**\n * Emotion Module\n */\n\nimport { log, join } from '../helpers';\nimport { Config } from '../config';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nconst annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];\nlet model;\n// let last: Array<{ score: number, emotion: string }> = [];\nconst last: Array> = [];\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// tuning values\nconst rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale\n\nexport async function load(config: Config): Promise {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < config.face.emotion.skipFrames) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const normalize = tf.tidy(() => grayscale.sub(0.5).mul(2));\n grayscale.dispose();\n const obj: Array<{ score: number, emotion: string }> = [];\n if (config.face.emotion.enabled) {\n const emotionT = await model.predict(normalize); // result is already in range 0..1, no need for additional activation\n const data = emotionT.dataSync();\n tf.dispose(emotionT);\n for (let i = 0; i < data.length; i++) {\n if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n }\n normalize.dispose();\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * HSE-FaceRes Module\n * Returns Age, Gender, Descriptor\n * Implements Face simmilarity function\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\nconst last: Array<{\n age: number,\n gender: string,\n genderScore: number,\n descriptor: number[],\n}> = [];\n\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\ntype DB = Array<{ name: string, source: string, embedding: number[] }>;\n\nexport async function load(config: Config): Promise {\n const modelUrl = join(config.modelBasePath, config.face.description.modelPath);\n if (!model) {\n // @ts-ignore type mismatch for GraphModel\n model = await tf.loadGraphModel(modelUrl);\n if (!model) log('load model failed:', config.face.description.modelPath);\n else if (config.debug) log('load model:', modelUrl);\n } else if (config.debug) log('cached model:', modelUrl);\n return model;\n}\n\nexport function similarity(embedding1: Array, embedding2: Array, order = 2): number {\n if (!embedding1 || !embedding2) return 0;\n if (embedding1?.length === 0 || embedding2?.length === 0) return 0;\n if (embedding1?.length !== embedding2?.length) return 0;\n // general minkowski distance, euclidean distance is limited case where order is 2\n const distance = 5.0 * embedding1\n .map((_val, i) => (Math.abs(embedding1[i] - embedding2[i]) ** order)) // distance squared\n .reduce((sum, now) => (sum + now), 0) // sum all distances\n ** (1 / order); // get root of\n const res = Math.max(0, 100 - distance) / 100.0;\n return res;\n}\n\nexport function match(embedding: Array, db: DB, threshold = 0) {\n let best = { similarity: 0, name: '', source: '', embedding: [] as number[] };\n if (!embedding || !db || !Array.isArray(embedding) || !Array.isArray(db)) return best;\n for (const f of db) {\n if (f.embedding && f.name) {\n const perc = similarity(embedding, f.embedding);\n if (perc > threshold && perc > best.similarity) best = { ...f, similarity: perc };\n }\n }\n return best;\n}\n\nexport function enhance(input): Tensor {\n const image = tf.tidy(() => {\n // input received from detector is already normalized to 0..1\n // input is also assumed to be straightened\n const tensor = input.image || input.tensor || input;\n if (!(tensor instanceof tf.Tensor)) return null;\n // do a tight crop of image and resize it to fit the model\n const box = [[0.05, 0.15, 0.85, 0.85]]; // empyrical values for top, left, bottom, right\n // const box = [[0.0, 0.0, 1.0, 1.0]]; // basically no crop for test\n if (!model.inputs[0].shape) return null; // model has no shape so no point continuing\n const crop = (tensor.shape.length === 3)\n ? tf.image.cropAndResize(tf.expandDims(tensor, 0), box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) // add batch dimension if missing\n : tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n\n /*\n // just resize to fit the embedding model instead of cropping\n const crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n */\n\n /*\n // convert to black&white to avoid colorization impact\n const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const [red, green, blue] = tf.split(crop, 3, 3);\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n const merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\n */\n\n /*\n // increase image pseudo-contrast 100%\n // (or do it per-channel so mean is done on each channel)\n // (or calculate histogram and do it based on histogram)\n const mean = merge.mean();\n const factor = 2;\n const contrast = merge.sub(mean).mul(factor).add(mean);\n */\n\n /*\n // normalize brightness from 0..1\n // silly way of creating pseudo-hdr of image\n const darken = crop.sub(crop.min());\n const lighten = darken.div(darken.max());\n */\n\n const norm = crop.mul(255);\n\n return norm;\n });\n return image;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < config.face.description.skipFrames) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const enhanced = enhance(image);\n\n let resT;\n const obj = {\n age: 0,\n gender: 'unknown',\n genderScore: 0,\n descriptor: [],\n };\n\n if (config.face.description.enabled) resT = await model.predict(enhanced);\n tf.dispose(enhanced);\n\n if (resT) {\n tf.tidy(() => {\n const gender = resT.find((t) => t.shape[1] === 1).dataSync();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > config.face.description.minConfidence) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderScore = Math.min(0.99, confidence);\n }\n const age = resT.find((t) => t.shape[1] === 100).argMax(1).dataSync()[0];\n const all = resT.find((t) => t.shape[1] === 100).dataSync();\n obj.age = Math.round(all[age - 1] > all[age + 1] ? 10 * age - 100 * all[age - 1] : 10 * age + 100 * all[age + 1]) / 10;\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]); // reshape large 1024-element descriptor to 128 x 8\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it which leaves us with 128-element descriptor\n\n obj.descriptor = [...desc.dataSync()];\n });\n resT.forEach((t) => tf.dispose(t));\n }\n\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * Module that analyzes person age\n * Obsolete\n */\n\nimport { log, now } from './helpers';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as facemesh from './blazeface/facemesh';\nimport * as emotion from './emotion/emotion';\nimport * as faceres from './faceres/faceres';\nimport { Face } from './result';\nimport { Tensor } from './tfjs/types';\n\n// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nconst calculateGaze = (face): { bearing: number, strength: number } => {\n const radians = (pt1, pt2) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points\n if (!face.annotations['rightEyeIris'] || !face.annotations['leftEyeIris']) return { bearing: 0, strength: 0 };\n\n const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes\n const eyeRatio = 1; // factor to normalize changes x vs y\n\n const left = face.mesh[33][2] > face.mesh[263][2]; // pick left or right eye depending which one is closer bazed on outsize point z axis\n const irisCenter = left ? face.mesh[473] : face.mesh[468];\n const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise\n ? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]\n : [(face.mesh[263][0] + face.mesh[362][0]) / 2, (face.mesh[263][1] + face.mesh[362][1]) / 2];\n const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions\n ? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]\n : [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];\n\n const eyeDiff = [ // x distance between extreme point and center point normalized with eye size\n (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],\n eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],\n ];\n let strength = Math.sqrt((eyeDiff[0] ** 2) + (eyeDiff[1] ** 2)); // vector length is a diagonal between two differences\n strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision\n const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees\n\n return { bearing, strength };\n};\n\nconst calculateFaceAngle = (face, imageSize): {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n} => {\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v) => { // normalize vector\n const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] /= length;\n v[1] /= length;\n v[2] /= length;\n return v;\n };\n const subVectors = (a, b) => { // vector subtraction (a - b)\n const x = a[0] - b[0];\n const y = a[1] - b[1];\n const z = a[2] - b[2];\n return [x, y, z];\n };\n const crossVectors = (a, b) => { // vector cross product (a x b)\n const x = a[1] * b[2] - a[2] * b[1];\n const y = a[2] * b[0] - a[0] * b[2];\n const z = a[0] * b[1] - a[1] * b[0];\n return [x, y, z];\n };\n // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf\n const rotationMatrixToEulerAngle = (r) => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;\n let thetaX; let thetaY; let thetaZ;\n if (r10 < 1) { // YZX calculation\n if (r10 > -1) {\n thetaZ = Math.asin(r10);\n thetaY = Math.atan2(-r20, r00);\n thetaX = Math.atan2(-r12, r11);\n } else {\n thetaZ = -Math.PI / 2;\n thetaY = -Math.atan2(r21, r22);\n thetaX = 0;\n }\n } else {\n thetaZ = Math.PI / 2;\n thetaY = Math.atan2(r21, r22);\n thetaX = 0;\n }\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n // simple Euler angle calculation based existing 3D mesh\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const meshToEulerAngle = (mesh) => {\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const angle = {\n // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center\n // pitch is face move up/down\n pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face\n // yaw is face turn left/right\n yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye\n // roll is face lean left/right\n roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye\n };\n return angle;\n };\n\n // initialize gaze and mesh\n const mesh = face.meshRaw;\n if (!mesh || mesh.length < 300) return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };\n\n const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;\n // top, bottom, left, right\n const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [\n // make the xyz coordinates proportional, independent of the image/box size\n pt[0] * imageSize[0] / size,\n pt[1] * imageSize[1] / size,\n pt[2],\n ]);\n\n const y_axis = normalize(subVectors(pts[1], pts[0]));\n let x_axis = normalize(subVectors(pts[3], pts[2]));\n const z_axis = normalize(crossVectors(x_axis, y_axis));\n // adjust x_axis to make sure that all axes are perpendicular to each other\n x_axis = crossVectors(y_axis, z_axis);\n\n // Rotation Matrix from Axis Vectors - http://renderdan.blogspot.com/2006/05/rotation-matrix-from-axis-vectors.html\n // 3x3 rotation matrix is flatten to array in row-major order. Note that the rotation represented by this matrix is inverted.\n const matrix: [number, number, number, number, number, number, number, number, number] = [\n x_axis[0], x_axis[1], x_axis[2],\n y_axis[0], y_axis[1], y_axis[2],\n z_axis[0], z_axis[1], z_axis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n\n // we have iris keypoints so we can calculate gaze direction\n const gaze = mesh.length === 478 ? calculateGaze(face) : { bearing: 0, strength: 0 };\n\n return { angle, matrix, gaze };\n};\n\nexport const detectFace = async (parent /* instance of human */, input: Tensor): Promise => {\n // run facemesh, includes blazeface and iris\n // eslint-disable-next-line no-async-promise-executor\n let timeStamp;\n let ageRes;\n let genderRes;\n let emotionRes;\n let embeddingRes;\n let descRes;\n const faceRes: Array = [];\n parent.state = 'run:face';\n timeStamp = now();\n const faces = await facemesh.predict(input, parent.config);\n parent.performance.face = Math.trunc(now() - timeStamp);\n if (!input.shape || input.shape.length !== 4) return [];\n if (!faces) return [];\n // for (const face of faces) {\n for (let i = 0; i < faces.length; i++) {\n parent.analyze('Get Face');\n\n // is something went wrong, skip the face\n // @ts-ignore possibly undefined\n if (!faces[i].image || faces[i].image['isDisposedInternal']) {\n log('Face object is disposed:', faces[i].image);\n continue;\n }\n\n const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Emotion:');\n if (parent.config.async) {\n emotionRes = parent.config.face.emotion.enabled ? emotion.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : {};\n } else {\n parent.state = 'run:emotion';\n timeStamp = now();\n emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : {};\n parent.performance.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Emotion:');\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Description:');\n if (parent.config.async) {\n descRes = parent.config.face.description.enabled ? faceres.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : [];\n } else {\n parent.state = 'run:description';\n timeStamp = now();\n descRes = parent.config.face.description.enabled ? await faceres.predict(faces[i].image || tf.tensor([]), parent.config, i, faces.length) : [];\n parent.performance.embedding = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Description:');\n\n // if async wait for results\n if (parent.config.async) {\n [ageRes, genderRes, emotionRes, embeddingRes, descRes] = await Promise.all([ageRes, genderRes, emotionRes, embeddingRes, descRes]);\n }\n\n parent.analyze('Finish Face:');\n\n // calculate iris distance\n // iris: array[ center, left, top, right, bottom]\n if (!parent.config.face.iris.enabled && faces[i]?.annotations?.leftEyeIris && faces[i]?.annotations?.rightEyeIris) {\n delete faces[i].annotations.leftEyeIris;\n delete faces[i].annotations.rightEyeIris;\n }\n const irisSize = (faces[i].annotations?.leftEyeIris && faces[i].annotations?.rightEyeIris)\n /* note: average human iris size is 11.7mm */\n ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2]\n : 0;\n\n // combine results\n faceRes.push({\n ...faces[i],\n id: i,\n age: descRes.age,\n gender: descRes.gender,\n genderScore: descRes.genderScore,\n embedding: descRes.descriptor,\n emotion: emotionRes,\n iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,\n rotation,\n tensor: parent.config.face.detector.return ? tf.squeeze(faces[i].image) : null,\n });\n // dispose original face tensor\n tf.dispose(faces[i].image);\n // delete temp face image\n if (faces[i].image) delete faces[i].image;\n\n parent.analyze('End Face');\n }\n parent.analyze('End FaceMesh:');\n if (parent.config.async) {\n if (parent.performance.face) delete parent.performance.face;\n if (parent.performance.age) delete parent.performance.age;\n if (parent.performance.gender) delete parent.performance.gender;\n if (parent.performance.emotion) delete parent.performance.emotion;\n }\n return faceRes;\n};\n", "export const partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\n\nexport const count = partNames.length; // 17 keypoints\n\nexport const partIds = partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\n\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\nexport const connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));\n\nexport const poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\n", "import * as kpt from './keypoints';\nimport { Body } from '../result';\n\nexport function eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\n\nexport function getBoundingBox(keypoints): [number, number, number, number] {\n const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n });\n return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];\n}\n\nexport function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]): Array {\n const scaleY = height / inputResolutionHeight;\n const scaleX = width / inputResolutionWidth;\n const scalePose = (pose, i) => ({\n id: i,\n score: pose.score,\n boxRaw: [pose.box[0] / inputResolutionWidth, pose.box[1] / inputResolutionHeight, pose.box[2] / inputResolutionWidth, pose.box[3] / inputResolutionHeight],\n box: [Math.trunc(pose.box[0] * scaleX), Math.trunc(pose.box[1] * scaleY), Math.trunc(pose.box[2] * scaleX), Math.trunc(pose.box[3] * scaleY)],\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: [Math.trunc(position.x * scaleX), Math.trunc(position.y * scaleY)],\n positionRaw: [position.x / inputResolutionHeight, position.y / inputResolutionHeight],\n })),\n });\n const scaledPoses = poses.map((pose, i) => scalePose(pose, i));\n return scaledPoses;\n}\n\n// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nexport class MaxHeap {\n priorityQueue: Array; // don't touch\n numberOfElements: number;\n getElementValue: unknown; // function call\n\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() { return this.numberOfElements === -1; }\n\n size() { return this.numberOfElements + 1; }\n\n all() { return this.priorityQueue.slice(0, this.numberOfElements + 1); }\n\n max() { return this.priorityQueue[0]; }\n\n swim(k) {\n while (k > 0 && this.less(Math.floor(k / 2), k)) {\n this.exchange(k, Math.floor(k / 2));\n k = Math.floor(k / 2);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n // @ts-ignore getter is of unknown type\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\n\nexport function getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.count),\n };\n}\n\nexport function getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\n\nexport function fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\n\nexport function clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\n\nexport function squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\n\nexport function addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\nexport function clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\n", "import * as utils from './utils';\nimport * as kpt from './keypoints';\n\nconst localMaximumRadius = 1;\nconst outputStride = 16;\nconst squaredNmsRadius = 50 ** 2;\n\nfunction traverse(edgeId, sourceKeypoint, targetId, scores, offsets, displacements, offsetRefineStep = 2) {\n const getDisplacement = (point) => ({\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, (displacements.shape[2] / 2) + edgeId),\n });\n const getStridedIndexNearPoint = (point, height, width) => ({\n y: utils.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: utils.clamp(Math.round(point.x / outputStride), 0, width - 1),\n });\n\n const [height, width] = scores.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, height, width);\n const displacement = getDisplacement(sourceKeypointIndices);\n const displacedPoint = utils.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const offsetPoint = utils.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetId, offsets);\n targetKeypoint = utils.addVectors(\n { x: targetKeypointIndices.x * outputStride, y: targetKeypointIndices.y * outputStride },\n { x: offsetPoint.x, y: offsetPoint.y },\n );\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scores.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetId);\n return { position: targetKeypoint, part: kpt.partNames[targetId], score };\n}\n\nexport function decodePose(root, scores, offsets, displacementsFwd, displacementsBwd) {\n const tuples = kpt.poseChain.map(([parentJoinName, childJoinName]) => ([kpt.partIds[parentJoinName], kpt.partIds[childJoinName]]));\n const edgesFwd = tuples.map(([, childJointId]) => childJointId);\n const edgesBwd = tuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2]; // [21,21,17]\n const numEdges = edgesFwd.length;\n const keypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const rootPoint = utils.getImageCoords(root.part, outputStride, offsets);\n keypoints[root.part.id] = {\n score: root.score,\n part: kpt.partNames[root.part.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceId = edgesFwd[edge];\n const targetId = edgesBwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceId = edgesBwd[edge];\n const targetId = edgesFwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsFwd);\n }\n }\n return keypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) break;\n }\n return localMaximum;\n}\n\nexport function buildPartWithScoreQueue(minConfidence, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new utils.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < minConfidence) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores)) queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n return queue;\n}\n\nfunction withinRadius(poses, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId]?.position;\n if (!correspondingKeypoint) return false;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, keypoints) {\n const notOverlappedKeypointScores = keypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / keypoints.length;\n}\n\nexport function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected, minConfidence) {\n const poses: Array<{ keypoints, box: [number, number, number, number], score: number }> = [];\n const queue = buildPartWithScoreQueue(minConfidence, scores);\n // Generate at most maxDetected object instances per image in decreasing root part score order.\n while (poses.length < maxDetected && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it is within a disk of `nmsRadius` pixels from the corresponding part of a previously detected instance.\n // @ts-ignore this one is tree walk\n const rootImageCoords = utils.getImageCoords(root.part, outputStride, offsets);\n // @ts-ignore this one is tree walk\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n let keypoints = decodePose(root, scores, offsets, displacementsFwd, displacementsBwd);\n keypoints = keypoints.filter((a) => a.score > minConfidence);\n const score = getInstanceScore(poses, keypoints);\n const box = utils.getBoundingBox(keypoints);\n if (score > minConfidence) poses.push({ keypoints, box, score: Math.round(100 * score) / 100 });\n }\n return poses;\n}\n", "/**\n * PoseNet module entry point\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as poses from './poses';\nimport * as util from './utils';\nimport { Body } from '../result';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const res = tf.tidy(() => {\n if (!model.inputs[0].shape) return [];\n const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = resized.toFloat().div(127.5).sub(1.0);\n const results: Array = model.execute(normalized, poseNetOutputs) as Array;\n const results3d = results.map((y) => tf.squeeze(y, [0]));\n results3d[1] = results3d[1].sigmoid(); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor) => tensor.buffer()));\n for (const t of res) t.dispose();\n\n const decoded = await poses.decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n if (!model.inputs[0].shape) return [];\n const scaled = util.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) as Body[];\n return scaled;\n}\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch for GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks, confidence: box.confidence };\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0],\n box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n", "export const anchors = [\n { x: 0.015625, y: 0.015625 },\n { x: 0.015625, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n];\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as anchors from './anchors';\nimport { Tensor, GraphModel } from '../tfjs/types';\n\nexport class HandDetector {\n model: GraphModel;\n anchors: number[][];\n anchorsTensor: Tensor;\n inputSize: number;\n inputSizeTensor: Tensor;\n doubleInputSizeTensor: Tensor;\n\n constructor(model) {\n this.model = model;\n this.anchors = anchors.anchors.map((anchor) => [anchor.x, anchor.y]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n // @ts-ignore model is not undefined here\n this.inputSize = this.model?.inputs[0].shape[2];\n this.inputSizeTensor = tf.tensor1d([this.inputSize, this.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([this.inputSize * 2, this.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoxes(input, config) {\n const batched = this.model.predict(input) as Tensor;\n const predictions = tf.squeeze(batched);\n batched.dispose();\n const scoresT = tf.tidy(() => tf.sigmoid(tf.slice(predictions, [0, 0], [-1, 1])).squeeze());\n const scores = scoresT.dataSync();\n const rawBoxes = tf.slice(predictions, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n rawBoxes.dispose();\n const filteredT = await tf.image.nonMaxSuppressionAsync(boxes, scores, config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const filtered = filteredT.arraySync();\n\n scoresT.dispose();\n filteredT.dispose();\n const hands: Array<{ box: Tensor, palmLandmarks: Tensor, confidence: number }> = [];\n for (const index of filtered) {\n if (scores[index] >= config.hand.minConfidence) {\n const matchingBox = tf.slice(boxes, [index, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(predictions, [index, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, index).reshape([-1, 2]));\n rawPalmLandmarks.dispose();\n hands.push({ box: matchingBox, palmLandmarks, confidence: scores[index] });\n }\n }\n predictions.dispose();\n boxes.dispose();\n return hands;\n }\n\n async estimateHandBounds(input, config): Promise<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }[]> {\n const inputHeight = input.shape[1];\n const inputWidth = input.shape[2];\n const image = tf.tidy(() => input.resizeBilinear([this.inputSize, this.inputSize]).div(127.5).sub(1));\n const predictions = await this.getBoxes(image, config);\n image.dispose();\n const hands: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }> = [];\n if (!predictions || predictions.length === 0) return hands;\n for (const prediction of predictions) {\n const boxes = prediction.box.dataSync();\n const startPoint = boxes.slice(0, 2);\n const endPoint = boxes.slice(2, 4);\n const palmLandmarks = prediction.palmLandmarks.arraySync();\n prediction.box.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(box.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks, confidence: prediction.confidence }, [inputWidth / this.inputSize, inputHeight / this.inputSize]));\n }\n return hands;\n }\n}\n", "export function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\nimport * as detector from './handdetector';\nimport { Tensor, GraphModel } from '../tfjs/types';\n\nconst palmBoxEnlargeFactor = 5; // default 3\nconst handBoxEnlargeFactor = 1.65; // default 1.65\nconst palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];\nconst palmLandmarksPalmBase = 0;\nconst palmLandmarksMiddleFingerBase = 2;\n\nexport class HandPipeline {\n handDetector: detector.HandDetector;\n handPoseModel: GraphModel;\n inputSize: number;\n storedBoxes: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number } | null>;\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, handPoseModel) {\n this.handDetector = handDetector;\n this.handPoseModel = handPoseModel;\n // @ts-ignore model is not undefined here\n this.inputSize = this.handPoseModel?.inputs[0].shape[2];\n this.storedBoxes = [];\n this.skipped = 0;\n this.detectedHands = 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n return box.enlargeBox(box.squarifyBox(boxAroundPalm), palmBoxEnlargeFactor);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = box.enlargeBox(box.squarifyBox(boundingBox), handBoxEnlargeFactor);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < palmLandmarkIds.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[palmLandmarkIds[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = box.getBoxSize(box2);\n const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.inputSize / 2),\n scaleFactor[1] * (coord[1] - this.inputSize / 2),\n scaleFactor[2] * coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...box.getBoxCenter(box2), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n Math.trunc(coord[0] + originalBoxCenter[0]),\n Math.trunc(coord[1] + originalBoxCenter[1]),\n Math.trunc(coord[2]),\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames unless we only want box to start with\n let boxes;\n\n // console.log(this.skipped, config.hand.skipFrames, !config.hand.landmarks, !config.skipFrame);\n if ((this.skipped === 0) || (this.skipped > config.hand.skipFrames) || !config.hand.landmarks || !config.skipFrame) {\n boxes = await this.handDetector.estimateHandBounds(image, config);\n this.skipped = 0;\n }\n if (config.skipFrame) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (boxes && (boxes.length > 0) && ((boxes.length !== this.detectedHands) && (this.detectedHands !== config.hand.maxDetected) || !config.hand.landmarks)) {\n this.detectedHands = 0;\n this.storedBoxes = [...boxes];\n // for (const possible of boxes) this.storedBoxes.push(possible);\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n const hands: Array<{ landmarks?: number[], confidence: number, box: { topLeft: number[], bottomRight: number[] } }> = [];\n\n // go through working set of boxes\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const currentBox = this.storedBoxes[i];\n if (!currentBox) continue;\n if (config.hand.landmarks) {\n const angle = config.hand.rotation ? util.computeRotation(currentBox.palmLandmarks[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0;\n const palmCenter = box.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation && tf.ENV.flags.IS_BROWSER ? tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone();\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = box.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const [confidenceT, keypoints] = await this.handPoseModel.predict(handImage) as Array;\n handImage.dispose();\n const confidence = confidenceT.dataSync()[0];\n confidenceT.dispose();\n if (confidence >= config.hand.minConfidence) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = keypointsReshaped.arraySync();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = { ...nextBoundingBox, confidence };\n const result = {\n landmarks: coords,\n confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n this.storedBoxes[i] = null;\n }\n keypoints.dispose();\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), handBoxEnlargeFactor);\n const enlarged = box.enlargeBox(box.squarifyBox(currentBox), handBoxEnlargeFactor);\n const result = {\n confidence: currentBox.confidence,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n return hands;\n }\n}\n", "/**\n * HandPose module entry point\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as handdetector from './handdetector';\nimport * as handpipeline from './handpipeline';\nimport { Hand } from '../result';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Config } from '../config';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n\nlet handDetectorModel: GraphModel | null;\nlet handPoseModel: GraphModel | null;\nlet handPipeline: handpipeline.HandPipeline;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: Array = [];\n for (let i = 0; i < predictions.length; i++) {\n const annotations = {};\n if (predictions[i].landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n // @ts-ignore landmarks are not undefined\n annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);\n }\n }\n\n const keypoints = predictions[i].landmarks as unknown as Array<[number, number, number]>;\n\n let box: [number, number, number, number] = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work\n let boxRaw: [number, number, number, number] = [0, 0, 0, 0];\n if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks\n for (const pt of keypoints) {\n if (pt[0] < box[0]) box[0] = pt[0];\n if (pt[1] < box[1]) box[1] = pt[1];\n if (pt[0] > box[2]) box[2] = pt[0];\n if (pt[1] > box[3]) box[3] = pt[1];\n }\n box[2] -= box[0];\n box[3] -= box[1];\n boxRaw = [box[0] / (input.shape[2] || 0), box[1] / (input.shape[1] || 0), box[2] / (input.shape[2] || 0), box[3] / (input.shape[1] || 0)];\n } else { // otherwise use box from prediction\n box = predictions[i].box ? [\n Math.trunc(Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.max(0, predictions[i].box.topLeft[1])),\n Math.trunc(Math.min((input.shape[2] || 0), predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.min((input.shape[1] || 0), predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])),\n ] : [0, 0, 0, 0];\n boxRaw = [\n (predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n ];\n }\n hands.push({ id: i, score: Math.round(100 * predictions[i].confidence) / 100, box, boxRaw, keypoints, annotations });\n }\n return hands;\n}\n\nexport async function load(config: Config): Promise<[unknown, unknown]> {\n if (!handDetectorModel || !handPoseModel) {\n // @ts-ignore type mismatch on GraphModel\n [handDetectorModel, handPoseModel] = await Promise.all([\n config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) : null,\n config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.hand.enabled) {\n if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector.modelPath);\n else if (config.debug) log('load model:', handDetectorModel['modelUrl']);\n if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton.modelPath);\n else if (config.debug) log('load model:', handPoseModel['modelUrl']);\n }\n } else {\n if (config.debug) log('cached model:', handDetectorModel['modelUrl']);\n if (config.debug) log('cached model:', handPoseModel['modelUrl']);\n }\n const handDetector = new handdetector.HandDetector(handDetectorModel);\n handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n return [handDetectorModel, handPoseModel];\n}\n", "export const full = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftPalm',\n 'rightPalm',\n 'leftIndex',\n 'rightIndex',\n 'leftPinky',\n 'rightPinky',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n 'leftHeel',\n 'rightHeel',\n 'leftFoot',\n 'rightFoot',\n 'midHip',\n 'forehead',\n 'leftThumb',\n 'leftHand',\n 'rightThumb',\n 'rightHand',\n];\n\nexport const upper = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'left:15',\n 'right:16',\n 'left:17',\n 'right:18',\n 'left:19',\n 'right:20',\n 'left:21',\n 'right:22',\n 'leftChest',\n 'rightChest',\n 'neck',\n 'forehead',\n 'left:27',\n 'right:28',\n 'left:29',\n 'right:30',\n];\n", "/**\n * BlazePose Module\n */\n\n// paper: https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as annotations from './annotations';\nimport { Tensor, GraphModel } from '../tfjs/types';\nimport { Body } from '../result';\nimport { Config } from '../config';\n\nlet model: GraphModel;\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch for Graphmodel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n model['width'] = parseInt(model['signature'].inputs['input_1:0'].tensorShape.dim[2].size);\n model['height'] = parseInt(model['signature'].inputs['input_1:0'].tensorShape.dim[1].size);\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if (!model) return [];\n if (!config.body.enabled) return [];\n const imgSize = { width: (image.shape[2] || 0), height: (image.shape[1] || 0) };\n const resize = tf.image.resizeBilinear(image, [model['width'], model['height']], false);\n const normalize = tf.div(resize, [255.0]);\n resize.dispose();\n const resT = await model.predict(normalize) as Array;\n const points = resT.find((t) => (t.size === 195 || t.size === 155))?.dataSync() || []; // order of output tensors may change between models, full has 195 and upper has 155 items\n resT.forEach((t) => t.dispose());\n normalize.dispose();\n const keypoints: Array<{ id, part, position: [number, number, number], positionRaw: [number, number, number], score, presence }> = [];\n const labels = points?.length === 195 ? annotations.full : annotations.upper; // full model has 39 keypoints, upper has 31 keypoints\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n keypoints.push({\n id: i,\n part: labels[i],\n position: [\n Math.trunc(imgSize.width * points[depth * i + 0] / 255), // return normalized x value istead of 0..255\n Math.trunc(imgSize.height * points[depth * i + 1] / 255), // return normalized y value istead of 0..255\n Math.trunc(points[depth * i + 2]) + 0, // fix negative zero\n ],\n positionRaw: [\n points[depth * i + 0] / 255, // return x value normalized to 0..1\n points[depth * i + 1] / 255, // return y value normalized to 0..1\n points[depth * i + 2] + 0, // fix negative zero\n ],\n score: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100, // reverse sigmoid value\n presence: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100, // reverse sigmoid value\n });\n }\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n const box: [number, number, number, number] = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...x),\n ];\n const boxRaw: [number, number, number, number] = [0, 0, 0, 0]; // not yet implemented\n const score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n return [{ id: 0, score, box, boxRaw, keypoints }];\n}\n", "/**\n * EfficientPose Module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { Body } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\n\ntype Keypoints = { score: number, part: string, position: [number, number], positionRaw: [number, number] };\n\nconst keypoints: Array = [];\nlet box: [number, number, number, number] = [0, 0, 0, 0];\nlet boxRaw: [number, number, number, number] = [0, 0, 0, 0];\nlet score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst bodyParts = ['head', 'neck', 'rightShoulder', 'rightElbow', 'rightWrist', 'chest', 'leftShoulder', 'leftElbow', 'leftWrist', 'pelvis', 'rightHip', 'rightKnee', 'rightAnkle', 'leftHip', 'leftKnee', 'leftAnkle'];\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch on GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// performs argmax and max functions on a 2d tensor\nfunction max2d(inputs, minScore) {\n const [width, height] = inputs.shape;\n return tf.tidy(() => {\n // modulus op implemented in tf\n const mod = (a, b) => tf.sub(a, tf.mul(tf.div(a, tf.scalar(b, 'int32')), tf.scalar(b, 'int32')));\n // combine all data\n const reshaped = tf.reshape(inputs, [height * width]);\n // get highest score\n const newScore = tf.max(reshaped, 0).dataSync()[0];\n if (newScore > minScore) {\n // skip coordinate calculation is score is too low\n const coords = tf.argMax(reshaped, 0);\n const x = mod(coords, width).dataSync()[0];\n const y = tf.div(coords, tf.scalar(width, 'int32')).dataSync()[0];\n return [x, y, newScore];\n }\n return [0, 0, newScore];\n });\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {\n skipped++;\n return [{ id: 0, score, box, boxRaw, keypoints }];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n if (!model.inputs[0].shape) return null;\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const enhance = tf.mul(resize, 2);\n const norm = enhance.sub(1);\n return norm;\n });\n\n let resT;\n if (config.body.enabled) resT = await model.predict(tensor);\n tensor.dispose();\n\n if (resT) {\n keypoints.length = 0;\n const squeeze = resT.squeeze();\n tf.dispose(resT);\n // body parts are basically just a stack of 2d tensors\n const stack = squeeze.unstack(2);\n tf.dispose(squeeze);\n // process each unstacked tensor as a separate body part\n for (let id = 0; id < stack.length; id++) {\n // actual processing to get coordinates and score\n const [x, y, partScore] = max2d(stack[id], config.body.minConfidence);\n if (score > config.body.minConfidence) {\n keypoints.push({\n score: Math.round(100 * partScore) / 100,\n part: bodyParts[id],\n positionRaw: [ // normalized to 0..1\n // @ts-ignore model is not undefined here\n x / model.inputs[0].shape[2], y / model.inputs[0].shape[1],\n ],\n position: [ // normalized to input image size\n // @ts-ignore model is not undefined here\n Math.round(image.shape[2] * x / model.inputs[0].shape[2]), Math.round(image.shape[1] * y / model.inputs[0].shape[1]),\n ],\n });\n }\n }\n stack.forEach((s) => tf.dispose(s));\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = keypoints.map((a) => a.positionRaw[0]);\n const yRaw = keypoints.map((a) => a.positionRaw[1]);\n boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n resolve([{ id: 0, score, box, boxRaw, keypoints }]);\n });\n}\n", "/**\n * EfficientPose Module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { Body } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model: GraphModel;\n\ntype Keypoints = { score: number, part: string, position: [number, number], positionRaw: [number, number] };\n\nconst keypoints: Array = [];\nlet box: [number, number, number, number] = [0, 0, 0, 0];\nlet boxRaw: [number, number, number, number] = [0, 0, 0, 0];\nlet score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst bodyParts = ['nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder', 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist', 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle'];\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch on GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < config.body.skipFrames) && config.skipFrame && Object.keys(keypoints).length > 0) {\n skipped++;\n return [{ id: 0, score, box, boxRaw, keypoints }];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n if (!model.inputs[0].shape) return null;\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const cast = tf.cast(resize, 'int32');\n return cast;\n });\n\n let resT;\n if (config.body.enabled) resT = await model.predict(tensor);\n tensor.dispose();\n\n if (resT) {\n keypoints.length = 0;\n const res = resT.arraySync();\n tf.dispose(resT);\n const kpt = res[0][0];\n for (let id = 0; id < kpt.length; id++) {\n score = kpt[id][2];\n if (score > config.body.minConfidence) {\n keypoints.push({\n score: Math.round(100 * score) / 100,\n part: bodyParts[id],\n positionRaw: [ // normalized to 0..1\n kpt[id][1],\n kpt[id][0],\n ],\n position: [ // normalized to input image size\n Math.round((image.shape[2] || 0) * kpt[id][1]),\n Math.round((image.shape[1] || 0) * kpt[id][0]),\n ],\n });\n }\n }\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = keypoints.map((a) => a.positionRaw[0]);\n const yRaw = keypoints.map((a) => a.positionRaw[1]);\n boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n resolve([{ id: 0, score, box, boxRaw, keypoints }]);\n });\n}\n", "/**\n * CoCo Labels used by object detection modules\n */\nexport const labels = [\n { class: 1, label: 'person' },\n { class: 2, label: 'bicycle' },\n { class: 3, label: 'car' },\n { class: 4, label: 'motorcycle' },\n { class: 5, label: 'airplane' },\n { class: 6, label: 'bus' },\n { class: 7, label: 'train' },\n { class: 8, label: 'truck' },\n { class: 9, label: 'boat' },\n { class: 10, label: 'traffic light' },\n { class: 11, label: 'fire hydrant' },\n { class: 12, label: 'stop sign' },\n { class: 13, label: 'parking meter' },\n { class: 14, label: 'bench' },\n { class: 15, label: 'bird' },\n { class: 16, label: 'cat' },\n { class: 17, label: 'dog' },\n { class: 18, label: 'horse' },\n { class: 19, label: 'sheep' },\n { class: 20, label: 'cow' },\n { class: 21, label: 'elephant' },\n { class: 22, label: 'bear' },\n { class: 23, label: 'zebra' },\n { class: 24, label: 'giraffe' },\n { class: 25, label: 'backpack' },\n { class: 26, label: 'umbrella' },\n { class: 27, label: 'handbag' },\n { class: 28, label: 'tie' },\n { class: 29, label: 'suitcase' },\n { class: 30, label: 'frisbee' },\n { class: 31, label: 'skis' },\n { class: 32, label: 'snowboard' },\n { class: 33, label: 'sports ball' },\n { class: 34, label: 'kite' },\n { class: 35, label: 'baseball bat' },\n { class: 36, label: 'baseball glove' },\n { class: 37, label: 'skateboard' },\n { class: 38, label: 'surfboard' },\n { class: 39, label: 'tennis racket' },\n { class: 40, label: 'bottle' },\n { class: 41, label: 'wine glass' },\n { class: 42, label: 'cup' },\n { class: 43, label: 'fork' },\n { class: 44, label: 'knife' },\n { class: 45, label: 'spoon' },\n { class: 46, label: 'bowl' },\n { class: 47, label: 'banana' },\n { class: 48, label: 'apple' },\n { class: 49, label: 'sandwich' },\n { class: 50, label: 'orange' },\n { class: 51, label: 'broccoli' },\n { class: 52, label: 'carrot' },\n { class: 53, label: 'hot dog' },\n { class: 54, label: 'pizza' },\n { class: 55, label: 'donut' },\n { class: 56, label: 'cake' },\n { class: 57, label: 'chair' },\n { class: 58, label: 'couch' },\n { class: 59, label: 'potted plant' },\n { class: 60, label: 'bed' },\n { class: 61, label: 'dining table' },\n { class: 62, label: 'toilet' },\n { class: 63, label: 'tv' },\n { class: 64, label: 'laptop' },\n { class: 65, label: 'mouse' },\n { class: 66, label: 'remote' },\n { class: 67, label: 'keyboard' },\n { class: 68, label: 'cell phone' },\n { class: 69, label: 'microwave' },\n { class: 70, label: 'oven' },\n { class: 71, label: 'toaster' },\n { class: 72, label: 'sink' },\n { class: 73, label: 'refrigerator' },\n { class: 74, label: 'book' },\n { class: 75, label: 'clock' },\n { class: 76, label: 'vase' },\n { class: 77, label: 'scissors' },\n { class: 78, label: 'teddy bear' },\n { class: 79, label: 'hair drier' },\n { class: 80, label: 'toothbrush' },\n];\n", "/**\n * NanoDet object detection module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport { Item } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model;\nlet last: Array = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config: Config): Promise {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res, inputSize, outputShape, config) {\n let id = 0;\n let results: Array = [];\n for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects\n // find scores, boxes, classes\n tf.tidy(() => { // wrap in tidy to automatically deallocate temp tensors\n const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();\n const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();\n const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdx = boxesMax.argMax(2).arraySync(); // what we need is indexes of features with highest scores, not values itself\n const scores = scoresT.arraySync(); // optionally use exponential scores or just as-is\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > config.object.minConfidence && j !== 61) {\n const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1\n const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1\n const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores\n const [x, y] = [\n cx - (scaleBox / strideSize * boxOffset[0]),\n cy - (scaleBox / strideSize * boxOffset[1]),\n ];\n const [w, h] = [\n cx + (scaleBox / strideSize * boxOffset[2]) - x,\n cy + (scaleBox / strideSize * boxOffset[3]) - y,\n ];\n let boxRaw = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))); // fix out-of-bounds coords\n const box = [ // results normalized to input image pixels\n boxRaw[0] * outputShape[0],\n boxRaw[1] * outputShape[1],\n boxRaw[2] * outputShape[0],\n boxRaw[3] * outputShape[1],\n ];\n const result = {\n id: id++,\n // strideSize,\n score: Math.round(100 * score) / 100,\n class: j + 1,\n label: labels[j].label,\n // center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n // centerRaw: [cx, cy],\n box: (box.map((a) => Math.trunc(a))) as [number, number, number, number],\n boxRaw: boxRaw as [number, number, number, number],\n };\n results.push(result);\n }\n }\n }\n });\n }\n // deallocate tensors\n res.forEach((t) => tf.dispose(t));\n\n // normally nms is run on raw results, but since boxes need to be calculated this way we skip calulcation of\n // unnecessary boxes and run nms only on good candidates (basically it just does IOU analysis as scores are already filtered)\n const nmsBoxes = results.map((a) => [a.boxRaw[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); // switches coordinates from x,y to y,x as expected by tf.nms\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: Array = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = nms.dataSync();\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((_val, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2], image.shape[1]];\n const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);\n const norm = resize.div(255);\n const transpose = norm.transpose([0, 3, 1, 2]);\n norm.dispose();\n resize.dispose();\n\n let objectT;\n if (config.object.enabled) objectT = await model.predict(transpose);\n transpose.dispose();\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * CenterNet object detection module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport { Item } from '../result';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\nlet model;\nlet last: Item[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res: Tensor, inputSize, outputShape, config: Config) {\n if (!res) return [];\n const results: Array = [];\n const detections = res.arraySync();\n const squeezeT = tf.squeeze(res);\n res.dispose();\n const arr = tf.split(squeezeT, 6, 1); // x1, y1, x2, y2, score, class\n squeezeT.dispose();\n const stackT = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x\n const boxesT = stackT.squeeze();\n const scoresT = arr[4].squeeze();\n const classesT = arr[5].squeeze();\n arr.forEach((t) => t.dispose());\n const nmsT = await tf.image.nonMaxSuppressionAsync(boxesT, scoresT, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n boxesT.dispose();\n scoresT.dispose();\n classesT.dispose();\n const nms = nmsT.dataSync();\n nmsT.dispose();\n let i = 0;\n for (const id of nms) {\n const score = Math.trunc(100 * detections[0][id][4]) / 100;\n const classVal = detections[0][id][5];\n const label = labels[classVal].label;\n const boxRaw = [\n detections[0][id][0] / inputSize,\n detections[0][id][1] / inputSize,\n detections[0][id][2] / inputSize,\n detections[0][id][3] / inputSize,\n ] as [number, number, number, number];\n const box = [\n Math.trunc(boxRaw[0] * outputShape[0]),\n Math.trunc(boxRaw[1] * outputShape[1]),\n Math.trunc(boxRaw[2] * outputShape[0]),\n Math.trunc(boxRaw[3] * outputShape[1]),\n ] as [number, number, number, number];\n results.push({ id: i++, score, class: classVal, label, box, boxRaw });\n }\n return results;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if ((skipped < config.object.skipFrames) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const outputSize = [input.shape[2], input.shape[1]];\n const resize = tf.image.resizeBilinear(input, [model.inputSize, model.inputSize]);\n const objectT = config.object.enabled ? model.execute(resize, ['tower_0/detections']) : null;\n resize.dispose();\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * Gesture detection module\n */\n\nimport { Gesture } from '../result';\n\nexport const body = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ body: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n // raising hands\n const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));\n const rightWrist = res[i].keypoints.find((a) => (a.part === 'rightWrist'));\n const nose = res[i].keypoints.find((a) => (a.part === 'nose'));\n if (nose && leftWrist && rightWrist && (leftWrist.position.y < nose.position.y) && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise right hand' });\n\n // leaning\n const leftShoulder = res[i].keypoints.find((a) => (a.part === 'leftShoulder'));\n const rightShoulder = res[i].keypoints.find((a) => (a.part === 'rightShoulder'));\n if (leftShoulder && rightShoulder) gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position.y > rightShoulder.position.y) ? 'left' : 'right'}` });\n }\n return gestures;\n};\n\nexport const face = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ face: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 0) {\n const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];\n if (Math.abs(eyeFacing) < 10) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${eyeFacing < 0 ? 'left' : 'right'}` });\n const openLeft = Math.abs(res[i].mesh[374][1] - res[i].mesh[386][1]) / Math.abs(res[i].mesh[443][1] - res[i].mesh[450][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openLeft < 0.2) gestures.push({ face: i, gesture: 'blink left eye' });\n const openRight = Math.abs(res[i].mesh[145][1] - res[i].mesh[159][1]) / Math.abs(res[i].mesh[223][1] - res[i].mesh[230][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openRight < 0.2) gestures.push({ face: i, gesture: 'blink right eye' });\n const mouthOpen = Math.min(100, 500 * Math.abs(res[i].mesh[13][1] - res[i].mesh[14][1]) / Math.abs(res[i].mesh[10][1] - res[i].mesh[152][1]));\n if (mouthOpen > 10) gestures.push({ face: i, gesture: `mouth ${Math.trunc(mouthOpen)}% open` });\n const chinDepth = res[i].mesh[152][2];\n if (Math.abs(chinDepth) > 10) gestures.push({ face: i, gesture: `head ${chinDepth < 0 ? 'up' : 'down'}` });\n }\n }\n return gestures;\n};\n\nexport const iris = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ iris: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.rightEyeIris) continue;\n const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];\n const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1];\n const areaLeft = Math.abs(sizeXLeft * sizeYLeft);\n\n const sizeXRight = res[i].annotations.rightEyeIris[3][0] - res[i].annotations.rightEyeIris[1][0];\n const sizeYRight = res[i].annotations.rightEyeIris[4][1] - res[i].annotations.rightEyeIris[2][1];\n const areaRight = Math.abs(sizeXRight * sizeYRight);\n\n let center = false;\n const difference = Math.abs(areaLeft - areaRight) / Math.max(areaLeft, areaRight);\n if (difference < 0.25) {\n center = true;\n gestures.push({ iris: i, gesture: 'facing center' });\n }\n\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].box[2];\n const leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].box[2];\n if (leftIrisCenterX > 0.06 || rightIrisCenterX > 0.06) center = false;\n if (leftIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking right' });\n if (rightIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking left' });\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].box[3];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].box[3];\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01 || leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) center = false;\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) gestures.push({ iris: i, gesture: 'looking up' });\n\n // still center;\n if (center) gestures.push({ iris: i, gesture: 'looking center' });\n }\n return gestures;\n};\n\nexport const hand = (res): Gesture[] => {\n if (!res) return [];\n const gestures: Array<{ hand: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: Array<{ name: string, position: number }> = [];\n for (const [finger, pos] of Object.entries(res[i]['annotations'])) {\n if (finger !== 'palmBase' && Array.isArray(pos)) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });\n }\n }\n return gestures;\n};\n", "/*\nWebGLImageFilter by Dominic Szablewski: \n*/\n\nfunction GLProgram(gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n const _vsh = _compile(vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(fragmentSource, gl.FRAGMENT_SHADER);\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n\n gl.useProgram(this.id);\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) this.attribute[a] = gl.getAttribLocation(this.id, a);\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = gl.getUniformLocation(this.id, u);\n}\n\n// export const GLImageFilter = function (params) {\nexport function GLImageFilter(params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _filter = {};\n const _canvas = params.canvas || document.createElement('canvas');\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n const DRAW = { INTERMEDIATE: 1 };\n const gl = _canvas.getContext('webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n // eslint-disable-next-line prefer-rest-params\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n _canvas.width = width;\n _width = width;\n _canvas.height = height;\n _height = height;\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n // eslint-disable-next-line no-unused-expressions\n (_vertexBuffer = gl.createBuffer(), gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer));\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n gl.viewport(0, 0, _width, _height);\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n return { fbo, texture };\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index] || _createFramebufferTexture(_width, _height);\n return _tempFramebuffers[index];\n };\n\n const _draw = function (flags = null) {\n let source = null;\n let target = null;\n let flipY = false;\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex)?.texture;\n }\n _drawCount++;\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex)?.fbo;\n }\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n // No filters? Just draw\n if (_filterChain.length === 0) {\n // const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n return _canvas;\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n // Compile shaders\n const SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n _currentProgram = new GLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n const program = _compileShader(_filter.blur.SHADER);\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n const program = _compileShader(_filter.pixelate.SHADER);\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n}\n", "/**\n * Image Processing module used by Human\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\nimport { Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\ntype Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\nconst maxSize = 2048;\n// internal temp canvases\nlet inCanvas;\nlet outCanvas;\n// instance of fximage\nlet fx;\n\n// process input image and return tensor\n// input can be tensor, imagedata, htmlimageelement, htmlvideoelement\n// input is resized and run through imagefx filter\nexport function process(input: Input, config: Config): { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement } {\n let tensor;\n if (!input) throw new Error('Human: Input is missing');\n // sanity checks since different browsers do not implement all dom elements\n if (\n !(input instanceof tf.Tensor)\n && !(typeof Image !== 'undefined' && input instanceof Image)\n && !(typeof ImageData !== 'undefined' && input instanceof ImageData)\n && !(typeof ImageBitmap !== 'undefined' && input instanceof ImageBitmap)\n && !(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n && !(typeof HTMLMediaElement !== 'undefined' && input instanceof HTMLMediaElement)\n && !(typeof HTMLVideoElement !== 'undefined' && input instanceof HTMLVideoElement)\n && !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)\n && !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)\n ) {\n throw new Error('Human: Input type is not recognized');\n }\n if (input instanceof tf.Tensor) {\n // if input is tensor, use as-is\n if (input.shape && input.shape.length === 4 && input.shape[0] === 1 && input.shape[3] === 3) tensor = tf.clone(input);\n else throw new Error(`Human: Input tensor shape must be [1, height, width, 3] and instead was ${input.shape}`);\n } else {\n // check if resizing will be needed\n const originalWidth = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n if (!originalWidth || !originalHeight) return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n let targetWidth = originalWidth;\n let targetHeight = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = targetWidth * originalHeight / originalWidth;\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = targetHeight * originalWidth / originalHeight;\n }\n\n // create our canvas and resize it if needed\n if (config.filter.width > 0) targetWidth = config.filter.width;\n else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);\n if (config.filter.height > 0) targetHeight = config.filter.height;\n else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('Human: Input cannot determine dimension');\n if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) {\n inCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n if (inCanvas?.width !== targetWidth) inCanvas.width = targetWidth;\n if (inCanvas?.height !== targetHeight) inCanvas.height = targetHeight;\n }\n\n // draw input to our canvas\n const ctx = inCanvas.getContext('2d');\n if (input instanceof ImageData) {\n ctx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof ctx.translate !== 'undefined') {\n ctx.translate(originalWidth, 0);\n ctx.scale(-1, 1);\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n ctx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n }\n }\n\n // imagefx transforms using gl\n if (config.filter.enabled) {\n if (!fx || !outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas?.height !== outCanvas?.height)) {\n outCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(inCanvas?.width, inCanvas?.height) : document.createElement('canvas');\n if (outCanvas?.width !== inCanvas?.width) outCanvas.width = inCanvas?.width;\n if (outCanvas?.height !== inCanvas?.height) outCanvas.height = inCanvas?.height;\n // log('created FX filter');\n fx = tf.ENV.flags.IS_BROWSER ? new fxImage.GLImageFilter({ canvas: outCanvas }) : null; // && (typeof document !== 'undefined')\n }\n if (!fx) return { tensor: null, canvas: inCanvas };\n fx.reset();\n fx.addFilter('brightness', config.filter.brightness); // must have at least one filter enabled\n if (config.filter.contrast !== 0) fx.addFilter('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.addFilter('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.addFilter('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.addFilter('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.addFilter('hue', config.filter.hue);\n if (config.filter.negative) fx.addFilter('negative');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.vintage) fx.addFilter('brownie');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.kodachrome) fx.addFilter('kodachrome');\n if (config.filter.technicolor) fx.addFilter('technicolor');\n if (config.filter.polaroid) fx.addFilter('polaroid');\n if (config.filter.pixelate !== 0) fx.addFilter('pixelate', config.filter.pixelate);\n fx.apply(inCanvas);\n // read pixel data\n /*\n const gl = outCanvas.getContext('webgl');\n if (gl) {\n const glBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 4);\n const pixBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 3);\n gl.readPixels(0, 0, outCanvas.width, outCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, glBuffer);\n // gl returns rbga while we only need rgb, so discarding alpha channel\n // gl returns starting point as lower left, so need to invert vertical\n let i = 0;\n for (let y = outCanvas.height - 1; y >= 0; y--) {\n for (let x = 0; x < outCanvas.width; x++) {\n const index = (x + y * outCanvas.width) * 4;\n pixBuffer[i++] = glBuffer[index + 0];\n pixBuffer[i++] = glBuffer[index + 1];\n pixBuffer[i++] = glBuffer[index + 2];\n }\n }\n outCanvas.data = pixBuffer;\n }\n */\n } else {\n outCanvas = inCanvas;\n if (fx) fx = null;\n }\n\n // create tensor from image\n let pixels;\n if (outCanvas.data) { // if we have data, just convert to tensor\n const shape = [outCanvas.height, outCanvas.width, 3];\n pixels = tf.tensor3d(outCanvas.data, shape, 'int32');\n } else if (outCanvas instanceof ImageData) { // if input is imagedata, just use it\n pixels = tf.browser ? tf.browser.fromPixels(outCanvas) : null;\n } else if (config.backend === 'webgl' || config.backend === 'humangl') { // tf kernel-optimized method to get imagedata\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n pixels = tf.browser ? tf.browser.fromPixels(tempCanvas) : null;\n } else { // cpu and wasm kernel does not implement efficient fromPixels method\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n const data = tempCtx?.getImageData(0, 0, targetWidth, targetHeight);\n pixels = tf.browser ? tf.browser.fromPixels(data) : null;\n }\n if (pixels) {\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n }\n const canvas = config.filter.return ? outCanvas : null;\n return { tensor, canvas };\n}\n", "/**\n * Module that implements helper draw functions, exposed as human.draw\n */\n\nimport { TRI468 as triangulation } from '../blazeface/coords';\nimport { mergeDeep, now } from '../helpers';\nimport type { Result, Face, Body, Hand, Item, Gesture, Person } from '../result';\n\n/**\n * Draw Options\n * Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n * -color: draw color\n * -labelColor: color for labels\n * -shadowColor: optional shadow color for labels\n * -font: font for labels\n * -lineHeight: line height for labels, used for multi-line labels,\n * -lineWidth: width of any lines,\n * -pointSize: size of any point,\n * -roundRect: for boxes, round corners by this many pixels,\n * -drawPoints: should points be drawn,\n * -drawLabels: should labels be drawn,\n * -drawBoxes: should boxes be drawn,\n * -drawPolygons: should polygons be drawn,\n * -fillPolygons: should drawn polygons be filled,\n * -useDepth: use z-axis coordinate as color shade,\n * -useCurves: draw polygons as cures or as lines,\n * -bufferedOutput: experimental: allows to call draw methods multiple times for each detection and interpolate results between results thus achieving smoother animations\n */\nexport interface DrawOptions {\n color: string,\n labelColor: string,\n shadowColor: string,\n font: string,\n lineHeight: number,\n lineWidth: number,\n pointSize: number,\n roundRect: number,\n drawPoints: boolean,\n drawLabels: boolean,\n drawBoxes: boolean,\n drawPolygons: boolean,\n drawGaze: boolean,\n fillPolygons: boolean,\n useDepth: boolean,\n useCurves: boolean,\n bufferedOutput: boolean,\n}\n\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.6)', // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)', // 'lightblue' with dark alpha channel\n shadowColor: 'black',\n font: 'small-caps 14px \"Segoe UI\"',\n lineHeight: 24,\n lineWidth: 6,\n pointSize: 2,\n roundRect: 28,\n drawPoints: false,\n drawLabels: true,\n drawBoxes: true,\n drawPolygons: true,\n drawGaze: true,\n fillPolygons: false,\n useDepth: true,\n useCurves: false,\n bufferedOutput: true,\n};\n\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nfunction point(ctx, x, y, z = 0, localOptions) {\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nfunction rect(ctx, x, y, width, height, localOptions) {\n ctx.beginPath();\n if (localOptions.useCurves) {\n const cx = (x + x + width) / 2;\n const cy = (y + y + height) / 2;\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.moveTo(x + localOptions.roundRect, y);\n ctx.lineTo(x + width - localOptions.roundRect, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);\n ctx.lineTo(x + width, y + height - localOptions.roundRect);\n ctx.quadraticCurveTo(x + width, y + height, x + width - localOptions.roundRect, y + height);\n ctx.lineTo(x + localOptions.roundRect, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - localOptions.roundRect);\n ctx.lineTo(x, y + localOptions.roundRect);\n ctx.quadraticCurveTo(x, y, x + localOptions.roundRect, y);\n ctx.closePath();\n }\n ctx.stroke();\n}\n\nfunction lines(ctx, points: [number, number, number?][] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n const z = pt[2] || 0;\n ctx.strokeStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.lineTo(pt[0], Math.round(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nfunction curves(ctx, points: [number, number, number?][] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n if (!localOptions.useCurves || points.length <= 2) {\n lines(ctx, points, localOptions);\n return;\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 0; i < points.length - 2; i++) {\n const xc = (points[i][0] + points[i + 1][0]) / 2;\n const yc = (points[i][1] + points[i + 1][1]) / 2;\n ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc);\n }\n ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport async function gesture(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.font = localOptions.font;\n ctx.fillStyle = localOptions.color;\n let i = 1;\n for (let j = 0; j < result.length; j++) {\n let where: unknown[] = []; // what&where is a record\n let what: unknown[] = []; // what&where is a record\n [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && ((what[1] as string).length > 0)) {\n const who = where[1] as number > 0 ? `#${where[1]}` : '';\n const label = `${where[0]} ${who}: ${what[1]}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 8, 2 + (i * localOptions.lineHeight));\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, 6, 0 + (i * localOptions.lineHeight));\n i += 1;\n }\n }\n}\n\nexport async function face(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n for (const f of result) {\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.drawBoxes) rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n // silly hack since fillText does not suport new line\n const labels:string[] = [];\n labels.push(`face: ${Math.trunc(100 * f.score)}%`);\n if (f.genderScore) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderScore)}%`);\n if (f.age) labels.push(`age: ${f.age || ''}`);\n if (f.iris) labels.push(`distance: ${f.iris}`);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n if (emotion.length > 3) emotion.length = 3;\n labels.push(emotion.join(' '));\n }\n if (f.rotation && f.rotation.angle && f.rotation.gaze) {\n if (f.rotation.angle.roll) labels.push(`roll: ${rad2deg(f.rotation.angle.roll)}\u00B0 yaw:${rad2deg(f.rotation.angle.yaw)}\u00B0 pitch:${rad2deg(f.rotation.angle.pitch)}\u00B0`);\n if (f.rotation.gaze.bearing) labels.push(`gaze: ${rad2deg(f.rotation.gaze.bearing)}\u00B0`);\n }\n if (labels.length === 0) labels.push('face');\n ctx.fillStyle = localOptions.color;\n for (let i = labels.length - 1; i >= 0; i--) {\n const x = Math.max(f.box[0], 0);\n const y = i * localOptions.lineHeight + f.box[1];\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(labels[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(labels[i], x + 4, y + 15);\n }\n ctx.lineWidth = 1;\n if (f.mesh && f.mesh.length > 0) {\n if (localOptions.drawPoints) {\n for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);\n // for (const pt of f.meshRaw) point(ctx, pt[0] * inCanvas.offsetWidth, pt[1] * inCanvas.offsetHeight, pt[2]);\n }\n if (localOptions.drawPolygons) {\n ctx.lineWidth = 1;\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [\n triangulation[i * 3 + 0],\n triangulation[i * 3 + 1],\n triangulation[i * 3 + 2],\n ].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n // iris: array[center, left, top, right, bottom]\n if (f.annotations && f.annotations['leftEyeIris']) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['leftEyeIris'][3][0] - f.annotations['leftEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['leftEyeIris'][4][1] - f.annotations['leftEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (f.annotations && f.annotations['rightEyeIris']) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['rightEyeIris'][3][0] - f.annotations['rightEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['rightEyeIris'][4][1] - f.annotations['rightEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (localOptions.drawGaze && f.rotation?.gaze?.strength && f.rotation?.gaze?.bearing && f.annotations['leftEyeIris'] && f.annotations['rightEyeIris'] && f.annotations['leftEyeIris'][0] && f.annotations['rightEyeIris'][0]) {\n ctx.strokeStyle = 'pink';\n ctx.beginPath();\n\n const leftGaze = [\n f.annotations['leftEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['leftEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1]);\n ctx.lineTo(leftGaze[0], leftGaze[1]);\n\n const rightGaze = [\n f.annotations['rightEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['rightEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1]);\n ctx.lineTo(rightGaze[0], rightGaze[1]);\n\n ctx.stroke();\n }\n }\n }\n }\n}\n\nexport async function body(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; i++) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n ctx.lineWidth = localOptions.lineWidth;\n ctx.font = localOptions.font;\n if (localOptions.drawBoxes && result[i].box && result[i].box?.length === 4) {\n // @ts-ignore box may not exist\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n // @ts-ignore box may not exist\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n // @ts-ignore box may not exist\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n }\n if (localOptions.drawPoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position[2] ? `rgba(${127.5 + (2 * (result[i].keypoints[pt].position[2] || 0))}, ${127.5 - (2 * (result[i].keypoints[pt].position[2] || 0))}, 255, 0.5)` : localOptions.color;\n point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions);\n }\n }\n if (localOptions.drawLabels) {\n ctx.font = localOptions.font;\n if (result[i].keypoints) {\n for (const pt of result[i].keypoints) {\n ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + (2 * pt.position[2])}, ${127.5 - (2 * pt.position[2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4);\n }\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints) {\n let part;\n const points: [number, number, number?][] = [];\n // shoulder line\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // torso main\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n if (points.length === 4) lines(ctx, points, localOptions); // only draw if we have complete torso\n // leg left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftKnee');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftAnkle');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftHeel');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftFoot');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // leg right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightKnee');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightAnkle');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightHeel');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightFoot');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // arm left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftElbow');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftWrist');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftPalm');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // arm right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightElbow');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightWrist');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightPalm');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // draw all\n }\n }\n}\n\nexport async function hand(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText('hand', h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText('hand', h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.keypoints && h.keypoints.length > 0) {\n for (const pt of h.keypoints) {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.5)` : localOptions.color;\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels) {\n const addHandLabel = (part, title) => {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[part.length - 1][2])}, ${127.5 - (2 * part[part.length - 1][2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);\n };\n ctx.font = localOptions.font;\n addHandLabel(h.annotations['indexFinger'], 'index');\n addHandLabel(h.annotations['middleFinger'], 'middle');\n addHandLabel(h.annotations['ringFinger'], 'ring');\n addHandLabel(h.annotations['pinky'], 'pinky');\n addHandLabel(h.annotations['thumb'], 'thumb');\n addHandLabel(h.annotations['palmBase'], 'palm');\n }\n if (localOptions.drawPolygons) {\n const addHandLine = (part) => {\n if (!part) return;\n for (let i = 0; i < part.length; i++) {\n ctx.beginPath();\n ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[i][2])}, ${127.5 - (2 * part[i][2])}, 255, 0.5)` : localOptions.color;\n ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);\n ctx.lineTo(part[i][0], part[i][1]);\n ctx.stroke();\n }\n };\n ctx.lineWidth = localOptions.lineWidth;\n addHandLine(h.annotations['indexFinger']);\n addHandLine(h.annotations['middleFinger']);\n addHandLine(h.annotations['ringFinger']);\n addHandLine(h.annotations['pinky']);\n addHandLine(h.annotations['thumb']);\n // addPart(h.annotations.palmBase);\n }\n }\n}\n\nexport async function object(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `${Math.round(100 * h.score)}% ${h.label}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function person(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n\n for (let i = 0; i < result.length; i++) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `person #${i}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function canvas(inCanvas: HTMLCanvasElement, outCanvas: HTMLCanvasElement) {\n if (!inCanvas || !outCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement) || !(outCanvas instanceof HTMLCanvasElement)) return;\n const outCtx = inCanvas.getContext('2d');\n outCtx?.drawImage(inCanvas, 0, 0);\n}\n\nexport async function all(inCanvas: HTMLCanvasElement, result: Result, drawOptions?: DrawOptions) {\n const timestamp = now();\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n\n face(inCanvas, result.face, localOptions);\n body(inCanvas, result.body, localOptions);\n hand(inCanvas, result.hand, localOptions);\n object(inCanvas, result.object, localOptions);\n // person(inCanvas, result.persons, localOptions);\n gesture(inCanvas, result.gesture, localOptions); // gestures do not have buffering\n\n /*\n if (!bufferedResult) bufferedResult = result; // first pass\n else if (localOptions.bufferedOutput) calcBuffered(result); // do results interpolation\n else bufferedResult = result; // or just use results as-is\n const promises: Promise[] = [];\n promises.push(face(inCanvas, bufferedResult.face, localOptions));\n promises.push(body(inCanvas, bufferedResult.body, localOptions));\n promises.push(hand(inCanvas, bufferedResult.hand, localOptions));\n promises.push(object(inCanvas, bufferedResult.object, localOptions));\n // promises.push(person(inCanvas, bufferedResult.persons, localOptions));\n promises.push(gesture(inCanvas, result.gesture, localOptions)); // gestures do not have buffering\n // await Promise.all(promises);\n */\n result.performance.draw = Math.trunc(now() - timestamp);\n}\n", "/**\n * Module that analyzes existing results and recombines them into a unified person object\n */\n\nimport { Face, Body, Hand, Gesture, Person } from './result';\n\nexport function join(faces: Array, bodies: Array, hands: Array, gestures: Array, shape: Array | undefined): Array {\n let id = 0;\n const persons: Array = [];\n for (const face of faces) { // person is defined primarily by face and then we append other objects as found\n const person: Person = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };\n for (const body of bodies) {\n if (face.box[0] > body.box[0] // x within body\n && face.box[0] < body.box[0] + body.box[2]\n && face.box[1] + face.box[3] > body.box[1] // y within body\n && face.box[1] + face.box[3] < body.box[1] + body.box[3]) {\n person.body = body;\n }\n }\n if (person.body) { // only try to join hands if body is found\n for (const hand of hands) {\n if (hand.box[0] + hand.box[2] > person.body.box[0] // x within body for left hand\n && hand.box[0] + hand.box[2] < person.body.box[0] + person.body.box[2]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for left hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.left = hand;\n }\n if (hand.box[0] < person.body.box[0] + person.body.box[2] // x within body for right hand\n && hand.box[0] > person.body.box[0]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for right hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.right = hand;\n }\n }\n }\n for (const gesture of gestures) { // append all gestures according to ids\n if (gesture['face'] !== undefined && gesture['face'] === face.id) person.gestures?.push(gesture);\n else if (gesture['iris'] !== undefined && gesture['iris'] === face.id) person.gestures?.push(gesture);\n else if (gesture['body'] !== undefined && gesture['body'] === person.body?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.left?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.right?.id) person.gestures?.push(gesture);\n }\n\n // create new overarching box from all boxes beloning to person\n const x: number[] = [];\n const y: number[] = [];\n const extractXY = (box) => { // extract all [x, y] coordinates from boxes [x, y, width, height]\n if (box && box.length === 4) {\n x.push(box[0], box[0] + box[2]);\n y.push(box[1], box[1] + box[3]);\n }\n };\n extractXY(person.face?.box);\n extractXY(person.body?.box);\n extractXY(person.hands?.left?.box);\n extractXY(person.hands?.right?.box);\n const minX = Math.min(...x);\n const minY = Math.min(...y);\n person.box = [minX, minY, Math.max(...x) - minX, Math.max(...y) - minY]; // create new overarching box\n\n // shape is known so we calculate boxRaw as well\n if (shape && shape.length === 4) person.boxRaw = [person.box[0] / shape[2], person.box[1] / shape[1], person.box[2] / shape[2], person.box[3] / shape[1]];\n\n persons.push(person);\n }\n return persons;\n}\n", "/**\n * Module that interpolates results for smoother animations\n */\n\nimport type { Result, Face, Body, Hand, Item, Gesture, Person } from './result';\n\nconst bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };\n\nexport function calc(newResult: Result): Result {\n // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself\n // otherwise bufferedResult is a shallow clone of result plus updated local calculated values\n // thus mixing by-reference and by-value assignments to minimize memory operations\n\n const elapsed = Date.now() - newResult.timestamp;\n // curve fitted: buffer = 8 - ln(delay)\n // interpolation formula: current = ((buffer - 1) * previous + live) / buffer\n // - at 50ms delay buffer = ~4.1 => 28% towards live data\n // - at 250ms delay buffer = ~2.5 => 40% towards live data\n // - at 500ms delay buffer = ~1.8 => 55% towards live data\n // - at 750ms delay buffer = ~1.4 => 71% towards live data\n // - at 1sec delay buffer = 1 which means live data is used\n const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed) : 1;\n\n bufferedResult.canvas = newResult.canvas;\n\n // interpolate body results\n if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {\n bufferedResult.body = JSON.parse(JSON.stringify(newResult.body as Body[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.body.length; i++) {\n const box = newResult.body[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + b) / bufferedFactor) as [number, number, number, number];\n const boxRaw = newResult.body[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + b) / bufferedFactor) as [number, number, number, number];\n const keypoints = (newResult.body[i].keypoints // update keypoints\n .map((keypoint, j) => ({\n score: keypoint.score,\n part: keypoint.part,\n position: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[0] + keypoint.position[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[1] + keypoint.position[1]) / bufferedFactor : keypoint.position[1],\n ],\n positionRaw: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[0] + keypoint.positionRaw[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[1] + keypoint.positionRaw[1]) / bufferedFactor : keypoint.position[1],\n ],\n }))) as Array<{ score: number, part: string, position: [number, number, number?], positionRaw: [number, number, number?] }>;\n bufferedResult.body[i] = { ...newResult.body[i], box, boxRaw, keypoints }; // shallow clone plus updated values\n }\n }\n\n // interpolate hand results\n if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {\n bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand as Hand[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.hand.length; i++) {\n const box = (newResult.hand[i].box// update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];\n const boxRaw = (newResult.hand[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];\n const keypoints = newResult.hand[i].keypoints // update landmarks\n .map((landmark, j) => landmark\n .map((coord, k) => (((bufferedFactor - 1) * bufferedResult.hand[i].keypoints[j][k] + coord) / bufferedFactor)) as [number, number, number]);\n const keys = Object.keys(newResult.hand[i].annotations); // update annotations\n const annotations = {};\n for (const key of keys) {\n annotations[key] = newResult.hand[i].annotations[key]\n .map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor));\n }\n bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations }; // shallow clone plus updated values\n }\n }\n\n // interpolate face results\n if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {\n bufferedResult.face = JSON.parse(JSON.stringify(newResult.face as Face[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.face.length; i++) {\n const box = (newResult.face[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];\n const boxRaw = (newResult.face[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];\n const rotation: {\n matrix: [number, number, number, number, number, number, number, number, number],\n angle: { roll: number, yaw: number, pitch: number },\n gaze: { bearing: number, strength: number }\n } = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } };\n rotation.matrix = newResult.face[i].rotation?.matrix as [number, number, number, number, number, number, number, number, number];\n rotation.angle = {\n roll: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.roll || 0) + (newResult.face[i].rotation?.angle?.roll || 0)) / bufferedFactor,\n yaw: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.yaw || 0) + (newResult.face[i].rotation?.angle?.yaw || 0)) / bufferedFactor,\n pitch: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.pitch || 0) + (newResult.face[i].rotation?.angle?.pitch || 0)) / bufferedFactor,\n };\n rotation.gaze = {\n // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive\n bearing: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.bearing || 0) + (newResult.face[i].rotation?.gaze?.bearing || 0)) / bufferedFactor,\n strength: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.strength || 0) + (newResult.face[i].rotation?.gaze?.strength || 0)) / bufferedFactor,\n };\n bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate object detection results\n if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {\n bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as Item[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.object.length; i++) {\n const box = (newResult.object[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];\n const boxRaw = (newResult.object[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];\n bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate person results\n const newPersons = newResult.persons; // trigger getter function\n if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {\n bufferedResult.persons = JSON.parse(JSON.stringify(newPersons as Person[]));\n } else {\n for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow\n bufferedResult.persons[i].box = (newPersons[i].box\n .map((box, j) => ((bufferedFactor - 1) * bufferedResult.persons[i].box[j] + box) / bufferedFactor)) as [number, number, number, number];\n }\n }\n\n // just copy latest gestures without interpolation\n bufferedResult.gesture = newResult.gesture as Gesture[];\n bufferedResult.performance = newResult.performance;\n\n return bufferedResult;\n}\n", "/**\n * EfficientPose Module\n */\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport { GraphModel, Tensor } from '../tfjs/types';\nimport { Config } from '../config';\n\ntype Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\nlet model: GraphModel;\nlet busy = false;\n\nexport async function load(config: Config): Promise {\n if (!model) {\n // @ts-ignore type mismatch on GraphModel\n model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath));\n if (!model || !model['modelUrl']) log('load model failed:', config.segmentation.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement }): Promise {\n const width = input.tensor?.shape[1] || 0;\n const height = input.tensor?.shape[2] || 0;\n if (!input.tensor) return null;\n if (!model || !model.inputs[0].shape) return null;\n const resizeInput = tf.image.resizeBilinear(input.tensor, [model.inputs[0].shape[1], model.inputs[0].shape[2]], false);\n const norm = resizeInput.div(255);\n const res = model.predict(norm) as Tensor;\n // meet output: 1,256,256,1\n // selfie output: 1,144,256,2\n tf.dispose(resizeInput);\n tf.dispose(norm);\n\n const squeeze = tf.squeeze(res, 0);\n let resizeOutput;\n if (squeeze.shape[2] === 2) {\n // model meet has two channels for fg and bg\n const softmax = squeeze.softmax();\n const [bg, fg] = tf.unstack(softmax, 2);\n const expand = fg.expandDims(2);\n const pad = expand.expandDims(0);\n tf.dispose(softmax);\n tf.dispose(bg);\n tf.dispose(fg);\n // running sofmax before unstack creates 2x2 matrix so we only take upper-left quadrant\n const crop = tf.image.cropAndResize(pad, [[0, 0, 0.5, 0.5]], [0], [width, height]);\n // otherwise run softmax after unstack and use standard resize\n // resizeOutput = tf.image.resizeBilinear(expand, [input.tensor?.shape[1], input.tensor?.shape[2]]);\n resizeOutput = crop.squeeze(0);\n tf.dispose(crop);\n tf.dispose(expand);\n tf.dispose(pad);\n } else { // model selfie has a single channel that we can use directly\n resizeOutput = tf.image.resizeBilinear(squeeze, [width, height]);\n }\n\n if (typeof document === 'undefined') return resizeOutput.dataSync(); // we're running in nodejs so return alpha array as-is\n\n const overlay = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n overlay.width = width;\n overlay.height = height;\n if (tf.browser) await tf.browser.toPixels(resizeOutput, overlay);\n tf.dispose(resizeOutput);\n tf.dispose(squeeze);\n tf.dispose(res);\n\n // get alpha channel data\n const alphaCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(width, height) : document.createElement('canvas'); // need one more copy since input may already have gl context so 2d context fails\n alphaCanvas.width = width;\n alphaCanvas.height = height;\n const ctxAlpha = alphaCanvas.getContext('2d') as CanvasRenderingContext2D;\n ctxAlpha.filter = 'blur(8px';\n await ctxAlpha.drawImage(overlay, 0, 0);\n const alpha = ctxAlpha.getImageData(0, 0, width, height).data;\n\n // get original canvas merged with overlay\n const original = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(width, height) : document.createElement('canvas'); // need one more copy since input may already have gl context so 2d context fails\n original.width = width;\n original.height = height;\n const ctx = original.getContext('2d') as CanvasRenderingContext2D;\n if (input.canvas) await ctx.drawImage(input.canvas, 0, 0);\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation // best options are: darken, color-burn, multiply\n ctx.globalCompositeOperation = 'darken';\n ctx.filter = 'blur(8px)'; // use css filter for bluring, can be done with gaussian blur manually instead\n await ctx.drawImage(overlay, 0, 0);\n ctx.globalCompositeOperation = 'source-over'; // reset\n ctx.filter = 'none'; // reset\n\n input.canvas = original;\n\n return alpha;\n}\n\nexport async function process(input: Input, background: Input | undefined, config: Config): Promise {\n if (busy) return null;\n busy = true;\n if (!model) await load(config);\n const img = image.process(input, config);\n const alpha = await predict(img);\n tf.dispose(img.tensor);\n\n if (background && alpha) {\n const tmp = image.process(background, config);\n const bg = tmp.canvas;\n tf.dispose(tmp.tensor);\n const fg = img.canvas;\n const fgData = fg.getContext('2d')?.getImageData(0, 0, fg.width, fg.height).data as Uint8ClampedArray;\n\n const c = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(fg.width, fg.height) : document.createElement('canvas');\n c.width = fg.width;\n c.height = fg.height;\n const ctx = c.getContext('2d') as CanvasRenderingContext2D;\n\n ctx.globalCompositeOperation = 'copy'; // reset\n ctx.drawImage(bg, 0, 0, c.width, c.height);\n const cData = ctx.getImageData(0, 0, c.width, c.height) as ImageData;\n for (let i = 0; i < c.width * c.height; i++) { // this should be done with globalCompositeOperation instead of looping through image data\n cData.data[4 * i + 0] = ((255 - alpha[4 * i + 0]) / 255.0 * cData.data[4 * i + 0]) + (alpha[4 * i + 0] / 255.0 * fgData[4 * i + 0]);\n cData.data[4 * i + 1] = ((255 - alpha[4 * i + 1]) / 255.0 * cData.data[4 * i + 1]) + (alpha[4 * i + 1] / 255.0 * fgData[4 * i + 1]);\n cData.data[4 * i + 2] = ((255 - alpha[4 * i + 2]) / 255.0 * cData.data[4 * i + 2]) + (alpha[4 * i + 2] / 255.0 * fgData[4 * i + 2]);\n cData.data[4 * i + 3] = ((255 - alpha[4 * i + 3]) / 255.0 * cData.data[4 * i + 3]) + (alpha[4 * i + 3] / 255.0 * fgData[4 * i + 3]);\n }\n ctx.putImageData(cData, 0, 0);\n img.canvas = c;\n }\n busy = false;\n return img.canvas;\n}\n", "/**\n * Embedded sample images used during warmup in dataURL format\n */\n\n// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA\nAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu\nbmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob\nIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgo\nKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AAEQgBAAEAAwEhAAIRAQMRAf/E\nAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAE\nEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZH\nSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiY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s4swj5pgFkSziVcM4BZEsolXDKAZwyhjCYBkACQhIAAAAAAAJAAAAAAAAAAAAAAAAAAAShIAA\nAAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA\nBAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2\nSbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T\nlBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/\n2Q==`;\n", "/**\n * Human main module\n */\n\nimport { log, now, mergeDeep } from './helpers';\nimport { Config, defaults } from './config';\nimport { Result, Gesture } from './result';\nimport * as sysinfo from './sysinfo';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as backend from './tfjs/backend';\nimport * as face from './face';\nimport * as facemesh from './blazeface/facemesh';\nimport * as faceres from './faceres/faceres';\nimport * as emotion from './emotion/emotion';\nimport * as posenet from './posenet/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as blazepose from './blazepose/blazepose';\nimport * as efficientpose from './efficientpose/efficientpose';\nimport * as movenet from './movenet/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as centernet from './object/centernet';\nimport * as gesture from './gesture/gesture';\nimport * as image from './image/image';\nimport * as draw from './draw/draw';\nimport * as persons from './persons';\nimport * as interpolate from './interpolate';\nimport * as segmentation from './segmentation/segmentation';\nimport * as sample from './sample';\nimport * as app from '../package.json';\nimport { Tensor } from './tfjs/types';\n\n// export types\nexport type { Config } from './config';\nexport type { Result, Face, Hand, Body, Item, Gesture, Person } from './result';\nexport type { DrawOptions } from './draw/draw';\n\n/** Defines all possible input types for **Human** detection\n * @typedef Input Type\n */\nexport type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\n/** Error message\n * @typedef Error Type\n */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS */\nexport type TensorFlow = typeof tf;\n\n/** Generic Model object type, holds instance of individual models */\ntype Model = unknown;\n\n/**\n * **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n *\n * @param userConfig: {@link Config}\n */\nexport class Human {\n /** Current version of Human library in *semver* format */\n version: string;\n /** Current configuration\n * - Details: {@link Config}\n */\n config: Config;\n /** Last known result of detect run\n * - Can be accessed anytime after initial detection\n */\n result: Result;\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n * - Progresses through: 'config', 'check', 'backend', 'load', 'run:', 'idle'\n */\n state: string;\n /** @internal: Instance of current image being processed */\n image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n /** @internal: Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n */\n tf: TensorFlow;\n /** Draw helper classes that can draw detected objects on canvas using specified draw styles\n * - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: {\n options: draw.DrawOptions,\n gesture: typeof draw.gesture,\n face: typeof draw.face,\n body: typeof draw.body,\n hand: typeof draw.hand,\n canvas: typeof draw.canvas,\n all: typeof draw.all,\n };\n /** @internal: Currently loaded models */\n models: {\n face: [Model, Model, Model] | null,\n posenet: Model | null,\n blazepose: Model | null,\n efficientpose: Model | null,\n movenet: Model | null,\n handpose: [Model, Model] | null,\n age: Model | null,\n gender: Model | null,\n emotion: Model | null,\n embedding: Model | null,\n nanodet: Model | null,\n centernet: Model | null,\n faceres: Model | null,\n segmentation: Model | null,\n };\n /** Reference face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** Refernce UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Platform and agent information detected by Human */\n sysinfo: { platform: string, agent: string };\n /** Performance object that contains values for all recently performed operations */\n performance: Record; // perf members are dynamically defined as needed\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n #firstRun: boolean;\n #lastInputSum: number;\n #lastCacheDiff: number;\n\n // definition end\n\n /**\n * Creates instance of Human library that is futher used for all operations\n * @param userConfig: {@link Config}\n */\n constructor(userConfig?: Config | Record) {\n this.config = mergeDeep(defaults, userConfig || {});\n this.tf = tf;\n this.draw = draw;\n this.version = app.version;\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.#firstRun = true;\n this.#lastCacheDiff = 0;\n this.performance = { backend: 0, load: 0, image: 0, frames: 0, cached: 0, changed: 0, total: 0, draw: 0 };\n // object that contains all initialized models\n this.models = {\n face: null,\n posenet: null,\n blazepose: null,\n efficientpose: null,\n movenet: null,\n handpose: null,\n age: null,\n gender: null,\n emotion: null,\n embedding: null,\n nanodet: null,\n centernet: null,\n faceres: null,\n segmentation: null,\n };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.image = (input: Input) => image.process(input, this.config);\n // export raw access to underlying models\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // include platform info\n this.sysinfo = sysinfo.info();\n this.#lastInputSum = 1;\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg) => {\n if (!this.#analyzeMemoryLeaks) return;\n const currentTensors = this.tf.engine().state.numTensors;\n const previousTensors = this.#numTensors;\n this.#numTensors = currentTensors;\n const leaked = currentTensors - previousTensors;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)\n * - Calculation is based on normalized Minkowski distance between\n *\n * @param embedding1: face descriptor as array of numbers\n * @param embedding2: face descriptor as array of numbers\n * @returns similarity: number\n */\n // eslint-disable-next-line class-methods-use-this\n similarity(embedding1: Array, embedding2: Array): number {\n return faceres.similarity(embedding1, embedding2);\n }\n\n /**\n * Segmentation method takes any input and returns processed canvas with body segmentation\n * Optional parameter background is used to fill the background with specific input\n * Segmentation is not triggered as part of detect process\n *\n * @param input: {@link Input}\n * @param background?: {@link Input}\n * @returns Canvas\n */\n segmentation(input: Input, background?: Input) {\n return segmentation.process(input, background, this.config);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n * @param input: Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n // @ts-ignore type mismach for Tensor\n return faceres.enhance(input);\n }\n\n /** Math method find best match between provided face descriptor and predefined database of known descriptors\n * @param faceEmbedding: face descriptor previsouly calculated on any face\n * @param db: array of mapping of face descriptors to known values\n * @param threshold: minimum score for matching to be considered in the result\n * @returns best match\n */\n // eslint-disable-next-line class-methods-use-this\n match(faceEmbedding: Array, db: Array<{ name: string, source: string, embedding: number[] }>, threshold = 0): { name: string, source: string, similarity: number, embedding: number[] } {\n return faceres.match(faceEmbedding, db, threshold);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n * @param userConfig?: {@link Config}\n */\n async load(userConfig?: Config | Record) {\n this.state = 'load';\n const timeStamp = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n\n if (this.#firstRun) { // print version info on first run and check for correct backend setup\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (this.config.debug) log('platform:', this.sysinfo.platform);\n if (this.config.debug) log('agent:', this.sysinfo.agent);\n\n await this.#checkBackend(true);\n if (this.tf.ENV.flags.IS_BROWSER) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n if (this.config.async) { // load models concurrently\n [\n // @ts-ignore async model loading is not correctly inferred\n this.models.face,\n this.models.emotion,\n // @ts-ignore async model loading is not correctly inferred\n this.models.handpose,\n this.models.posenet,\n this.models.blazepose,\n this.models.efficientpose,\n this.models.movenet,\n this.models.nanodet,\n this.models.centernet,\n this.models.faceres,\n this.models.segmentation,\n ] = await Promise.all([\n this.models.face || (this.config.face.enabled ? facemesh.load(this.config) : null),\n this.models.emotion || ((this.config.face.enabled && this.config.face.emotion.enabled) ? emotion.load(this.config) : null),\n this.models.handpose || (this.config.hand.enabled ? handpose.load(this.config) : null),\n this.models.posenet || (this.config.body.enabled && this.config.body.modelPath.includes('posenet') ? posenet.load(this.config) : null),\n this.models.blazepose || (this.config.body.enabled && this.config.body.modelPath.includes('blazepose') ? blazepose.load(this.config) : null),\n this.models.efficientpose || (this.config.body.enabled && this.config.body.modelPath.includes('efficientpose') ? efficientpose.load(this.config) : null),\n this.models.movenet || (this.config.body.enabled && this.config.body.modelPath.includes('movenet') ? movenet.load(this.config) : null),\n this.models.nanodet || (this.config.object.enabled && this.config.object.modelPath.includes('nanodet') ? nanodet.load(this.config) : null),\n this.models.centernet || (this.config.object.enabled && this.config.object.modelPath.includes('centernet') ? centernet.load(this.config) : null),\n this.models.faceres || ((this.config.face.enabled && this.config.face.description.enabled) ? faceres.load(this.config) : null),\n this.models.segmentation || (this.config.segmentation.enabled ? segmentation.load(this.config) : null),\n ]);\n } else { // load models sequentially\n if (this.config.face.enabled && !this.models.face) this.models.face = await facemesh.load(this.config);\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) this.models.emotion = await emotion.load(this.config);\n if (this.config.hand.enabled && !this.models.handpose) this.models.handpose = await handpose.load(this.config);\n if (this.config.body.enabled && !this.models.posenet && this.config.body.modelPath.includes('posenet')) this.models.posenet = await posenet.load(this.config);\n if (this.config.body.enabled && !this.models.blazepose && this.config.body.modelPath.includes('blazepose')) this.models.blazepose = await blazepose.load(this.config);\n if (this.config.body.enabled && !this.models.efficientpose && this.config.body.modelPath.includes('efficientpose')) this.models.efficientpose = await blazepose.load(this.config);\n if (this.config.body.enabled && !this.models.movenet && this.config.body.modelPath.includes('movenet')) this.models.movenet = await movenet.load(this.config);\n if (this.config.object.enabled && !this.models.nanodet && this.config.object.modelPath.includes('nanodet')) this.models.nanodet = await nanodet.load(this.config);\n if (this.config.object.enabled && !this.models.centernet && this.config.object.modelPath.includes('centernet')) this.models.centernet = await centernet.load(this.config);\n if (this.config.face.enabled && this.config.face.description.enabled && !this.models.faceres) this.models.faceres = await faceres.load(this.config);\n if (this.config.segmentation.enabled && !this.models.segmentation) this.models.segmentation = await segmentation.load(this.config);\n }\n\n if (this.#firstRun) { // print memory stats on first run\n if (this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors');\n this.#firstRun = false;\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.performance.load as number || 0)) this.performance.load = current;\n }\n\n // check if backend needs initialization if it changed\n /** @hidden */\n #checkBackend = async (force = false) => {\n if (this.config.backend && (this.config.backend.length > 0) && force || (this.tf.getBackend() !== this.config.backend)) {\n const timeStamp = now();\n this.state = 'backend';\n /* force backend reload\n if (this.config.backend in tf.engine().registry) {\n const backendFactory = tf.findBackendFactory(this.config.backend);\n tf.removeBackend(this.config.backend);\n tf.registerBackend(this.config.backend, backendFactory);\n } else {\n log('Backend not registred:', this.config.backend);\n }\n */\n\n if (this.config.backend && this.config.backend.length > 0) {\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && this.config.debug) log('running inside web worker');\n\n // force browser vs node backend\n if (this.tf.ENV.flags.IS_BROWSER && this.config.backend === 'tensorflow') this.config.backend = 'webgl';\n if (this.tf.ENV.flags.IS_NODE && (this.config.backend === 'webgl' || this.config.backend === 'humangl')) this.config.backend = 'tensorflow';\n\n if (this.config.debug) log('setting backend:', this.config.backend);\n\n if (this.config.backend === 'wasm') {\n if (this.config.debug) log('wasm path:', this.config.wasmPath);\n if (typeof this.tf?.setWasmPaths !== 'undefined') this.tf.setWasmPaths(this.config.wasmPath);\n else throw new Error('Human: WASM backend is not loaded');\n const simd = await this.tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await this.tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (this.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (this.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n if (this.config.backend === 'humangl') backend.register();\n try {\n await this.tf.setBackend(this.config.backend);\n } catch (err) {\n log('error: cannot set backend:', this.config.backend, err);\n }\n }\n this.tf.enableProdMode();\n // this.tf.enableDebugMode();\n if (this.tf.getBackend() === 'webgl' || this.tf.getBackend() === 'humangl') {\n this.tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n this.tf.ENV.set('WEBGL_CPU_FORWARD', true);\n this.tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n // if (!this.config.object.enabled) this.tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true); // safe to use 16bit precision\n if (typeof this.config['deallocate'] !== 'undefined' && this.config['deallocate']) { // hidden param\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n this.tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n const gl = await this.tf.backend().getGPGPUContext().gl;\n if (this.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n await this.tf.ready();\n this.performance.backend = Math.trunc(now() - timeStamp);\n }\n }\n\n /**\n * Runs interpolation using last known result and returns smoothened result\n * Interpolation is based on time since last known result so can be called independently\n *\n * @param result?: {@link Result} optional use specific result set to run interpolation on\n * @returns result: {@link Result}\n */\n next = (result?: Result) => interpolate.calc(result || this.result) as Result;\n\n // check if input changed sufficiently to trigger new detections\n /** @hidden */\n #skipFrame = async (input) => {\n if (this.config.cacheSensitivity === 0) return false;\n const resizeFact = 32;\n const reduced: Tensor = input.resizeBilinear([Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);\n // use tensor sum\n /*\n const sumT = this.tf.sum(reduced);\n const sum = sumT.dataSync()[0] as number;\n sumT.dispose();\n */\n // use js loop sum, faster than uploading tensor to gpu calculating and downloading back\n const reducedData = reduced.dataSync(); // raw image rgb array\n let sum = 0;\n for (let i = 0; i < reducedData.length / 3; i++) sum += reducedData[3 * i + 2]; // look only at green value of each pixel\n\n reduced.dispose();\n const diff = 100 * (Math.max(sum, this.#lastInputSum) / Math.min(sum, this.#lastInputSum) - 1);\n this.#lastInputSum = sum;\n // if previous frame was skipped, skip this frame if changed more than cacheSensitivity\n // if previous frame was not skipped, then look for cacheSensitivity or difference larger than one in previous frame to avoid resetting cache in subsequent frames unnecessarily\n const skipFrame = diff < Math.max(this.config.cacheSensitivity, this.#lastCacheDiff);\n // if difference is above 10x threshold, don't use last value to force reset cache for significant change of scenes or images\n this.#lastCacheDiff = diff > 10 * this.config.cacheSensitivity ? 0 : diff;\n return skipFrame;\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n *\n * @param input: Input\n * @param userConfig?: {@link Config}\n * @returns result: {@link Result}\n */\n async detect(input: Input, userConfig?: Config | Record): Promise {\n // detection happens inside a promise\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n let elapsedTime;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig) as Config;\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend\n await this.#checkBackend();\n\n // load models if enabled\n await this.load();\n\n /*\n // function disabled in favor of inputChanged\n // disable video optimization for inputs of type image, but skip if inside worker thread\n let previousVideoOptimized;\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (input && this.config.videoOptimized && (typeof window !== 'undefined') && (typeof WorkerGlobalScope !== 'undefined') && (\n (typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n || (typeof Image !== 'undefined' && input instanceof Image)\n || (typeof ImageData !== 'undefined' && input instanceof ImageData)\n || (typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap))\n ) {\n log('disabling video optimization');\n previousVideoOptimized = this.config.videoOptimized;\n this.config.videoOptimized = false;\n }\n */\n\n timeStamp = now();\n let process = image.process(input, this.config);\n this.performance.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n // run segmentation preprocessing\n if (this.config.segmentation.enabled && process && process.tensor) {\n this.analyze('Start Segmentation:');\n this.state = 'run:segmentation';\n timeStamp = now();\n await segmentation.predict(process);\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.segmentation = elapsedTime;\n if (process.canvas) {\n // replace input\n process.tensor.dispose();\n process = image.process(process.canvas, this.config);\n }\n this.analyze('End Segmentation:');\n }\n\n if (!process || !process.tensor) {\n log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n\n timeStamp = now();\n this.config.skipFrame = await this.#skipFrame(process.tensor);\n if (!this.performance.frames) this.performance.frames = 0;\n if (!this.performance.cached) this.performance.cached = 0;\n (this.performance.frames as number)++;\n if (this.config.skipFrame) this.performance.cached++;\n this.performance.changed = Math.trunc(now() - timeStamp);\n this.analyze('Check Changed:');\n\n // prepare where to store model results\n // keep them with weak typing as it can be promise or not\n let faceRes;\n let bodyRes;\n let handRes;\n let objectRes;\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n if (this.config.async) {\n faceRes = this.config.face.enabled ? face.detectFace(this, process.tensor) : [];\n if (this.performance.face) delete this.performance.face;\n } else {\n this.state = 'run:face';\n timeStamp = now();\n faceRes = this.config.face.enabled ? await face.detectFace(this, process.tensor) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.face = elapsedTime;\n }\n\n // run body: can be posenet, blazepose, efficientpose, movenet\n this.analyze('Start Body:');\n if (this.config.async) {\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(process.tensor, this.config) : [];\n if (this.performance.body) delete this.performance.body;\n } else {\n this.state = 'run:body';\n timeStamp = now();\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(process.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.body = elapsedTime;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n if (this.config.async) {\n handRes = this.config.hand.enabled ? handpose.predict(process.tensor, this.config) : [];\n if (this.performance.hand) delete this.performance.hand;\n } else {\n this.state = 'run:hand';\n timeStamp = now();\n handRes = this.config.hand.enabled ? await handpose.predict(process.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.hand = elapsedTime;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n if (this.config.async) {\n if (this.config.object.modelPath.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(process.tensor, this.config) : [];\n else if (this.config.object.modelPath.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(process.tensor, this.config) : [];\n if (this.performance.object) delete this.performance.object;\n } else {\n this.state = 'run:object';\n timeStamp = now();\n if (this.config.object.modelPath.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(process.tensor, this.config) : [];\n else if (this.config.object.modelPath.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(process.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.object = elapsedTime;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n\n // run gesture analysis last\n let gestureRes: Gesture[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.performance.gesture = Math.trunc(now() - timeStamp);\n else if (this.performance.gesture) delete this.performance.gesture;\n }\n\n this.performance.total = Math.trunc(now() - timeStart);\n this.state = 'idle';\n this.result = {\n face: faceRes,\n body: bodyRes,\n hand: handRes,\n gesture: gestureRes,\n object: objectRes,\n performance: this.performance,\n canvas: process.canvas,\n timestamp: Date.now(),\n get persons() { return persons.join(faceRes, bodyRes, handRes, gestureRes, process?.tensor?.shape); },\n };\n\n // finally dispose input tensor\n tf.dispose(process.tensor);\n\n // log('Result:', result);\n resolve(this.result);\n });\n }\n\n /** @hidden */\n #warmupBitmap = async () => {\n const b64toBlob = (base64, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (this.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await this.detect(bitmap, this.config);\n bitmap.close();\n }\n return res;\n }\n\n /** @hidden */\n #warmupCanvas = async () => new Promise((resolve) => {\n let src;\n let size = 0;\n switch (this.config.warmup) {\n case 'face':\n size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n const img = new Image();\n img.onload = async () => {\n const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx?.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const res = await this.detect(canvas, this.config);\n resolve(res);\n };\n if (src) img.src = src;\n else resolve(null);\n });\n\n /** @hidden */\n #warmupNode = async () => {\n const atob = (str) => Buffer.from(str, 'base64');\n let img;\n if (this.config.warmup === 'face') img = atob(sample.face);\n if (this.config.warmup === 'body' || this.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n this.tf.dispose(data);\n // log('Input:', expanded);\n res = await this.detect(expanded, this.config);\n this.tf.dispose(expanded);\n } else {\n if (this.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await this.detect(input, this.config);\n */\n }\n return res;\n }\n\n /** Warmup metho pre-initializes all models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig?: Config\n */\n async warmup(userConfig?: Config | Record): Promise {\n const t0 = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n if (!this.config.warmup || this.config.warmup === 'none') return { error: 'null' };\n let res;\n if (typeof createImageBitmap === 'function') res = await this.#warmupBitmap();\n else if (typeof Image !== 'undefined') res = await this.#warmupCanvas();\n else res = await this.#warmupNode();\n const t1 = now();\n if (this.config.debug) log('Warmup', this.config.warmup, Math.round(t1 - t0), 'ms', res);\n return res;\n }\n}\n\n/**\n * Class Human is also available as default export\n */\nexport { Human as default };\n"], + "mappings": ";;;;;;stBAKO,WAAc,EAAgB,EAAsB,CACzD,GAAM,GAAY,EAAO,SAAS,KAAO,GAAK,IAExC,EAAO,AADI,EAAK,WAAW,MAAQ,EAAK,WAAW,MAAQ,EAAK,WAAW,UAAY,EAAK,WAAW,WAAa,EAAK,WAAW,SAClH,GAAG,IAAS,GAAG,IAAS,IAAY,IAC5D,GAAI,CAAC,EAAK,oBAAoB,SAAS,SAAU,KAAM,IAAI,OAAM,2BAA2B,yBAC5F,MAAO,GAIF,cAAgB,EAAW,CAChC,GAAM,GAAK,GAAI,MACT,EAAK,GAAG,EAAG,WAAW,WAAW,SAAS,EAAG,QAAQ,EAAG,aAAa,WAAW,SAAS,EAAG,QAAQ,EAAG,aAAa,WAAW,SAAS,EAAG,QAAQ,EAAG,kBAAkB,WAAW,SAAS,EAAG,OAErM,AAAI,GAAK,QAAQ,IAAI,EAAI,SAAU,GAAG,GAIjC,GAAM,GAAM,IACb,MAAO,cAAgB,YAAoB,YAAY,MACpD,SAAU,QAAO,QAAQ,OAAO,UAAY,IAAO,KAAM,YAI3D,cAAsB,EAAS,CACpC,GAAM,GAAW,AA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AO,EAAI,SAAU,KAAK,OAAO,OAAQ,KAAK,MAAM,EAAK,GAAK,KAAM,GAC7E,IArkBT,eACA,eACA,eACA,eACA,eACA,eA6DA,eAoIA,eAuEA,eA2NA,eAkBA,eAiCA", "names": [] } diff --git a/dist/human.esm.js b/dist/human.esm.js index 9874637b..30180bfa 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -1,53 +1,52 @@ - /* - Human library - homepage: - author: ' - */ - -var BI=Object.defineProperty;var zm=e=>{if(typeof require!="undefined")return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')};var b5=(e,t)=>{for(var n in t)BI(e,n,{get:t[n],enumerable:!0})};var v5=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var pn=(e,t,n)=>(v5(e,t,"read from private field"),n?n.call(e):t.get(e)),ra=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ia=(e,t,n,a)=>(v5(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);function ft(e,t){let n=e.endsWith("/")?"":"/",r=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${n}${t}`;if(!r.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${r} Expecting JSON file`);return r}function de(...e){let t=new Date,n=`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`;e&&console.log(n,"Human:",...e)}var Je=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Ln(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,a)=>(Object.keys(a||{}).forEach(r=>{let s=n[r],i=a[r];Array.isArray(s)&&Array.isArray(i)?n[r]=s.concat(...i):t(s)&&t(i)?n[r]=Ln(s,i):n[r]=i}),n),{})}var w5={backend:"webgl",modelBasePath:"../models/",wasmPath:"../node_modules/@tensorflow/tfjs-backend-wasm/dist/",debug:!0,async:!0,warmup:"full",cacheSensitivity:.75,skipFrame:!1,filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!0,maxDetected:15,skipFrames:15,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:11,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:17,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:1,minConfidence:.2,skipFrames:1},hand:{enabled:!0,rotation:!0,skipFrames:18,minConfidence:.1,iouThreshold:.1,maxDetected:2,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"mb3-centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:19},segmentation:{enabled:!1,modelPath:"selfie.json"}};function k5(){let e,t;if(typeof navigator!="undefined"){let n=navigator.userAgent.match(/\(([^()]+)\)/g);if(n&&n[0]){let a=n[0].match(/\(([^()]+)\)/g);e=a?a[0].replace(/\(|\)/g,""):"",t=navigator.userAgent.replace(n[0],""),e[1]&&(t=t.replace(n[1],"")),t=t.replace(/ /g," ")}}else typeof process!="undefined"&&(e=`${process.platform} ${process.arch}`,t=`NodeJS ${process.version}`);return{platform:e,agent:t}}var dp={};b5(dp,{Abs:()=>fo,Acos:()=>mo,Acosh:()=>go,AdadeltaOptimizer:()=>wh,AdagradOptimizer:()=>kh,AdamOptimizer:()=>Ih,AdamaxOptimizer:()=>Sh,Add:()=>Or,AddN:()=>xs,All:()=>yo,Any:()=>Ao,ArgMax:()=>bs,ArgMin:()=>Fu,Asin:()=>xo,Asinh:()=>bo,Atan:()=>vo,Atan2:()=>ko,Atanh:()=>wo,AvgPool:()=>vs,AvgPool3D:()=>$u,AvgPool3DGrad:()=>Kp,AvgPoolGrad:()=>Xp,BackendWasm:()=>i4,BatchMatMul:()=>ws,BatchToSpaceND:()=>Du,Bincount:()=>Zp,BroadcastTo:()=>mb,Callback:()=>Y8,CallbackList:()=>j4,Cast:()=>ks,Ceil:()=>Is,ClipByValue:()=>zr,Complex:()=>Yp,ComplexAbs:()=>Ou,Concat:()=>Io,Conv2D:()=>Ss,Conv2DBackpropFilter:()=>Jp,Conv2DBackpropInput:()=>Ns,Conv3D:()=>zu,Conv3DBackpropFilterV2:()=>Qp,Conv3DBackpropInputV2:()=>ec,Cos:()=>Ts,Cosh:()=>So,CropAndResize:()=>No,Cumsum:()=>Cs,CustomCallback:()=>H4,DataStorage:()=>Up,DenseBincount:()=>tc,DepthToSpace:()=>To,DepthwiseConv2dNative:()=>Es,DepthwiseConv2dNativeBackpropFilter:()=>nc,DepthwiseConv2dNativeBackpropInput:()=>ac,Diag:()=>rc,Dilation2D:()=>_u,Dilation2DBackpropFilter:()=>ic,Dilation2DBackpropInput:()=>sc,ENV:()=>sa,EarlyStopping:()=>Q8,Einsum:()=>oc,Elu:()=>Co,EluGrad:()=>lc,Environment:()=>hb,Equal:()=>Ro,Erf:()=>Eo,Exp:()=>Ms,ExpandDims:()=>Mo,Expm1:()=>Fo,FFT:()=>uc,Fill:()=>Pu,FlipLeftRight:()=>$o,Floor:()=>Fs,FloorDiv:()=>$s,FromPixels:()=>Rc,FusedBatchNorm:()=>Ds,FusedConv2D:()=>fi,FusedDepthwiseConv2D:()=>mi,GPGPUContext:()=>Vh,GatherNd:()=>Oo,GatherV2:()=>Do,GraphModel:()=>Mk,Greater:()=>zo,GreaterEqual:()=>Os,History:()=>U4,IFFT:()=>dc,Identity:()=>zs,Imag:()=>pc,InputSpec:()=>zt,IsFinite:()=>_o,IsInf:()=>Po,IsNan:()=>Lo,KernelBackend:()=>Eu,LRN:()=>Bu,LRNGrad:()=>hc,LayerVariable:()=>P4,LayersModel:()=>kr,LeakyRelu:()=>_s,Less:()=>Wo,LessEqual:()=>Bo,LinSpace:()=>cc,Log:()=>Ps,Log1p:()=>Vo,LogSoftmax:()=>gb,LogicalAnd:()=>jo,LogicalNot:()=>Lu,LogicalOr:()=>Wu,MathBackendCPU:()=>Eh,MathBackendWebGL:()=>Xl,Max:()=>Ls,MaxPool:()=>Bs,MaxPool3D:()=>Vu,MaxPool3DGrad:()=>mc,MaxPoolGrad:()=>fc,MaxPoolWithArgmax:()=>gc,Maximum:()=>Ws,Mean:()=>Vs,Min:()=>js,Minimum:()=>Us,MirrorPad:()=>Hs,Mod:()=>Uo,MomentumOptimizer:()=>Nh,Multinomial:()=>yc,Multiply:()=>Gs,Neg:()=>Ho,NonMaxSuppressionV3:()=>qo,NonMaxSuppressionV4:()=>Xo,NonMaxSuppressionV5:()=>Ko,NotEqual:()=>Go,OP_SCOPE_SUFFIX:()=>Mb,OneHot:()=>qs,OnesLike:()=>Zo,Optimizer:()=>xr,Pack:()=>Yo,PadV2:()=>Xs,Pool:()=>jS,Pow:()=>Ks,Prelu:()=>Zs,Prod:()=>Jo,RMSPropOptimizer:()=>Th,RNN:()=>ar,Range:()=>ju,Rank:()=>Jm,Real:()=>Ac,RealDiv:()=>Rs,Reciprocal:()=>Qo,Reduction:()=>yn,Relu:()=>Ys,Relu6:()=>Qs,Reshape:()=>el,ResizeBilinear:()=>Js,ResizeBilinearGrad:()=>bc,ResizeNearestNeighbor:()=>Uu,ResizeNearestNeighborGrad:()=>xc,Reverse:()=>ei,RotateWithOffset:()=>fl,Round:()=>ti,Rsqrt:()=>ni,SGDOptimizer:()=>kd,ScatterNd:()=>tl,Select:()=>nl,Selu:()=>al,Sequential:()=>au,Sigmoid:()=>ri,Sign:()=>il,Sin:()=>ai,Sinh:()=>sl,Slice:()=>rl,Softmax:()=>oi,Softplus:()=>ol,SpaceToBatchND:()=>Hu,SparseFillEmptyRows:()=>vc,SparseReshape:()=>wc,SparseSegmentMean:()=>kc,SparseSegmentSum:()=>Ic,SparseToDense:()=>Sc,SplitV:()=>ll,Sqrt:()=>si,Square:()=>Gu,SquaredDifference:()=>li,Step:()=>Pr,StridedSlice:()=>ul,StringNGrams:()=>Nc,StringSplit:()=>Tc,StringToHashBucketFast:()=>Cc,Sub:()=>ui,Sum:()=>ii,SymbolicTensor:()=>Da,Tan:()=>di,Tanh:()=>pi,Tensor:()=>Be,TensorBuffer:()=>Lt,Tile:()=>_r,TopK:()=>dl,Transform:()=>pl,Transpose:()=>ci,Unique:()=>Ec,Unpack:()=>cl,UnsortedSegmentSum:()=>qu,Variable:()=>td,ZerosLike:()=>hl,_FusedMatMul:()=>hi,abs:()=>Wt,acos:()=>S1,acosh:()=>N1,add:()=>ie,addN:()=>jc,all:()=>Uc,any:()=>id,argMax:()=>ki,argMin:()=>T1,asin:()=>C1,asinh:()=>E1,atan:()=>R1,atan2:()=>M1,atanh:()=>F1,avgPool:()=>ld,avgPool3d:()=>O1,backend:()=>c3,backend_util:()=>F,basicLSTMCell:()=>TC,batchNorm:()=>Ni,batchNorm2d:()=>g3,batchNorm3d:()=>y3,batchNorm4d:()=>A3,batchToSpaceND:()=>ud,bincount:()=>z1,booleanMaskAsync:()=>$M,broadcastTo:()=>Sl,browser:()=>oa,buffer:()=>Ve,callbacks:()=>Tie,cast:()=>ge,ceil:()=>_1,clipByValue:()=>Mn,clone:()=>Ha,complex:()=>Wr,concat:()=>lt,concat1d:()=>x3,concat2d:()=>Nl,concat3d:()=>b3,concat4d:()=>v3,constraints:()=>y4,conv1d:()=>Gc,conv2d:()=>mr,conv2dTranspose:()=>qc,conv3d:()=>L1,conv3dTranspose:()=>k3,copyRegisteredKernels:()=>GS,cos:()=>dd,cosh:()=>Xc,cosineWindow:()=>cg,cumsum:()=>Kc,customGrad:()=>qa,data:()=>Fk,denseBincount:()=>I3,deprecationWarn:()=>k1,depthToSpace:()=>W1,depthwiseConv2d:()=>Tl,deregisterOp:()=>Eie,device_util:()=>ad,diag:()=>nE,dilation2d:()=>B1,disableDeprecationWarnings:()=>WT,dispose:()=>he,disposeVariables:()=>BT,div:()=>me,divNoNan:()=>V1,dot:()=>S3,dropout:()=>G3,einsum:()=>N3,elu:()=>Cl,enableDebugMode:()=>LT,enableProdMode:()=>PT,enclosingPowerOfTwo:()=>q3,engine:()=>fr,env:()=>te,equal:()=>Hr,erf:()=>j1,exp:()=>la,expandDims:()=>mn,expm1:()=>U1,eye:()=>H1,fft:()=>bd,fill:()=>El,findBackend:()=>I1,findBackendFactory:()=>XT,floor:()=>Rl,floorDiv:()=>Vc,forceHalfFloat:()=>yw,fused:()=>Kr,gather:()=>Ti,gatherND:()=>H3,gather_util:()=>g1,getBackend:()=>GT,getGradient:()=>Xm,getKernel:()=>Mc,getKernelsForBackend:()=>gl,gpgpu_util:()=>Wv,grad:()=>FE,grads:()=>$E,greater:()=>Wn,greaterEqual:()=>qr,ifft:()=>Dl,imag:()=>Zc,image:()=>De,inTopKAsync:()=>UM,initializers:()=>I4,input:()=>f8,io:()=>En,irfft:()=>ch,isFinite:()=>T3,isInf:()=>C3,isNaN:()=>G1,keep:()=>Kt,kernel_impls:()=>Za,layers:()=>O4,leakyRelu:()=>pd,less:()=>Yc,lessEqual:()=>Xr,linalg:()=>s7,linspace:()=>E3,loadGraphModel:()=>ct,loadLayersModel:()=>_re,localResponseNormalization:()=>q1,log:()=>Bn,log1p:()=>Jc,logSigmoid:()=>M3,logSoftmax:()=>eh,logSumExp:()=>Z1,logicalAnd:()=>xa,logicalNot:()=>cd,logicalOr:()=>th,logicalXor:()=>O3,losses:()=>I$,matMul:()=>je,math:()=>qb,max:()=>Vn,maxPool:()=>hd,maxPool3d:()=>Y1,maxPoolWithArgmax:()=>z3,maximum:()=>Xa,mean:()=>Nt,memory:()=>Bc,meshgrid:()=>tR,metrics:()=>X8,min:()=>fd,minimum:()=>Ml,mirrorPad:()=>J1,mod:()=>Q1,model:()=>Ore,models:()=>K8,moments:()=>nh,movingAverage:()=>zM,mul:()=>B,multiRNNCell:()=>uR,multinomial:()=>_3,neg:()=>St,nextFrame:()=>Ch,norm:()=>gh,notEqual:()=>Ri,oneHot:()=>vl,ones:()=>jn,onesLike:()=>Un,op:()=>L,outerProduct:()=>fR,pad:()=>gr,pad1d:()=>yR,pad2d:()=>xR,pad3d:()=>vR,pad4d:()=>kR,pool:()=>P3,pow:()=>yr,prelu:()=>gd,print:()=>Bb,prod:()=>ah,profile:()=>VT,rand:()=>FR,randomGamma:()=>zR,randomNormal:()=>L3,randomUniform:()=>Fl,range:()=>$l,ready:()=>HT,real:()=>yd,reciprocal:()=>ng,registerBackend:()=>kl,registerCallbackConstructor:()=>Pre,registerGradient:()=>yb,registerKernel:()=>gi,registerOp:()=>Cie,regularizers:()=>Z8,relu:()=>Ka,relu6:()=>rh,removeBackend:()=>qT,reshape:()=>q,reverse:()=>Hn,reverse1d:()=>HR,reverse2d:()=>qR,reverse3d:()=>KR,reverse4d:()=>YR,rfft:()=>vd,round:()=>sh,rsqrt:()=>ih,scalar:()=>ke,scatterND:()=>U3,scatter_util:()=>y1,selu:()=>oh,separableConv2d:()=>ag,sequential:()=>zre,serialization:()=>re,setBackend:()=>UT,setPlatform:()=>KT,setWasmPath:()=>Bee,setWasmPaths:()=>Vee,setWebGLContext:()=>Oh,setdiff1dAsync:()=>W3,shared:()=>yg,sigmoid:()=>Rn,sign:()=>rg,signal:()=>k$,sin:()=>lh,sinh:()=>uh,slice:()=>Re,slice1d:()=>dh,slice2d:()=>sg,slice3d:()=>ph,slice4d:()=>Ad,slice_util:()=>fn,softmax:()=>xd,softplus:()=>Ci,spaceToBatchND:()=>md,sparse:()=>wd,sparseToDense:()=>pg,spectral:()=>w$,split:()=>Zt,sqrt:()=>an,square:()=>ot,squaredDifference:()=>hh,squeeze:()=>Vt,stack:()=>gn,step:()=>Ol,stridedSlice:()=>ig,string:()=>vh,sub:()=>ye,sum:()=>Se,sumOutType:()=>zc,tan:()=>og,tanh:()=>Si,tensor:()=>ln,tensor1d:()=>Dt,tensor2d:()=>Ta,tensor3d:()=>Lc,tensor4d:()=>kM,tensor5d:()=>IM,tensor6d:()=>SM,tensor_util:()=>Sa,test_util:()=>u3,tidy:()=>V,tile:()=>Gr,time:()=>jT,topk:()=>lg,train:()=>Fi,transpose:()=>Qe,truncatedNormal:()=>fh,unique:()=>mh,unregisterGradient:()=>HS,unregisterKernel:()=>US,unsortedSegmentSum:()=>ug,unstack:()=>Gn,upcastType:()=>Aa,util:()=>k,valueAndGrad:()=>DE,valueAndGrads:()=>OE,variable:()=>B3,variableGrads:()=>R3,version:()=>Ale,version_converter:()=>Foe,version_core:()=>_T,version_cpu:()=>q7,version_layers:()=>Dy,version_wasm:()=>l4,version_webgl:()=>gw,webgl:()=>CV,webgl_util:()=>fv,where:()=>un,whereAsync:()=>dg,zeros:()=>$t,zerosLike:()=>Ge});var VI=Object.create,jp=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,UI=Object.getOwnPropertyNames,HI=Object.getPrototypeOf,GI=Object.prototype.hasOwnProperty,qI=e=>jp(e,"__esModule",{value:!0}),po=e=>{if(typeof zm!="undefined")return zm(e);throw new Error('Dynamic require of "'+e+'" is not supported')},xt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fe=(e,t)=>{for(var n in t)jp(e,n,{get:t[n],enumerable:!0})},XI=(e,t,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of UI(t))!GI.call(e,a)&&a!=="default"&&jp(e,a,{get:()=>t[a],enumerable:!(n=jI(t,a))||n.enumerable});return e},gs=e=>XI(qI(jp(e!=null?VI(HI(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),KI=xt((e,t)=>{t.exports=a;var n=null;try{n=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(S){}function a(S,z,O){this.low=S|0,this.high=z|0,this.unsigned=!!O}a.prototype.__isLong__,Object.defineProperty(a.prototype,"__isLong__",{value:!0});function r(S){return(S&&S.__isLong__)===!0}a.isLong=r;var s={},i={};function o(S,z){var O,W,G;return z?(S>>>=0,(G=0<=S&&S<256)&&(W=i[S],W)?W:(O=l(S,(S|0)<0?-1:0,!0),G&&(i[S]=O),O)):(S|=0,(G=-128<=S&&S<128)&&(W=s[S],W)?W:(O=l(S,S<0?-1:0,!1),G&&(s[S]=O),O))}a.fromInt=o;function u(S,z){if(isNaN(S))return z?v:x;if(z){if(S<0)return v;if(S>=g)return E}else{if(S<=-y)return _;if(S+1>=y)return C}return S<0?u(-S,z).neg():l(S%f|0,S/f|0,z)}a.fromNumber=u;function l(S,z,O){return new a(S,z,O)}a.fromBits=l;var d=Math.pow;function p(S,z,O){if(S.length===0)throw Error("empty string");if(S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return x;if(typeof z=="number"?(O=z,z=!1):z=!!z,O=O||10,O<2||360)throw Error("interior hyphen");if(W===0)return p(S.substring(1),z,O).neg();for(var G=u(d(O,8)),H=x,J=0;J>>0:this.low},$.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},$.toString=function(S){if(S=S||10,S<2||36>>0,Q=ne.toString(S);if(H=K,H.isZero())return Q+J;for(;Q.length<6;)Q="0"+Q;J=""+Q+J}},$.getHighBits=function(){return this.high},$.getHighBitsUnsigned=function(){return this.high>>>0},$.getLowBits=function(){return this.low},$.getLowBitsUnsigned=function(){return this.low>>>0},$.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,z=31;z>0&&(S&1<=0},$.isOdd=function(){return(this.low&1)==1},$.isEven=function(){return(this.low&1)==0},$.equals=function(S){return r(S)||(S=c(S)),this.unsigned!==S.unsigned&&this.high>>>31==1&&S.high>>>31==1?!1:this.high===S.high&&this.low===S.low},$.eq=$.equals,$.notEquals=function(S){return!this.eq(S)},$.neq=$.notEquals,$.ne=$.notEquals,$.lessThan=function(S){return this.comp(S)<0},$.lt=$.lessThan,$.lessThanOrEqual=function(S){return this.comp(S)<=0},$.lte=$.lessThanOrEqual,$.le=$.lessThanOrEqual,$.greaterThan=function(S){return this.comp(S)>0},$.gt=$.greaterThan,$.greaterThanOrEqual=function(S){return this.comp(S)>=0},$.gte=$.greaterThanOrEqual,$.ge=$.greaterThanOrEqual,$.compare=function(S){if(r(S)||(S=c(S)),this.eq(S))return 0;var z=this.isNegative(),O=S.isNegative();return z&&!O?-1:!z&&O?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},$.comp=$.compare,$.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(b)},$.neg=$.negate,$.add=function(S){r(S)||(S=c(S));var z=this.high>>>16,O=this.high&65535,W=this.low>>>16,G=this.low&65535,H=S.high>>>16,J=S.high&65535,K=S.low>>>16,ne=S.low&65535,Q=0,se=0,Z=0,le=0;return le+=G+ne,Z+=le>>>16,le&=65535,Z+=W+K,se+=Z>>>16,Z&=65535,se+=O+J,Q+=se>>>16,se&=65535,Q+=z+H,Q&=65535,l(Z<<16|le,Q<<16|se,this.unsigned)},$.subtract=function(S){return r(S)||(S=c(S)),this.add(S.neg())},$.sub=$.subtract,$.multiply=function(S){if(this.isZero())return x;if(r(S)||(S=c(S)),n){var z=n.mul(this.low,this.high,S.low,S.high);return l(z,n.get_high(),this.unsigned)}if(S.isZero())return x;if(this.eq(_))return S.isOdd()?_:x;if(S.eq(_))return this.isOdd()?_:x;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(A)&&S.lt(A))return u(this.toNumber()*S.toNumber(),this.unsigned);var O=this.high>>>16,W=this.high&65535,G=this.low>>>16,H=this.low&65535,J=S.high>>>16,K=S.high&65535,ne=S.low>>>16,Q=S.low&65535,se=0,Z=0,le=0,oe=0;return oe+=H*Q,le+=oe>>>16,oe&=65535,le+=G*Q,Z+=le>>>16,le&=65535,le+=H*ne,Z+=le>>>16,le&=65535,Z+=W*Q,se+=Z>>>16,Z&=65535,Z+=G*ne,se+=Z>>>16,Z&=65535,Z+=H*K,se+=Z>>>16,Z&=65535,se+=O*Q+W*ne+G*K+H*J,se&=65535,l(le<<16|oe,se<<16|Z,this.unsigned)},$.mul=$.multiply,$.divide=function(S){if(r(S)||(S=c(S)),S.isZero())throw Error("division by zero");if(n){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var z=(this.unsigned?n.div_u:n.div_s)(this.low,this.high,S.low,S.high);return l(z,n.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?v:x;var O,W,G;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return v;if(S.gt(this.shru(1)))return w;G=v}else{if(this.eq(_)){if(S.eq(b)||S.eq(N))return _;if(S.eq(_))return b;var H=this.shr(1);return O=H.div(S).shl(1),O.eq(x)?S.isNegative()?b:N:(W=this.sub(S.mul(O)),G=O.add(W.div(S)),G)}else if(S.eq(_))return this.unsigned?v:x;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();G=x}for(W=this;W.gte(S);){O=Math.max(1,Math.floor(W.toNumber()/S.toNumber()));for(var J=Math.ceil(Math.log(O)/Math.LN2),K=J<=48?1:d(2,J-48),ne=u(O),Q=ne.mul(S);Q.isNegative()||Q.gt(W);)O-=K,ne=u(O,this.unsigned),Q=ne.mul(S);ne.isZero()&&(ne=b),G=G.add(ne),W=W.sub(Q)}return G},$.div=$.divide,$.modulo=function(S){if(r(S)||(S=c(S)),n){var z=(this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,S.low,S.high);return l(z,n.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},$.mod=$.modulo,$.rem=$.modulo,$.not=function(){return l(~this.low,~this.high,this.unsigned)},$.and=function(S){return r(S)||(S=c(S)),l(this.low&S.low,this.high&S.high,this.unsigned)},$.or=function(S){return r(S)||(S=c(S)),l(this.low|S.low,this.high|S.high,this.unsigned)},$.xor=function(S){return r(S)||(S=c(S)),l(this.low^S.low,this.high^S.high,this.unsigned)},$.shiftLeft=function(S){return r(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low<>>32-S,this.unsigned):l(0,this.low<>>S|this.high<<32-S,this.high>>S,this.unsigned):l(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},$.shr=$.shiftRight,$.shiftRightUnsigned=function(S){if(r(S)&&(S=S.toInt()),S&=63,S===0)return this;var z=this.high;if(S<32){var O=this.low;return l(O>>>S|z<<32-S,z>>>S,this.unsigned)}else return S===32?l(z,0,this.unsigned):l(z>>>S-32,0,this.unsigned)},$.shru=$.shiftRightUnsigned,$.shr_u=$.shiftRightUnsigned,$.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},$.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},$.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},$.toBytesLE=function(){var S=this.high,z=this.low;return[z&255,z>>>8&255,z>>>16&255,z>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},$.toBytesBE=function(){var S=this.high,z=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,z>>>24,z>>>16&255,z>>>8&255,z&255]},a.fromBytes=function(S,z,O){return O?a.fromBytesLE(S,z):a.fromBytesBE(S,z)},a.fromBytesLE=function(S,z){return new a(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,z)},a.fromBytesBE=function(S,z){return new a(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],z)}}),ZI=xt(()=>{}),YI=xt((e,t)=>{(function(n,a,r){function s(l){var d=this,p=u();d.next=function(){var c=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=c-(d.c=c|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(l),d.s0<0&&(d.s0+=1),d.s1-=p(l),d.s1<0&&(d.s1+=1),d.s2-=p(l),d.s2<0&&(d.s2+=1),p=null}function i(l,d){return d.c=l.c,d.s0=l.s0,d.s1=l.s1,d.s2=l.s2,d}function o(l,d){var p=new s(l),c=d&&d.state,h=p.next;return h.int32=function(){return p.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,c&&(typeof c=="object"&&i(c,p),h.state=function(){return i(p,{})}),h}function u(){var l=4022871197,d=function(p){p=p.toString();for(var c=0;c>>0,h-=l,h*=l,l=h>>>0,h-=l,l+=h*4294967296}return(l>>>0)*23283064365386963e-26};return d}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),JI=xt((e,t)=>{(function(n,a,r){function s(u){var l=this,d="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var c=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^c^c>>>8},u===(u|0)?l.x=u:d+=u;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),QI=xt((e,t)=>{(function(n,a,r){function s(u){var l=this,d="";l.next=function(){var c=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(c^c<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,u===(u|0)?l.x=u:d+=u;for(var p=0;p>>4),l.next()}function i(u,l){return l.x=u.x,l.y=u.y,l.z=u.z,l.w=u.w,l.v=u.v,l.d=u.d,l}function o(u,l){var d=new s(u),p=l&&l.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),eS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this;l.next=function(){var p=l.x,c=l.i,h,m,f;return h=p[c],h^=h>>>7,m=h^h<<24,h=p[c+1&7],m^=h^h>>>10,h=p[c+3&7],m^=h^h>>>3,h=p[c+4&7],m^=h^h<<7,h=p[c+7&7],h=h^h<<13,m^=h^h<<9,p[c]=m,l.i=c+1&7,m};function d(p,c){var h,m,f=[];if(c===(c|0))m=f[0]=c;else for(c=""+c,h=0;h0;--h)p.next()}d(l,u)}function i(u,l){return l.x=u.x.slice(),l.i=u.i,l}function o(u,l){u==null&&(u=+new Date);var d=new s(u),p=l&&l.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.x&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),tS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this;l.next=function(){var p=l.w,c=l.X,h=l.i,m,f;return l.w=p=p+1640531527|0,f=c[h+34&127],m=c[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=c[h]=f^m,l.i=h,f+(p^p>>>16)|0};function d(p,c){var h,m,f,g,y,A=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),f=0,g=-32;g>>15,m^=m<<4,m^=m>>>13,g>=0&&(y=y+1640531527|0,h=A[g&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(A[(c&&c.length||0)&127]=-1),f=127,g=4*128;g>0;--g)m=A[f+34&127],h=A[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,A[f]=m^h;p.w=y,p.X=A,p.i=f}d(l,u)}function i(u,l){return l.i=u.i,l.w=u.w,l.X=u.X.slice(),l}function o(u,l){u==null&&(u=+new Date);var d=new s(u),p=l&&l.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.X&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),nS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this,d="";l.next=function(){var c=l.b,h=l.c,m=l.d,f=l.a;return c=c<<25^c>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-c|0,l.b=c=c<<20^c>>>12^h,l.c=h=h-m|0,l.d=m<<16^h>>>16^f,l.a=f-c|0},l.a=0,l.b=0,l.c=2654435769|0,l.d=1367130551,u===Math.floor(u)?(l.a=u/4294967296|0,l.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),I5=xt(()=>{}),aS=xt((e,t)=>{(function(n,a){var r=this,s=256,i=6,o=52,u="random",l=a.pow(s,i),d=a.pow(2,o),p=d*2,c=s-1,h;function m(b,w,N){var C=[];w=w==!0?{entropy:!0}:w||{};var E=A(y(w.entropy?[b,v(n)]:b==null?x():b,3),C),_=new f(C),$=function(){for(var S=_.g(i),z=l,O=0;S=p;)S/=2,z/=2,O>>>=1;return(S+O)/z};return $.int32=function(){return _.g(4)|0},$.quick=function(){return _.g(4)/4294967296},$.double=$,A(v(_.S),n),(w.pass||N||function(S,z,O,W){return W&&(W.S&&g(W,_),S.state=function(){return g(_,{})}),O?(a[u]=S,z):S})($,E,"global"in w?w.global:this==a,w.state)}a["seed"+u]=m;function f(b){var w,N=b.length,C=this,E=0,_=C.i=C.j=0,$=C.S=[];for(N||(b=[N++]);E{var n=YI(),a=JI(),r=QI(),s=eS(),i=tS(),o=nS(),u=aS();u.alea=n,u.xor128=a,u.xorwow=r,u.xorshift7=s,u.xor4096=i,u.tychei=o,t.exports=u}),Cu=xt(()=>{}),rS=xt(()=>{}),sS=xt(()=>{}),iS=xt((e,t)=>{var n=function(){var a=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(a=a||__filename),function(r){r=r||{};function s(){return Z.buffer!=Ue&&tn(Z.buffer),In}function i(){return Z.buffer!=Ue&&tn(Z.buffer),kt}function o(){return Z.buffer!=Ue&&tn(Z.buffer),Sn}function u(){return Z.buffer!=Ue&&tn(Z.buffer),na}function l(){return Z.buffer!=Ue&&tn(Z.buffer),dn}var d=typeof r!="undefined"?r:{},p,c;d.ready=new Promise(function(T,R){p=T,c=R});var h={},m;for(m in d)d.hasOwnProperty(m)&&(h[m]=d[m]);var f=[],g="./this.program",y=function(T,R){throw R},A=!1,x=!1,v=!1,b=!1;A=typeof window=="object",x=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",b=!A&&!v&&!x;var w=d.ENVIRONMENT_IS_PTHREAD||!1;w&&(Ue=d.buffer);var N="";function C(T){return d.locateFile?d.locateFile(T,N):N+T}var E,_,$,S,z,O;if(v){x?N=Cu().dirname(N)+"/":N=__dirname+"/",E=function(T,R){return z||(z=po("fs")),O||(O=Cu()),T=O.normalize(T),z.readFileSync(T,R?null:"utf8")},$=function(T){var R=E(T,!0);return R.buffer||(R=new Uint8Array(R)),fe(R.buffer),R},process.argv.length>1&&(g=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",function(T){if(!(T instanceof Tu))throw T}),process.on("unhandledRejection",ur),y=function(T){process.exit(T)},d.inspect=function(){return"[Emscripten Module object]"};var W;try{W=rS()}catch(T){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),T}global.Worker=W.Worker}else b?(typeof read!="undefined"&&(E=function(T){return read(T)}),$=function(T){var R;return typeof readbuffer=="function"?new Uint8Array(readbuffer(T)):(R=read(T,"binary"),fe(typeof R=="object"),R)},typeof scriptArgs!="undefined"?f=scriptArgs:typeof arguments!="undefined"&&(f=arguments),typeof quit=="function"&&(y=function(T){quit(T)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(A||x)&&(x?N=self.location.href:typeof document!="undefined"&&document.currentScript&&(N=document.currentScript.src),typeof a!="undefined"&&a&&(N=a),N.indexOf("blob:")!==0?N=N.substr(0,N.lastIndexOf("/")+1):N="",v?(E=function(T,R){return z||(z=po("fs")),O||(O=Cu()),T=O.normalize(T),z.readFileSync(T,R?null:"utf8")},$=function(T){var R=E(T,!0);return R.buffer||(R=new Uint8Array(R)),fe(R.buffer),R}):(E=function(T){var R=new XMLHttpRequest;return R.open("GET",T,!1),R.send(null),R.responseText},x&&($=function(T){var R=new XMLHttpRequest;return R.open("GET",T,!1),R.responseType="arraybuffer",R.send(null),new Uint8Array(R.response)}),_=function(T,R,j){var X=new XMLHttpRequest;X.open("GET",T,!0),X.responseType="arraybuffer",X.onload=function(){if(X.status==200||X.status==0&&X.response){R(X.response);return}j()},X.onerror=j,X.send(null)}),S=function(T){document.title=T});v&&typeof performance=="undefined"&&(global.performance=sS().performance);var G=d.print||console.log.bind(console),H=d.printErr||console.warn.bind(console);for(m in h)h.hasOwnProperty(m)&&(d[m]=h[m]);h=null,d.arguments&&(f=d.arguments),d.thisProgram&&(g=d.thisProgram),d.quit&&(y=d.quit);var J=Atomics.load,K=Atomics.store,ne=Atomics.compareExchange,Q;d.wasmBinary&&(Q=d.wasmBinary);var se=d.noExitRuntime||!0;typeof WebAssembly!="object"&&ur("no native wasm support detected");var Z,le,oe=!1,xe;function fe(T,R){T||ur("Assertion failed: "+R)}function Ne(T){var R=d["_"+T];return fe(R,"Cannot call unknown function "+T+", make sure it is exported"),R}function Te(T,R,j,X,ce){var ue={string:function(Cn){var uo=0;if(Cn!=null&&Cn!==0){var x5=(Cn.length<<2)+1;uo=io(x5),nt(Cn,uo,x5)}return uo},array:function(Cn){var uo=io(Cn.length);return Ze(Cn,uo),uo}};function pe(Cn){return R==="string"?ze(Cn):R==="boolean"?Boolean(Cn):Cn}var ve=Ne(T),at=[],Gt=0;if(X)for(var Pt=0;Pt=X);){var ue=T[R++];if(!ue)return ce;if(!(ue&128)){ce+=String.fromCharCode(ue);continue}var pe=T[R++]&63;if((ue&224)==192){ce+=String.fromCharCode((ue&31)<<6|pe);continue}var ve=T[R++]&63;if((ue&240)==224?ue=(ue&15)<<12|pe<<6|ve:ue=(ue&7)<<18|pe<<12|ve<<6|T[R++]&63,ue<65536)ce+=String.fromCharCode(ue);else{var at=ue-65536;ce+=String.fromCharCode(55296|at>>10,56320|at&1023)}}return ce}function ze(T,R){return T?Pe(i(),T,R):""}function tt(T,R,j,X){if(!(X>0))return 0;for(var ce=j,ue=j+X-1,pe=0;pe=55296&&ve<=57343){var at=T.charCodeAt(++pe);ve=65536+((ve&1023)<<10)|at&1023}if(ve<=127){if(j>=ue)break;R[j++]=ve}else if(ve<=2047){if(j+1>=ue)break;R[j++]=192|ve>>6,R[j++]=128|ve&63}else if(ve<=65535){if(j+2>=ue)break;R[j++]=224|ve>>12,R[j++]=128|ve>>6&63,R[j++]=128|ve&63}else{if(j+3>=ue)break;R[j++]=240|ve>>18,R[j++]=128|ve>>12&63,R[j++]=128|ve>>6&63,R[j++]=128|ve&63}}return R[j]=0,j-ce}function nt(T,R,j){return tt(T,i(),R,j)}function it(T){for(var R=0,j=0;j=55296&&X<=57343&&(X=65536+((X&1023)<<10)|T.charCodeAt(++j)&1023),X<=127?++R:X<=2047?R+=2:X<=65535?R+=3:R+=4}return R}function Ze(T,R){s().set(T,R)}function ht(T,R){return T%R>0&&(T+=R-T%R),T}var Ue,In,kt,ta,en,Sn,na,Pn,dn;function tn(T){Ue=T,d.HEAP8=In=new Int8Array(T),d.HEAP16=ta=new Int16Array(T),d.HEAP32=Sn=new Int32Array(T),d.HEAPU8=kt=new Uint8Array(T),d.HEAPU16=en=new Uint16Array(T),d.HEAPU32=na=new Uint32Array(T),d.HEAPF32=Pn=new Float32Array(T),d.HEAPF64=dn=new Float64Array(T)}var Ba=d.INITIAL_MEMORY||16777216;if(w)Z=d.wasmMemory,Ue=d.buffer;else if(d.wasmMemory)Z=d.wasmMemory;else if(Z=new WebAssembly.Memory({initial:Ba/65536,maximum:2147483648/65536,shared:!0}),!(Z.buffer instanceof SharedArrayBuffer))throw H("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),v&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Z&&(Ue=Z.buffer),Ba=Ue.byteLength,tn(Ue);var fa,ma=[],Nr=[],or=[],Tr=[],Qi=[],Va=!1,vp=!1;w||Nr.push({func:function(){zp()}});function cf(){if(!w){if(d.preRun)for(typeof d.preRun=="function"&&(d.preRun=[d.preRun]);d.preRun.length;)kp(d.preRun.shift());to(ma)}}function yu(){Va=!0,!w&&to(Nr)}function hf(){w||to(or)}function wp(){w||(vp=!0)}function Nn(){if(!w){if(d.postRun)for(typeof d.postRun=="function"&&(d.postRun=[d.postRun]);d.postRun.length;)ff(d.postRun.shift());to(Qi)}}function kp(T){ma.unshift(T)}function ff(T){Qi.unshift(T)}var lr=0,Cr=null,hs=null;function mf(T){fe(!w,"addRunDependency cannot be used in a pthread worker"),lr++,d.monitorRunDependencies&&d.monitorRunDependencies(lr)}function gf(T){if(lr--,d.monitorRunDependencies&&d.monitorRunDependencies(lr),lr==0&&(Cr!==null&&(clearInterval(Cr),Cr=null),hs)){var R=hs;hs=null,R()}}d.preloadedImages={},d.preloadedAudios={};function ur(T){d.onAbort&&d.onAbort(T),w&&console.error("Pthread aborting at "+new Error().stack),T+="",H(T),oe=!0,xe=1,T="abort("+T+"). Build with -s ASSERTIONS=1 for more info.";var R=new WebAssembly.RuntimeError(T);throw c(R),R}function Ip(T,R){return String.prototype.startsWith?T.startsWith(R):T.indexOf(R)===0}var eo="data:application/octet-stream;base64,";function Sp(T){return Ip(T,eo)}var yf="file://";function Np(T){return Ip(T,yf)}var Tn="tfjs-backend-wasm-threaded-simd.wasm";Sp(Tn)||(Tn=C(Tn));function Tp(T){try{if(T==Tn&&Q)return new Uint8Array(Q);if($)return $(T);throw"both async and sync fetching of the wasm failed"}catch(R){ur(R)}}function Af(){if(!Q&&(A||x)){if(typeof fetch=="function"&&!Np(Tn))return fetch(Tn,{credentials:"same-origin"}).then(function(T){if(!T.ok)throw"failed to load wasm binary file at '"+Tn+"'";return T.arrayBuffer()}).catch(function(){return Tp(Tn)});if(_)return new Promise(function(T,R){_(Tn,function(j){T(new Uint8Array(j))},R)})}return Promise.resolve().then(function(){return Tp(Tn)})}function xf(){var T={a:um};function R(pe,ve){var at=pe.exports;if(d.asm=at,fa=d.asm.F,le=ve,!w){var Gt=Ie.unusedWorkers.length;Ie.unusedWorkers.forEach(function(Pt){Ie.loadWasmModuleToWorker(Pt,function(){--Gt||gf("wasm-instantiate")})})}}w||mf("wasm-instantiate");function j(pe){R(pe.instance,pe.module)}function X(pe){return Af().then(function(ve){return WebAssembly.instantiate(ve,T)}).then(pe,function(ve){H("failed to asynchronously prepare wasm: "+ve),ur(ve)})}function ce(){return!Q&&typeof WebAssembly.instantiateStreaming=="function"&&!Sp(Tn)&&!Np(Tn)&&typeof fetch=="function"?fetch(Tn,{credentials:"same-origin"}).then(function(pe){var ve=WebAssembly.instantiateStreaming(pe,T);return ve.then(j,function(at){return H("wasm streaming compile failed: "+at),H("falling back to ArrayBuffer instantiation"),X(j)})}):X(j)}if(d.instantiateWasm)try{var ue=d.instantiateWasm(T,R);return ue}catch(pe){return H("Module.instantiateWasm callback failed with error: "+pe),!1}return ce().catch(c),{}}var bf={9816:function(){throw"Canceled!"},9834:function(T,R){setTimeout(function(){h5(T,R)},0)}};function Cp(){Ie.initRuntime()}function to(T){for(;T.length>0;){var R=T.shift();if(typeof R=="function"){R(d);continue}var j=R.func;typeof j=="number"?R.arg===void 0?fa.get(j)():fa.get(j)(R.arg):j(R.arg===void 0?null:R.arg)}}function Au(T,R){if(T<=0||T>s().length||T&!0||R<0)return-28;if(R==0)return 0;R>=2147483647&&(R=Infinity);var j=Atomics.load(o(),oo>>2),X=0;if(j==T){var ce=Atomics.compareExchange(o(),oo>>2,j,0);if(ce==j&&(--R,X=1,R<=0))return 1}var ue=Atomics.notify(o(),T>>2,R);if(ue>=0)return ue+X;throw"Atomics.notify returned an unexpected value "+ue}d._emscripten_futex_wake=Au;function vf(T){if(w)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!T)throw"Internal Error! Null pthread_ptr in killThread!";o()[T+12>>2]=0;var R=Ie.pthreads[T];R.worker.terminate(),Ie.freeThreadData(R),Ie.runningWorkers.splice(Ie.runningWorkers.indexOf(R.worker),1),R.worker.pthread=void 0}function wf(T){if(w)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!T)throw"Internal Error! Null pthread_ptr in cancelThread!";var R=Ie.pthreads[T];R.worker.postMessage({cmd:"cancel"})}function kf(T){if(w)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!T)throw"Internal Error! Null pthread_ptr in cleanupThread!";var R=Ie.pthreads[T];if(R){o()[T+12>>2]=0;var j=R.worker;Ie.returnWorkerToPool(j)}}var Ie={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){for(var T=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2)),R=0;R>2]=T;var j=T+152;o()[j>>2]=j;for(var X=ms(512),R=0;R<128;++R)u()[X/4+R]=0;Atomics.store(u(),T+100>>2,X),Atomics.store(u(),T+40>>2,T),Dm(T,!x,1),c5(T)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){for(;Ie.threadExitHandlers.length>0;)Ie.threadExitHandlers.pop()();w&&ro()&&p5()},runExitHandlersAndDeinitThread:function(T,R){Atomics.store(u(),T+56>>2,1),Atomics.store(u(),T+60>>2,0),Ie.runExitHandlers(),Atomics.store(u(),T+4>>2,R),Atomics.store(u(),T+0>>2,1),Au(T+0,2147483647),Dm(0,0,0)},threadExit:function(T){var R=ro();R&&(Ie.runExitHandlersAndDeinitThread(R,T),w&&postMessage({cmd:"exit"}))},threadCancel:function(){Ie.runExitHandlersAndDeinitThread(ro(),-1),postMessage({cmd:"cancelDone"})},terminateAllThreads:function(){for(var T in Ie.pthreads){var R=Ie.pthreads[T];R&&R.worker&&Ie.returnWorkerToPool(R.worker)}Ie.pthreads={};for(var j=0;j>2];o()[T.threadInfoStruct+100>>2]=0,Su(R),Su(T.threadInfoStruct)}T.threadInfoStruct=0,T.allocatedOwnStack&&T.stackBase&&Su(T.stackBase),T.stackBase=0,T.worker&&(T.worker.pthread=null)}},returnWorkerToPool:function(T){Ie.runWithoutMainThreadQueuedCalls(function(){delete Ie.pthreads[T.pthread.threadInfoStruct],Ie.unusedWorkers.push(T),Ie.runningWorkers.splice(Ie.runningWorkers.indexOf(T),1),Ie.freeThreadData(T.pthread),T.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(T){o()[A5>>2]=0;try{T()}finally{o()[A5>>2]=1}},receiveObjectTransfer:function(T){},loadWasmModuleToWorker:function(T,R){T.onmessage=function(j){var X=j.data,ce=X.cmd;if(T.pthread&&(Ie.currentProxiedOperationCallerThread=T.pthread.threadInfoStruct),X.targetThread&&X.targetThread!=ro()){var ue=Ie.pthreads[X.targetThread];ue?ue.worker.postMessage(j.data,X.transferList):console.error('Internal error! Worker sent a message "'+ce+'" to target pthread '+X.targetThread+", but that thread no longer exists!"),Ie.currentProxiedOperationCallerThread=void 0;return}if(ce==="processQueuedMainThreadWork")Fm();else if(ce==="spawnThread")Dp(j.data);else if(ce==="cleanupThread")kf(X.thread);else if(ce==="killThread")vf(X.thread);else if(ce==="cancelThread")wf(X.thread);else if(ce==="loaded")T.loaded=!0,R&&R(T),T.runPthread&&(T.runPthread(),delete T.runPthread);else if(ce==="print")G("Thread "+X.threadId+": "+X.text);else if(ce==="printErr")H("Thread "+X.threadId+": "+X.text);else if(ce==="alert")alert("Thread "+X.threadId+": "+X.text);else if(ce==="exit"){var pe=T.pthread&&Atomics.load(u(),T.pthread.threadInfoStruct+64>>2);pe&&Ie.returnWorkerToPool(T)}else if(ce==="exitProcess")try{WI(X.returnCode)}catch(ve){if(ve instanceof Tu)return;throw ve}else ce==="cancelDone"?Ie.returnWorkerToPool(T):ce==="objectTransfer"?Ie.receiveObjectTransfer(j.data):j.data.target==="setimmediate"?T.postMessage(j.data):H("worker sent an unknown command "+ce);Ie.currentProxiedOperationCallerThread=void 0},T.onerror=function(j){H("pthread sent an error! "+j.filename+":"+j.lineno+": "+j.message)},v&&(T.on("message",function(j){T.onmessage({data:j})}),T.on("error",function(j){T.onerror(j)}),T.on("exit",function(j){})),T.postMessage({cmd:"load",urlOrBlob:d.mainScriptUrlOrBlob||a,wasmMemory:Z,wasmModule:le})},allocateUnusedWorker:function(){var T=C("tfjs-backend-wasm-threaded-simd.worker.js");Ie.unusedWorkers.push(new Worker(T))},getNewWorker:function(){return Ie.unusedWorkers.length==0&&(Ie.allocateUnusedWorker(),Ie.loadWasmModuleToWorker(Ie.unusedWorkers[0])),Ie.unusedWorkers.length>0?Ie.unusedWorkers.pop():null},busySpinWait:function(T){for(var R=performance.now()+T;performance.now()>2]=T,T}function Rf(T,R){if(w)return Er(1,1,T,R)}function Mf(T,R){if(T==R)postMessage({cmd:"processQueuedMainThreadWork"});else if(w)postMessage({targetThread:T,cmd:"processThreadQueue"});else{var j=Ie.pthreads[T],X=j&&j.worker;if(!X)return;X.postMessage({cmd:"processThreadQueue"})}return 1}function Ff(){ur()}function $f(T,R,j){var X=Pf(R,j);return bf[T].apply(null,X)}function Df(T,R){}function Of(T,R,j){if(T<=0||T>s().length||T&!0)return-28;if(A){if(Atomics.load(o(),T>>2)!=R)return-6;for(var X=performance.now(),ce=X+j,ue=Atomics.exchange(o(),oo>>2,T);;){if(X=performance.now(),X>ce)return ue=Atomics.exchange(o(),oo>>2,0),-73;if(ue=Atomics.exchange(o(),oo>>2,0),ue==0)break;if(Fm(),Atomics.load(o(),T>>2)!=R)return-6;ue=Atomics.exchange(o(),oo>>2,T)}return 0}else{var pe=Atomics.wait(o(),T>>2,R,j);if(pe==="timed-out")return-73;if(pe==="not-equal")return-6;if(pe==="ok")return 0;throw"Atomics.wait returned an unexpected value "+pe}}function zf(T,R,j){i().copyWithin(T,R,R+j)}function _f(){return v?po("os").cpus().length:navigator.hardwareConcurrency}function Er(T,R){for(var j=arguments.length-2,X=Nu(),ce=j,ue=io(ce*8),pe=ue>>3,ve=0;ve>=2;j=i()[T++];){var X=j<105;X&&R&1&&R++,bu.push(X?l()[R++>>1]:o()[R]),++R}return bu}function Lf(T,R,j){xu.length=R;for(var X=j>>3,ce=0;ce>>16),tn(Z.buffer),1}catch(R){}}function Vf(T){var R=Wf();if(T<=R)return!1;var j=2147483648;if(T>j)return!1;for(var X=1;X<=4;X*=2){var ce=R*(1+.2/X);ce=Math.min(ce,T+100663296);var ue=Math.min(j,ht(Math.max(T,ce),65536)),pe=Bf(ue);if(pe)return!0}return!1}var We={inEventHandler:0,removeAllEventListeners:function(){for(var T=We.eventHandlers.length-1;T>=0;--T)We._removeHandler(T);We.eventHandlers=[],We.deferredCalls=[]},registerRemoveEventListeners:function(){We.removeEventListenersRegistered||(Tr.push(We.removeAllEventListeners),We.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(T,R,j){function X(pe,ve){if(pe.length!=ve.length)return!1;for(var at in pe)if(pe[at]!=ve[at])return!1;return!0}for(var ce in We.deferredCalls){var ue=We.deferredCalls[ce];if(ue.targetFunction==T&&X(ue.argsList,j))return}We.deferredCalls.push({targetFunction:T,precedence:R,argsList:j}),We.deferredCalls.sort(function(pe,ve){return pe.precedence>2]=j,o()[pe+4>>2]=X,o()[pe+8>>2]=ce,$m(0,T,637534208,R,X,pe),so(ue)},getTargetThreadForEventCallback:function(T){switch(T){case 1:return 0;case 2:return Ie.currentProxiedOperationCallerThread;default:return T}},getNodeNameForTarget:function(T){return T?T==window?"#window":T==screen?"#screen":T&&T.nodeName?T.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function jf(T){var R=it(T)+1,j=ms(R);return nt(T,j,R),j}function Uf(T,R,j,X){var ce=Nu(),ue=io(12),pe=0;R&&(pe=jf(R)),o()[ue>>2]=pe,o()[ue+4>>2]=j,o()[ue+8>>2]=X,$m(0,T,657457152,0,pe,ue),so(ce)}function Hf(T,R,j,X){R=R?ze(R):"",Uf(T,R,j,X)}function Gf(T){return T>2?ze(T):T}var qf=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function Xf(T){T=Gf(T);var R=qf[T]||(typeof document!="undefined"?document.querySelector(T):void 0);return R}function vu(T){return Xf(T)}function Ep(T,R,j){var X=vu(T);if(!X)return-4;if(X.canvasSharedPtr&&(o()[X.canvasSharedPtr>>2]=R,o()[X.canvasSharedPtr+4>>2]=j),X.offscreenCanvas||!X.controlTransferredOffscreen){X.offscreenCanvas&&(X=X.offscreenCanvas);var ce=!1;if(X.GLctxObject&&X.GLctxObject.GLctx){var ue=X.GLctxObject.GLctx.getParameter(2978);ce=ue[0]===0&&ue[1]===0&&ue[2]===X.width&&ue[3]===X.height}X.width=R,X.height=j,ce&&X.GLctxObject.GLctx.viewport(0,0,R,j)}else if(X.canvasSharedPtr){var pe=o()[X.canvasSharedPtr+8>>2];return Hf(pe,T,R,j),1}else return-4;return 0}function Rp(T,R,j){return w?Er(2,1,T,R,j):Ep(T,R,j)}function Kf(T,R,j){var X=vu(T);return X?Ep(T,R,j):Rp(T,R,j)}function Zf(T){}function Yf(T,R){}function Jf(T){var R=T.getExtension("ANGLE_instanced_arrays");if(R)return T.vertexAttribDivisor=function(j,X){R.vertexAttribDivisorANGLE(j,X)},T.drawArraysInstanced=function(j,X,ce,ue){R.drawArraysInstancedANGLE(j,X,ce,ue)},T.drawElementsInstanced=function(j,X,ce,ue,pe){R.drawElementsInstancedANGLE(j,X,ce,ue,pe)},1}function Qf(T){var R=T.getExtension("OES_vertex_array_object");if(R)return T.createVertexArray=function(){return R.createVertexArrayOES()},T.deleteVertexArray=function(j){R.deleteVertexArrayOES(j)},T.bindVertexArray=function(j){R.bindVertexArrayOES(j)},T.isVertexArray=function(j){return R.isVertexArrayOES(j)},1}function em(T){var R=T.getExtension("WEBGL_draw_buffers");if(R)return T.drawBuffers=function(j,X){R.drawBuffersWEBGL(j,X)},1}function tm(T){return!!(T.multiDrawWebgl=T.getExtension("WEBGL_multi_draw"))}var et={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(T){et.lastError||(et.lastError=T)},getNewId:function(T){for(var R=et.counter++,j=T.length;j>2]:-1;ce+=ze(o()[j+ue*4>>2],pe<0?void 0:pe)}return ce},createContext:function(T,R){var j=T.getContext("webgl",R);if(!j)return 0;var X=et.registerContext(j,R);return X},registerContext:function(T,R){var j=ms(8);o()[j+4>>2]=ro();var X={handle:j,attributes:R,version:R.majorVersion,GLctx:T};return T.canvas&&(T.canvas.GLctxObject=X),et.contexts[j]=X,(typeof R.enableExtensionsByDefault=="undefined"||R.enableExtensionsByDefault)&&et.initExtensions(X),j},makeContextCurrent:function(T){return et.currentContext=et.contexts[T],d.ctx=Rr=et.currentContext&&et.currentContext.GLctx,!(T&&!Rr)},getContext:function(T){return et.contexts[T]},deleteContext:function(T){et.currentContext===et.contexts[T]&&(et.currentContext=null),typeof We=="object"&&We.removeAllHandlersOnTarget(et.contexts[T].GLctx.canvas),et.contexts[T]&&et.contexts[T].GLctx.canvas&&(et.contexts[T].GLctx.canvas.GLctxObject=void 0),Su(et.contexts[T].handle),et.contexts[T]=null},initExtensions:function(T){if(T||(T=et.currentContext),!T.initExtensionsDone){T.initExtensionsDone=!0;var R=T.GLctx;Jf(R),Qf(R),em(R),R.disjointTimerQueryExt=R.getExtension("EXT_disjoint_timer_query"),tm(R);var j=R.getSupportedExtensions()||[];j.forEach(function(X){X.indexOf("lose_context")<0&&X.indexOf("debug")<0&&R.getExtension(X)})}},populateUniformTable:function(T){for(var R=et.programs[T],j=et.programInfos[T]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},X=j.uniforms,ce=Rr.getProgramParameter(R,35718),ue=0;ue>2,X=o()[j+(24>>2)],ce={alpha:!!o()[j+(0>>2)],depth:!!o()[j+(4>>2)],stencil:!!o()[j+(8>>2)],antialias:!!o()[j+(12>>2)],premultipliedAlpha:!!o()[j+(16>>2)],preserveDrawingBuffer:!!o()[j+(20>>2)],powerPreference:nm[X],failIfMajorPerformanceCaveat:!!o()[j+(28>>2)],majorVersion:o()[j+(32>>2)],minorVersion:o()[j+(36>>2)],enableExtensionsByDefault:o()[j+(40>>2)],explicitSwapControl:o()[j+(44>>2)],proxyContextToMainThread:o()[j+(48>>2)],renderViaOffscreenBackBuffer:o()[j+(52>>2)]},ue=vu(T);if(!ue||ce.explicitSwapControl)return 0;var pe=et.createContext(ue,ce);return pe}function rm(T,R){return am(T,R)}var no={mappings:{},buffers:[null,[],[]],printChar:function(T,R){var j=no.buffers[T];R===0||R===10?((T===1?G:H)(Pe(j,0)),j.length=0):j.push(R)},varargs:void 0,get:function(){no.varargs+=4;var T=o()[no.varargs-4>>2];return T},getStr:function(T){var R=ze(T);return R},get64:function(T,R){return T}};function Mp(T){return w?Er(3,1,T):0}function Fp(T,R,j,X,ce){if(w)return Er(4,1,T,R,j,X,ce)}function $p(T,R,j,X){if(w)return Er(5,1,T,R,j,X);for(var ce=0,ue=0;ue>2],ve=o()[R+(ue*8+4)>>2],at=0;at>2]=ce,0}function sm(T){var R=Ie.threadExitHandlers.pop();T&&R()}function im(T,R){Ie.threadExitHandlers.push(function(){fa.get(T)(R)})}function Dp(T){if(w)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var R=Ie.getNewWorker();if(R.pthread!==void 0)throw"Internal error!";if(!T.pthread_ptr)throw"Internal error, no pthread ptr!";Ie.runningWorkers.push(R);for(var j=ms(128*4),X=0;X<128;++X)o()[j+X*4>>2]=0;var ce=T.stackBase+T.stackSize,ue=Ie.pthreads[T.pthread_ptr]={worker:R,stackBase:T.stackBase,stackSize:T.stackSize,allocatedOwnStack:T.allocatedOwnStack,threadInfoStruct:T.pthread_ptr},pe=ue.threadInfoStruct>>2;Atomics.store(u(),pe+(64>>2),T.detached),Atomics.store(u(),pe+(100>>2),j),Atomics.store(u(),pe+(40>>2),ue.threadInfoStruct),Atomics.store(u(),pe+(80>>2),T.stackSize),Atomics.store(u(),pe+(76>>2),ce),Atomics.store(u(),pe+(104>>2),T.stackSize),Atomics.store(u(),pe+(104+8>>2),ce),Atomics.store(u(),pe+(104+12>>2),T.detached);var ve=d5(),at=ve+40;Atomics.store(u(),pe+(172>>2),at),R.pthread=ue;var Gt={cmd:"run",start_routine:T.startRoutine,arg:T.arg,threadInfoStruct:T.pthread_ptr,stackBase:T.stackBase,stackSize:T.stackSize};R.runPthread=function(){Gt.time=performance.now(),R.postMessage(Gt,T.transferList)},R.loaded&&(R.runPthread(),delete R.runPthread)}function om(T,R,j,X){if(typeof SharedArrayBuffer=="undefined")return H("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;if(!T)return H("pthread_create called with a null thread pointer!"),28;var ce=[],ue=0;if(w&&(ce.length===0||ue))return f5(687865856,T,R,j,X);if(ue)return ue;var pe=0,ve=0,at=0;R&&R!=-1?(pe=o()[R>>2],pe+=81920,ve=o()[R+8>>2],at=o()[R+12>>2]!==0):pe=2097152;var Gt=ve==0;Gt?ve=y5(16,pe):(ve-=pe,fe(ve>0));for(var Pt=ms(228),Fr=0;Fr<228>>2;++Fr)u()[(Pt>>2)+Fr]=0;o()[T>>2]=Pt,o()[Pt+12>>2]=Pt;var lo=Pt+152;o()[lo>>2]=lo;var Cn={stackBase:ve,stackSize:pe,allocatedOwnStack:Gt,detached:at,startRoutine:j,pthread_ptr:Pt,arg:X,transferList:ce};return w?(Cn.cmd="spawnThread",postMessage(Cn,ce)):Dp(Cn),0}function Op(T){if(w)return Er(6,1,T);switch(T){case 30:return 16384;case 85:var R=2147483648;return R/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return Ef(28),-1}w||Ie.initMainThreadBlock();var Rr,lm=[null,Rf,Rp,Mp,Fp,$p,Op],um={e:Tf,r:Cf,x:Mf,b:Ff,y:$f,j:Df,c:Of,d:Au,f:fs,p:zf,z:_f,u:Lf,q:Vf,v:Kf,i:Zf,t:Yf,w:rm,m:Mp,n:Fp,g:$p,o:Cp,a:Z||d.wasmMemory,k:sm,l:im,h:om,s:Op},l5=xf(),zp=d.___wasm_call_ctors=function(){return(zp=d.___wasm_call_ctors=d.asm.A).apply(null,arguments)},dm=d._init=function(){return(dm=d._init=d.asm.B).apply(null,arguments)},pm=d._register_tensor=function(){return(pm=d._register_tensor=d.asm.C).apply(null,arguments)},cm=d._dispose_data=function(){return(cm=d._dispose_data=d.asm.D).apply(null,arguments)},hm=d._dispose=function(){return(hm=d._dispose=d.asm.E).apply(null,arguments)},fm=d._Abs=function(){return(fm=d._Abs=d.asm.G).apply(null,arguments)},mm=d._Add=function(){return(mm=d._Add=d.asm.H).apply(null,arguments)},gm=d._AddN=function(){return(gm=d._AddN=d.asm.I).apply(null,arguments)},ym=d._All=function(){return(ym=d._All=d.asm.J).apply(null,arguments)},Am=d._Any=function(){return(Am=d._Any=d.asm.K).apply(null,arguments)},xm=d._ArgMax=function(){return(xm=d._ArgMax=d.asm.L).apply(null,arguments)},bm=d._AvgPool=function(){return(bm=d._AvgPool=d.asm.M).apply(null,arguments)},vm=d._BatchMatMul=function(){return(vm=d._BatchMatMul=d.asm.N).apply(null,arguments)},wm=d._Ceil=function(){return(wm=d._Ceil=d.asm.O).apply(null,arguments)},km=d._ClipByValue=function(){return(km=d._ClipByValue=d.asm.P).apply(null,arguments)},Im=d._Conv2D=function(){return(Im=d._Conv2D=d.asm.Q).apply(null,arguments)},Sm=d._Conv2DBackpropInput=function(){return(Sm=d._Conv2DBackpropInput=d.asm.R).apply(null,arguments)},Nm=d._Cos=function(){return(Nm=d._Cos=d.asm.S).apply(null,arguments)},Tm=d._CropAndResize=function(){return(Tm=d._CropAndResize=d.asm.T).apply(null,arguments)},Cm=d._Cumsum=function(){return(Cm=d._Cumsum=d.asm.U).apply(null,arguments)},Em=d._DepthToSpace=function(){return(Em=d._DepthToSpace=d.asm.V).apply(null,arguments)},Rm=d._DepthwiseConv2dNative=function(){return(Rm=d._DepthwiseConv2dNative=d.asm.W).apply(null,arguments)},_p=d._Equal=function(){return(_p=d._Equal=d.asm.X).apply(null,arguments)},Pp=d._Exp=function(){return(Pp=d._Exp=d.asm.Y).apply(null,arguments)},Lp=d._FlipLeftRight=function(){return(Lp=d._FlipLeftRight=d.asm.Z).apply(null,arguments)},wu=d._Floor=function(){return(wu=d._Floor=d.asm._).apply(null,arguments)},ao=d._FloorDiv=function(){return(ao=d._FloorDiv=d.asm.$).apply(null,arguments)},Mm=d._FusedBatchNorm=function(){return(Mm=d._FusedBatchNorm=d.asm.aa).apply(null,arguments)},ku=d._FusedConv2D=function(){return(ku=d._FusedConv2D=d.asm.ba).apply(null,arguments)},Y=d._FusedDepthwiseConv2D=function(){return(Y=d._FusedDepthwiseConv2D=d.asm.ca).apply(null,arguments)},ae=d._Gather=function(){return(ae=d._Gather=d.asm.da).apply(null,arguments)},Ce=d._GatherNd=function(){return(Ce=d._GatherNd=d.asm.ea).apply(null,arguments)},Ye=d._Greater=function(){return(Ye=d._Greater=d.asm.fa).apply(null,arguments)},Ct=d._GreaterEqual=function(){return(Ct=d._GreaterEqual=d.asm.ga).apply(null,arguments)},At=d._LeakyRelu=function(){return(At=d._LeakyRelu=d.asm.ha).apply(null,arguments)},He=d._Less=function(){return(He=d._Less=d.asm.ia).apply(null,arguments)},qe=d._LessEqual=function(){return(qe=d._LessEqual=d.asm.ja).apply(null,arguments)},nn=d._Log=function(){return(nn=d._Log=d.asm.ka).apply(null,arguments)},dr=d._LogicalAnd=function(){return(dr=d._LogicalAnd=d.asm.la).apply(null,arguments)},pr=d._Max=function(){return(pr=d._Max=d.asm.ma).apply(null,arguments)},Wp=d._MaxPool=function(){return(Wp=d._MaxPool=d.asm.na).apply(null,arguments)},Iu=d._Maximum=function(){return(Iu=d._Maximum=d.asm.oa).apply(null,arguments)},aa=d._Mean=function(){return(aa=d._Mean=d.asm.pa).apply(null,arguments)},Mr=d._Min=function(){return(Mr=d._Min=d.asm.qa).apply(null,arguments)},Bp=d._Minimum=function(){return(Bp=d._Minimum=d.asm.ra).apply(null,arguments)},Q9=d._MirrorPad=function(){return(Q9=d._MirrorPad=d.asm.sa).apply(null,arguments)},eI=d._Multiply=function(){return(eI=d._Multiply=d.asm.ta).apply(null,arguments)},tI=d._Neg=function(){return(tI=d._Neg=d.asm.ua).apply(null,arguments)},nI=d._NonMaxSuppressionV3=function(){return(nI=d._NonMaxSuppressionV3=d.asm.va).apply(null,arguments)},aI=d._NonMaxSuppressionV4=function(){return(aI=d._NonMaxSuppressionV4=d.asm.wa).apply(null,arguments)},rI=d._NonMaxSuppressionV5=function(){return(rI=d._NonMaxSuppressionV5=d.asm.xa).apply(null,arguments)},sI=d._NotEqual=function(){return(sI=d._NotEqual=d.asm.ya).apply(null,arguments)},iI=d._OneHot=function(){return(iI=d._OneHot=d.asm.za).apply(null,arguments)},oI=d._PadV2=function(){return(oI=d._PadV2=d.asm.Aa).apply(null,arguments)},lI=d._Pow=function(){return(lI=d._Pow=d.asm.Ba).apply(null,arguments)},uI=d._Prelu=function(){return(uI=d._Prelu=d.asm.Ca).apply(null,arguments)},dI=d._Prod=function(){return(dI=d._Prod=d.asm.Da).apply(null,arguments)},pI=d._RealDiv=function(){return(pI=d._RealDiv=d.asm.Ea).apply(null,arguments)},cI=d._Relu=function(){return(cI=d._Relu=d.asm.Fa).apply(null,arguments)},hI=d._Relu6=function(){return(hI=d._Relu6=d.asm.Ga).apply(null,arguments)},fI=d._ResizeBilinear=function(){return(fI=d._ResizeBilinear=d.asm.Ha).apply(null,arguments)},mI=d._Reverse=function(){return(mI=d._Reverse=d.asm.Ia).apply(null,arguments)},gI=d._RotateWithOffset=function(){return(gI=d._RotateWithOffset=d.asm.Ja).apply(null,arguments)},yI=d._Round=function(){return(yI=d._Round=d.asm.Ka).apply(null,arguments)},AI=d._Rsqrt=function(){return(AI=d._Rsqrt=d.asm.La).apply(null,arguments)},xI=d._ScatterNd=function(){return(xI=d._ScatterNd=d.asm.Ma).apply(null,arguments)},bI=d._SelectV2=function(){return(bI=d._SelectV2=d.asm.Na).apply(null,arguments)},vI=d._Sigmoid=function(){return(vI=d._Sigmoid=d.asm.Oa).apply(null,arguments)},wI=d._Sin=function(){return(wI=d._Sin=d.asm.Pa).apply(null,arguments)},kI=d._Softmax=function(){return(kI=d._Softmax=d.asm.Qa).apply(null,arguments)},II=d._Sqrt=function(){return(II=d._Sqrt=d.asm.Ra).apply(null,arguments)},SI=d._Square=function(){return(SI=d._Square=d.asm.Sa).apply(null,arguments)},NI=d._SquaredDifference=function(){return(NI=d._SquaredDifference=d.asm.Ta).apply(null,arguments)},TI=d._Step=function(){return(TI=d._Step=d.asm.Ua).apply(null,arguments)},CI=d._StridedSlice=function(){return(CI=d._StridedSlice=d.asm.Va).apply(null,arguments)},EI=d._Sub=function(){return(EI=d._Sub=d.asm.Wa).apply(null,arguments)},RI=d._Sum=function(){return(RI=d._Sum=d.asm.Xa).apply(null,arguments)},MI=d._Tan=function(){return(MI=d._Tan=d.asm.Ya).apply(null,arguments)},FI=d._Tanh=function(){return(FI=d._Tanh=d.asm.Za).apply(null,arguments)},$I=d._Tile=function(){return($I=d._Tile=d.asm._a).apply(null,arguments)},DI=d._TopK=function(){return(DI=d._TopK=d.asm.$a).apply(null,arguments)},OI=d._Transform=function(){return(OI=d._Transform=d.asm.ab).apply(null,arguments)},zI=d._Transpose=function(){return(zI=d._Transpose=d.asm.bb).apply(null,arguments)},_I=d.__FusedMatMul=function(){return(_I=d.__FusedMatMul=d.asm.cb).apply(null,arguments)},ms=d._malloc=function(){return(ms=d._malloc=d.asm.db).apply(null,arguments)},Su=d._free=function(){return(Su=d._free=d.asm.eb).apply(null,arguments)},u5=d.___errno_location=function(){return(u5=d.___errno_location=d.asm.fb).apply(null,arguments)},d5=d._emscripten_get_global_libc=function(){return(d5=d._emscripten_get_global_libc=d.asm.gb).apply(null,arguments)},ro=d._pthread_self=function(){return(ro=d._pthread_self=d.asm.hb).apply(null,arguments)},p5=d.___pthread_tsd_run_dtors=function(){return(p5=d.___pthread_tsd_run_dtors=d.asm.ib).apply(null,arguments)},Fm=d._emscripten_main_thread_process_queued_calls=function(){return(Fm=d._emscripten_main_thread_process_queued_calls=d.asm.jb).apply(null,arguments)},PI=d._emscripten_current_thread_process_queued_calls=function(){return(PI=d._emscripten_current_thread_process_queued_calls=d.asm.kb).apply(null,arguments)},c5=d._emscripten_register_main_browser_thread_id=function(){return(c5=d._emscripten_register_main_browser_thread_id=d.asm.lb).apply(null,arguments)},h5=d.__emscripten_do_dispatch_to_thread=function(){return(h5=d.__emscripten_do_dispatch_to_thread=d.asm.mb).apply(null,arguments)},f5=d._emscripten_sync_run_in_main_thread_4=function(){return(f5=d._emscripten_sync_run_in_main_thread_4=d.asm.nb).apply(null,arguments)},m5=d._emscripten_run_in_main_runtime_thread_js=function(){return(m5=d._emscripten_run_in_main_runtime_thread_js=d.asm.ob).apply(null,arguments)},$m=d.__emscripten_call_on_thread=function(){return($m=d.__emscripten_call_on_thread=d.asm.pb).apply(null,arguments)},LI=d._emscripten_tls_init=function(){return(LI=d._emscripten_tls_init=d.asm.qb).apply(null,arguments)},Dm=d.__emscripten_thread_init=function(){return(Dm=d.__emscripten_thread_init=d.asm.rb).apply(null,arguments)},Nu=d.stackSave=function(){return(Nu=d.stackSave=d.asm.sb).apply(null,arguments)},so=d.stackRestore=function(){return(so=d.stackRestore=d.asm.tb).apply(null,arguments)},io=d.stackAlloc=function(){return(io=d.stackAlloc=d.asm.ub).apply(null,arguments)},g5=d._emscripten_stack_set_limits=function(){return(g5=d._emscripten_stack_set_limits=d.asm.vb).apply(null,arguments)},y5=d._memalign=function(){return(y5=d._memalign=d.asm.wb).apply(null,arguments)},A5=d.__emscripten_allow_main_runtime_queued_calls=9808,oo=d.__emscripten_main_thread_futex=11432;d.cwrap=Oe,d.PThread=Ie,d.PThread=Ie,d.wasmMemory=Z,d.ExitStatus=Tu;var Vp;function Tu(T){this.name="ExitStatus",this.message="Program terminated with exit("+T+")",this.status=T}hs=function T(){Vp||Om(),Vp||(hs=T)};function Om(T){if(T=T||f,lr>0)return;if(w){p(d),yu(),postMessage({cmd:"loaded"});return}if(cf(),lr>0)return;function R(){Vp||(Vp=!0,d.calledRun=!0,!oe&&(yu(),hf(),p(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),Nn()))}d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1),R()},1)):R()}d.run=Om;function WI(T,R){if(!(R&&se&&T===0)){if(!R&&w)throw postMessage({cmd:"exitProcess",returnCode:T}),new Tu(T);se||(Ie.terminateAllThreads(),xe=T,wp(),d.onExit&&d.onExit(T),oe=!0),y(T,new Tu(T))}}if(d.preInit)for(typeof d.preInit=="function"&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();return w&&(se=!1,Ie.initWorker()),Om(),r.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModuleThreadedSimd=n)}),oS=xt((e,t)=>{var n=function(){var a=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(a=a||__filename),function(r){r=r||{};var s=typeof r!="undefined"?r:{},i,o;s.ready=new Promise(function(Y,ae){i=Y,o=ae});var u={},l;for(l in s)s.hasOwnProperty(l)&&(u[l]=s[l]);var d=[],p="./this.program",c=function(Y,ae){throw ae},h=!1,m=!1,f=!1,g=!1;h=typeof window=="object",m=typeof importScripts=="function",f=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g=!h&&!f&&!m;var y="";function A(Y){return s.locateFile?s.locateFile(Y,y):y+Y}var x,v,b,w,N,C;f?(m?y=Cu().dirname(y)+"/":y=__dirname+"/",x=function(Y,ae){return N||(N=po("fs")),C||(C=Cu()),Y=C.normalize(Y),N.readFileSync(Y,ae?null:"utf8")},b=function(Y){var ae=x(Y,!0);return ae.buffer||(ae=new Uint8Array(ae)),G(ae.buffer),ae},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",function(Y){if(!(Y instanceof Mm))throw Y}),process.on("unhandledRejection",Va),c=function(Y){process.exit(Y)},s.inspect=function(){return"[Emscripten Module object]"}):g?(typeof read!="undefined"&&(x=function(Y){return read(Y)}),b=function(Y){var ae;return typeof readbuffer=="function"?new Uint8Array(readbuffer(Y)):(ae=read(Y,"binary"),G(typeof ae=="object"),ae)},typeof scriptArgs!="undefined"?d=scriptArgs:typeof arguments!="undefined"&&(d=arguments),typeof quit=="function"&&(c=function(Y){quit(Y)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(h||m)&&(m?y=self.location.href:typeof document!="undefined"&&document.currentScript&&(y=document.currentScript.src),a&&(y=a),y.indexOf("blob:")!==0?y=y.substr(0,y.lastIndexOf("/")+1):y="",x=function(Y){var ae=new XMLHttpRequest;return ae.open("GET",Y,!1),ae.send(null),ae.responseText},m&&(b=function(Y){var ae=new XMLHttpRequest;return ae.open("GET",Y,!1),ae.responseType="arraybuffer",ae.send(null),new Uint8Array(ae.response)}),v=function(Y,ae,Ce){var Ye=new XMLHttpRequest;Ye.open("GET",Y,!0),Ye.responseType="arraybuffer",Ye.onload=function(){if(Ye.status==200||Ye.status==0&&Ye.response){ae(Ye.response);return}Ce()},Ye.onerror=Ce,Ye.send(null)},w=function(Y){document.title=Y});var E=s.print||console.log.bind(console),_=s.printErr||console.warn.bind(console);for(l in u)u.hasOwnProperty(l)&&(s[l]=u[l]);u=null,s.arguments&&(d=s.arguments),s.thisProgram&&(p=s.thisProgram),s.quit&&(c=s.quit);var $;s.wasmBinary&&($=s.wasmBinary);var S=s.noExitRuntime||!0;typeof WebAssembly!="object"&&Va("no native wasm support detected");var z,O=!1,W;function G(Y,ae){Y||Va("Assertion failed: "+ae)}function H(Y){var ae=s["_"+Y];return G(ae,"Cannot call unknown function "+Y+", make sure it is exported"),ae}function J(Y,ae,Ce,Ye,Ct){var At={string:function(aa){var Mr=0;if(aa!=null&&aa!==0){var Bp=(aa.length<<2)+1;Mr=wu(Bp),le(aa,Mr,Bp)}return Mr},array:function(aa){var Mr=wu(aa.length);return oe(aa,Mr),Mr}};function He(aa){return ae==="string"?se(aa):ae==="boolean"?Boolean(aa):aa}var qe=H(Y),nn=[],dr=0;if(Ye)for(var pr=0;pr=Ye);)++Ct;if(Ct-ae>16&&Y.subarray&&ne)return ne.decode(Y.subarray(ae,Ct));for(var At="";ae>10,56320|dr&1023)}}return At}function se(Y,ae){return Y?Q(Te,Y,ae):""}function Z(Y,ae,Ce,Ye){if(!(Ye>0))return 0;for(var Ct=Ce,At=Ce+Ye-1,He=0;He=55296&&qe<=57343){var nn=Y.charCodeAt(++He);qe=65536+((qe&1023)<<10)|nn&1023}if(qe<=127){if(Ce>=At)break;ae[Ce++]=qe}else if(qe<=2047){if(Ce+1>=At)break;ae[Ce++]=192|qe>>6,ae[Ce++]=128|qe&63}else if(qe<=65535){if(Ce+2>=At)break;ae[Ce++]=224|qe>>12,ae[Ce++]=128|qe>>6&63,ae[Ce++]=128|qe&63}else{if(Ce+3>=At)break;ae[Ce++]=240|qe>>18,ae[Ce++]=128|qe>>12&63,ae[Ce++]=128|qe>>6&63,ae[Ce++]=128|qe&63}}return ae[Ce]=0,Ce-Ct}function le(Y,ae,Ce){return Z(Y,Te,ae,Ce)}function oe(Y,ae){Ne.set(Y,ae)}function xe(Y,ae){return Y%ae>0&&(Y+=ae-Y%ae),Y}var fe,Ne,Te,Oe,Pe,ze,tt,nt,it;function Ze(Y){fe=Y,s.HEAP8=Ne=new Int8Array(Y),s.HEAP16=Oe=new Int16Array(Y),s.HEAP32=ze=new Int32Array(Y),s.HEAPU8=Te=new Uint8Array(Y),s.HEAPU16=Pe=new Uint16Array(Y),s.HEAPU32=tt=new Uint32Array(Y),s.HEAPF32=nt=new Float32Array(Y),s.HEAPF64=it=new Float64Array(Y)}var ht=s.INITIAL_MEMORY||16777216,Ue,In=[],kt=[],ta=[],en=[],Sn=!1;kt.push({func:function(){Cp()}});function na(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Ba(s.preRun.shift());Cr(In)}function Pn(){Sn=!0,Cr(kt)}function dn(){Cr(ta)}function tn(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)fa(s.postRun.shift());Cr(en)}function Ba(Y){In.unshift(Y)}function fa(Y){en.unshift(Y)}var ma=0,Nr=null,or=null;function Tr(Y){ma++,s.monitorRunDependencies&&s.monitorRunDependencies(ma)}function Qi(Y){if(ma--,s.monitorRunDependencies&&s.monitorRunDependencies(ma),ma==0&&(Nr!==null&&(clearInterval(Nr),Nr=null),or)){var ae=or;or=null,ae()}}s.preloadedImages={},s.preloadedAudios={};function Va(Y){s.onAbort&&s.onAbort(Y),Y+="",_(Y),O=!0,W=1,Y="abort("+Y+"). Build with -s ASSERTIONS=1 for more info.";var ae=new WebAssembly.RuntimeError(Y);throw o(ae),ae}function vp(Y,ae){return String.prototype.startsWith?Y.startsWith(ae):Y.indexOf(ae)===0}var cf="data:application/octet-stream;base64,";function yu(Y){return vp(Y,cf)}var hf="file://";function wp(Y){return vp(Y,hf)}var Nn="tfjs-backend-wasm.wasm";yu(Nn)||(Nn=A(Nn));function kp(Y){try{if(Y==Nn&&$)return new Uint8Array($);if(b)return b(Y);throw"both async and sync fetching of the wasm failed"}catch(ae){Va(ae)}}function ff(){if(!$&&(h||m)){if(typeof fetch=="function"&&!wp(Nn))return fetch(Nn,{credentials:"same-origin"}).then(function(Y){if(!Y.ok)throw"failed to load wasm binary file at '"+Nn+"'";return Y.arrayBuffer()}).catch(function(){return kp(Nn)});if(v)return new Promise(function(Y,ae){v(Nn,function(Ce){Y(new Uint8Array(Ce))},ae)})}return Promise.resolve().then(function(){return kp(Nn)})}function lr(){var Y={a:xf};function ae(He,qe){var nn=He.exports;s.asm=nn,z=s.asm.i,Ze(z.buffer),Ue=s.asm.o,Qi("wasm-instantiate")}Tr("wasm-instantiate");function Ce(He){ae(He.instance)}function Ye(He){return ff().then(function(qe){return WebAssembly.instantiate(qe,Y)}).then(He,function(qe){_("failed to asynchronously prepare wasm: "+qe),Va(qe)})}function Ct(){return!$&&typeof WebAssembly.instantiateStreaming=="function"&&!yu(Nn)&&!wp(Nn)&&typeof fetch=="function"?fetch(Nn,{credentials:"same-origin"}).then(function(He){var qe=WebAssembly.instantiateStreaming(He,Y);return qe.then(Ce,function(nn){return _("wasm streaming compile failed: "+nn),_("falling back to ArrayBuffer instantiation"),Ye(Ce)})}):Ye(Ce)}if(s.instantiateWasm)try{var At=s.instantiateWasm(Y,ae);return At}catch(He){return _("Module.instantiateWasm callback failed with error: "+He),!1}return Ct().catch(o),{}}function Cr(Y){for(;Y.length>0;){var ae=Y.shift();if(typeof ae=="function"){ae(s);continue}var Ce=ae.func;typeof Ce=="number"?ae.arg===void 0?Ue.get(Ce)():Ue.get(Ce)(ae.arg):Ce(ae.arg===void 0?null:ae.arg)}}function hs(){Va()}function mf(Y,ae,Ce){Te.copyWithin(Y,ae,ae+Ce)}function gf(){return Te.length}function ur(Y){try{return z.grow(Y-fe.byteLength+65535>>>16),Ze(z.buffer),1}catch(ae){}}function Ip(Y){var ae=gf(),Ce=2147483648;if(Y>Ce)return!1;for(var Ye=1;Ye<=4;Ye*=2){var Ct=ae*(1+.2/Ye);Ct=Math.min(Ct,Y+100663296);var At=Math.min(Ce,xe(Math.max(Y,Ct),65536)),He=ur(At);if(He)return!0}return!1}var eo={mappings:{},buffers:[null,[],[]],printChar:function(Y,ae){var Ce=eo.buffers[Y];ae===0||ae===10?((Y===1?E:_)(Q(Ce,0)),Ce.length=0):Ce.push(ae)},varargs:void 0,get:function(){eo.varargs+=4;var Y=ze[eo.varargs-4>>2];return Y},getStr:function(Y){var ae=se(Y);return ae},get64:function(Y,ae){return Y}};function Sp(Y){return 0}function yf(Y,ae,Ce,Ye,Ct){}function Np(Y,ae,Ce,Ye){for(var Ct=0,At=0;At>2],qe=ze[ae+(At*8+4)>>2],nn=0;nn>2]=Ct,0}function Tn(){return 6}function Tp(Y){return ze[_p()>>2]=Y,Y}function Af(Y){switch(Y){case 30:return 16384;case 85:var ae=2147483648;return ae/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return Tp(28),-1}var xf={a:hs,d:mf,e:Ip,f:Sp,c:yf,b:Np,g:Tn,h:Af},bf=lr(),Cp=s.___wasm_call_ctors=function(){return(Cp=s.___wasm_call_ctors=s.asm.j).apply(null,arguments)},to=s._init=function(){return(to=s._init=s.asm.k).apply(null,arguments)},Au=s._register_tensor=function(){return(Au=s._register_tensor=s.asm.l).apply(null,arguments)},vf=s._dispose_data=function(){return(vf=s._dispose_data=s.asm.m).apply(null,arguments)},wf=s._dispose=function(){return(wf=s._dispose=s.asm.n).apply(null,arguments)},kf=s._Abs=function(){return(kf=s._Abs=s.asm.p).apply(null,arguments)},Ie=s._Add=function(){return(Ie=s._Add=s.asm.q).apply(null,arguments)},If=s._AddN=function(){return(If=s._AddN=s.asm.r).apply(null,arguments)},Sf=s._All=function(){return(Sf=s._All=s.asm.s).apply(null,arguments)},Nf=s._Any=function(){return(Nf=s._Any=s.asm.t).apply(null,arguments)},Tf=s._ArgMax=function(){return(Tf=s._ArgMax=s.asm.u).apply(null,arguments)},Cf=s._AvgPool=function(){return(Cf=s._AvgPool=s.asm.v).apply(null,arguments)},fs=s._BatchMatMul=function(){return(fs=s._BatchMatMul=s.asm.w).apply(null,arguments)},Ef=s._Ceil=function(){return(Ef=s._Ceil=s.asm.x).apply(null,arguments)},Rf=s._ClipByValue=function(){return(Rf=s._ClipByValue=s.asm.y).apply(null,arguments)},Mf=s._Conv2D=function(){return(Mf=s._Conv2D=s.asm.z).apply(null,arguments)},Ff=s._Conv2DBackpropInput=function(){return(Ff=s._Conv2DBackpropInput=s.asm.A).apply(null,arguments)},$f=s._Cos=function(){return($f=s._Cos=s.asm.B).apply(null,arguments)},Df=s._CropAndResize=function(){return(Df=s._CropAndResize=s.asm.C).apply(null,arguments)},Of=s._Cumsum=function(){return(Of=s._Cumsum=s.asm.D).apply(null,arguments)},zf=s._DepthToSpace=function(){return(zf=s._DepthToSpace=s.asm.E).apply(null,arguments)},_f=s._DepthwiseConv2dNative=function(){return(_f=s._DepthwiseConv2dNative=s.asm.F).apply(null,arguments)},Er=s._Equal=function(){return(Er=s._Equal=s.asm.G).apply(null,arguments)},xu=s._Exp=function(){return(xu=s._Exp=s.asm.H).apply(null,arguments)},bu=s._FlipLeftRight=function(){return(bu=s._FlipLeftRight=s.asm.I).apply(null,arguments)},Pf=s._Floor=function(){return(Pf=s._Floor=s.asm.J).apply(null,arguments)},Lf=s._FloorDiv=function(){return(Lf=s._FloorDiv=s.asm.K).apply(null,arguments)},Wf=s._FusedBatchNorm=function(){return(Wf=s._FusedBatchNorm=s.asm.L).apply(null,arguments)},Bf=s._FusedConv2D=function(){return(Bf=s._FusedConv2D=s.asm.M).apply(null,arguments)},Vf=s._FusedDepthwiseConv2D=function(){return(Vf=s._FusedDepthwiseConv2D=s.asm.N).apply(null,arguments)},We=s._Gather=function(){return(We=s._Gather=s.asm.O).apply(null,arguments)},jf=s._GatherNd=function(){return(jf=s._GatherNd=s.asm.P).apply(null,arguments)},Uf=s._Greater=function(){return(Uf=s._Greater=s.asm.Q).apply(null,arguments)},Hf=s._GreaterEqual=function(){return(Hf=s._GreaterEqual=s.asm.R).apply(null,arguments)},Gf=s._LeakyRelu=function(){return(Gf=s._LeakyRelu=s.asm.S).apply(null,arguments)},qf=s._Less=function(){return(qf=s._Less=s.asm.T).apply(null,arguments)},Xf=s._LessEqual=function(){return(Xf=s._LessEqual=s.asm.U).apply(null,arguments)},vu=s._Log=function(){return(vu=s._Log=s.asm.V).apply(null,arguments)},Ep=s._LogicalAnd=function(){return(Ep=s._LogicalAnd=s.asm.W).apply(null,arguments)},Rp=s._Max=function(){return(Rp=s._Max=s.asm.X).apply(null,arguments)},Kf=s._MaxPool=function(){return(Kf=s._MaxPool=s.asm.Y).apply(null,arguments)},Zf=s._Maximum=function(){return(Zf=s._Maximum=s.asm.Z).apply(null,arguments)},Yf=s._Mean=function(){return(Yf=s._Mean=s.asm._).apply(null,arguments)},Jf=s._Min=function(){return(Jf=s._Min=s.asm.$).apply(null,arguments)},Qf=s._Minimum=function(){return(Qf=s._Minimum=s.asm.aa).apply(null,arguments)},em=s._MirrorPad=function(){return(em=s._MirrorPad=s.asm.ba).apply(null,arguments)},tm=s._Multiply=function(){return(tm=s._Multiply=s.asm.ca).apply(null,arguments)},et=s._Neg=function(){return(et=s._Neg=s.asm.da).apply(null,arguments)},nm=s._NonMaxSuppressionV3=function(){return(nm=s._NonMaxSuppressionV3=s.asm.ea).apply(null,arguments)},am=s._NonMaxSuppressionV4=function(){return(am=s._NonMaxSuppressionV4=s.asm.fa).apply(null,arguments)},rm=s._NonMaxSuppressionV5=function(){return(rm=s._NonMaxSuppressionV5=s.asm.ga).apply(null,arguments)},no=s._NotEqual=function(){return(no=s._NotEqual=s.asm.ha).apply(null,arguments)},Mp=s._OneHot=function(){return(Mp=s._OneHot=s.asm.ia).apply(null,arguments)},Fp=s._PadV2=function(){return(Fp=s._PadV2=s.asm.ja).apply(null,arguments)},$p=s._Pow=function(){return($p=s._Pow=s.asm.ka).apply(null,arguments)},sm=s._Prelu=function(){return(sm=s._Prelu=s.asm.la).apply(null,arguments)},im=s._Prod=function(){return(im=s._Prod=s.asm.ma).apply(null,arguments)},Dp=s._RealDiv=function(){return(Dp=s._RealDiv=s.asm.na).apply(null,arguments)},om=s._Relu=function(){return(om=s._Relu=s.asm.oa).apply(null,arguments)},Op=s._Relu6=function(){return(Op=s._Relu6=s.asm.pa).apply(null,arguments)},Rr=s._ResizeBilinear=function(){return(Rr=s._ResizeBilinear=s.asm.qa).apply(null,arguments)},lm=s._Reverse=function(){return(lm=s._Reverse=s.asm.ra).apply(null,arguments)},um=s._RotateWithOffset=function(){return(um=s._RotateWithOffset=s.asm.sa).apply(null,arguments)},l5=s._Round=function(){return(l5=s._Round=s.asm.ta).apply(null,arguments)},zp=s._Rsqrt=function(){return(zp=s._Rsqrt=s.asm.ua).apply(null,arguments)},dm=s._ScatterNd=function(){return(dm=s._ScatterNd=s.asm.va).apply(null,arguments)},pm=s._SelectV2=function(){return(pm=s._SelectV2=s.asm.wa).apply(null,arguments)},cm=s._Sigmoid=function(){return(cm=s._Sigmoid=s.asm.xa).apply(null,arguments)},hm=s._Sin=function(){return(hm=s._Sin=s.asm.ya).apply(null,arguments)},fm=s._Softmax=function(){return(fm=s._Softmax=s.asm.za).apply(null,arguments)},mm=s._Sqrt=function(){return(mm=s._Sqrt=s.asm.Aa).apply(null,arguments)},gm=s._Square=function(){return(gm=s._Square=s.asm.Ba).apply(null,arguments)},ym=s._SquaredDifference=function(){return(ym=s._SquaredDifference=s.asm.Ca).apply(null,arguments)},Am=s._Step=function(){return(Am=s._Step=s.asm.Da).apply(null,arguments)},xm=s._StridedSlice=function(){return(xm=s._StridedSlice=s.asm.Ea).apply(null,arguments)},bm=s._Sub=function(){return(bm=s._Sub=s.asm.Fa).apply(null,arguments)},vm=s._Sum=function(){return(vm=s._Sum=s.asm.Ga).apply(null,arguments)},wm=s._Tan=function(){return(wm=s._Tan=s.asm.Ha).apply(null,arguments)},km=s._Tanh=function(){return(km=s._Tanh=s.asm.Ia).apply(null,arguments)},Im=s._Tile=function(){return(Im=s._Tile=s.asm.Ja).apply(null,arguments)},Sm=s._TopK=function(){return(Sm=s._TopK=s.asm.Ka).apply(null,arguments)},Nm=s._Transform=function(){return(Nm=s._Transform=s.asm.La).apply(null,arguments)},Tm=s._Transpose=function(){return(Tm=s._Transpose=s.asm.Ma).apply(null,arguments)},Cm=s.__FusedMatMul=function(){return(Cm=s.__FusedMatMul=s.asm.Na).apply(null,arguments)},Em=s._malloc=function(){return(Em=s._malloc=s.asm.Oa).apply(null,arguments)},Rm=s._free=function(){return(Rm=s._free=s.asm.Pa).apply(null,arguments)},_p=s.___errno_location=function(){return(_p=s.___errno_location=s.asm.Qa).apply(null,arguments)},Pp=s.stackSave=function(){return(Pp=s.stackSave=s.asm.Ra).apply(null,arguments)},Lp=s.stackRestore=function(){return(Lp=s.stackRestore=s.asm.Sa).apply(null,arguments)},wu=s.stackAlloc=function(){return(wu=s.stackAlloc=s.asm.Ta).apply(null,arguments)};s.cwrap=K;var ao;function Mm(Y){this.name="ExitStatus",this.message="Program terminated with exit("+Y+")",this.status=Y}or=function Y(){ao||ku(),ao||(or=Y)};function ku(Y){if(Y=Y||d,ma>0||(na(),ma>0))return;function ae(){ao||(ao=!0,s.calledRun=!0,!O&&(Pn(),dn(),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),tn()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),ae()},1)):ae()}if(s.run=ku,s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return ku(),r.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModule=n)}),lS=xt((e,t)=>{(function(n,a,r){function s(l){var d=this,p=u();d.next=function(){var c=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=c-(d.c=c|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(l),d.s0<0&&(d.s0+=1),d.s1-=p(l),d.s1<0&&(d.s1+=1),d.s2-=p(l),d.s2<0&&(d.s2+=1),p=null}function i(l,d){return d.c=l.c,d.s0=l.s0,d.s1=l.s1,d.s2=l.s2,d}function o(l,d){var p=new s(l),c=d&&d.state,h=p.next;return h.int32=function(){return p.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,c&&(typeof c=="object"&&i(c,p),h.state=function(){return i(p,{})}),h}function u(){var l=4022871197,d=function(p){p=String(p);for(var c=0;c>>0,h-=l,h*=l,l=h>>>0,h-=l,l+=h*4294967296}return(l>>>0)*23283064365386963e-26};return d}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),uS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this,d="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var c=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^c^c>>>8},u===(u|0)?l.x=u:d+=u;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),dS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this,d="";l.next=function(){var c=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(c^c<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,u===(u|0)?l.x=u:d+=u;for(var p=0;p>>4),l.next()}function i(u,l){return l.x=u.x,l.y=u.y,l.z=u.z,l.w=u.w,l.v=u.v,l.d=u.d,l}function o(u,l){var d=new s(u),p=l&&l.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),pS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this;l.next=function(){var p=l.x,c=l.i,h,m,f;return h=p[c],h^=h>>>7,m=h^h<<24,h=p[c+1&7],m^=h^h>>>10,h=p[c+3&7],m^=h^h>>>3,h=p[c+4&7],m^=h^h<<7,h=p[c+7&7],h=h^h<<13,m^=h^h<<9,p[c]=m,l.i=c+1&7,m};function d(p,c){var h,m,f=[];if(c===(c|0))m=f[0]=c;else for(c=""+c,h=0;h0;--h)p.next()}d(l,u)}function i(u,l){return l.x=u.x.slice(),l.i=u.i,l}function o(u,l){u==null&&(u=+new Date);var d=new s(u),p=l&&l.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.x&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),cS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this;l.next=function(){var p=l.w,c=l.X,h=l.i,m,f;return l.w=p=p+1640531527|0,f=c[h+34&127],m=c[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=c[h]=f^m,l.i=h,f+(p^p>>>16)|0};function d(p,c){var h,m,f,g,y,A=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),f=0,g=-32;g>>15,m^=m<<4,m^=m>>>13,g>=0&&(y=y+1640531527|0,h=A[g&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(A[(c&&c.length||0)&127]=-1),f=127,g=4*128;g>0;--g)m=A[f+34&127],h=A[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,A[f]=m^h;p.w=y,p.X=A,p.i=f}d(l,u)}function i(u,l){return l.i=u.i,l.w=u.w,l.X=u.X.slice(),l}function o(u,l){u==null&&(u=+new Date);var d=new s(u),p=l&&l.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.X&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),hS=xt((e,t)=>{(function(n,a,r){function s(u){var l=this,d="";l.next=function(){var c=l.b,h=l.c,m=l.d,f=l.a;return c=c<<25^c>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-c|0,l.b=c=c<<20^c>>>12^h,l.c=h=h-m|0,l.d=m<<16^h>>>16^f,l.a=f-c|0},l.a=0,l.b=0,l.c=2654435769|0,l.d=1367130551,u===Math.floor(u)?(l.a=u/4294967296|0,l.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),fS=xt((e,t)=>{(function(n,a,r){var s=256,i=6,o=52,u="random",l=r.pow(s,i),d=r.pow(2,o),p=d*2,c=s-1,h;function m(b,w,N){var C=[];w=w==!0?{entropy:!0}:w||{};var E=A(y(w.entropy?[b,v(a)]:b==null?x():b,3),C),_=new f(C),$=function(){for(var S=_.g(i),z=l,O=0;S=p;)S/=2,z/=2,O>>>=1;return(S+O)/z};return $.int32=function(){return _.g(4)|0},$.quick=function(){return _.g(4)/4294967296},$.double=$,A(v(_.S),a),(w.pass||N||function(S,z,O,W){return W&&(W.S&&g(W,_),S.state=function(){return g(_,{})}),O?(r[u]=S,z):S})($,E,"global"in w?w.global:this==r,w.state)}function f(b){var w,N=b.length,C=this,E=0,_=C.i=C.j=0,$=C.S=[];for(N||(b=[N++]);E{var n=lS(),a=uS(),r=dS(),s=pS(),i=cS(),o=hS(),u=fS();u.alea=n,u.xor128=a,u.xorwow=r,u.xorshift7=s,u.xor4096=i,u.tychei=o,t.exports=u}),mS=xt(()=>{}),_m={};Fe(_m,{bin:()=>_5,browser:()=>j5,default:()=>gS,dependencies:()=>V5,description:()=>E5,devDependencies:()=>W5,jsdelivr:()=>$5,license:()=>L5,main:()=>M5,miniprogram:()=>z5,module:()=>F5,name:()=>T5,private:()=>R5,repository:()=>P5,scripts:()=>B5,types:()=>O5,unpkg:()=>D5,version:()=>C5});var T5="@tensorflow/tfjs",C5="3.7.0",E5="An open-source machine learning framework.",R5=!1,M5="dist/tf.node.js",F5="dist/index.js",$5="dist/tf.min.js",D5="dist/tf.min.js",O5="dist/index.d.ts",z5="dist/miniprogram",_5={"tfjs-custom-module":"dist/tools/custom_module/cli.js"},P5={type:"git",url:"https://github.com/tensorflow/tfjs.git"},L5="Apache-2.0",W5={"@babel/core":"^7.9.0","@babel/polyfill":"^7.10.4","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@types/argparse":"^1.0.38","@types/jasmine":"2.8.7","@types/node":"~10.17.50","@types/shelljs":"^0.8.4","@types/yargs":"^15.0.7","clang-format":"~1.2.2",commander:"~2.14.1",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.2","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.5.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~4.2.2",shelljs:"~0.8.1","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"1.0.0-pre.50"},B5={build:"tsc && yarn build-cli && yarn bundle","build-ci":"tsc && yarn build-cli && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-converter":"cd ../tfjs-converter && yarn && yarn build","build-converter-ci":"cd ../tfjs-converter && yarn && yarn build-ci","build-data":"cd ../tfjs-data && yarn && yarn build","build-data-ci":"cd ../tfjs-data && yarn && yarn build-ci","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-converter && yarn build-data && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-converter-ci && yarn build-data-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-cli":"tsc --project ./tools/custom_module/tsconfig.json && chmod +x ./dist/tools/custom_module/cli.js","run-custom-build":"ts-node -s ./tools/custom_module/cli.ts","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && yarn build && karma start","test-dev":"karma start","test-tools":"ts-node --project ./tools/custom_module/tsconfig.json run_tools_tests.ts","test-ci":"./scripts/test-ci.sh"},V5={"@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-backend-webgl":"3.7.0","@tensorflow/tfjs-converter":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@tensorflow/tfjs-data":"3.7.0","@tensorflow/tfjs-layers":"3.7.0",argparse:"^1.0.10",chalk:"^4.1.0","core-js":"3","regenerator-runtime":"^0.13.5",yargs:"^16.0.3"},j5={"node-fetch":!1,util:!1,crypto:!1},gS={name:T5,version:C5,description:E5,private:R5,main:M5,module:F5,jsdelivr:$5,unpkg:D5,types:O5,miniprogram:z5,bin:_5,repository:P5,license:L5,devDependencies:W5,scripts:B5,dependencies:V5,browser:j5},Pm={};Fe(Pm,{browser:()=>ox,default:()=>yS,dependencies:()=>ix,description:()=>G5,devDependencies:()=>rx,engines:()=>tx,jsdelivr:()=>K5,"jsnext:main":()=>J5,license:()=>ax,main:()=>X5,miniprogram:()=>ex,module:()=>Q5,name:()=>U5,private:()=>q5,repository:()=>nx,scripts:()=>sx,sideEffects:()=>lx,types:()=>Y5,unpkg:()=>Z5,version:()=>H5});var U5="@tensorflow/tfjs-core",H5="3.7.0",G5="Hardware-accelerated JavaScript library for machine intelligence",q5=!1,X5="dist/tf-core.node.js",K5="dist/tf-core.min.js",Z5="dist/tf-core.min.js",Y5="dist/index.d.ts",J5="dist/index.js",Q5="dist/index.js",ex="dist/miniprogram",tx={yarn:">= 1.3.2"},nx={type:"git",url:"https://github.com/tensorflow/tfjs-core.git"},ax="Apache-2.0",rx={"@bazel/bazelisk":"^1.3.0","@bazel/typescript":"^0.27.8","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"link:../tfjs-backend-cpu","@types/jasmine":"~3.0.0","@types/node":"~9.6.0","@types/node-fetch":"~2.1.2","clang-format":"~1.2.4",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"6.3.2","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~3.1.0","karma-jasmine":"~4.0.1","karma-typescript":"~5.5.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~5.3.0","rollup-plugin-visualizer":"~3.3.2",shelljs:"~0.8.3","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"~1.0.0-pre.21",yargs:"~13.2.2"},sx={"build-ci":"./scripts/enumerate-tests.js --ci && tsc && yarn bundle-ci && yarn build-test-snippets",build:"node ./scripts/enumerate-tests.js && tsc && yarn bundle",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-npm":"./scripts/build-npm.sh","build-deps":"yarn build && yarn build-cpu-backend","build-cpu-backend":"cd ../tfjs-backend-cpu && yarn && yarn build","build-cpu-backend-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build:bazel":"bazelisk build //...","build-test-snippets":"yarn tsc --project ./scripts/test_snippets/tsconfig.json","format-all":"clang-format -i -style=Google --glob=src/**/*.ts","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build && rollup -c && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-webworker":"karma start --worker","run-browserstack":"karma start --browserstack","test-bundle-size":"./scripts/test-bundle-size.js","test-node":"rimraf dist/ && yarn build-deps && yarn build && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-dev":"tsc && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_node.js","test-async-backends":"rimraf dist/ && yarn build && ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-async-backends-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-snippets":"yarn build && yarn build-cpu-backend && ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts","test-snippets-ci":"ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts"},ix={"@types/long":"^4.0.1","@types/offscreencanvas":"~2019.3.0","@types/seedrandom":"2.4.27","@types/webgl-ext":"0.0.30",long:"4.0.0","node-fetch":"~2.6.1",seedrandom:"2.4.3"},ox={"node-fetch":!1,util:!1,crypto:!1,worker_threads:!1},lx=["./dist/index.js","./dist/engine.js","./dist/tensor.js","./dist/base_side_effects.js","./dist/flags.js","./dist/platforms/*.js","./dist/register_all_gradients.js","./dist/public/chained_ops/*.js","./dist/io/*.js"],yS={name:U5,version:H5,description:G5,private:q5,main:X5,jsdelivr:K5,unpkg:Z5,types:Y5,"jsnext:main":J5,module:Q5,miniprogram:ex,engines:tx,repository:nx,license:ax,devDependencies:rx,scripts:sx,dependencies:ix,browser:ox,sideEffects:lx},Lm={};Fe(Lm,{browser:()=>Sx,default:()=>AS,dependencies:()=>Ix,description:()=>px,devDependencies:()=>vx,jsdelivr:()=>fx,"jsnext:main":()=>yx,license:()=>bx,main:()=>hx,miniprogram:()=>xx,module:()=>Ax,name:()=>ux,peerDependencies:()=>kx,private:()=>cx,scripts:()=>wx,types:()=>gx,unpkg:()=>mx,version:()=>dx});var ux="@tensorflow/tfjs-data",dx="3.7.0",px="TensorFlow Data API in JavaScript",cx=!1,hx="dist/tf-data.node.js",fx="dist/tf-data.min.js",mx="dist/tf-data.min.js",gx="dist/index.d.ts",yx="dist/index.js",Ax="dist/index.js",xx="dist/miniprogram",bx="Apache-2.0",vx={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@tensorflow/tfjs-layers":"3.7.0","@types/jasmine":"~2.5.53","@types/seedrandom":"^2.4.27","@types/utf8":"~2.1.6","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",nyc:"^15.1.0",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~7.0.0",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"^1.0.0-pre.50"},wx={build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-backend-cpu-ci","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-dev":"tsc && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-browsers":"karma start --browsers='Chrome,Firefox'","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/test_node.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts",coverage:"yarn nyc yarn ts-node --transpile-only -P tsconfig.test.json src/test_node.ts",lint:"tslint -p . -t verbose"},kx={"@tensorflow/tfjs-core":"3.7.0",seedrandom:"~2.4.3"},Ix={"@types/node-fetch":"^2.1.2","node-fetch":"~2.6.1"},Sx={fs:!1,"node-fetch":!1,string_decoder:!1,crypto:!1},AS={name:ux,version:dx,description:px,private:cx,main:hx,jsdelivr:fx,unpkg:mx,types:gx,"jsnext:main":yx,module:Ax,miniprogram:xx,license:bx,devDependencies:vx,scripts:wx,peerDependencies:kx,dependencies:Ix,browser:Sx},Wm={};Fe(Wm,{default:()=>xS,description:()=>Cx,devDependencies:()=>Px,jsdelivr:()=>Ox,"jsnext:main":()=>$x,license:()=>Ex,main:()=>Mx,miniprogram:()=>_x,module:()=>Dx,name:()=>Nx,peerDependencies:()=>Wx,private:()=>Rx,scripts:()=>Lx,types:()=>Fx,unpkg:()=>zx,version:()=>Tx});var Nx="@tensorflow/tfjs-layers",Tx="3.7.0",Cx="TensorFlow layers API in JavaScript",Ex="Apache-2.0 AND MIT",Rx=!1,Mx="dist/tf-layers.node.js",Fx="dist/index.d.ts",$x="dist/index.js",Dx="dist/index.js",Ox="dist/tf-layers.min.js",zx="dist/tf-layers.min.js",_x="dist/miniprogram",Px={"@babel/polyfill":"^7.8.7","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-backend-webgl":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@types/jasmine":"~2.5.53","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},Lx={prep:"yarn install && yarn build-ci",build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-npm":"./scripts/build-npm.sh",format:"./tools/clang_format_ts.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts","run-browserstack":"karma start --browsers='bs_chrome_mac' --singleRun --reporters='dots,karma-typescript'",lint:"tslint -p . -t verbose"},Wx={"@tensorflow/tfjs-core":"3.7.0"},xS={name:Nx,version:Tx,description:Cx,license:Ex,private:Rx,main:Mx,types:Fx,"jsnext:main":$x,module:Dx,jsdelivr:Ox,unpkg:zx,miniprogram:_x,devDependencies:Px,scripts:Lx,peerDependencies:Wx},Bm={};Fe(Bm,{default:()=>bS,description:()=>jx,devDependencies:()=>eb,jsdelivr:()=>Kx,"jsnext:main":()=>Hx,license:()=>Jx,main:()=>Ux,miniprogram:()=>Zx,module:()=>Gx,name:()=>Bx,peerDependencies:()=>Qx,repository:()=>Yx,scripts:()=>tb,types:()=>qx,unpkg:()=>Xx,version:()=>Vx});var Bx="@tensorflow/tfjs-converter",Vx="3.7.0",jx="Tensorflow model converter for javascript",Ux="dist/tf-converter.node.js",Hx="dist/index.js",Gx="dist/index.js",qx="dist/index.d.ts",Xx="dist/tf-converter.min.js",Kx="dist/tf-converter.min.js",Zx="dist/miniprogram",Yx={type:"git",url:"https://github.com/tensorflow/tfjs-converter.git"},Jx="Apache-2.0",Qx={"@tensorflow/tfjs-core":"3.7.0"},eb={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-replace":"^2.3.3","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@types/argparse":"^1.0.38","@types/deep-equal":"^1.0.1","@types/jasmine":"~2.8.6","@types/long":"~3.0.32","@types/node-fetch":"1.6.9",ajv:"~6.3.0",argparse:"^1.0.10","babel-core":"~6.26.3","babel-plugin-external-helpers":"~6.22.0","babel-preset-env":"~1.7.0","clang-format":"~1.2.2",copyfiles:"~1.2.0","deep-equal":"^1.0.1","jasmine-core":"~3.5.0","node-fetch":"~2.6.1",opn:"~5.1.0",protobufjs:"~6.8.6",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-morph":"^7.1.3","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"~0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},tb={build:"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle","build-ci":"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && yarn gen-json --test && yarn gen-kernel2ops && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/run_tests.ts","test-dev":"tsc && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts",lint:"tslint -p . -t verbose","make-version":"sh -c ./scripts/make-version","gen-doc":"ts-node -s ./scripts/gen_doc.ts","gen-json":"ts-node -s ./scripts/gen_json.ts","model-summary":"ts-node -s ./tools/model_summary.ts",pb2json:"ts-node -s ./tools/pb2json_converter.ts","build-pip-package":"yarn gen-json --test && cd python && ./build-pip-package.sh --test /tmp/tfjs-pips","run-python-tests":"yarn gen-json --test && cd python && ./run-python-tests.sh","gen-kernel2ops":"ts-node -s scripts/kernels_to_ops.ts --out metadata/kernel2op.json"},bS={name:Bx,version:Vx,description:jx,main:Ux,"jsnext:main":Hx,module:Gx,types:qx,unpkg:Xx,jsdelivr:Kx,miniprogram:Zx,repository:Yx,license:Jx,peerDependencies:Qx,devDependencies:eb,scripts:tb},vS=1e-7,wS=1e-4,Up=class{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}},Eu=class{refCount(e){return ga("refCount")}incRef(e){return ga("incRef")}timerAvailable(){return!0}time(e){return ga("time")}read(e){return ga("read")}readSync(e){return ga("readSync")}numDataIds(){return ga("numDataIds")}disposeData(e,t){return ga("disposeData")}write(e,t,n){return ga("write")}move(e,t,n,a,r){return ga("move")}memory(){return ga("memory")}floatPrecision(){return ga("floatPrecision")}epsilon(){return this.floatPrecision()===32?vS:wS}dispose(){return ga("dispose")}};function ga(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function nb(e){let t=e.length,n=0,a=0;for(;t>0;)a=Math.random()*t|0,t--,n=e[t],e[t]=e[a],e[a]=n}function kS(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,a,r,s=0;for(;n>0;)s=Math.random()*n|0,n--,a=e[n],r=t[n],e[n]=e[s],t[n]=t[s],e[s]=a,t[s]=r}function Ru(e,t,n){return Math.max(e,Math.min(t,n))}function IS(e){return e%2==0?e:e+1}function SS(e){let t=0;for(let n=0;nn+` Shapes ${e} and ${t} must match`)}function ys(e){D(e!=null,()=>"The input to the tensor constructor must be a non-null value.")}function As(e,t=[],n=!1){if(t==null&&(t=[]),Array.isArray(e)||on(e)&&!n)for(let a=0;a0,n){return new Promise((a,r)=>{let s=0,i=()=>{if(e()){a();return}s++;let o=t(s);if(n!=null&&s>=n){r();return}setTimeout(i,o)};i()})}function $S(e,t){let n=1,a=-1;for(let s=0;s=0)n*=e[s];else if(e[s]===-1){if(a!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${a} and dim ${s}`);a=s}else if(e[s]<0)throw Error(`Shapes can not be < 0. Found ${e[s]} at dim ${s}`);if(a===-1){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(n===0)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);let r=e.slice();return r[a]=t/n,r}function ya(e,t){let n=t.length;return e=e==null?t.map((a,r)=>r):[].concat(e),D(e.every(a=>a>=-n&&a`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),D(e.every(a=>qt(a)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(a=>a<0?n+a:a)}function ab(e,t){let n=[],a=[],r=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||r?null:ya(t,e).sort(),i=0;for(let o=0;oo)&&e[o]===1&&(n.push(e[o]),a.push(o)),s[i]<=o&&i++}e[o]!==1&&(n.push(e[o]),a.push(o))}return{newShape:n,keptDims:a}}function rb(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else throw new Error(`Unknown data type ${e}`);return n}function sb(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else if(e==="string")n=new Array(t);else throw new Error(`Unknown data type ${e}`);return n}function ib(e,t){for(let n=0;nt+=n.length),t}function $r(e){return typeof e=="string"||e instanceof String}function ub(e){return typeof e=="boolean"}function db(e){return typeof e=="number"}function Hp(e){return Array.isArray(e)?Hp(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":db(e)?"float32":$r(e)?"string":ub(e)?"bool":"float32"}function Dr(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Gp(e,t){for(let n=t;n=0;--a)n[a]=n[a+1]*e[a+1];return n}function pb(e,t,n,a=!1){let r=new Array;if(t.length===1){let s=t[0]*(a?2:1);for(let i=0;iu*l)*(a?2:1);for(let u=0;ur*s)*(n?2:1);if(a===0)return[];if(a!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return pb(0,e,t,n)}function jm(e,t){let n=qp(e,t);for(let a=0;aa*r,1);if(t==null||t==="float32")return ho(e,new Float32Array(n));if(t==="int32")return ho(e,new Int32Array(n));if(t==="bool")return ho(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function Um(e){e.forEach(t=>{D(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function zS(e,t,n){if(t===0)return 0;if(t===1)return e[0];let a=e[e.length-1];for(let r=0;r{let[n,a]=t.split(":");this.urlFlags[n]=WS(n,a)})}};function PS(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...a)=>(LS(t,a[0],a[1]),a.join("="))),t}function LS(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}function WS(e,t){if(t=t.toLowerCase(),t==="true"||t==="false")return t==="true";if(`${+t}`===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}function te(){return sa}var sa=null;function BS(e){sa=e}var Gm;function fb(){if(Gm==null){let e;if(typeof window!="undefined")e=window;else if(typeof global!="undefined")e=global;else if(typeof process!="undefined")e=process;else if(typeof self!="undefined")e=self;else throw new Error("Could not find a global object");Gm=e}return Gm}function VS(){let e=fb();return e._tfGlobals==null&&(e._tfGlobals=new Map),e._tfGlobals}function qm(e,t){let n=VS();if(n.has(e))return n.get(e);{let a=t();return n.set(e,a),n.get(e)}}var fo="Abs",mo="Acos",go="Acosh",Or="Add",xs="AddN",yo="All",Ao="Any",bs="ArgMax",Fu="ArgMin",xo="Asin",bo="Asinh",vo="Atan",wo="Atanh",ko="Atan2",vs="AvgPool",Xp="AvgPoolGrad",$u="AvgPool3D",Kp="AvgPool3DGrad",ws="BatchMatMul",Du="BatchToSpaceND",Zp="Bincount",mb="BroadcastTo",ks="Cast",Is="Ceil",zr="ClipByValue",Yp="Complex",Ou="ComplexAbs",Io="Concat",Ss="Conv2D",Jp="Conv2DBackpropFilter",Ns="Conv2DBackpropInput",zu="Conv3D",Qp="Conv3DBackpropFilterV2",ec="Conv3DBackpropInputV2",Ts="Cos",So="Cosh",Cs="Cumsum",No="CropAndResize",tc="DenseBincount",To="DepthToSpace",Es="DepthwiseConv2dNative",nc="DepthwiseConv2dNativeBackpropFilter",ac="DepthwiseConv2dNativeBackpropInput",rc="Diag",_u="Dilation2D",sc="Dilation2DBackpropInput",ic="Dilation2DBackpropFilter",Rs="RealDiv",oc="Einsum",Co="Elu",lc="EluGrad",Eo="Erf",Ro="Equal",Ms="Exp",Mo="ExpandDims",Fo="Expm1",uc="FFT",Pu="Fill",$o="FlipLeftRight",Fs="Floor",$s="FloorDiv",Ds="FusedBatchNorm",Do="GatherV2",Oo="GatherNd",zo="Greater",Os="GreaterEqual",zs="Identity",dc="IFFT",pc="Imag",_o="IsFinite",Po="IsInf",Lo="IsNan",_s="LeakyRelu",Wo="Less",Bo="LessEqual",cc="LinSpace",Ps="Log",Vo="Log1p",jo="LogicalAnd",Lu="LogicalNot",Wu="LogicalOr",gb="LogSoftmax",Bu="LRN",hc="LRNGrad",Ls="Max",Ws="Maximum",Bs="MaxPool",fc="MaxPoolGrad",Vu="MaxPool3D",mc="MaxPool3DGrad",gc="MaxPoolWithArgmax",Vs="Mean",js="Min",Us="Minimum",Hs="MirrorPad",Uo="Mod",yc="Multinomial",Gs="Multiply",Ho="Neg",Go="NotEqual",qo="NonMaxSuppressionV3",Xo="NonMaxSuppressionV4",Ko="NonMaxSuppressionV5",Zo="OnesLike",qs="OneHot",Yo="Pack",Xs="PadV2",jS="Pool",Ks="Pow",Zs="Prelu",Jo="Prod",ju="Range",Ac="Real",Qo="Reciprocal",Ys="Relu",el="Reshape",Uu="ResizeNearestNeighbor",xc="ResizeNearestNeighborGrad",Js="ResizeBilinear",bc="ResizeBilinearGrad",Qs="Relu6",ei="Reverse",ti="Round",ni="Rsqrt",tl="ScatterNd",nl="Select",al="Selu",rl="Slice",ai="Sin",sl="Sinh",il="Sign",ri="Sigmoid",ol="Softplus",si="Sqrt",ii="Sum",Hu="SpaceToBatchND",ll="SplitV",oi="Softmax",vc="SparseFillEmptyRows",wc="SparseReshape",kc="SparseSegmentMean",Ic="SparseSegmentSum",Sc="SparseToDense",li="SquaredDifference",Gu="Square",ul="StridedSlice",Nc="StringNGrams",Tc="StringSplit",Cc="StringToHashBucketFast",ui="Sub",di="Tan",pi="Tanh",_r="Tile",dl="TopK",pl="Transform",ci="Transpose",Ec="Unique",cl="Unpack",qu="UnsortedSegmentSum",hl="ZerosLike",Pr="Step",Rc="FromPixels",fl="RotateWithOffset",hi="_FusedMatMul",fi="FusedConv2D",mi="FusedDepthwiseConv2D",ml=qm("kernelRegistry",()=>new Map),Xu=qm("gradRegistry",()=>new Map);function Mc(e,t){let n=Km(e,t);return ml.get(n)}function Xm(e){return Xu.get(e)}function gl(e){let t=ml.entries(),n=[];for(;;){let{done:a,value:r}=t.next();if(a)break;let[s,i]=r,[o]=s.split("_");o===e&&n.push(i)}return n}function gi(e){let{kernelName:t,backendName:n}=e,a=Km(t,n);ml.has(a)&&console.warn(`The kernel '${t}' for backend '${n}' is already registered`),ml.set(a,e)}function yb(e){let{kernelName:t}=e;Xu.has(t)&&te().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${t}'`),Xu.set(t,e)}function US(e,t){let n=Km(e,t);if(!ml.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);ml.delete(n)}function HS(e){if(!Xu.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);Xu.delete(e)}function GS(e,t){gl(e).forEach(n=>{let a=Object.assign({},n,{backendName:t});gi(a)})}function Km(e,t){return`${t}_${e}`}var k={};Fe(k,{arraysEqual:()=>cr,assert:()=>D,assertNonNegativeIntegerDimensions:()=>Um,assertNonNull:()=>ys,assertShapesMatch:()=>cn,bytesFromStringArray:()=>lb,bytesPerElement:()=>Vm,checkConversionForErrors:()=>ib,clamp:()=>Ru,computeStrides:()=>co,createScalarValue:()=>JS,createShuffledIndices:()=>MS,decodeString:()=>Dc,distSquared:()=>TS,encodeString:()=>Yu,fetch:()=>eN,fingerPrint64:()=>YS,flatten:()=>As,getArrayFromDType:()=>sb,getTypedArrayFromDType:()=>rb,hasEncodingLoss:()=>DS,hexToLong:()=>Ku,indexToLoc:()=>_S,inferDtype:()=>Hp,inferFromImplicitShape:()=>$S,isBoolean:()=>ub,isFunction:()=>Dr,isInt:()=>qt,isNumber:()=>db,isPromise:()=>Hm,isScalarShape:()=>CS,isString:()=>$r,isTypedArray:()=>on,isValidDtype:()=>ob,locToIndex:()=>zS,makeOnesTypedArray:()=>jm,makeZerosNestedTypedArray:()=>OS,makeZerosTypedArray:()=>qp,nearestDivisor:()=>Gp,nearestLargerEven:()=>IS,now:()=>Zu,parseAxisParam:()=>ya,randUniform:()=>NS,repeatedTry:()=>FS,rightPad:()=>Mu,shuffle:()=>nb,shuffleCombo:()=>kS,sizeFromShape:()=>Mt,sizeToSquarishShape:()=>RS,squeezeShape:()=>ab,sum:()=>SS,tanh:()=>ES,toNestedArray:()=>ho,toTypedArray:()=>$c});var Ab=gs(KI()),yi=Ab.default||Ab;function Ku(e){return yi.fromString(e,!0,16)}var xb=Ku("c3a5c85c97cb3127"),Ai=Ku("b492b66fbe98f273"),hn=Ku("9ae16a3b2f90404f");function Zm(e){return e.xor(e.shru(47))}function bb(e,t,n){let a=e.slice(t,t+n);return yi.fromBytes(Array.from(a),!0,!0)}function pt(e,t){return bb(e,t,8)}function vb(e,t){return bb(e,t,4)}function Xt(e,t){return t===0?e:e.shru(t).or(e.shl(64-t))}function Lr(e,t,n=Ku("9ddfea08eb382d69")){let a=e.xor(t).mul(n);a=a.xor(a.shru(47));let r=t.xor(a).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function qS(e,t,n,a,r,s){r=r.add(e),s=Xt(s.add(r).add(a),21);let i=r;return r=r.add(t),r=r.add(n),s=s.add(Xt(r,44)),[r.add(a),s.add(i)]}function Fc(e,t,n,a){return qS(pt(e,t),pt(e,t+8),pt(e,t+16),pt(e,t+24),n,a)}function XS(e,t=e.length){if(t>=8){let n=hn.add(t*2),a=pt(e,0).add(hn),r=pt(e,t-8),s=Xt(r,37).mul(n).add(a),i=Xt(a,25).add(r).mul(n);return Lr(s,i,n)}if(t>=4){let n=hn.add(t*2),a=vb(e,0);return Lr(a.shl(3).add(t),vb(e,t-4),n)}if(t>0){let n=e[0],a=e[t>>1],r=e[t-1],s=n+(a<<8),i=t+(r<<2);return Zm(hn.mul(s).xor(xb.mul(i))).mul(hn)}return hn}function KS(e,t=e.length){let n=hn.add(t*2),a=pt(e,0).mul(Ai),r=pt(e,8),s=pt(e,t-8).mul(n),i=pt(e,t-16).mul(hn);return Lr(Xt(a.add(r),43).add(Xt(s,30)).add(i),a.add(Xt(r.add(hn),18)).add(s),n)}function ZS(e,t=e.length){let n=hn.add(t*2),a=pt(e,0).mul(hn),r=pt(e,8),s=pt(e,t-8).mul(n),i=pt(e,t-16).mul(hn),o=Xt(a.add(r),43).add(Xt(s,30)).add(i),u=Lr(o,a.add(Xt(r.add(hn),18)).add(s),n),l=pt(e,16).mul(n),d=pt(e,24),p=o.add(pt(e,t-32)).mul(n),c=u.add(pt(e,t-24)).mul(n);return Lr(Xt(l.add(d),43).add(Xt(p,30)).add(c),l.add(Xt(d.add(a),18)).add(p),n)}function YS(e,t=e.length){let n=yi.fromNumber(81,!0);if(t<=32)return t<=16?XS(e,t):KS(e,t);if(t<=64)return ZS(e,t);let a=n,r=n.mul(Ai).add(113),s=Zm(r.mul(hn).add(113)).mul(hn),i=[yi.UZERO,yi.UZERO],o=[yi.UZERO,yi.UZERO];a=a.mul(hn).add(pt(e,0));let u=0,l=(t-1>>6)*64,d=l+(t-1&63)-63;do a=Xt(a.add(r).add(i[0]).add(pt(e,u+8)),37).mul(Ai),r=Xt(r.add(i[1]).add(pt(e,u+48)),42).mul(Ai),a=a.xor(o[1]),r=r.add(i[0]).add(pt(e,u+40)),s=Xt(s.add(o[0]),33).mul(Ai),i=Fc(e,u,i[1].mul(Ai),a.add(o[0])),o=Fc(e,u+32,s.add(o[1]),r.add(pt(e,u+16))),[s,a]=[a,s],u+=64;while(u!==l);let p=Ai.add(s.and(255).shl(1));return u=d,o[0]=o[0].add(t-1&63),i[0]=i[0].add(o[0]),o[0]=o[0].add(i[0]),a=Xt(a.add(r).add(i[0]).add(pt(e,u+8)),37).mul(p),r=Xt(r.add(i[1]).add(pt(e,u+48)),42).mul(p),a=a.xor(o[1].mul(9)),r=r.add(i[0].mul(9).add(pt(e,u+40))),s=Xt(s.add(o[0]),33).mul(p),i=Fc(e,u,i[1].mul(p),a.add(o[0])),o=Fc(e,u+32,s.add(o[1]),r.add(pt(e,u+16))),[s,a]=[a,s],Lr(Lr(i[0],o[0],p).add(Zm(r).mul(xb)).add(s),Lr(i[1],o[1],p).add(a),p)}function JS(e,t){return t==="string"?Yu(e):$c([e],t)}function QS(e,t){return e instanceof Float32Array&&t==="float32"||e instanceof Int32Array&&t==="int32"||e instanceof Uint8Array&&t==="bool"}function $c(e,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=As(e)),te().getBool("DEBUG")&&ib(e,t),QS(e,t))return e;if(t==null||t==="float32"||t==="complex64")return new Float32Array(e);if(t==="int32")return new Int32Array(e);if(t==="bool"){let n=new Uint8Array(e.length);for(let a=0;a{a=n()},s,i=Zu();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(r);else{r();for(let o of a)o.dataSync();s=Promise.resolve({kernelMs:Zu()-i})}if(te().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let o=0;o{nN(l,u.dtype,e)})}return{kernelName:e,outputs:a,inputs:t,timeMs:s.then(o=>o.kernelMs),extraInfo:s.then(o=>o.getExtraProfileInfo!=null?o.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:n,timeMs:a,inputs:r,extraInfo:s}=e;n.forEach(i=>{Promise.all([i.data(),a,s]).then(o=>{this.logger.logKernelProfile(t,i,o[0],o[1],r,o[2])})})}};function nN(e,t,n){if(t!=="float32")return!1;for(let a=0;a0?m:""} `}}console.log(`%c${o} %c${i} %c${u}D ${d} %c${l} %c${p} %c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function rN(e,t,n){let a={},r={};for(let u=0;ua[f.id]=!0),h=!0,r[l.id]=!0;break}if(h)break}}let s={};s[n.id]=!0;let i={};for(let u=e.length-1;u>=0;u--){let l=e[u],d=l.inputs;for(let p=0;p=0;r--){let s=t[r],i=[];if(s.outputs.forEach(u=>{let l=e[u.id];l!=null?i.push(l):i.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let o=s.gradient(i);for(let u in s.inputs){if(!(u in o))throw new Error(`Cannot backprop through input ${u}. Available gradients found: ${Object.keys(o)}.`);let l=n(()=>o[u]());if(l.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${u} must have 'float32' dtype, but has '${l.dtype}'`);let d=s.inputs[u];if(!cr(l.shape,d.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${u}' has shape '${l.shape}', which does not match the shape of the input '${d.shape}'`);if(e[d.id]==null)e[d.id]=l;else{let p=e[d.id];e[d.id]=a(p,l),p.dispose()}}}}var wb=20,Ju=3,Ym=7;function iN(e,t,n,a){let r=co(t),s=oN(e,t,n,r),i=t.length,o=Oc(e,t,n,r,s),u=["Tensor"];return a&&(u.push(` dtype: ${n}`),u.push(` rank: ${i}`),u.push(` shape: [${t}]`),u.push(" values:")),u.push(o.map(l=>" "+l).join(` -`)),u.join(` -`)}function oN(e,t,n,a){let r=Mt(t),s=a[a.length-1],i=new Array(s).fill(0),o=t.length,u=n==="complex64"?ed(e):e;if(o>1)for(let l=0;lwb){let g=Ju*i,y=Array.from(e.slice(0,g)),A=Array.from(e.slice((o-Ju)*i,o*i));return n==="complex64"&&(y=ed(y),A=ed(A)),["["+y.map((x,v)=>Qu(x,r[v],n)).join(", ")+", ..., "+A.map((x,v)=>Qu(x,r[o-Ju+v],n)).join(", ")+"]"]}let f=n==="complex64"?ed(e):Array.from(e);return["["+f.map((g,y)=>Qu(g,r[y],n)).join(", ")+"]"]}let l=t.slice(1),d=a.slice(1),p=a[0]*i,c=[];if(o>wb){for(let f=0;f`Length of values '${a}' 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=n||sb(t,this.size),this.strides=co(e)}set(e,...t){t.length===0&&(t=[0]),D(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let n=this.locToIndex(t);this.values[n]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let a of e){if(a<0||a>=this.shape[t]){let r=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(r)}t++}let n=e[e.length-1];for(let a=0;aDc(n))}catch(n){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();let e=ja().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>Dc(t))}catch(t){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();let e=await ja().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(ja().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return yl.print(this,e)}clone(){return this.throwIfDisposed(),yl.clone(this)}toString(e=!1){let t=this.dataSync();return iN(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),yl.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),ja().makeVariable(this,e,t,n)}};Object.defineProperty(Be,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function ee(){return qm("Tensor",()=>Be)}ee();var td=class extends Be{constructor(e,t,n,a){super(e.shape,e.dtype,e.dataId,a);this.trainable=t,this.name=n}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(!cr(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);ja().disposeTensor(this),this.dataId=e.dataId,ja().incRef(this,null)}dispose(){ja().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(td,Symbol.hasInstance,{value:e=>e instanceof Be&&e.assign!=null&&e.assign instanceof Function});var Sa={};Fe(Sa,{assertTypesMatch:()=>Ib,getTensorsInContainer:()=>a1,isTensorInList:()=>hN,makeTypesMatch:()=>It});var Jm;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(Jm||(Jm={}));var Qm;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(Qm||(Qm={}));var e1;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(e1||(e1={}));var t1;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(t1||(t1={}));var n1;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(n1||(n1={}));var cN={float32:t1,int32:Qm,bool:e1,complex64:n1};function Aa(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return cN[e][t]}function zc(e){return Aa(e,"int32")}function It(e,t){if(e.dtype===t.dtype)return[e,t];let n=Aa(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Ib(e,t){D(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function hN(e,t){return t.some(n=>n.id===e.id)}function a1(e){let t=[],n=new Set;return Sb(e,t,n),t}function Sb(e,t,n){if(e==null)return;if(e instanceof Be){t.push(e);return}if(!fN(e))return;let a=e;for(let r in a){let s=a[r];n.has(s)||(n.add(s),Sb(s,t,n))}}function fN(e){return Array.isArray(e)||typeof e=="object"}function r1(e){return e.kernelName!=null}var Nb=class{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(let e in this.registeredVariables)this.registeredVariables[e].dispose()}},nd=class{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Nb}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){gl(e).forEach(t=>{t.disposeFunc!=null&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{let n=t.factory();if(n&&!(n instanceof Eu)&&typeof n.then=="function"){let a=++this.pendingBackendInitId,r=n.then(s=>a(athis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(a),()=>(a=t(),a instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),a))}scopedRun(e,t,n){e();try{let a=n();return t(),a}catch(a){throw t(),a}}nextTensorId(){return nd.nextTensorId++}nextVariableId(){return nd.nextVariableId++}clone(e){let t=P.runKernel(zs,{x:e}),n={x:e},a=s=>({x:()=>{let i="float32",o={x:s},u={dtype:i};return P.runKernel(ks,o,u)}}),r=[];return this.addTapeNode(this.state.activeScope.name,n,[t],a,r,{}),t}runKernel(e,t,n){if(Mc(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){let a=this.backend.numDataIds(),r=0;n.forEach(o=>{r+=o.dtype==="complex64"?3:1});let s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=a-t-r-s;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[],a=this.isTapeOn(),r=this.state.numBytes,s=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let o,u=r1(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(r1(e)){let{kernelName:h,inputs:m,attrs:f}=e;this.backendName==null&&this.backend;let g=Mc(h,this.backendName);D(g!=null,()=>`Cannot find registered kernel '${h}' for backend '${this.backendName}'`),i=()=>{let y=this.backend.numDataIds();o=g.kernelFunc({inputs:m,attrs:f,backend:this.backend});let A=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(h,y,A);let x=A.map(v=>{if(v.rank!=null)return v;let{dataId:b,shape:w,dtype:N}=v;return this.makeTensorFromDataId(b,w,N)});if(a){let v=this.getTensorsForGradient(h,m,x);n=this.saveTensorsForBackwardMode(v)}return x}}else{let{forwardFunc:h}=e,m=f=>{!a||(n=f.map(g=>this.keep(this.clone(g))))};i=()=>{let f=this.backend.numDataIds();o=this.tidy(()=>h(this.backend,m));let g=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,f,g),g}}let{inputs:l,attrs:d}=e,p=r1(e)?null:e.backwardsFunc,c;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=i():(c=this.profiler.profileKernel(u,l,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(c),t=c.outputs)}),a&&this.addTapeNode(u,l,t,p,n,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(l).map(h=>l[h]!=null?l[h].shape:null),outputShapes:t.map(h=>h.shape),kernelTimeMs:c.timeMs,extraInfo:c.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(e,t,n){let a=Xm(e);if(a!=null){let r=a.inputsToSave||[],s=a.outputsToSave||[],i;a.saveAllInputs?(D(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(u=>t[u])):i=r.map(u=>t[u]);let o=n.filter((u,l)=>s[l]);return i.concat(o)}return[]}makeTensor(e,t,n,a){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",a=a||this.backend;let r=e;n==="string"&&$r(e[0])&&(r=e.map(o=>Yu(o)));let s=a.write(r,t,n),i=new Be(t,n,s,this.nextTensorId());if(this.trackTensor(i,a),n==="string"){let o=this.state.tensorInfo.get(s),u=lb(r);this.state.numBytes+=u-o.bytes,o.bytes=u}return i}makeTensorFromDataId(e,t,n,a){n=n||"float32";let r=new Be(t,n,e,this.nextTensorId());return this.trackTensor(r,a),r}makeVariable(e,t=!0,n,a){n=n||this.nextVariableId().toString(),a!=null&&a!==e.dtype&&(e=e.cast(a));let r=new td(e,t,n,this.nextTensorId());if(this.state.registeredVariables[r.name]!=null)throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let n=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(n=e.size*Vm(e.dtype)),this.state.numBytes+=n,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:n})),e instanceof td||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;let 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"){let n=e.size*Vm(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(let e in this.state.registeredVariables){let 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(){let 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;let t=this.state.numBytes,n=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(a=>a.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(let a of this.state.activeProfile.kernels)a.kernelTimeMs=await a.kernelTimeMs,a.extraInfo=await a.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,n,a,r,s){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=Xm(e);o!=null&&(a=o.gradFunc),a!=null&&(i.gradient=u=>(u=u.map((l,d)=>{if(l==null){let p=n[d],c=qp(p.size,p.dtype);return this.makeTensor(c,p.shape,p.dtype)}return l}),a(u.length>1?u:u[0],r,s))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){let t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){let t=a1(e),n=new Set(t.map(r=>r.id));for(let r=0;r{!r.kept&&r.scopeId===a.id&&this.track(r)})}gradients(e,t,n,a=!1){if(D(t.length>0,()=>"gradients() received an empty list of xs."),n!=null&&n.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);let r=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));D(r instanceof Be,()=>"The result y returned by f() must be a tensor.");let s=rN(this.state.activeTape,t,r);if(!a&&s.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",()=>{let i={};i[r.id]=n==null?mN(r.shape):n,sN(i,s,u=>this.tidy(u),gN);let o=t.map(u=>i[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let l of u.saved)l.dispose()}),this.state.activeTape=null),{value:r,grads:o}})}customGrad(e){return D(Dr(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{D(t.every(i=>i instanceof Be),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,a={};t.forEach((i,o)=>{a[o]=i});let r=(i,o)=>(n=e(...t,o),D(n.value instanceof Be,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),D(Dr(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),s=(i,o)=>{let u=n.gradFunc(i,o),l=Array.isArray(u)?u:[u];D(l.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(...)."),D(l.every(p=>p instanceof Be),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");let d={};return l.forEach((p,c)=>{d[c]=()=>p}),d};return this.runKernelFunc({forwardFunc:r,backwardsFunc:s,inputs:a})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){let t=Zu(),n=await this.backend.time(e);return n.wallMs=Zu()-t,n}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 Nb;for(let e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};nd.nextTensorId=0;nd.nextVariableId=0;function mN(e){let t=jm(Mt(e),"float32");return P.makeTensor(t,e,"float32")}function Tb(){let e=fb();if(e._tfengine==null){let t=new hb(e);e._tfengine=new nd(t)}return BS(e._tfengine.ENV),uN(()=>e._tfengine),e._tfengine}var P=Tb();function gN(e,t){let n={a:e,b:t};return P.runKernel(Or,n)}var ad={};Fe(ad,{isBrowser:()=>Cb,isMobile:()=>AN});function yN(){return typeof navigator!="undefined"&&navigator!=null}function AN(e){if(e||yN()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||window.opera;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(t)||/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(t.substr(0,4))}return!1}function Cb(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var Na=te();Na.registerFlag("DEBUG",()=>!1,e=>{e&&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.")});Na.registerFlag("IS_BROWSER",()=>Cb());Na.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");Na.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Na.registerFlag("PROD",()=>!1);Na.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>Na.getBool("DEBUG"));Na.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);Na.registerFlag("IS_TEST",()=>!1);Na.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0);Na.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);function Ua(e,t){let n=e;if(on(e))return t==="string"?[]:[e.length];if(!Array.isArray(e))return[];let a=[];for(;Array.isArray(n)||on(n)&&t!=="string";)a.push(n.length),n=n[0];return Array.isArray(e)&&te().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Eb(e,a,[]),a}function Eb(e,t,n){if(n=n||[],!Array.isArray(e)&&!on(e)){D(t.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}D(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),D(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let a=t.slice(1);for(let r=0;r=0&&(r=a),Rb(a,r,t,n),e==null||!on(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string"){let o=e==null?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${o}'`)}let s=Ua(e,r);!on(e)&&!Array.isArray(e)&&(e=[e]);let i=r!=="string"?$c(e,r):As(e,[],!0);return P.makeTensor(i,s,r)}function rd(e,t,n,a="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((r,s)=>M(r,`${t}[${s}]`,n,a))}var Mb="__op";function L(e){let t=Object.keys(e);if(t.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0],a=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+Mb;let r=(...s)=>{P.startScope(n);try{let i=a(...s);return Hm(i)&&console.error("Cannot return a Promise inside of tidy."),P.endScope(i),i}catch(i){throw P.endScope(null),i}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}function xN(e,t){let n=M(e,"real","complex"),a=M(t,"imag","complex");cn(n.shape,a.shape,`real and imag shapes, ${n.shape} and ${a.shape}, must match in call to tf.complex().`);let r={real:n,imag:a};return P.runKernel(Yp,r)}var Wr=L({complex_:xN});function Br(e,t,n,a){if(a==null&&(a=Hp(e)),a==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!on(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="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(t!=null){Um(t);let r=Mt(t),s=Mt(n);D(r===s,()=>`Based on the provided shape, [${t}], the tensor should have ${r} values but has ${s}`);for(let i=0;i`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return!on(e)&&!Array.isArray(e)&&(e=[e]),t=t||n,e=a!=="string"?$c(e,a):As(e,[],!0),P.makeTensor(e,t,a)}function ln(e,t,n){let a=Ua(e,n);return Br(e,t,a,n)}var s1={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},_c=4;async function bN(e,t){let n=[],a=[],r=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let c=await u.bytes(),h=c.reduce((g,y)=>g+y.length,0)+_c*c.length,m=new Uint8Array(h),f=0;for(let g=0;g{if(t+=s.byteLength,n.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}`)});let a=new Uint8Array(t),r=0;return n.forEach(s=>{a.set(new Uint8Array(s.buffer),r),r+=s.byteLength}),a.buffer}var i1=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function $b(e){return i1?Buffer.byteLength(e):new Blob([e]).size}function wN(e){if(i1)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),n="";for(let a=0,r=t.length;a{t+=r.byteLength});let n=new Uint8Array(t),a=0;return e.forEach(r=>{n.set(new Uint8Array(r),a),a+=r.byteLength}),n.buffer}function Db(e){let t="/";for(e=e.trim();e.endsWith(t);)e=e.slice(0,e.length-1);let n=e.split(t);return n[n.length-1]}function sd(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:e.modelTopology==null?0:$b(JSON.stringify(e.modelTopology)),weightSpecsBytes:e.weightSpecs==null?0:$b(JSON.stringify(e.weightSpecs)),weightDataBytes:e.weightData==null?0:e.weightData.byteLength}}function IN(){let e=n=>{let a=n<<13,r=0;for(;(a&8388608)==0;)r-=8388608,a<<=1;return a&=~8388608,r+=947912704,a|r},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let n=1024;n<2048;n++)t[n]=939524096+(n-1024<<13);return t}function SN(){let e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}function NN(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function TN(){let e=IN(),t=SN(),n=NN();return a=>{let r=new ArrayBuffer(4*a.length),s=new Uint32Array(r);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=u}return new Float32Array(r)}}var Et=class{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return Et.instance==null&&(Et.instance=new Et),Et.instance}static registerSaveRouter(e){Et.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Et.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Et.getHandlers(e,"save")}static getLoadHandlers(e,t){return Et.getHandlers(e,"load",t)}static getHandlers(e,t,n){let a=[];return(t==="load"?Et.getInstance().loadRouters:Et.getInstance().saveRouters).forEach(r=>{let s=r(e,n);s!==null&&a.push(s)}),a}},CN=e=>Et.registerSaveRouter(e),EN=e=>Et.registerLoadRouter(e),RN=e=>Et.getSaveHandlers(e),MN=(e,t)=>Et.getLoadHandlers(e,t),l1="tensorflowjs",u1=1,xi="models_store",Vr="model_info_store";function Ob(){if(!te().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e=typeof window=="undefined"?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function d1(e){let t=e.result;t.createObjectStore(xi,{keyPath:"modelPath"}),t.createObjectStore(Vr,{keyPath:"modelPath"})}var bi=class{constructor(e){if(this.indexedDB=Ob(),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((n,a)=>{let r=this.indexedDB.open(l1,u1);r.onupgradeneeded=()=>d1(r),r.onsuccess=()=>{let s=r.result;if(t==null){let i=s.transaction(xi,"readonly"),o=i.objectStore(xi).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),a(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));n(o.result.modelArtifacts)},o.onerror=u=>(s.close(),a(o.error)),i.oncomplete=()=>s.close()}else{let i=sd(t),o=s.transaction(Vr,"readwrite"),u=o.objectStore(Vr),l=u.put({modelPath:this.modelPath,modelArtifactsInfo:i}),d;l.onsuccess=()=>{d=s.transaction(xi,"readwrite");let p=d.objectStore(xi).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i});p.onsuccess=()=>n({modelArtifactsInfo:i}),p.onerror=c=>{u=o.objectStore(Vr);let h=u.delete(this.modelPath);h.onsuccess=()=>(s.close(),a(p.error)),h.onerror=m=>(s.close(),a(p.error))}},l.onerror=p=>(s.close(),a(l.error)),o.oncomplete=()=>{d==null?s.close():d.oncomplete=()=>s.close()}}},r.onerror=s=>a(r.error)})}};bi.URL_SCHEME="indexeddb://";var zb=e=>te().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(bi.URL_SCHEME)?FN(e.slice(bi.URL_SCHEME.length)):null;Et.registerSaveRouter(zb);Et.registerLoadRouter(zb);function FN(e){return new bi(e)}function $N(e){return e.startsWith(bi.URL_SCHEME)?e.slice(bi.URL_SCHEME.length):e}var DN=class{constructor(){this.indexedDB=Ob()}async listModels(){return new Promise((e,t)=>{let n=this.indexedDB.open(l1,u1);n.onupgradeneeded=()=>d1(n),n.onsuccess=()=>{let a=n.result,r=a.transaction(Vr,"readonly"),s=r.objectStore(Vr).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(a.close(),t(s.error)),r.oncomplete=()=>a.close()},n.onerror=a=>t(n.error)})}async removeModel(e){return e=$N(e),new Promise((t,n)=>{let a=this.indexedDB.open(l1,u1);a.onupgradeneeded=()=>d1(a),a.onsuccess=()=>{let r=a.result,s=r.transaction(Vr,"readwrite"),i=s.objectStore(Vr),o=i.get(e),u;o.onsuccess=()=>{if(o.result==null)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let l=i.delete(e),d=()=>{u=r.transaction(xi,"readwrite");let p=u.objectStore(xi).delete(e);p.onsuccess=()=>t(o.result.modelArtifactsInfo),p.onerror=c=>n(o.error)};l.onsuccess=d,l.onerror=p=>(d(),r.close(),n(o.error))}},o.onerror=l=>(r.close(),n(o.error)),s.oncomplete=()=>{u==null?r.close():u.oncomplete=()=>r.close()}},a.onerror=r=>n(a.error)})}},hr="/",Al="tensorflowjs_models",_b="info",ON="model_topology",zN="weight_specs",_N="weight_data",PN="model_metadata";function Pb(e){return{info:[Al,e,_b].join(hr),topology:[Al,e,ON].join(hr),weightSpecs:[Al,e,zN].join(hr),weightData:[Al,e,_N].join(hr),modelMetadata:[Al,e,PN].join(hr)}}function LN(e){let t=e.split(hr);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(hr)}function WN(e){return e.startsWith(vi.URL_SCHEME)?e.slice(vi.URL_SCHEME.length):e}var vi=class{constructor(e){if(!te().getBool("IS_BROWSER")||typeof window=="undefined"||typeof window.localStorage=="undefined")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=Pb(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.");{let t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),a=sd(e);try{this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,wN(e.weightData));let r={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};return e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer),this.LS.setItem(this.keys.modelMetadata,JSON.stringify(r)),{modelArtifactsInfo:a}}catch(r){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${a.modelTopologyBytes}, weightSpecsBytes=${a.weightSpecsBytes}, weightDataBytes=${a.weightDataBytes}.`)}}}async load(){let 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.");let t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(n==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;let a=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(a==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=a;let r=this.LS.getItem(this.keys.modelMetadata);if(r!=null){let i=JSON.parse(r);t.format=i.format,t.generatedBy=i.generatedBy,t.convertedBy=i.convertedBy,i.signature!=null&&(t.signature=i.signature),i.userDefinedMetadata!=null&&(t.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(t.modelInitializer=i.modelInitializer)}let s=this.LS.getItem(this.keys.weightData);if(s==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=kN(s),t}};vi.URL_SCHEME="localstorage://";var Lb=e=>te().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(vi.URL_SCHEME)?BN(e.slice(vi.URL_SCHEME.length)):null;Et.registerSaveRouter(Lb);Et.registerLoadRouter(Lb);function BN(e){return new vi(e)}var VN=class{constructor(){D(te().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),D(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=Al+hr,n=hr+_b;for(let a=0;a"scheme must not be undefined or null."),e.endsWith(xl)&&(e=e.slice(0,e.indexOf(xl))),D(e.length>0,()=>"scheme must not be an empty string.");let n=ia.getInstance();D(n.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){let t=this.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}};function Pc(e){if(e.indexOf(xl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${ia.getSchemes().join(",")}`);return{scheme:e.split(xl)[0],path:e.split(xl)[1]}}async function Wb(e,t,n=!1){D(e!==t,()=>`Old path and new path are the same: '${e}'`);let a=Et.getLoadHandlers(e);D(a.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),D(a.length<2,()=>`Copying failed because more than one (${a.length}) load handlers for source URL ${e}.`);let r=a[0],s=Et.getSaveHandlers(t);D(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),D(s.length<2,()=>`Copying failed because more than one (${a.length}) save handlers for destination URL ${t}.`);let i=s[0],o=Pc(e).scheme,u=Pc(e).path,l=o===Pc(e).scheme,d=await r.load();n&&l&&await ia.getManager(o).removeModel(u);let p=await i.save(d);return n&&!l&&await ia.getManager(o).removeModel(u),p.modelArtifactsInfo}async function jN(){let e=ia.getSchemes(),t={};for(let n of e){let a=await ia.getManager(n).listModels();for(let r in a){let s=n+xl+r;t[s]=a[r]}}return t}async function UN(e){let t=Pc(e);return ia.getManager(t.scheme).removeModel(t.path)}async function HN(e,t){return Wb(e,t,!1)}async function GN(e,t){return Wb(e,t,!0)}var qN=class{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)}};if(te().get("IS_BROWSER")){te().setPlatform("browser",new qN);try{ia.registerManager(vi.URL_SCHEME,new VN)}catch(e){}try{ia.registerManager(bi.URL_SCHEME,new DN)}catch(e){}}var XN={importFetch:()=>ZI()},p1,KN=class{constructor(){this.util=po("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return te().global.fetch!=null?te().global.fetch(e,t):(p1==null&&(p1=XN.importFetch()),p1(e,t))}now(){let 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)}};te().get("IS_NODE")&&te().setPlatform("node",new KN);function Ve(e,t="float32",n){return t=t||"float32",Um(e),new Lt(e,t,n)}function ZN(e,t){let n=M(e,"x","cast");if(!ob(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&n.dtype!=="string"||t!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");let a={x:n},r={dtype:t};return P.runKernel(ks,a,r)}var ge=L({cast_:ZN});function YN(e){let t={x:M(e,"x","clone","string_or_numeric")};return P.runKernel(zs,t)}var Ha=L({clone_:YN});function Bb(e,t=!1){console.log(e.toString(t))}Tb();var JN={buffer:Ve,cast:ge,clone:Ha,print:Bb};dN(JN);var En={};Fe(En,{browserFiles:()=>sT,browserHTTPRequest:()=>dT,concatenateArrayBuffers:()=>o1,copyModel:()=>HN,decodeWeights:()=>Fb,encodeWeights:()=>bN,fromMemory:()=>cT,getLoadHandlers:()=>MN,getModelArtifactsInfoForJSON:()=>sd,getSaveHandlers:()=>RN,http:()=>f1,isHTTPScheme:()=>h1,listModels:()=>jN,loadWeights:()=>iT,moveModel:()=>GN,registerLoadRouter:()=>EN,registerSaveRouter:()=>CN,removeModel:()=>UN,weightsLoaderFactory:()=>Hb,withSaveHandler:()=>hT});var QN="model",eT=".json",tT=".weights.bin";function Vb(e){return new Promise(t=>setTimeout(t)).then(e)}var bl=class{constructor(e){if(!te().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(bl.URL_SCHEME)&&(e=e.slice(bl.URL_SCHEME.length)),(e==null||e.length===0)&&(e=QN),this.modelTopologyFileName=e+eT,this.weightDataFileName=e+tT}async save(e){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer);let r=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor;if(s.download=this.modelTopologyFileName,s.href=r,await Vb(()=>s.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let i=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;i.download=this.weightDataFileName,i.href=t,await Vb(()=>i.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:sd(e)}}}};bl.URL_SCHEME="downloads://";var nT=class{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.files=e}async load(){let e=this.files[0],t=this.files.slice(1);return new Promise((n,a)=>{let r=new FileReader;r.onload=s=>{let i=JSON.parse(s.target.result),o=i.modelTopology;if(o==null){a(new Error(`modelTopology field is missing from file ${e.name}`));return}t.length===0&&n({modelTopology:o});let u=i.weightsManifest;if(u==null){a(new Error(`weightManifest field is missing from file ${e.name}`));return}let l;try{l=this.checkManifestAndWeightFiles(u,t)}catch(h){a(h);return}let d=[],p=[],c=[];u.forEach(h=>{h.paths.forEach(m=>{p.push(m),c.push(null)}),d.push(...h.weights)}),u.forEach(h=>{h.paths.forEach(m=>{let f=new FileReader;f.onload=g=>{let y=g.target.result,A=p.indexOf(m);if(c[A]=y,c.indexOf(null)===-1){let x={modelTopology:o,weightSpecs:d,weightData:o1(c),format:i.format,generatedBy:i.generatedBy,convertedBy:i.convertedBy};i.signature!=null&&(x.signature=i.signature),i.userDefinedMetadata!=null&&(x.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(x.modelInitializer=i.modelInitializer),n(x)}},f.onerror=g=>a(`Failed to weights data from file of path '${m}'.`),f.readAsArrayBuffer(l[m])})})},r.onerror=s=>a(`Failed to read model topology and weights manifest JSON from file '${e.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(e)})}checkManifestAndWeightFiles(e,t){let n=[],a=t.map(s=>Db(s.name)),r={};for(let s of e)s.paths.forEach(i=>{let o=Db(i);if(n.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(n.push(o),a.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);r[i]=t[a.indexOf(o)]});if(n.length!==t.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${t.length}).`);return r}},aT=e=>te().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(bl.URL_SCHEME)?rT(e.slice(bl.URL_SCHEME.length)):null;Et.registerSaveRouter(aT);function rT(e="model"){return new bl(e)}function sT(e){return new nT(e)}function jb(e,t,n,a){i(e),n=n==null?0:n,a=a==null?1:a,o(n,a);let r=0,s=u=>(u.then(l=>{let d=n+ ++r/e.length*(a-n);return t(d),l}),u);function i(u){D(u!=null&&Array.isArray(u)&&u.length>0,()=>"promises must be a none empty array")}function o(u,l){D(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${u}`),D(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${l}`),D(l>=u,()=>`startFraction must be no more than endFraction, but got startFraction ${u} and endFraction ${l}`)}return Promise.all(e.map(s))}async function Ub(e,t){t==null&&(t={});let n=t.fetchFunc==null?te().platform.fetch:t.fetchFunc,a=e.map(l=>n(l,t.requestInit,{isBinary:!0})),r=0,s=.5,i=(t.onProgress==null?await Promise.all(a):await jb(a,t.onProgress,r,s)).map(l=>l.arrayBuffer()),o=.5,u=1;return t.onProgress==null?await Promise.all(i):await jb(i,t.onProgress,o,u)}async function iT(e,t="",n,a){return Hb(r=>Ub(r,{requestInit:a}))(e,t,n)}function Hb(e){return async(t,n="",a)=>{let r=t.map(()=>!1),s={},i=a!=null?a.map(()=>!1):[],o=[];if(t.forEach((h,m)=>{let f=0;h.weights.forEach(g=>{let y="quantization"in g?g.quantization.dtype:g.dtype,A=s1[y]*Mt(g.shape),x=()=>{r[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:g,groupOffset:f,sizeBytes:A})};a!=null?a.forEach((v,b)=>{v===g.name&&(x(),i[b]=!0)}):x(),o.push(g.name),f+=A})}),!i.every(h=>h)){let h=a.filter((m,f)=>!i[f]);throw new Error(`Could not find weights in manifest with names: ${h.join(", ")}. -Manifest JSON has weights with names: ${o.join(", ")}.`)}let u=r.reduce((h,m,f)=>(m&&h.push(f),h),[]),l=[];u.forEach(h=>{t[h].paths.forEach(m=>{let f=n+(n.endsWith("/")?"":"/")+m;l.push(f)})});let d=await e(l),p={},c=0;return u.forEach(h=>{let m=t[h].paths.length,f=0;for(let x=0;x{let v=g.slice(x.groupOffset,x.groupOffset+x.sizeBytes),b=Fb(v,[x.manifestEntry]);for(let w in b)p[w]=b[w]}),c+=m}),p}}var oT="application/octet-stream",lT="application/json",c1=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(D(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=te().platform.fetch,D(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&D(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||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;let n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer),t.body.append("model.json",new Blob([JSON.stringify(a)],{type:lT}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:oT}),"model.weights.bin");let r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:sd(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){let 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(h){let m=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?m+=" 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.":m+=" Please make sure the server is serving valid JSON for this request.",new Error(m)}let n=t.modelTopology,a=t.weightsManifest,r=t.generatedBy,s=t.convertedBy,i=t.format,o=t.signature,u=t.userDefinedMetadata;if(n==null&&a==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);let l,d;a!=null&&([l,d]=await this.loadWeights(a));let p={modelTopology:n,weightSpecs:l,weightData:d,generatedBy:r,convertedBy:s,format:i};o!=null&&(p.signature=o),u!=null&&(p.userDefinedMetadata=u);let c=t.modelInitializer;return c&&(p.modelInitializer=c),p}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[n,a]=uT(t),r=this.weightPathPrefix||n,s=[];for(let l of e)s.push(...l.weights);let i=[],o=[];for(let l of e)for(let d of l.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(d)):i.push(r+d+a);this.weightUrlConverter&&i.push(...await Promise.all(o));let u=await Ub(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,o1(u)]}};c1.URL_SCHEME_REGEX=/^https?:\/\//;function uT(e){let t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),a=e.substring(0,t),r=n>t?e.substring(n):"";return[a+"/",r]}function h1(e){return e.match(c1.URL_SCHEME_REGEX)!=null}var Gb=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let n=!0;if(Array.isArray(e)?n=e.every(a=>h1(a)):n=h1(e),n)return f1(e,t)}return null};Et.registerSaveRouter(Gb);Et.registerLoadRouter(Gb);function f1(e,t){return new c1(e,t)}function dT(e,t){return f1(e,t)}var m1=class{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}},pT=class{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}};function cT(e,t,n,a){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new m1(e):(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 m1({modelTopology:e})):(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 m1({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:a}))}function hT(e){return new pT(e)}var qb={};Fe(qb,{confusionMatrix:()=>AT});function fT(e,t,n=!1,a=!1){let r=M(e,"a","matMul"),s=M(t,"b","matMul");[r,s]=It(r,s);let i={a:r,b:s},o={transposeA:n,transposeB:a};return P.runKernel(ws,i,o)}var je=L({matMul_:fT});function mT(e,t,n=1,a=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let r={indices:M(e,"indices","oneHot","int32")},s={depth:t,onValue:n,offValue:a};return P.runKernel(qs,r,s)}var vl=L({oneHot_:mT});function gT(e,t){let n=M(e,"x","transpose");if(t==null&&(t=n.shape.map((s,i)=>i).reverse()),D(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(s=>{D(s>=0&&s`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let a={x:n},r={perm:t};return P.runKernel(ci,a,r)}var Qe=L({transpose_:gT});function yT(e,t,n){let a=M(e,"labels","confusionMatrix"),r=M(t,"predictions","confusionMatrix");D(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),D(a.rank===1,()=>`Expected the rank of labels to be 1, but got ${a.rank}`),D(r.rank===1,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),D(a.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${a.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),D(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);let s=vl(ge(a,"int32"),n),i=vl(ge(r,"int32"),n),o=Qe(s),u=je(o,i);return ge(u,"int32")}var AT=L({confusionMatrix_:yT}),oa={};Fe(oa,{fromPixels:()=>ST,fromPixelsAsync:()=>kT,toPixels:()=>IT});function Lc(e,t,n){if(ys(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let a=Ua(e,n);if(a.length!==3&&a.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Br(e,t,a,n)}var wl;function Xb(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(e==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,a=!1,r=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)a=!0;else if(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)r=!0;else if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)s=!0;else if(e.getContext!=null)i=!0;else if(typeof ImageBitmap!="undefined"&&e 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 ${e.constructor.name}`);if(r){let c=2;if(r&&e.readyState element.")}if(Mc(Rc,P.backendName)!=null){let c={pixels:e},h={numChannels:t};return P.runKernel(Rc,c,h)}let[u,l]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height],d;i?d=e.getContext("2d").getImageData(0,0,u,l).data:a||n?d=e.data:(s||r||o)&&(wl==null&&(wl=document.createElement("canvas").getContext("2d")),wl.canvas.width=u,wl.canvas.height=l,wl.drawImage(e,0,0,u,l),d=wl.getImageData(0,0,u,l).data);let p;if(t===4)p=new Int32Array(d);else{let c=u*l;p=new Int32Array(c*t);for(let h=0;h4||s===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);let i=await n.data(),o=n.dtype==="float32"?255:1,u=new Uint8ClampedArray(r*a*4);for(let l=0;l1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${h}.`)}else if(n.dtype==="int32"&&(h<0||h>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${h}.`);s===1?(d[0]=h*o,d[1]=h*o,d[2]=h*o):d[c]=h*o}let p=l*4;u[p+0]=Math.round(d[0]),u[p+1]=Math.round(d[1]),u[p+2]=Math.round(d[2]),u[p+3]=Math.round(d[3])}if(t!=null){t.width=r,t.height=a;let l=t.getContext("2d"),d=new ImageData(u,r,a);l.putImageData(d,0,0)}return n!==e&&n.dispose(),u}var ST=L({fromPixels_:Xb}),g1={};Fe(g1,{prepareAndValidate:()=>Kb});function Kb(e,t){let n=e.shape.length,a=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(a<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${a}.`);if(t.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[a-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[a-1]} vs. ${n}`);if(Mt(e.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let r=t.shape,s=r[r.length-1],i=1;for(let p=0;pp/l),1].slice(0,s);return[u,i,l,d]}var y1={};Fe(y1,{calculateShapes:()=>Zb,validateInput:()=>x1,validateUpdateShape:()=>A1});function A1(e,t,n){let a=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${a}, and batchDim: ${r}.`;if(n.rank1?t.shape[a-1]:1,s=n.length,i=1;for(let p=r;pNT,computeFlatOffset:()=>CT,computeOutShape:()=>Yb,getNormalizedAxes:()=>t3,isSliceContinous:()=>TT,maskToAxes:()=>Wc,parseSliceParams:()=>o3,sliceInfo:()=>ET,startForAxis:()=>s3,startIndicesWithElidedDims:()=>n3,stopForAxis:()=>i3,stopIndicesWithElidedDims:()=>a3,stridesForAxis:()=>r3,stridesWithElidedDims:()=>Jb});function NT(e,t,n){let a=e.shape.length;D(a===t.length,()=>`Error in slice${a}D: Length of begin ${t} must match the rank of the array (${a}).`),D(a===n.length,()=>`Error in slice${a}D: Length of size ${n} must match the rank of the array (${a}).`);for(let r=0;r`Error in slice${a}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`)}function Wc(e){let t=[],n=0;for(;e>0;)e&1&&t.push(n),e/=2,n++;return t}function Yb(e,t,n){let a=[];for(let r=0;r0){let h=t[0],m=n+1;d=n3(i,h,m,a,e),p=a3(o,h,m,r,e),c=Jb(s,h,m,e)}else for(let h=0;h-1)s[o]=0;else{let u=Qb(t,n,o),l=a[u];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let u=Qb(t,n,o),l=a[u];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let u=a[r];return i<0&&(i+=u),i=Ru(0,i,u-1),i}function i3(e,t,n,a,r,s){let i=t[r],o=n[r]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let u=a[r];return i<0&&(i+=u),o>0?i=Ru(0,i,u):i=Ru(-1,i,u-1),i}function TT(e,t,n){let a=n.length;for(let r=0;r1){a=r;break}for(let r=a+1;r0||n[r]!==e[r])return!1;return!0}function CT(e,t){let n=e.length>0?e[e.length-1]:1;for(let a=0;a{D(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return n==null?s=new Array(r).fill(-1):typeof n=="number"?s=[n,...new Array(r-1).fill(-1)]:n.lengthi>=0?i:(D(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-a[o])),[a,s]}function ET(e,t,n,a,r,s,i,o,u){let l=t.slice(),d=n.slice(),p=a;a==null&&(p=new Array(l.length));let c=Wc(i);if(c.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(i!==0&&o!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(i!==0&&u!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let h=e.length-l.length,m=Wc(o),f=e.slice();m.forEach(w=>{l[w]=0,d[w]=1,f.splice(w,0,1)});let{begin:g,end:y,strides:A}=t3(f,c,h,l,d,p,r,s,i);l=g,d=y,p=A;let x=Wc(u);x.forEach(w=>{d[w]=l[w]+1,p[w]=1});let v=Yb(l,d,p),b=v.filter((w,N)=>x.indexOf(N)===-1);return{nonStrided:p.every(w=>w===1),$begin:l,$end:d,$strides:p,size:v,newShape:f,outShape:b}}var re={};Fe(re,{Serializable:()=>l3,SerializationMap:()=>wi,registerClass:()=>jr});var l3=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},wi=class{constructor(){this.classNameMap={}}static getMap(){return wi.instance==null&&(wi.instance=new wi),wi.instance}static register(e){wi.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function jr(e){D(e.className!=null,()=>"Class being registered does not have the static className property defined."),D(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),D(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),wi.register(e)}var u3={};Fe(u3,{TEST_EPSILON_FLOAT16:()=>d3,encodeStrings:()=>p3,expectArrayBuffersEqual:()=>zT,expectArraysClose:()=>MT,expectArraysEqual:()=>$T,expectNumbersClose:()=>DT,expectPromiseToFail:()=>FT,expectValuesInRange:()=>OT,testEpsilon:()=>b1});var RT=.001,d3=.1;function MT(e,t,n){return n==null&&(n=b1()),v1(e,t,(a,r)=>w1(a,r,n))}function b1(){return P.backend.floatPrecision()===32?RT:d3}function v1(e,t,n){let a=!0;if((on(e)||on(t))&&(a=!1),on(e)&&on(t)&&(a=!0),a){let i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error(`Arrays are of different type. Actual: ${i}. Expected: ${o}`)}if(Array.isArray(e)&&Array.isArray(t)){let i=Ua(e),o=Ua(t);if(!cr(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let r=on(e)?e:As(e),s=on(t)?t:As(t);if(r.length!==s.length)throw new Error(`Arrays have different lengths actual: ${r.length} vs expected: ${s.length}. + /* + Human library + homepage: + author: ' + */ +var VI=Object.defineProperty;var zm=e=>{if(typeof require!="undefined")return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')};var v5=(e,t)=>{for(var n in t)VI(e,n,{get:t[n],enumerable:!0})};var w5=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var pn=(e,t,n)=>(w5(e,t,"read from private field"),n?n.call(e):t.get(e)),ra=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ia=(e,t,n,a)=>(w5(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);function ft(e,t){let n=e.endsWith("/")?"":"/",r=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${n}${t}`;if(!r.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${r} Expecting JSON file`);return r}function de(...e){let t=new Date,n=`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`;e&&console.log(n,"Human:",...e)}var Ke=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Ln(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,a)=>(Object.keys(a||{}).forEach(r=>{let s=n[r],i=a[r];Array.isArray(s)&&Array.isArray(i)?n[r]=s.concat(...i):t(s)&&t(i)?n[r]=Ln(s,i):n[r]=i}),n),{})}var k5={backend:"webgl",modelBasePath:"../models/",wasmPath:"../node_modules/@tensorflow/tfjs-backend-wasm/dist/",debug:!0,async:!0,warmup:"full",cacheSensitivity:.75,skipFrame:!1,filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!0,maxDetected:15,skipFrames:15,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:11,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:17,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:1,minConfidence:.2,skipFrames:1},hand:{enabled:!0,rotation:!0,skipFrames:18,minConfidence:.1,iouThreshold:.1,maxDetected:2,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"mb3-centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:19},segmentation:{enabled:!1,modelPath:"selfie.json"}};function I5(){let e,t;if(typeof navigator!="undefined"){let n=navigator.userAgent.match(/\(([^()]+)\)/g);if(n&&n[0]){let a=n[0].match(/\(([^()]+)\)/g);e=a?a[0].replace(/\(|\)/g,""):"",t=navigator.userAgent.replace(n[0],""),e[1]&&(t=t.replace(n[1],"")),t=t.replace(/ /g," ")}}else typeof process!="undefined"&&(e=`${process.platform} ${process.arch}`,t=`NodeJS ${process.version}`);return{platform:e,agent:t}}var dp={};v5(dp,{Abs:()=>mo,Acos:()=>go,Acosh:()=>yo,AdadeltaOptimizer:()=>wh,AdagradOptimizer:()=>kh,AdamOptimizer:()=>Ih,AdamaxOptimizer:()=>Sh,Add:()=>Or,AddN:()=>xs,All:()=>Ao,Any:()=>xo,ArgMax:()=>bs,ArgMin:()=>Fu,Asin:()=>bo,Asinh:()=>vo,Atan:()=>wo,Atan2:()=>Io,Atanh:()=>ko,AvgPool:()=>vs,AvgPool3D:()=>$u,AvgPool3DGrad:()=>Kp,AvgPoolGrad:()=>Xp,BackendWasm:()=>o4,BatchMatMul:()=>ws,BatchToSpaceND:()=>Du,Bincount:()=>Zp,BroadcastTo:()=>gb,Callback:()=>J8,CallbackList:()=>U4,Cast:()=>ks,Ceil:()=>Is,ClipByValue:()=>zr,Complex:()=>Yp,ComplexAbs:()=>Ou,Concat:()=>So,Conv2D:()=>Ss,Conv2DBackpropFilter:()=>Jp,Conv2DBackpropInput:()=>Ns,Conv3D:()=>zu,Conv3DBackpropFilterV2:()=>Qp,Conv3DBackpropInputV2:()=>ec,Cos:()=>Ts,Cosh:()=>No,CropAndResize:()=>To,Cumsum:()=>Cs,CustomCallback:()=>G4,DataStorage:()=>Up,DenseBincount:()=>tc,DepthToSpace:()=>Co,DepthwiseConv2dNative:()=>Es,DepthwiseConv2dNativeBackpropFilter:()=>nc,DepthwiseConv2dNativeBackpropInput:()=>ac,Diag:()=>rc,Dilation2D:()=>_u,Dilation2DBackpropFilter:()=>ic,Dilation2DBackpropInput:()=>sc,ENV:()=>sa,EarlyStopping:()=>ek,Einsum:()=>oc,Elu:()=>Eo,EluGrad:()=>lc,Environment:()=>fb,Equal:()=>Mo,Erf:()=>Ro,Exp:()=>Ms,ExpandDims:()=>Fo,Expm1:()=>$o,FFT:()=>uc,Fill:()=>Pu,FlipLeftRight:()=>Do,Floor:()=>Fs,FloorDiv:()=>$s,FromPixels:()=>Rc,FusedBatchNorm:()=>Ds,FusedConv2D:()=>fi,FusedDepthwiseConv2D:()=>mi,GPGPUContext:()=>Vh,GatherNd:()=>zo,GatherV2:()=>Oo,GraphModel:()=>Fk,Greater:()=>_o,GreaterEqual:()=>Os,History:()=>H4,IFFT:()=>dc,Identity:()=>zs,Imag:()=>pc,InputSpec:()=>zt,IsFinite:()=>Po,IsInf:()=>Lo,IsNan:()=>Wo,KernelBackend:()=>Eu,LRN:()=>Bu,LRNGrad:()=>hc,LayerVariable:()=>L4,LayersModel:()=>kr,LeakyRelu:()=>_s,Less:()=>Bo,LessEqual:()=>Vo,LinSpace:()=>cc,Log:()=>Ps,Log1p:()=>jo,LogSoftmax:()=>yb,LogicalAnd:()=>Uo,LogicalNot:()=>Lu,LogicalOr:()=>Wu,MathBackendCPU:()=>Eh,MathBackendWebGL:()=>Kl,Max:()=>Ls,MaxPool:()=>Bs,MaxPool3D:()=>Vu,MaxPool3DGrad:()=>mc,MaxPoolGrad:()=>fc,MaxPoolWithArgmax:()=>gc,Maximum:()=>Ws,Mean:()=>Vs,Min:()=>js,Minimum:()=>Us,MirrorPad:()=>Hs,Mod:()=>Ho,MomentumOptimizer:()=>Nh,Multinomial:()=>yc,Multiply:()=>Gs,Neg:()=>Go,NonMaxSuppressionV3:()=>Xo,NonMaxSuppressionV4:()=>Ko,NonMaxSuppressionV5:()=>Zo,NotEqual:()=>qo,OP_SCOPE_SUFFIX:()=>Fb,OneHot:()=>qs,OnesLike:()=>Yo,Optimizer:()=>xr,Pack:()=>Jo,PadV2:()=>Xs,Pool:()=>US,Pow:()=>Ks,Prelu:()=>Zs,Prod:()=>Qo,RMSPropOptimizer:()=>Th,RNN:()=>ar,Range:()=>ju,Rank:()=>Jm,Real:()=>Ac,RealDiv:()=>Rs,Reciprocal:()=>el,Reduction:()=>yn,Relu:()=>Ys,Relu6:()=>Qs,Reshape:()=>tl,ResizeBilinear:()=>Js,ResizeBilinearGrad:()=>bc,ResizeNearestNeighbor:()=>Uu,ResizeNearestNeighborGrad:()=>xc,Reverse:()=>ei,RotateWithOffset:()=>ml,Round:()=>ti,Rsqrt:()=>ni,SGDOptimizer:()=>kd,ScatterNd:()=>nl,Select:()=>al,Selu:()=>rl,Sequential:()=>ru,Sigmoid:()=>ri,Sign:()=>ol,Sin:()=>ai,Sinh:()=>il,Slice:()=>sl,Softmax:()=>oi,Softplus:()=>ll,SpaceToBatchND:()=>Hu,SparseFillEmptyRows:()=>vc,SparseReshape:()=>wc,SparseSegmentMean:()=>kc,SparseSegmentSum:()=>Ic,SparseToDense:()=>Sc,SplitV:()=>ul,Sqrt:()=>si,Square:()=>Gu,SquaredDifference:()=>li,Step:()=>Pr,StridedSlice:()=>dl,StringNGrams:()=>Nc,StringSplit:()=>Tc,StringToHashBucketFast:()=>Cc,Sub:()=>ui,Sum:()=>ii,SymbolicTensor:()=>Da,Tan:()=>di,Tanh:()=>pi,Tensor:()=>Be,TensorBuffer:()=>Lt,Tile:()=>_r,TopK:()=>pl,Transform:()=>cl,Transpose:()=>ci,Unique:()=>Ec,Unpack:()=>hl,UnsortedSegmentSum:()=>qu,Variable:()=>td,ZerosLike:()=>fl,_FusedMatMul:()=>hi,abs:()=>Wt,acos:()=>S1,acosh:()=>N1,add:()=>ie,addN:()=>jc,all:()=>Uc,any:()=>id,argMax:()=>ki,argMin:()=>T1,asin:()=>C1,asinh:()=>E1,atan:()=>R1,atan2:()=>M1,atanh:()=>F1,avgPool:()=>ld,avgPool3d:()=>O1,backend:()=>h3,backend_util:()=>F,basicLSTMCell:()=>CC,batchNorm:()=>Ni,batchNorm2d:()=>y3,batchNorm3d:()=>A3,batchNorm4d:()=>x3,batchToSpaceND:()=>ud,bincount:()=>z1,booleanMaskAsync:()=>DM,broadcastTo:()=>Nl,browser:()=>oa,buffer:()=>Ve,callbacks:()=>Cie,cast:()=>ge,ceil:()=>_1,clipByValue:()=>Mn,clone:()=>Ha,complex:()=>Wr,concat:()=>lt,concat1d:()=>b3,concat2d:()=>Tl,concat3d:()=>v3,concat4d:()=>w3,constraints:()=>A4,conv1d:()=>Gc,conv2d:()=>mr,conv2dTranspose:()=>qc,conv3d:()=>L1,conv3dTranspose:()=>I3,copyRegisteredKernels:()=>qS,cos:()=>dd,cosh:()=>Xc,cosineWindow:()=>cg,cumsum:()=>Kc,customGrad:()=>qa,data:()=>$k,denseBincount:()=>S3,deprecationWarn:()=>k1,depthToSpace:()=>W1,depthwiseConv2d:()=>Cl,deregisterOp:()=>Rie,device_util:()=>ad,diag:()=>aE,dilation2d:()=>B1,disableDeprecationWarnings:()=>BT,dispose:()=>he,disposeVariables:()=>VT,div:()=>me,divNoNan:()=>V1,dot:()=>N3,dropout:()=>q3,einsum:()=>T3,elu:()=>El,enableDebugMode:()=>WT,enableProdMode:()=>LT,enclosingPowerOfTwo:()=>X3,engine:()=>fr,env:()=>te,equal:()=>Hr,erf:()=>j1,exp:()=>la,expandDims:()=>mn,expm1:()=>U1,eye:()=>H1,fft:()=>bd,fill:()=>Rl,findBackend:()=>I1,findBackendFactory:()=>KT,floor:()=>Ml,floorDiv:()=>Vc,forceHalfFloat:()=>Aw,fused:()=>Kr,gather:()=>Ti,gatherND:()=>G3,gather_util:()=>g1,getBackend:()=>qT,getGradient:()=>Xm,getKernel:()=>Mc,getKernelsForBackend:()=>yl,gpgpu_util:()=>Bv,grad:()=>$E,grads:()=>DE,greater:()=>Wn,greaterEqual:()=>qr,ifft:()=>Ol,imag:()=>Zc,image:()=>De,inTopKAsync:()=>HM,initializers:()=>S4,input:()=>m8,io:()=>En,irfft:()=>ch,isFinite:()=>C3,isInf:()=>E3,isNaN:()=>G1,keep:()=>Kt,kernel_impls:()=>Za,layers:()=>z4,leakyRelu:()=>pd,less:()=>Yc,lessEqual:()=>Xr,linalg:()=>i7,linspace:()=>R3,loadGraphModel:()=>ct,loadLayersModel:()=>Pre,localResponseNormalization:()=>q1,log:()=>Bn,log1p:()=>Jc,logSigmoid:()=>F3,logSoftmax:()=>eh,logSumExp:()=>Z1,logicalAnd:()=>xa,logicalNot:()=>cd,logicalOr:()=>th,logicalXor:()=>z3,losses:()=>S$,matMul:()=>je,math:()=>Xb,max:()=>Vn,maxPool:()=>hd,maxPool3d:()=>Y1,maxPoolWithArgmax:()=>_3,maximum:()=>Xa,mean:()=>Nt,memory:()=>Bc,meshgrid:()=>nR,metrics:()=>K8,min:()=>fd,minimum:()=>Fl,mirrorPad:()=>J1,mod:()=>Q1,model:()=>zre,models:()=>Z8,moments:()=>nh,movingAverage:()=>_M,mul:()=>B,multiRNNCell:()=>dR,multinomial:()=>P3,neg:()=>St,nextFrame:()=>Ch,norm:()=>gh,notEqual:()=>Ri,oneHot:()=>wl,ones:()=>jn,onesLike:()=>Un,op:()=>L,outerProduct:()=>mR,pad:()=>gr,pad1d:()=>AR,pad2d:()=>bR,pad3d:()=>wR,pad4d:()=>IR,pool:()=>L3,pow:()=>yr,prelu:()=>gd,print:()=>Vb,prod:()=>ah,profile:()=>jT,rand:()=>$R,randomGamma:()=>_R,randomNormal:()=>W3,randomUniform:()=>$l,range:()=>Dl,ready:()=>GT,real:()=>yd,reciprocal:()=>ng,registerBackend:()=>Il,registerCallbackConstructor:()=>Lre,registerGradient:()=>Ab,registerKernel:()=>gi,registerOp:()=>Eie,regularizers:()=>Y8,relu:()=>Ka,relu6:()=>rh,removeBackend:()=>XT,reshape:()=>q,reverse:()=>Hn,reverse1d:()=>GR,reverse2d:()=>XR,reverse3d:()=>ZR,reverse4d:()=>JR,rfft:()=>vd,round:()=>sh,rsqrt:()=>ih,scalar:()=>ke,scatterND:()=>H3,scatter_util:()=>y1,selu:()=>oh,separableConv2d:()=>ag,sequential:()=>_re,serialization:()=>re,setBackend:()=>HT,setPlatform:()=>ZT,setWasmPath:()=>Vee,setWasmPaths:()=>jee,setWebGLContext:()=>Oh,setdiff1dAsync:()=>B3,shared:()=>yg,sigmoid:()=>Rn,sign:()=>rg,signal:()=>I$,sin:()=>lh,sinh:()=>uh,slice:()=>Re,slice1d:()=>dh,slice2d:()=>sg,slice3d:()=>ph,slice4d:()=>Ad,slice_util:()=>fn,softmax:()=>xd,softplus:()=>Ci,spaceToBatchND:()=>md,sparse:()=>wd,sparseToDense:()=>pg,spectral:()=>k$,split:()=>Zt,sqrt:()=>an,square:()=>ot,squaredDifference:()=>hh,squeeze:()=>Vt,stack:()=>gn,step:()=>zl,stridedSlice:()=>ig,string:()=>vh,sub:()=>ye,sum:()=>Se,sumOutType:()=>zc,tan:()=>og,tanh:()=>Si,tensor:()=>ln,tensor1d:()=>Dt,tensor2d:()=>Ta,tensor3d:()=>Lc,tensor4d:()=>IM,tensor5d:()=>SM,tensor6d:()=>NM,tensor_util:()=>Sa,test_util:()=>d3,tidy:()=>V,tile:()=>Gr,time:()=>UT,topk:()=>lg,train:()=>Fi,transpose:()=>Qe,truncatedNormal:()=>fh,unique:()=>mh,unregisterGradient:()=>GS,unregisterKernel:()=>HS,unsortedSegmentSum:()=>ug,unstack:()=>Gn,upcastType:()=>Aa,util:()=>k,valueAndGrad:()=>OE,valueAndGrads:()=>zE,variable:()=>V3,variableGrads:()=>M3,version:()=>xle,version_converter:()=>$oe,version_core:()=>PT,version_cpu:()=>X7,version_layers:()=>Dy,version_wasm:()=>u4,version_webgl:()=>yw,webgl:()=>EV,webgl_util:()=>mv,where:()=>un,whereAsync:()=>dg,zeros:()=>$t,zerosLike:()=>Ge});var jI=Object.create,jp=Object.defineProperty,UI=Object.getOwnPropertyDescriptor,HI=Object.getOwnPropertyNames,GI=Object.getPrototypeOf,qI=Object.prototype.hasOwnProperty,XI=e=>jp(e,"__esModule",{value:!0}),co=e=>{if(typeof zm!="undefined")return zm(e);throw new Error('Dynamic require of "'+e+'" is not supported')},xt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fe=(e,t)=>{for(var n in t)jp(e,n,{get:t[n],enumerable:!0})},KI=(e,t,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of HI(t))!qI.call(e,a)&&a!=="default"&&jp(e,a,{get:()=>t[a],enumerable:!(n=UI(t,a))||n.enumerable});return e},gs=e=>KI(XI(jp(e!=null?jI(GI(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),ZI=xt((e,t)=>{t.exports=a;var n=null;try{n=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(S){}function a(S,z,O){this.low=S|0,this.high=z|0,this.unsigned=!!O}a.prototype.__isLong__,Object.defineProperty(a.prototype,"__isLong__",{value:!0});function r(S){return(S&&S.__isLong__)===!0}a.isLong=r;var s={},i={};function o(S,z){var O,W,G;return z?(S>>>=0,(G=0<=S&&S<256)&&(W=i[S],W)?W:(O=u(S,(S|0)<0?-1:0,!0),G&&(i[S]=O),O)):(S|=0,(G=-128<=S&&S<128)&&(W=s[S],W)?W:(O=u(S,S<0?-1:0,!1),G&&(s[S]=O),O))}a.fromInt=o;function l(S,z){if(isNaN(S))return z?v:x;if(z){if(S<0)return v;if(S>=g)return E}else{if(S<=-y)return _;if(S+1>=y)return C}return S<0?l(-S,z).neg():u(S%f|0,S/f|0,z)}a.fromNumber=l;function u(S,z,O){return new a(S,z,O)}a.fromBits=u;var d=Math.pow;function p(S,z,O){if(S.length===0)throw Error("empty string");if(S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return x;if(typeof z=="number"?(O=z,z=!1):z=!!z,O=O||10,O<2||360)throw Error("interior hyphen");if(W===0)return p(S.substring(1),z,O).neg();for(var G=l(d(O,8)),H=x,J=0;J>>0:this.low},$.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},$.toString=function(S){if(S=S||10,S<2||36>>0,Q=ne.toString(S);if(H=K,H.isZero())return Q+J;for(;Q.length<6;)Q="0"+Q;J=""+Q+J}},$.getHighBits=function(){return this.high},$.getHighBitsUnsigned=function(){return this.high>>>0},$.getLowBits=function(){return this.low},$.getLowBitsUnsigned=function(){return this.low>>>0},$.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,z=31;z>0&&(S&1<=0},$.isOdd=function(){return(this.low&1)==1},$.isEven=function(){return(this.low&1)==0},$.equals=function(S){return r(S)||(S=c(S)),this.unsigned!==S.unsigned&&this.high>>>31==1&&S.high>>>31==1?!1:this.high===S.high&&this.low===S.low},$.eq=$.equals,$.notEquals=function(S){return!this.eq(S)},$.neq=$.notEquals,$.ne=$.notEquals,$.lessThan=function(S){return this.comp(S)<0},$.lt=$.lessThan,$.lessThanOrEqual=function(S){return this.comp(S)<=0},$.lte=$.lessThanOrEqual,$.le=$.lessThanOrEqual,$.greaterThan=function(S){return this.comp(S)>0},$.gt=$.greaterThan,$.greaterThanOrEqual=function(S){return this.comp(S)>=0},$.gte=$.greaterThanOrEqual,$.ge=$.greaterThanOrEqual,$.compare=function(S){if(r(S)||(S=c(S)),this.eq(S))return 0;var z=this.isNegative(),O=S.isNegative();return z&&!O?-1:!z&&O?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},$.comp=$.compare,$.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(b)},$.neg=$.negate,$.add=function(S){r(S)||(S=c(S));var z=this.high>>>16,O=this.high&65535,W=this.low>>>16,G=this.low&65535,H=S.high>>>16,J=S.high&65535,K=S.low>>>16,ne=S.low&65535,Q=0,se=0,Z=0,le=0;return le+=G+ne,Z+=le>>>16,le&=65535,Z+=W+K,se+=Z>>>16,Z&=65535,se+=O+J,Q+=se>>>16,se&=65535,Q+=z+H,Q&=65535,u(Z<<16|le,Q<<16|se,this.unsigned)},$.subtract=function(S){return r(S)||(S=c(S)),this.add(S.neg())},$.sub=$.subtract,$.multiply=function(S){if(this.isZero())return x;if(r(S)||(S=c(S)),n){var z=n.mul(this.low,this.high,S.low,S.high);return u(z,n.get_high(),this.unsigned)}if(S.isZero())return x;if(this.eq(_))return S.isOdd()?_:x;if(S.eq(_))return this.isOdd()?_:x;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(A)&&S.lt(A))return l(this.toNumber()*S.toNumber(),this.unsigned);var O=this.high>>>16,W=this.high&65535,G=this.low>>>16,H=this.low&65535,J=S.high>>>16,K=S.high&65535,ne=S.low>>>16,Q=S.low&65535,se=0,Z=0,le=0,oe=0;return oe+=H*Q,le+=oe>>>16,oe&=65535,le+=G*Q,Z+=le>>>16,le&=65535,le+=H*ne,Z+=le>>>16,le&=65535,Z+=W*Q,se+=Z>>>16,Z&=65535,Z+=G*ne,se+=Z>>>16,Z&=65535,Z+=H*K,se+=Z>>>16,Z&=65535,se+=O*Q+W*ne+G*K+H*J,se&=65535,u(le<<16|oe,se<<16|Z,this.unsigned)},$.mul=$.multiply,$.divide=function(S){if(r(S)||(S=c(S)),S.isZero())throw Error("division by zero");if(n){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var z=(this.unsigned?n.div_u:n.div_s)(this.low,this.high,S.low,S.high);return u(z,n.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?v:x;var O,W,G;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return v;if(S.gt(this.shru(1)))return w;G=v}else{if(this.eq(_)){if(S.eq(b)||S.eq(N))return _;if(S.eq(_))return b;var H=this.shr(1);return O=H.div(S).shl(1),O.eq(x)?S.isNegative()?b:N:(W=this.sub(S.mul(O)),G=O.add(W.div(S)),G)}else if(S.eq(_))return this.unsigned?v:x;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();G=x}for(W=this;W.gte(S);){O=Math.max(1,Math.floor(W.toNumber()/S.toNumber()));for(var J=Math.ceil(Math.log(O)/Math.LN2),K=J<=48?1:d(2,J-48),ne=l(O),Q=ne.mul(S);Q.isNegative()||Q.gt(W);)O-=K,ne=l(O,this.unsigned),Q=ne.mul(S);ne.isZero()&&(ne=b),G=G.add(ne),W=W.sub(Q)}return G},$.div=$.divide,$.modulo=function(S){if(r(S)||(S=c(S)),n){var z=(this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,S.low,S.high);return u(z,n.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},$.mod=$.modulo,$.rem=$.modulo,$.not=function(){return u(~this.low,~this.high,this.unsigned)},$.and=function(S){return r(S)||(S=c(S)),u(this.low&S.low,this.high&S.high,this.unsigned)},$.or=function(S){return r(S)||(S=c(S)),u(this.low|S.low,this.high|S.high,this.unsigned)},$.xor=function(S){return r(S)||(S=c(S)),u(this.low^S.low,this.high^S.high,this.unsigned)},$.shiftLeft=function(S){return r(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?u(this.low<>>32-S,this.unsigned):u(0,this.low<>>S|this.high<<32-S,this.high>>S,this.unsigned):u(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},$.shr=$.shiftRight,$.shiftRightUnsigned=function(S){if(r(S)&&(S=S.toInt()),S&=63,S===0)return this;var z=this.high;if(S<32){var O=this.low;return u(O>>>S|z<<32-S,z>>>S,this.unsigned)}else return S===32?u(z,0,this.unsigned):u(z>>>S-32,0,this.unsigned)},$.shru=$.shiftRightUnsigned,$.shr_u=$.shiftRightUnsigned,$.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},$.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},$.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},$.toBytesLE=function(){var S=this.high,z=this.low;return[z&255,z>>>8&255,z>>>16&255,z>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},$.toBytesBE=function(){var S=this.high,z=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,z>>>24,z>>>16&255,z>>>8&255,z&255]},a.fromBytes=function(S,z,O){return O?a.fromBytesLE(S,z):a.fromBytesBE(S,z)},a.fromBytesLE=function(S,z){return new a(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,z)},a.fromBytesBE=function(S,z){return new a(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],z)}}),YI=xt(()=>{}),JI=xt((e,t)=>{(function(n,a,r){function s(u){var d=this,p=l();d.next=function(){var c=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=c-(d.c=c|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(u),d.s0<0&&(d.s0+=1),d.s1-=p(u),d.s1<0&&(d.s1+=1),d.s2-=p(u),d.s2<0&&(d.s2+=1),p=null}function i(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function o(u,d){var p=new s(u),c=d&&d.state,h=p.next;return h.int32=function(){return p.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,c&&(typeof c=="object"&&i(c,p),h.state=function(){return i(p,{})}),h}function l(){var u=4022871197,d=function(p){p=p.toString();for(var c=0;c>>0,h-=u,h*=u,u=h>>>0,h-=u,u+=h*4294967296}return(u>>>0)*23283064365386963e-26};return d}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),QI=xt((e,t)=>{(function(n,a,r){function s(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var c=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^c^c>>>8},l===(l|0)?u.x=l:d+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),eS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this,d="";u.next=function(){var c=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(c^c<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var p=0;p>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var d=new s(l),p=u&&u.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),tS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this;u.next=function(){var p=u.x,c=u.i,h,m,f;return h=p[c],h^=h>>>7,m=h^h<<24,h=p[c+1&7],m^=h^h>>>10,h=p[c+3&7],m^=h^h>>>3,h=p[c+4&7],m^=h^h<<7,h=p[c+7&7],h=h^h<<13,m^=h^h<<9,p[c]=m,u.i=c+1&7,m};function d(p,c){var h,m,f=[];if(c===(c|0))m=f[0]=c;else for(c=""+c,h=0;h0;--h)p.next()}d(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var d=new s(l),p=u&&u.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.x&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),nS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this;u.next=function(){var p=u.w,c=u.X,h=u.i,m,f;return u.w=p=p+1640531527|0,f=c[h+34&127],m=c[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=c[h]=f^m,u.i=h,f+(p^p>>>16)|0};function d(p,c){var h,m,f,g,y,A=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),f=0,g=-32;g>>15,m^=m<<4,m^=m>>>13,g>=0&&(y=y+1640531527|0,h=A[g&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(A[(c&&c.length||0)&127]=-1),f=127,g=4*128;g>0;--g)m=A[f+34&127],h=A[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,A[f]=m^h;p.w=y,p.X=A,p.i=f}d(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var d=new s(l),p=u&&u.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.X&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),aS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this,d="";u.next=function(){var c=u.b,h=u.c,m=u.d,f=u.a;return c=c<<25^c>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-c|0,u.b=c=c<<20^c>>>12^h,u.c=h=h-m|0,u.d=m<<16^h>>>16^f,u.a=f-c|0},u.a=0,u.b=0,u.c=2654435769|0,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),S5=xt(()=>{}),rS=xt((e,t)=>{(function(n,a){var r=this,s=256,i=6,o=52,l="random",u=a.pow(s,i),d=a.pow(2,o),p=d*2,c=s-1,h;function m(b,w,N){var C=[];w=w==!0?{entropy:!0}:w||{};var E=A(y(w.entropy?[b,v(n)]:b==null?x():b,3),C),_=new f(C),$=function(){for(var S=_.g(i),z=u,O=0;S=p;)S/=2,z/=2,O>>>=1;return(S+O)/z};return $.int32=function(){return _.g(4)|0},$.quick=function(){return _.g(4)/4294967296},$.double=$,A(v(_.S),n),(w.pass||N||function(S,z,O,W){return W&&(W.S&&g(W,_),S.state=function(){return g(_,{})}),O?(a[l]=S,z):S})($,E,"global"in w?w.global:this==a,w.state)}a["seed"+l]=m;function f(b){var w,N=b.length,C=this,E=0,_=C.i=C.j=0,$=C.S=[];for(N||(b=[N++]);E{var n=JI(),a=QI(),r=eS(),s=tS(),i=nS(),o=aS(),l=rS();l.alea=n,l.xor128=a,l.xorwow=r,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),Cu=xt(()=>{}),sS=xt(()=>{}),iS=xt(()=>{}),oS=xt((e,t)=>{var n=function(){var a=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(a=a||__filename),function(r){r=r||{};function s(){return Z.buffer!=Ue&&tn(Z.buffer),In}function i(){return Z.buffer!=Ue&&tn(Z.buffer),kt}function o(){return Z.buffer!=Ue&&tn(Z.buffer),Sn}function l(){return Z.buffer!=Ue&&tn(Z.buffer),na}function u(){return Z.buffer!=Ue&&tn(Z.buffer),dn}var d=typeof r!="undefined"?r:{},p,c;d.ready=new Promise(function(T,R){p=T,c=R});var h={},m;for(m in d)d.hasOwnProperty(m)&&(h[m]=d[m]);var f=[],g="./this.program",y=function(T,R){throw R},A=!1,x=!1,v=!1,b=!1;A=typeof window=="object",x=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",b=!A&&!v&&!x;var w=d.ENVIRONMENT_IS_PTHREAD||!1;w&&(Ue=d.buffer);var N="";function C(T){return d.locateFile?d.locateFile(T,N):N+T}var E,_,$,S,z,O;if(v){x?N=Cu().dirname(N)+"/":N=__dirname+"/",E=function(T,R){return z||(z=co("fs")),O||(O=Cu()),T=O.normalize(T),z.readFileSync(T,R?null:"utf8")},$=function(T){var R=E(T,!0);return R.buffer||(R=new Uint8Array(R)),fe(R.buffer),R},process.argv.length>1&&(g=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",function(T){if(!(T instanceof Tu))throw T}),process.on("unhandledRejection",ur),y=function(T){process.exit(T)},d.inspect=function(){return"[Emscripten Module object]"};var W;try{W=sS()}catch(T){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),T}global.Worker=W.Worker}else b?(typeof read!="undefined"&&(E=function(T){return read(T)}),$=function(T){var R;return typeof readbuffer=="function"?new Uint8Array(readbuffer(T)):(R=read(T,"binary"),fe(typeof R=="object"),R)},typeof scriptArgs!="undefined"?f=scriptArgs:typeof arguments!="undefined"&&(f=arguments),typeof quit=="function"&&(y=function(T){quit(T)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(A||x)&&(x?N=self.location.href:typeof document!="undefined"&&document.currentScript&&(N=document.currentScript.src),typeof a!="undefined"&&a&&(N=a),N.indexOf("blob:")!==0?N=N.substr(0,N.lastIndexOf("/")+1):N="",v?(E=function(T,R){return z||(z=co("fs")),O||(O=Cu()),T=O.normalize(T),z.readFileSync(T,R?null:"utf8")},$=function(T){var R=E(T,!0);return R.buffer||(R=new Uint8Array(R)),fe(R.buffer),R}):(E=function(T){var R=new XMLHttpRequest;return R.open("GET",T,!1),R.send(null),R.responseText},x&&($=function(T){var R=new XMLHttpRequest;return R.open("GET",T,!1),R.responseType="arraybuffer",R.send(null),new Uint8Array(R.response)}),_=function(T,R,j){var X=new XMLHttpRequest;X.open("GET",T,!0),X.responseType="arraybuffer",X.onload=function(){if(X.status==200||X.status==0&&X.response){R(X.response);return}j()},X.onerror=j,X.send(null)}),S=function(T){document.title=T});v&&typeof performance=="undefined"&&(global.performance=iS().performance);var G=d.print||console.log.bind(console),H=d.printErr||console.warn.bind(console);for(m in h)h.hasOwnProperty(m)&&(d[m]=h[m]);h=null,d.arguments&&(f=d.arguments),d.thisProgram&&(g=d.thisProgram),d.quit&&(y=d.quit);var J=Atomics.load,K=Atomics.store,ne=Atomics.compareExchange,Q;d.wasmBinary&&(Q=d.wasmBinary);var se=d.noExitRuntime||!0;typeof WebAssembly!="object"&&ur("no native wasm support detected");var Z,le,oe=!1,xe;function fe(T,R){T||ur("Assertion failed: "+R)}function Ne(T){var R=d["_"+T];return fe(R,"Cannot call unknown function "+T+", make sure it is exported"),R}function Te(T,R,j,X,ce){var ue={string:function(Cn){var po=0;if(Cn!=null&&Cn!==0){var b5=(Cn.length<<2)+1;po=oo(b5),nt(Cn,po,b5)}return po},array:function(Cn){var po=oo(Cn.length);return Ye(Cn,po),po}};function pe(Cn){return R==="string"?ze(Cn):R==="boolean"?Boolean(Cn):Cn}var ve=Ne(T),at=[],Gt=0;if(X)for(var Pt=0;Pt=X);){var ue=T[R++];if(!ue)return ce;if(!(ue&128)){ce+=String.fromCharCode(ue);continue}var pe=T[R++]&63;if((ue&224)==192){ce+=String.fromCharCode((ue&31)<<6|pe);continue}var ve=T[R++]&63;if((ue&240)==224?ue=(ue&15)<<12|pe<<6|ve:ue=(ue&7)<<18|pe<<12|ve<<6|T[R++]&63,ue<65536)ce+=String.fromCharCode(ue);else{var at=ue-65536;ce+=String.fromCharCode(55296|at>>10,56320|at&1023)}}return ce}function ze(T,R){return T?Pe(i(),T,R):""}function tt(T,R,j,X){if(!(X>0))return 0;for(var ce=j,ue=j+X-1,pe=0;pe=55296&&ve<=57343){var at=T.charCodeAt(++pe);ve=65536+((ve&1023)<<10)|at&1023}if(ve<=127){if(j>=ue)break;R[j++]=ve}else if(ve<=2047){if(j+1>=ue)break;R[j++]=192|ve>>6,R[j++]=128|ve&63}else if(ve<=65535){if(j+2>=ue)break;R[j++]=224|ve>>12,R[j++]=128|ve>>6&63,R[j++]=128|ve&63}else{if(j+3>=ue)break;R[j++]=240|ve>>18,R[j++]=128|ve>>12&63,R[j++]=128|ve>>6&63,R[j++]=128|ve&63}}return R[j]=0,j-ce}function nt(T,R,j){return tt(T,i(),R,j)}function it(T){for(var R=0,j=0;j=55296&&X<=57343&&(X=65536+((X&1023)<<10)|T.charCodeAt(++j)&1023),X<=127?++R:X<=2047?R+=2:X<=65535?R+=3:R+=4}return R}function Ye(T,R){s().set(T,R)}function ht(T,R){return T%R>0&&(T+=R-T%R),T}var Ue,In,kt,ta,en,Sn,na,Pn,dn;function tn(T){Ue=T,d.HEAP8=In=new Int8Array(T),d.HEAP16=ta=new Int16Array(T),d.HEAP32=Sn=new Int32Array(T),d.HEAPU8=kt=new Uint8Array(T),d.HEAPU16=en=new Uint16Array(T),d.HEAPU32=na=new Uint32Array(T),d.HEAPF32=Pn=new Float32Array(T),d.HEAPF64=dn=new Float64Array(T)}var Ba=d.INITIAL_MEMORY||16777216;if(w)Z=d.wasmMemory,Ue=d.buffer;else if(d.wasmMemory)Z=d.wasmMemory;else if(Z=new WebAssembly.Memory({initial:Ba/65536,maximum:2147483648/65536,shared:!0}),!(Z.buffer instanceof SharedArrayBuffer))throw H("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),v&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Z&&(Ue=Z.buffer),Ba=Ue.byteLength,tn(Ue);var fa,ma=[],Nr=[],or=[],Tr=[],eo=[],Va=!1,vp=!1;w||Nr.push({func:function(){zp()}});function cf(){if(!w){if(d.preRun)for(typeof d.preRun=="function"&&(d.preRun=[d.preRun]);d.preRun.length;)kp(d.preRun.shift());no(ma)}}function yu(){Va=!0,!w&&no(Nr)}function hf(){w||no(or)}function wp(){w||(vp=!0)}function Nn(){if(!w){if(d.postRun)for(typeof d.postRun=="function"&&(d.postRun=[d.postRun]);d.postRun.length;)ff(d.postRun.shift());no(eo)}}function kp(T){ma.unshift(T)}function ff(T){eo.unshift(T)}var lr=0,Cr=null,hs=null;function mf(T){fe(!w,"addRunDependency cannot be used in a pthread worker"),lr++,d.monitorRunDependencies&&d.monitorRunDependencies(lr)}function gf(T){if(lr--,d.monitorRunDependencies&&d.monitorRunDependencies(lr),lr==0&&(Cr!==null&&(clearInterval(Cr),Cr=null),hs)){var R=hs;hs=null,R()}}d.preloadedImages={},d.preloadedAudios={};function ur(T){d.onAbort&&d.onAbort(T),w&&console.error("Pthread aborting at "+new Error().stack),T+="",H(T),oe=!0,xe=1,T="abort("+T+"). Build with -s ASSERTIONS=1 for more info.";var R=new WebAssembly.RuntimeError(T);throw c(R),R}function Ip(T,R){return String.prototype.startsWith?T.startsWith(R):T.indexOf(R)===0}var to="data:application/octet-stream;base64,";function Sp(T){return Ip(T,to)}var yf="file://";function Np(T){return Ip(T,yf)}var Tn="tfjs-backend-wasm-threaded-simd.wasm";Sp(Tn)||(Tn=C(Tn));function Tp(T){try{if(T==Tn&&Q)return new Uint8Array(Q);if($)return $(T);throw"both async and sync fetching of the wasm failed"}catch(R){ur(R)}}function Af(){if(!Q&&(A||x)){if(typeof fetch=="function"&&!Np(Tn))return fetch(Tn,{credentials:"same-origin"}).then(function(T){if(!T.ok)throw"failed to load wasm binary file at '"+Tn+"'";return T.arrayBuffer()}).catch(function(){return Tp(Tn)});if(_)return new Promise(function(T,R){_(Tn,function(j){T(new Uint8Array(j))},R)})}return Promise.resolve().then(function(){return Tp(Tn)})}function xf(){var T={a:um};function R(pe,ve){var at=pe.exports;if(d.asm=at,fa=d.asm.F,le=ve,!w){var Gt=Ie.unusedWorkers.length;Ie.unusedWorkers.forEach(function(Pt){Ie.loadWasmModuleToWorker(Pt,function(){--Gt||gf("wasm-instantiate")})})}}w||mf("wasm-instantiate");function j(pe){R(pe.instance,pe.module)}function X(pe){return Af().then(function(ve){return WebAssembly.instantiate(ve,T)}).then(pe,function(ve){H("failed to asynchronously prepare wasm: "+ve),ur(ve)})}function ce(){return!Q&&typeof WebAssembly.instantiateStreaming=="function"&&!Sp(Tn)&&!Np(Tn)&&typeof fetch=="function"?fetch(Tn,{credentials:"same-origin"}).then(function(pe){var ve=WebAssembly.instantiateStreaming(pe,T);return ve.then(j,function(at){return H("wasm streaming compile failed: "+at),H("falling back to ArrayBuffer instantiation"),X(j)})}):X(j)}if(d.instantiateWasm)try{var ue=d.instantiateWasm(T,R);return ue}catch(pe){return H("Module.instantiateWasm callback failed with error: "+pe),!1}return ce().catch(c),{}}var bf={9816:function(){throw"Canceled!"},9834:function(T,R){setTimeout(function(){f5(T,R)},0)}};function Cp(){Ie.initRuntime()}function no(T){for(;T.length>0;){var R=T.shift();if(typeof R=="function"){R(d);continue}var j=R.func;typeof j=="number"?R.arg===void 0?fa.get(j)():fa.get(j)(R.arg):j(R.arg===void 0?null:R.arg)}}function Au(T,R){if(T<=0||T>s().length||T&!0||R<0)return-28;if(R==0)return 0;R>=2147483647&&(R=Infinity);var j=Atomics.load(o(),lo>>2),X=0;if(j==T){var ce=Atomics.compareExchange(o(),lo>>2,j,0);if(ce==j&&(--R,X=1,R<=0))return 1}var ue=Atomics.notify(o(),T>>2,R);if(ue>=0)return ue+X;throw"Atomics.notify returned an unexpected value "+ue}d._emscripten_futex_wake=Au;function vf(T){if(w)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!T)throw"Internal Error! Null pthread_ptr in killThread!";o()[T+12>>2]=0;var R=Ie.pthreads[T];R.worker.terminate(),Ie.freeThreadData(R),Ie.runningWorkers.splice(Ie.runningWorkers.indexOf(R.worker),1),R.worker.pthread=void 0}function wf(T){if(w)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!T)throw"Internal Error! Null pthread_ptr in cancelThread!";var R=Ie.pthreads[T];R.worker.postMessage({cmd:"cancel"})}function kf(T){if(w)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!T)throw"Internal Error! Null pthread_ptr in cleanupThread!";var R=Ie.pthreads[T];if(R){o()[T+12>>2]=0;var j=R.worker;Ie.returnWorkerToPool(j)}}var Ie={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){for(var T=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2)),R=0;R>2]=T;var j=T+152;o()[j>>2]=j;for(var X=ms(512),R=0;R<128;++R)l()[X/4+R]=0;Atomics.store(l(),T+100>>2,X),Atomics.store(l(),T+40>>2,T),Dm(T,!x,1),h5(T)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){for(;Ie.threadExitHandlers.length>0;)Ie.threadExitHandlers.pop()();w&&so()&&c5()},runExitHandlersAndDeinitThread:function(T,R){Atomics.store(l(),T+56>>2,1),Atomics.store(l(),T+60>>2,0),Ie.runExitHandlers(),Atomics.store(l(),T+4>>2,R),Atomics.store(l(),T+0>>2,1),Au(T+0,2147483647),Dm(0,0,0)},threadExit:function(T){var R=so();R&&(Ie.runExitHandlersAndDeinitThread(R,T),w&&postMessage({cmd:"exit"}))},threadCancel:function(){Ie.runExitHandlersAndDeinitThread(so(),-1),postMessage({cmd:"cancelDone"})},terminateAllThreads:function(){for(var T in Ie.pthreads){var R=Ie.pthreads[T];R&&R.worker&&Ie.returnWorkerToPool(R.worker)}Ie.pthreads={};for(var j=0;j>2];o()[T.threadInfoStruct+100>>2]=0,Su(R),Su(T.threadInfoStruct)}T.threadInfoStruct=0,T.allocatedOwnStack&&T.stackBase&&Su(T.stackBase),T.stackBase=0,T.worker&&(T.worker.pthread=null)}},returnWorkerToPool:function(T){Ie.runWithoutMainThreadQueuedCalls(function(){delete Ie.pthreads[T.pthread.threadInfoStruct],Ie.unusedWorkers.push(T),Ie.runningWorkers.splice(Ie.runningWorkers.indexOf(T),1),Ie.freeThreadData(T.pthread),T.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(T){o()[x5>>2]=0;try{T()}finally{o()[x5>>2]=1}},receiveObjectTransfer:function(T){},loadWasmModuleToWorker:function(T,R){T.onmessage=function(j){var X=j.data,ce=X.cmd;if(T.pthread&&(Ie.currentProxiedOperationCallerThread=T.pthread.threadInfoStruct),X.targetThread&&X.targetThread!=so()){var ue=Ie.pthreads[X.targetThread];ue?ue.worker.postMessage(j.data,X.transferList):console.error('Internal error! Worker sent a message "'+ce+'" to target pthread '+X.targetThread+", but that thread no longer exists!"),Ie.currentProxiedOperationCallerThread=void 0;return}if(ce==="processQueuedMainThreadWork")Fm();else if(ce==="spawnThread")Dp(j.data);else if(ce==="cleanupThread")kf(X.thread);else if(ce==="killThread")vf(X.thread);else if(ce==="cancelThread")wf(X.thread);else if(ce==="loaded")T.loaded=!0,R&&R(T),T.runPthread&&(T.runPthread(),delete T.runPthread);else if(ce==="print")G("Thread "+X.threadId+": "+X.text);else if(ce==="printErr")H("Thread "+X.threadId+": "+X.text);else if(ce==="alert")alert("Thread "+X.threadId+": "+X.text);else if(ce==="exit"){var pe=T.pthread&&Atomics.load(l(),T.pthread.threadInfoStruct+64>>2);pe&&Ie.returnWorkerToPool(T)}else if(ce==="exitProcess")try{BI(X.returnCode)}catch(ve){if(ve instanceof Tu)return;throw ve}else ce==="cancelDone"?Ie.returnWorkerToPool(T):ce==="objectTransfer"?Ie.receiveObjectTransfer(j.data):j.data.target==="setimmediate"?T.postMessage(j.data):H("worker sent an unknown command "+ce);Ie.currentProxiedOperationCallerThread=void 0},T.onerror=function(j){H("pthread sent an error! "+j.filename+":"+j.lineno+": "+j.message)},v&&(T.on("message",function(j){T.onmessage({data:j})}),T.on("error",function(j){T.onerror(j)}),T.on("exit",function(j){})),T.postMessage({cmd:"load",urlOrBlob:d.mainScriptUrlOrBlob||a,wasmMemory:Z,wasmModule:le})},allocateUnusedWorker:function(){var T=C("tfjs-backend-wasm-threaded-simd.worker.js");Ie.unusedWorkers.push(new Worker(T))},getNewWorker:function(){return Ie.unusedWorkers.length==0&&(Ie.allocateUnusedWorker(),Ie.loadWasmModuleToWorker(Ie.unusedWorkers[0])),Ie.unusedWorkers.length>0?Ie.unusedWorkers.pop():null},busySpinWait:function(T){for(var R=performance.now()+T;performance.now()>2]=T,T}function Rf(T,R){if(w)return Er(1,1,T,R)}function Mf(T,R){if(T==R)postMessage({cmd:"processQueuedMainThreadWork"});else if(w)postMessage({targetThread:T,cmd:"processThreadQueue"});else{var j=Ie.pthreads[T],X=j&&j.worker;if(!X)return;X.postMessage({cmd:"processThreadQueue"})}return 1}function Ff(){ur()}function $f(T,R,j){var X=Pf(R,j);return bf[T].apply(null,X)}function Df(T,R){}function Of(T,R,j){if(T<=0||T>s().length||T&!0)return-28;if(A){if(Atomics.load(o(),T>>2)!=R)return-6;for(var X=performance.now(),ce=X+j,ue=Atomics.exchange(o(),lo>>2,T);;){if(X=performance.now(),X>ce)return ue=Atomics.exchange(o(),lo>>2,0),-73;if(ue=Atomics.exchange(o(),lo>>2,0),ue==0)break;if(Fm(),Atomics.load(o(),T>>2)!=R)return-6;ue=Atomics.exchange(o(),lo>>2,T)}return 0}else{var pe=Atomics.wait(o(),T>>2,R,j);if(pe==="timed-out")return-73;if(pe==="not-equal")return-6;if(pe==="ok")return 0;throw"Atomics.wait returned an unexpected value "+pe}}function zf(T,R,j){i().copyWithin(T,R,R+j)}function _f(){return v?co("os").cpus().length:navigator.hardwareConcurrency}function Er(T,R){for(var j=arguments.length-2,X=Nu(),ce=j,ue=oo(ce*8),pe=ue>>3,ve=0;ve>=2;j=i()[T++];){var X=j<105;X&&R&1&&R++,bu.push(X?u()[R++>>1]:o()[R]),++R}return bu}function Lf(T,R,j){xu.length=R;for(var X=j>>3,ce=0;ce>>16),tn(Z.buffer),1}catch(R){}}function Vf(T){var R=Wf();if(T<=R)return!1;var j=2147483648;if(T>j)return!1;for(var X=1;X<=4;X*=2){var ce=R*(1+.2/X);ce=Math.min(ce,T+100663296);var ue=Math.min(j,ht(Math.max(T,ce),65536)),pe=Bf(ue);if(pe)return!0}return!1}var We={inEventHandler:0,removeAllEventListeners:function(){for(var T=We.eventHandlers.length-1;T>=0;--T)We._removeHandler(T);We.eventHandlers=[],We.deferredCalls=[]},registerRemoveEventListeners:function(){We.removeEventListenersRegistered||(Tr.push(We.removeAllEventListeners),We.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(T,R,j){function X(pe,ve){if(pe.length!=ve.length)return!1;for(var at in pe)if(pe[at]!=ve[at])return!1;return!0}for(var ce in We.deferredCalls){var ue=We.deferredCalls[ce];if(ue.targetFunction==T&&X(ue.argsList,j))return}We.deferredCalls.push({targetFunction:T,precedence:R,argsList:j}),We.deferredCalls.sort(function(pe,ve){return pe.precedence>2]=j,o()[pe+4>>2]=X,o()[pe+8>>2]=ce,$m(0,T,637534208,R,X,pe),io(ue)},getTargetThreadForEventCallback:function(T){switch(T){case 1:return 0;case 2:return Ie.currentProxiedOperationCallerThread;default:return T}},getNodeNameForTarget:function(T){return T?T==window?"#window":T==screen?"#screen":T&&T.nodeName?T.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function jf(T){var R=it(T)+1,j=ms(R);return nt(T,j,R),j}function Uf(T,R,j,X){var ce=Nu(),ue=oo(12),pe=0;R&&(pe=jf(R)),o()[ue>>2]=pe,o()[ue+4>>2]=j,o()[ue+8>>2]=X,$m(0,T,657457152,0,pe,ue),io(ce)}function Hf(T,R,j,X){R=R?ze(R):"",Uf(T,R,j,X)}function Gf(T){return T>2?ze(T):T}var qf=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function Xf(T){T=Gf(T);var R=qf[T]||(typeof document!="undefined"?document.querySelector(T):void 0);return R}function vu(T){return Xf(T)}function Ep(T,R,j){var X=vu(T);if(!X)return-4;if(X.canvasSharedPtr&&(o()[X.canvasSharedPtr>>2]=R,o()[X.canvasSharedPtr+4>>2]=j),X.offscreenCanvas||!X.controlTransferredOffscreen){X.offscreenCanvas&&(X=X.offscreenCanvas);var ce=!1;if(X.GLctxObject&&X.GLctxObject.GLctx){var ue=X.GLctxObject.GLctx.getParameter(2978);ce=ue[0]===0&&ue[1]===0&&ue[2]===X.width&&ue[3]===X.height}X.width=R,X.height=j,ce&&X.GLctxObject.GLctx.viewport(0,0,R,j)}else if(X.canvasSharedPtr){var pe=o()[X.canvasSharedPtr+8>>2];return Hf(pe,T,R,j),1}else return-4;return 0}function Rp(T,R,j){return w?Er(2,1,T,R,j):Ep(T,R,j)}function Kf(T,R,j){var X=vu(T);return X?Ep(T,R,j):Rp(T,R,j)}function Zf(T){}function Yf(T,R){}function Jf(T){var R=T.getExtension("ANGLE_instanced_arrays");if(R)return T.vertexAttribDivisor=function(j,X){R.vertexAttribDivisorANGLE(j,X)},T.drawArraysInstanced=function(j,X,ce,ue){R.drawArraysInstancedANGLE(j,X,ce,ue)},T.drawElementsInstanced=function(j,X,ce,ue,pe){R.drawElementsInstancedANGLE(j,X,ce,ue,pe)},1}function Qf(T){var R=T.getExtension("OES_vertex_array_object");if(R)return T.createVertexArray=function(){return R.createVertexArrayOES()},T.deleteVertexArray=function(j){R.deleteVertexArrayOES(j)},T.bindVertexArray=function(j){R.bindVertexArrayOES(j)},T.isVertexArray=function(j){return R.isVertexArrayOES(j)},1}function em(T){var R=T.getExtension("WEBGL_draw_buffers");if(R)return T.drawBuffers=function(j,X){R.drawBuffersWEBGL(j,X)},1}function tm(T){return!!(T.multiDrawWebgl=T.getExtension("WEBGL_multi_draw"))}var et={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(T){et.lastError||(et.lastError=T)},getNewId:function(T){for(var R=et.counter++,j=T.length;j>2]:-1;ce+=ze(o()[j+ue*4>>2],pe<0?void 0:pe)}return ce},createContext:function(T,R){var j=T.getContext("webgl",R);if(!j)return 0;var X=et.registerContext(j,R);return X},registerContext:function(T,R){var j=ms(8);o()[j+4>>2]=so();var X={handle:j,attributes:R,version:R.majorVersion,GLctx:T};return T.canvas&&(T.canvas.GLctxObject=X),et.contexts[j]=X,(typeof R.enableExtensionsByDefault=="undefined"||R.enableExtensionsByDefault)&&et.initExtensions(X),j},makeContextCurrent:function(T){return et.currentContext=et.contexts[T],d.ctx=Rr=et.currentContext&&et.currentContext.GLctx,!(T&&!Rr)},getContext:function(T){return et.contexts[T]},deleteContext:function(T){et.currentContext===et.contexts[T]&&(et.currentContext=null),typeof We=="object"&&We.removeAllHandlersOnTarget(et.contexts[T].GLctx.canvas),et.contexts[T]&&et.contexts[T].GLctx.canvas&&(et.contexts[T].GLctx.canvas.GLctxObject=void 0),Su(et.contexts[T].handle),et.contexts[T]=null},initExtensions:function(T){if(T||(T=et.currentContext),!T.initExtensionsDone){T.initExtensionsDone=!0;var R=T.GLctx;Jf(R),Qf(R),em(R),R.disjointTimerQueryExt=R.getExtension("EXT_disjoint_timer_query"),tm(R);var j=R.getSupportedExtensions()||[];j.forEach(function(X){X.indexOf("lose_context")<0&&X.indexOf("debug")<0&&R.getExtension(X)})}},populateUniformTable:function(T){for(var R=et.programs[T],j=et.programInfos[T]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},X=j.uniforms,ce=Rr.getProgramParameter(R,35718),ue=0;ue>2,X=o()[j+(24>>2)],ce={alpha:!!o()[j+(0>>2)],depth:!!o()[j+(4>>2)],stencil:!!o()[j+(8>>2)],antialias:!!o()[j+(12>>2)],premultipliedAlpha:!!o()[j+(16>>2)],preserveDrawingBuffer:!!o()[j+(20>>2)],powerPreference:nm[X],failIfMajorPerformanceCaveat:!!o()[j+(28>>2)],majorVersion:o()[j+(32>>2)],minorVersion:o()[j+(36>>2)],enableExtensionsByDefault:o()[j+(40>>2)],explicitSwapControl:o()[j+(44>>2)],proxyContextToMainThread:o()[j+(48>>2)],renderViaOffscreenBackBuffer:o()[j+(52>>2)]},ue=vu(T);if(!ue||ce.explicitSwapControl)return 0;var pe=et.createContext(ue,ce);return pe}function rm(T,R){return am(T,R)}var ao={mappings:{},buffers:[null,[],[]],printChar:function(T,R){var j=ao.buffers[T];R===0||R===10?((T===1?G:H)(Pe(j,0)),j.length=0):j.push(R)},varargs:void 0,get:function(){ao.varargs+=4;var T=o()[ao.varargs-4>>2];return T},getStr:function(T){var R=ze(T);return R},get64:function(T,R){return T}};function Mp(T){return w?Er(3,1,T):0}function Fp(T,R,j,X,ce){if(w)return Er(4,1,T,R,j,X,ce)}function $p(T,R,j,X){if(w)return Er(5,1,T,R,j,X);for(var ce=0,ue=0;ue>2],ve=o()[R+(ue*8+4)>>2],at=0;at>2]=ce,0}function sm(T){var R=Ie.threadExitHandlers.pop();T&&R()}function im(T,R){Ie.threadExitHandlers.push(function(){fa.get(T)(R)})}function Dp(T){if(w)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var R=Ie.getNewWorker();if(R.pthread!==void 0)throw"Internal error!";if(!T.pthread_ptr)throw"Internal error, no pthread ptr!";Ie.runningWorkers.push(R);for(var j=ms(128*4),X=0;X<128;++X)o()[j+X*4>>2]=0;var ce=T.stackBase+T.stackSize,ue=Ie.pthreads[T.pthread_ptr]={worker:R,stackBase:T.stackBase,stackSize:T.stackSize,allocatedOwnStack:T.allocatedOwnStack,threadInfoStruct:T.pthread_ptr},pe=ue.threadInfoStruct>>2;Atomics.store(l(),pe+(64>>2),T.detached),Atomics.store(l(),pe+(100>>2),j),Atomics.store(l(),pe+(40>>2),ue.threadInfoStruct),Atomics.store(l(),pe+(80>>2),T.stackSize),Atomics.store(l(),pe+(76>>2),ce),Atomics.store(l(),pe+(104>>2),T.stackSize),Atomics.store(l(),pe+(104+8>>2),ce),Atomics.store(l(),pe+(104+12>>2),T.detached);var ve=p5(),at=ve+40;Atomics.store(l(),pe+(172>>2),at),R.pthread=ue;var Gt={cmd:"run",start_routine:T.startRoutine,arg:T.arg,threadInfoStruct:T.pthread_ptr,stackBase:T.stackBase,stackSize:T.stackSize};R.runPthread=function(){Gt.time=performance.now(),R.postMessage(Gt,T.transferList)},R.loaded&&(R.runPthread(),delete R.runPthread)}function om(T,R,j,X){if(typeof SharedArrayBuffer=="undefined")return H("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;if(!T)return H("pthread_create called with a null thread pointer!"),28;var ce=[],ue=0;if(w&&(ce.length===0||ue))return m5(687865856,T,R,j,X);if(ue)return ue;var pe=0,ve=0,at=0;R&&R!=-1?(pe=o()[R>>2],pe+=81920,ve=o()[R+8>>2],at=o()[R+12>>2]!==0):pe=2097152;var Gt=ve==0;Gt?ve=A5(16,pe):(ve-=pe,fe(ve>0));for(var Pt=ms(228),Fr=0;Fr<228>>2;++Fr)l()[(Pt>>2)+Fr]=0;o()[T>>2]=Pt,o()[Pt+12>>2]=Pt;var uo=Pt+152;o()[uo>>2]=uo;var Cn={stackBase:ve,stackSize:pe,allocatedOwnStack:Gt,detached:at,startRoutine:j,pthread_ptr:Pt,arg:X,transferList:ce};return w?(Cn.cmd="spawnThread",postMessage(Cn,ce)):Dp(Cn),0}function Op(T){if(w)return Er(6,1,T);switch(T){case 30:return 16384;case 85:var R=2147483648;return R/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return Ef(28),-1}w||Ie.initMainThreadBlock();var Rr,lm=[null,Rf,Rp,Mp,Fp,$p,Op],um={e:Tf,r:Cf,x:Mf,b:Ff,y:$f,j:Df,c:Of,d:Au,f:fs,p:zf,z:_f,u:Lf,q:Vf,v:Kf,i:Zf,t:Yf,w:rm,m:Mp,n:Fp,g:$p,o:Cp,a:Z||d.wasmMemory,k:sm,l:im,h:om,s:Op},u5=xf(),zp=d.___wasm_call_ctors=function(){return(zp=d.___wasm_call_ctors=d.asm.A).apply(null,arguments)},dm=d._init=function(){return(dm=d._init=d.asm.B).apply(null,arguments)},pm=d._register_tensor=function(){return(pm=d._register_tensor=d.asm.C).apply(null,arguments)},cm=d._dispose_data=function(){return(cm=d._dispose_data=d.asm.D).apply(null,arguments)},hm=d._dispose=function(){return(hm=d._dispose=d.asm.E).apply(null,arguments)},fm=d._Abs=function(){return(fm=d._Abs=d.asm.G).apply(null,arguments)},mm=d._Add=function(){return(mm=d._Add=d.asm.H).apply(null,arguments)},gm=d._AddN=function(){return(gm=d._AddN=d.asm.I).apply(null,arguments)},ym=d._All=function(){return(ym=d._All=d.asm.J).apply(null,arguments)},Am=d._Any=function(){return(Am=d._Any=d.asm.K).apply(null,arguments)},xm=d._ArgMax=function(){return(xm=d._ArgMax=d.asm.L).apply(null,arguments)},bm=d._AvgPool=function(){return(bm=d._AvgPool=d.asm.M).apply(null,arguments)},vm=d._BatchMatMul=function(){return(vm=d._BatchMatMul=d.asm.N).apply(null,arguments)},wm=d._Ceil=function(){return(wm=d._Ceil=d.asm.O).apply(null,arguments)},km=d._ClipByValue=function(){return(km=d._ClipByValue=d.asm.P).apply(null,arguments)},Im=d._Conv2D=function(){return(Im=d._Conv2D=d.asm.Q).apply(null,arguments)},Sm=d._Conv2DBackpropInput=function(){return(Sm=d._Conv2DBackpropInput=d.asm.R).apply(null,arguments)},Nm=d._Cos=function(){return(Nm=d._Cos=d.asm.S).apply(null,arguments)},Tm=d._CropAndResize=function(){return(Tm=d._CropAndResize=d.asm.T).apply(null,arguments)},Cm=d._Cumsum=function(){return(Cm=d._Cumsum=d.asm.U).apply(null,arguments)},Em=d._DepthToSpace=function(){return(Em=d._DepthToSpace=d.asm.V).apply(null,arguments)},Rm=d._DepthwiseConv2dNative=function(){return(Rm=d._DepthwiseConv2dNative=d.asm.W).apply(null,arguments)},_p=d._Equal=function(){return(_p=d._Equal=d.asm.X).apply(null,arguments)},Pp=d._Exp=function(){return(Pp=d._Exp=d.asm.Y).apply(null,arguments)},Lp=d._FlipLeftRight=function(){return(Lp=d._FlipLeftRight=d.asm.Z).apply(null,arguments)},wu=d._Floor=function(){return(wu=d._Floor=d.asm._).apply(null,arguments)},ro=d._FloorDiv=function(){return(ro=d._FloorDiv=d.asm.$).apply(null,arguments)},Mm=d._FusedBatchNorm=function(){return(Mm=d._FusedBatchNorm=d.asm.aa).apply(null,arguments)},ku=d._FusedConv2D=function(){return(ku=d._FusedConv2D=d.asm.ba).apply(null,arguments)},Y=d._FusedDepthwiseConv2D=function(){return(Y=d._FusedDepthwiseConv2D=d.asm.ca).apply(null,arguments)},ae=d._Gather=function(){return(ae=d._Gather=d.asm.da).apply(null,arguments)},Ce=d._GatherNd=function(){return(Ce=d._GatherNd=d.asm.ea).apply(null,arguments)},Je=d._Greater=function(){return(Je=d._Greater=d.asm.fa).apply(null,arguments)},Ct=d._GreaterEqual=function(){return(Ct=d._GreaterEqual=d.asm.ga).apply(null,arguments)},At=d._LeakyRelu=function(){return(At=d._LeakyRelu=d.asm.ha).apply(null,arguments)},He=d._Less=function(){return(He=d._Less=d.asm.ia).apply(null,arguments)},qe=d._LessEqual=function(){return(qe=d._LessEqual=d.asm.ja).apply(null,arguments)},nn=d._Log=function(){return(nn=d._Log=d.asm.ka).apply(null,arguments)},dr=d._LogicalAnd=function(){return(dr=d._LogicalAnd=d.asm.la).apply(null,arguments)},pr=d._Max=function(){return(pr=d._Max=d.asm.ma).apply(null,arguments)},Wp=d._MaxPool=function(){return(Wp=d._MaxPool=d.asm.na).apply(null,arguments)},Iu=d._Maximum=function(){return(Iu=d._Maximum=d.asm.oa).apply(null,arguments)},aa=d._Mean=function(){return(aa=d._Mean=d.asm.pa).apply(null,arguments)},Mr=d._Min=function(){return(Mr=d._Min=d.asm.qa).apply(null,arguments)},Bp=d._Minimum=function(){return(Bp=d._Minimum=d.asm.ra).apply(null,arguments)},eI=d._MirrorPad=function(){return(eI=d._MirrorPad=d.asm.sa).apply(null,arguments)},tI=d._Multiply=function(){return(tI=d._Multiply=d.asm.ta).apply(null,arguments)},nI=d._Neg=function(){return(nI=d._Neg=d.asm.ua).apply(null,arguments)},aI=d._NonMaxSuppressionV3=function(){return(aI=d._NonMaxSuppressionV3=d.asm.va).apply(null,arguments)},rI=d._NonMaxSuppressionV4=function(){return(rI=d._NonMaxSuppressionV4=d.asm.wa).apply(null,arguments)},sI=d._NonMaxSuppressionV5=function(){return(sI=d._NonMaxSuppressionV5=d.asm.xa).apply(null,arguments)},iI=d._NotEqual=function(){return(iI=d._NotEqual=d.asm.ya).apply(null,arguments)},oI=d._OneHot=function(){return(oI=d._OneHot=d.asm.za).apply(null,arguments)},lI=d._PadV2=function(){return(lI=d._PadV2=d.asm.Aa).apply(null,arguments)},uI=d._Pow=function(){return(uI=d._Pow=d.asm.Ba).apply(null,arguments)},dI=d._Prelu=function(){return(dI=d._Prelu=d.asm.Ca).apply(null,arguments)},pI=d._Prod=function(){return(pI=d._Prod=d.asm.Da).apply(null,arguments)},cI=d._RealDiv=function(){return(cI=d._RealDiv=d.asm.Ea).apply(null,arguments)},hI=d._Relu=function(){return(hI=d._Relu=d.asm.Fa).apply(null,arguments)},fI=d._Relu6=function(){return(fI=d._Relu6=d.asm.Ga).apply(null,arguments)},mI=d._ResizeBilinear=function(){return(mI=d._ResizeBilinear=d.asm.Ha).apply(null,arguments)},gI=d._Reverse=function(){return(gI=d._Reverse=d.asm.Ia).apply(null,arguments)},yI=d._RotateWithOffset=function(){return(yI=d._RotateWithOffset=d.asm.Ja).apply(null,arguments)},AI=d._Round=function(){return(AI=d._Round=d.asm.Ka).apply(null,arguments)},xI=d._Rsqrt=function(){return(xI=d._Rsqrt=d.asm.La).apply(null,arguments)},bI=d._ScatterNd=function(){return(bI=d._ScatterNd=d.asm.Ma).apply(null,arguments)},vI=d._SelectV2=function(){return(vI=d._SelectV2=d.asm.Na).apply(null,arguments)},wI=d._Sigmoid=function(){return(wI=d._Sigmoid=d.asm.Oa).apply(null,arguments)},kI=d._Sin=function(){return(kI=d._Sin=d.asm.Pa).apply(null,arguments)},II=d._Softmax=function(){return(II=d._Softmax=d.asm.Qa).apply(null,arguments)},SI=d._Sqrt=function(){return(SI=d._Sqrt=d.asm.Ra).apply(null,arguments)},NI=d._Square=function(){return(NI=d._Square=d.asm.Sa).apply(null,arguments)},TI=d._SquaredDifference=function(){return(TI=d._SquaredDifference=d.asm.Ta).apply(null,arguments)},CI=d._Step=function(){return(CI=d._Step=d.asm.Ua).apply(null,arguments)},EI=d._StridedSlice=function(){return(EI=d._StridedSlice=d.asm.Va).apply(null,arguments)},RI=d._Sub=function(){return(RI=d._Sub=d.asm.Wa).apply(null,arguments)},MI=d._Sum=function(){return(MI=d._Sum=d.asm.Xa).apply(null,arguments)},FI=d._Tan=function(){return(FI=d._Tan=d.asm.Ya).apply(null,arguments)},$I=d._Tanh=function(){return($I=d._Tanh=d.asm.Za).apply(null,arguments)},DI=d._Tile=function(){return(DI=d._Tile=d.asm._a).apply(null,arguments)},OI=d._TopK=function(){return(OI=d._TopK=d.asm.$a).apply(null,arguments)},zI=d._Transform=function(){return(zI=d._Transform=d.asm.ab).apply(null,arguments)},_I=d._Transpose=function(){return(_I=d._Transpose=d.asm.bb).apply(null,arguments)},PI=d.__FusedMatMul=function(){return(PI=d.__FusedMatMul=d.asm.cb).apply(null,arguments)},ms=d._malloc=function(){return(ms=d._malloc=d.asm.db).apply(null,arguments)},Su=d._free=function(){return(Su=d._free=d.asm.eb).apply(null,arguments)},d5=d.___errno_location=function(){return(d5=d.___errno_location=d.asm.fb).apply(null,arguments)},p5=d._emscripten_get_global_libc=function(){return(p5=d._emscripten_get_global_libc=d.asm.gb).apply(null,arguments)},so=d._pthread_self=function(){return(so=d._pthread_self=d.asm.hb).apply(null,arguments)},c5=d.___pthread_tsd_run_dtors=function(){return(c5=d.___pthread_tsd_run_dtors=d.asm.ib).apply(null,arguments)},Fm=d._emscripten_main_thread_process_queued_calls=function(){return(Fm=d._emscripten_main_thread_process_queued_calls=d.asm.jb).apply(null,arguments)},LI=d._emscripten_current_thread_process_queued_calls=function(){return(LI=d._emscripten_current_thread_process_queued_calls=d.asm.kb).apply(null,arguments)},h5=d._emscripten_register_main_browser_thread_id=function(){return(h5=d._emscripten_register_main_browser_thread_id=d.asm.lb).apply(null,arguments)},f5=d.__emscripten_do_dispatch_to_thread=function(){return(f5=d.__emscripten_do_dispatch_to_thread=d.asm.mb).apply(null,arguments)},m5=d._emscripten_sync_run_in_main_thread_4=function(){return(m5=d._emscripten_sync_run_in_main_thread_4=d.asm.nb).apply(null,arguments)},g5=d._emscripten_run_in_main_runtime_thread_js=function(){return(g5=d._emscripten_run_in_main_runtime_thread_js=d.asm.ob).apply(null,arguments)},$m=d.__emscripten_call_on_thread=function(){return($m=d.__emscripten_call_on_thread=d.asm.pb).apply(null,arguments)},WI=d._emscripten_tls_init=function(){return(WI=d._emscripten_tls_init=d.asm.qb).apply(null,arguments)},Dm=d.__emscripten_thread_init=function(){return(Dm=d.__emscripten_thread_init=d.asm.rb).apply(null,arguments)},Nu=d.stackSave=function(){return(Nu=d.stackSave=d.asm.sb).apply(null,arguments)},io=d.stackRestore=function(){return(io=d.stackRestore=d.asm.tb).apply(null,arguments)},oo=d.stackAlloc=function(){return(oo=d.stackAlloc=d.asm.ub).apply(null,arguments)},y5=d._emscripten_stack_set_limits=function(){return(y5=d._emscripten_stack_set_limits=d.asm.vb).apply(null,arguments)},A5=d._memalign=function(){return(A5=d._memalign=d.asm.wb).apply(null,arguments)},x5=d.__emscripten_allow_main_runtime_queued_calls=9808,lo=d.__emscripten_main_thread_futex=11432;d.cwrap=Oe,d.PThread=Ie,d.PThread=Ie,d.wasmMemory=Z,d.ExitStatus=Tu;var Vp;function Tu(T){this.name="ExitStatus",this.message="Program terminated with exit("+T+")",this.status=T}hs=function T(){Vp||Om(),Vp||(hs=T)};function Om(T){if(T=T||f,lr>0)return;if(w){p(d),yu(),postMessage({cmd:"loaded"});return}if(cf(),lr>0)return;function R(){Vp||(Vp=!0,d.calledRun=!0,!oe&&(yu(),hf(),p(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),Nn()))}d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1),R()},1)):R()}d.run=Om;function BI(T,R){if(!(R&&se&&T===0)){if(!R&&w)throw postMessage({cmd:"exitProcess",returnCode:T}),new Tu(T);se||(Ie.terminateAllThreads(),xe=T,wp(),d.onExit&&d.onExit(T),oe=!0),y(T,new Tu(T))}}if(d.preInit)for(typeof d.preInit=="function"&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();return w&&(se=!1,Ie.initWorker()),Om(),r.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModuleThreadedSimd=n)}),lS=xt((e,t)=>{var n=function(){var a=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(a=a||__filename),function(r){r=r||{};var s=typeof r!="undefined"?r:{},i,o;s.ready=new Promise(function(Y,ae){i=Y,o=ae});var l={},u;for(u in s)s.hasOwnProperty(u)&&(l[u]=s[u]);var d=[],p="./this.program",c=function(Y,ae){throw ae},h=!1,m=!1,f=!1,g=!1;h=typeof window=="object",m=typeof importScripts=="function",f=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g=!h&&!f&&!m;var y="";function A(Y){return s.locateFile?s.locateFile(Y,y):y+Y}var x,v,b,w,N,C;f?(m?y=Cu().dirname(y)+"/":y=__dirname+"/",x=function(Y,ae){return N||(N=co("fs")),C||(C=Cu()),Y=C.normalize(Y),N.readFileSync(Y,ae?null:"utf8")},b=function(Y){var ae=x(Y,!0);return ae.buffer||(ae=new Uint8Array(ae)),G(ae.buffer),ae},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",function(Y){if(!(Y instanceof Mm))throw Y}),process.on("unhandledRejection",Va),c=function(Y){process.exit(Y)},s.inspect=function(){return"[Emscripten Module object]"}):g?(typeof read!="undefined"&&(x=function(Y){return read(Y)}),b=function(Y){var ae;return typeof readbuffer=="function"?new Uint8Array(readbuffer(Y)):(ae=read(Y,"binary"),G(typeof ae=="object"),ae)},typeof scriptArgs!="undefined"?d=scriptArgs:typeof arguments!="undefined"&&(d=arguments),typeof quit=="function"&&(c=function(Y){quit(Y)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(h||m)&&(m?y=self.location.href:typeof document!="undefined"&&document.currentScript&&(y=document.currentScript.src),a&&(y=a),y.indexOf("blob:")!==0?y=y.substr(0,y.lastIndexOf("/")+1):y="",x=function(Y){var ae=new XMLHttpRequest;return ae.open("GET",Y,!1),ae.send(null),ae.responseText},m&&(b=function(Y){var ae=new XMLHttpRequest;return ae.open("GET",Y,!1),ae.responseType="arraybuffer",ae.send(null),new Uint8Array(ae.response)}),v=function(Y,ae,Ce){var Je=new XMLHttpRequest;Je.open("GET",Y,!0),Je.responseType="arraybuffer",Je.onload=function(){if(Je.status==200||Je.status==0&&Je.response){ae(Je.response);return}Ce()},Je.onerror=Ce,Je.send(null)},w=function(Y){document.title=Y});var E=s.print||console.log.bind(console),_=s.printErr||console.warn.bind(console);for(u in l)l.hasOwnProperty(u)&&(s[u]=l[u]);l=null,s.arguments&&(d=s.arguments),s.thisProgram&&(p=s.thisProgram),s.quit&&(c=s.quit);var $;s.wasmBinary&&($=s.wasmBinary);var S=s.noExitRuntime||!0;typeof WebAssembly!="object"&&Va("no native wasm support detected");var z,O=!1,W;function G(Y,ae){Y||Va("Assertion failed: "+ae)}function H(Y){var ae=s["_"+Y];return G(ae,"Cannot call unknown function "+Y+", make sure it is exported"),ae}function J(Y,ae,Ce,Je,Ct){var At={string:function(aa){var Mr=0;if(aa!=null&&aa!==0){var Bp=(aa.length<<2)+1;Mr=wu(Bp),le(aa,Mr,Bp)}return Mr},array:function(aa){var Mr=wu(aa.length);return oe(aa,Mr),Mr}};function He(aa){return ae==="string"?se(aa):ae==="boolean"?Boolean(aa):aa}var qe=H(Y),nn=[],dr=0;if(Je)for(var pr=0;pr=Je);)++Ct;if(Ct-ae>16&&Y.subarray&&ne)return ne.decode(Y.subarray(ae,Ct));for(var At="";ae>10,56320|dr&1023)}}return At}function se(Y,ae){return Y?Q(Te,Y,ae):""}function Z(Y,ae,Ce,Je){if(!(Je>0))return 0;for(var Ct=Ce,At=Ce+Je-1,He=0;He=55296&&qe<=57343){var nn=Y.charCodeAt(++He);qe=65536+((qe&1023)<<10)|nn&1023}if(qe<=127){if(Ce>=At)break;ae[Ce++]=qe}else if(qe<=2047){if(Ce+1>=At)break;ae[Ce++]=192|qe>>6,ae[Ce++]=128|qe&63}else if(qe<=65535){if(Ce+2>=At)break;ae[Ce++]=224|qe>>12,ae[Ce++]=128|qe>>6&63,ae[Ce++]=128|qe&63}else{if(Ce+3>=At)break;ae[Ce++]=240|qe>>18,ae[Ce++]=128|qe>>12&63,ae[Ce++]=128|qe>>6&63,ae[Ce++]=128|qe&63}}return ae[Ce]=0,Ce-Ct}function le(Y,ae,Ce){return Z(Y,Te,ae,Ce)}function oe(Y,ae){Ne.set(Y,ae)}function xe(Y,ae){return Y%ae>0&&(Y+=ae-Y%ae),Y}var fe,Ne,Te,Oe,Pe,ze,tt,nt,it;function Ye(Y){fe=Y,s.HEAP8=Ne=new Int8Array(Y),s.HEAP16=Oe=new Int16Array(Y),s.HEAP32=ze=new Int32Array(Y),s.HEAPU8=Te=new Uint8Array(Y),s.HEAPU16=Pe=new Uint16Array(Y),s.HEAPU32=tt=new Uint32Array(Y),s.HEAPF32=nt=new Float32Array(Y),s.HEAPF64=it=new Float64Array(Y)}var ht=s.INITIAL_MEMORY||16777216,Ue,In=[],kt=[],ta=[],en=[],Sn=!1;kt.push({func:function(){Cp()}});function na(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Ba(s.preRun.shift());Cr(In)}function Pn(){Sn=!0,Cr(kt)}function dn(){Cr(ta)}function tn(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)fa(s.postRun.shift());Cr(en)}function Ba(Y){In.unshift(Y)}function fa(Y){en.unshift(Y)}var ma=0,Nr=null,or=null;function Tr(Y){ma++,s.monitorRunDependencies&&s.monitorRunDependencies(ma)}function eo(Y){if(ma--,s.monitorRunDependencies&&s.monitorRunDependencies(ma),ma==0&&(Nr!==null&&(clearInterval(Nr),Nr=null),or)){var ae=or;or=null,ae()}}s.preloadedImages={},s.preloadedAudios={};function Va(Y){s.onAbort&&s.onAbort(Y),Y+="",_(Y),O=!0,W=1,Y="abort("+Y+"). Build with -s ASSERTIONS=1 for more info.";var ae=new WebAssembly.RuntimeError(Y);throw o(ae),ae}function vp(Y,ae){return String.prototype.startsWith?Y.startsWith(ae):Y.indexOf(ae)===0}var cf="data:application/octet-stream;base64,";function yu(Y){return vp(Y,cf)}var hf="file://";function wp(Y){return vp(Y,hf)}var Nn="tfjs-backend-wasm.wasm";yu(Nn)||(Nn=A(Nn));function kp(Y){try{if(Y==Nn&&$)return new Uint8Array($);if(b)return b(Y);throw"both async and sync fetching of the wasm failed"}catch(ae){Va(ae)}}function ff(){if(!$&&(h||m)){if(typeof fetch=="function"&&!wp(Nn))return fetch(Nn,{credentials:"same-origin"}).then(function(Y){if(!Y.ok)throw"failed to load wasm binary file at '"+Nn+"'";return Y.arrayBuffer()}).catch(function(){return kp(Nn)});if(v)return new Promise(function(Y,ae){v(Nn,function(Ce){Y(new Uint8Array(Ce))},ae)})}return Promise.resolve().then(function(){return kp(Nn)})}function lr(){var Y={a:xf};function ae(He,qe){var nn=He.exports;s.asm=nn,z=s.asm.i,Ye(z.buffer),Ue=s.asm.o,eo("wasm-instantiate")}Tr("wasm-instantiate");function Ce(He){ae(He.instance)}function Je(He){return ff().then(function(qe){return WebAssembly.instantiate(qe,Y)}).then(He,function(qe){_("failed to asynchronously prepare wasm: "+qe),Va(qe)})}function Ct(){return!$&&typeof WebAssembly.instantiateStreaming=="function"&&!yu(Nn)&&!wp(Nn)&&typeof fetch=="function"?fetch(Nn,{credentials:"same-origin"}).then(function(He){var qe=WebAssembly.instantiateStreaming(He,Y);return qe.then(Ce,function(nn){return _("wasm streaming compile failed: "+nn),_("falling back to ArrayBuffer instantiation"),Je(Ce)})}):Je(Ce)}if(s.instantiateWasm)try{var At=s.instantiateWasm(Y,ae);return At}catch(He){return _("Module.instantiateWasm callback failed with error: "+He),!1}return Ct().catch(o),{}}function Cr(Y){for(;Y.length>0;){var ae=Y.shift();if(typeof ae=="function"){ae(s);continue}var Ce=ae.func;typeof Ce=="number"?ae.arg===void 0?Ue.get(Ce)():Ue.get(Ce)(ae.arg):Ce(ae.arg===void 0?null:ae.arg)}}function hs(){Va()}function mf(Y,ae,Ce){Te.copyWithin(Y,ae,ae+Ce)}function gf(){return Te.length}function ur(Y){try{return z.grow(Y-fe.byteLength+65535>>>16),Ye(z.buffer),1}catch(ae){}}function Ip(Y){var ae=gf(),Ce=2147483648;if(Y>Ce)return!1;for(var Je=1;Je<=4;Je*=2){var Ct=ae*(1+.2/Je);Ct=Math.min(Ct,Y+100663296);var At=Math.min(Ce,xe(Math.max(Y,Ct),65536)),He=ur(At);if(He)return!0}return!1}var to={mappings:{},buffers:[null,[],[]],printChar:function(Y,ae){var Ce=to.buffers[Y];ae===0||ae===10?((Y===1?E:_)(Q(Ce,0)),Ce.length=0):Ce.push(ae)},varargs:void 0,get:function(){to.varargs+=4;var Y=ze[to.varargs-4>>2];return Y},getStr:function(Y){var ae=se(Y);return ae},get64:function(Y,ae){return Y}};function Sp(Y){return 0}function yf(Y,ae,Ce,Je,Ct){}function Np(Y,ae,Ce,Je){for(var Ct=0,At=0;At>2],qe=ze[ae+(At*8+4)>>2],nn=0;nn>2]=Ct,0}function Tn(){return 6}function Tp(Y){return ze[_p()>>2]=Y,Y}function Af(Y){switch(Y){case 30:return 16384;case 85:var ae=2147483648;return ae/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return Tp(28),-1}var xf={a:hs,d:mf,e:Ip,f:Sp,c:yf,b:Np,g:Tn,h:Af},bf=lr(),Cp=s.___wasm_call_ctors=function(){return(Cp=s.___wasm_call_ctors=s.asm.j).apply(null,arguments)},no=s._init=function(){return(no=s._init=s.asm.k).apply(null,arguments)},Au=s._register_tensor=function(){return(Au=s._register_tensor=s.asm.l).apply(null,arguments)},vf=s._dispose_data=function(){return(vf=s._dispose_data=s.asm.m).apply(null,arguments)},wf=s._dispose=function(){return(wf=s._dispose=s.asm.n).apply(null,arguments)},kf=s._Abs=function(){return(kf=s._Abs=s.asm.p).apply(null,arguments)},Ie=s._Add=function(){return(Ie=s._Add=s.asm.q).apply(null,arguments)},If=s._AddN=function(){return(If=s._AddN=s.asm.r).apply(null,arguments)},Sf=s._All=function(){return(Sf=s._All=s.asm.s).apply(null,arguments)},Nf=s._Any=function(){return(Nf=s._Any=s.asm.t).apply(null,arguments)},Tf=s._ArgMax=function(){return(Tf=s._ArgMax=s.asm.u).apply(null,arguments)},Cf=s._AvgPool=function(){return(Cf=s._AvgPool=s.asm.v).apply(null,arguments)},fs=s._BatchMatMul=function(){return(fs=s._BatchMatMul=s.asm.w).apply(null,arguments)},Ef=s._Ceil=function(){return(Ef=s._Ceil=s.asm.x).apply(null,arguments)},Rf=s._ClipByValue=function(){return(Rf=s._ClipByValue=s.asm.y).apply(null,arguments)},Mf=s._Conv2D=function(){return(Mf=s._Conv2D=s.asm.z).apply(null,arguments)},Ff=s._Conv2DBackpropInput=function(){return(Ff=s._Conv2DBackpropInput=s.asm.A).apply(null,arguments)},$f=s._Cos=function(){return($f=s._Cos=s.asm.B).apply(null,arguments)},Df=s._CropAndResize=function(){return(Df=s._CropAndResize=s.asm.C).apply(null,arguments)},Of=s._Cumsum=function(){return(Of=s._Cumsum=s.asm.D).apply(null,arguments)},zf=s._DepthToSpace=function(){return(zf=s._DepthToSpace=s.asm.E).apply(null,arguments)},_f=s._DepthwiseConv2dNative=function(){return(_f=s._DepthwiseConv2dNative=s.asm.F).apply(null,arguments)},Er=s._Equal=function(){return(Er=s._Equal=s.asm.G).apply(null,arguments)},xu=s._Exp=function(){return(xu=s._Exp=s.asm.H).apply(null,arguments)},bu=s._FlipLeftRight=function(){return(bu=s._FlipLeftRight=s.asm.I).apply(null,arguments)},Pf=s._Floor=function(){return(Pf=s._Floor=s.asm.J).apply(null,arguments)},Lf=s._FloorDiv=function(){return(Lf=s._FloorDiv=s.asm.K).apply(null,arguments)},Wf=s._FusedBatchNorm=function(){return(Wf=s._FusedBatchNorm=s.asm.L).apply(null,arguments)},Bf=s._FusedConv2D=function(){return(Bf=s._FusedConv2D=s.asm.M).apply(null,arguments)},Vf=s._FusedDepthwiseConv2D=function(){return(Vf=s._FusedDepthwiseConv2D=s.asm.N).apply(null,arguments)},We=s._Gather=function(){return(We=s._Gather=s.asm.O).apply(null,arguments)},jf=s._GatherNd=function(){return(jf=s._GatherNd=s.asm.P).apply(null,arguments)},Uf=s._Greater=function(){return(Uf=s._Greater=s.asm.Q).apply(null,arguments)},Hf=s._GreaterEqual=function(){return(Hf=s._GreaterEqual=s.asm.R).apply(null,arguments)},Gf=s._LeakyRelu=function(){return(Gf=s._LeakyRelu=s.asm.S).apply(null,arguments)},qf=s._Less=function(){return(qf=s._Less=s.asm.T).apply(null,arguments)},Xf=s._LessEqual=function(){return(Xf=s._LessEqual=s.asm.U).apply(null,arguments)},vu=s._Log=function(){return(vu=s._Log=s.asm.V).apply(null,arguments)},Ep=s._LogicalAnd=function(){return(Ep=s._LogicalAnd=s.asm.W).apply(null,arguments)},Rp=s._Max=function(){return(Rp=s._Max=s.asm.X).apply(null,arguments)},Kf=s._MaxPool=function(){return(Kf=s._MaxPool=s.asm.Y).apply(null,arguments)},Zf=s._Maximum=function(){return(Zf=s._Maximum=s.asm.Z).apply(null,arguments)},Yf=s._Mean=function(){return(Yf=s._Mean=s.asm._).apply(null,arguments)},Jf=s._Min=function(){return(Jf=s._Min=s.asm.$).apply(null,arguments)},Qf=s._Minimum=function(){return(Qf=s._Minimum=s.asm.aa).apply(null,arguments)},em=s._MirrorPad=function(){return(em=s._MirrorPad=s.asm.ba).apply(null,arguments)},tm=s._Multiply=function(){return(tm=s._Multiply=s.asm.ca).apply(null,arguments)},et=s._Neg=function(){return(et=s._Neg=s.asm.da).apply(null,arguments)},nm=s._NonMaxSuppressionV3=function(){return(nm=s._NonMaxSuppressionV3=s.asm.ea).apply(null,arguments)},am=s._NonMaxSuppressionV4=function(){return(am=s._NonMaxSuppressionV4=s.asm.fa).apply(null,arguments)},rm=s._NonMaxSuppressionV5=function(){return(rm=s._NonMaxSuppressionV5=s.asm.ga).apply(null,arguments)},ao=s._NotEqual=function(){return(ao=s._NotEqual=s.asm.ha).apply(null,arguments)},Mp=s._OneHot=function(){return(Mp=s._OneHot=s.asm.ia).apply(null,arguments)},Fp=s._PadV2=function(){return(Fp=s._PadV2=s.asm.ja).apply(null,arguments)},$p=s._Pow=function(){return($p=s._Pow=s.asm.ka).apply(null,arguments)},sm=s._Prelu=function(){return(sm=s._Prelu=s.asm.la).apply(null,arguments)},im=s._Prod=function(){return(im=s._Prod=s.asm.ma).apply(null,arguments)},Dp=s._RealDiv=function(){return(Dp=s._RealDiv=s.asm.na).apply(null,arguments)},om=s._Relu=function(){return(om=s._Relu=s.asm.oa).apply(null,arguments)},Op=s._Relu6=function(){return(Op=s._Relu6=s.asm.pa).apply(null,arguments)},Rr=s._ResizeBilinear=function(){return(Rr=s._ResizeBilinear=s.asm.qa).apply(null,arguments)},lm=s._Reverse=function(){return(lm=s._Reverse=s.asm.ra).apply(null,arguments)},um=s._RotateWithOffset=function(){return(um=s._RotateWithOffset=s.asm.sa).apply(null,arguments)},u5=s._Round=function(){return(u5=s._Round=s.asm.ta).apply(null,arguments)},zp=s._Rsqrt=function(){return(zp=s._Rsqrt=s.asm.ua).apply(null,arguments)},dm=s._ScatterNd=function(){return(dm=s._ScatterNd=s.asm.va).apply(null,arguments)},pm=s._SelectV2=function(){return(pm=s._SelectV2=s.asm.wa).apply(null,arguments)},cm=s._Sigmoid=function(){return(cm=s._Sigmoid=s.asm.xa).apply(null,arguments)},hm=s._Sin=function(){return(hm=s._Sin=s.asm.ya).apply(null,arguments)},fm=s._Softmax=function(){return(fm=s._Softmax=s.asm.za).apply(null,arguments)},mm=s._Sqrt=function(){return(mm=s._Sqrt=s.asm.Aa).apply(null,arguments)},gm=s._Square=function(){return(gm=s._Square=s.asm.Ba).apply(null,arguments)},ym=s._SquaredDifference=function(){return(ym=s._SquaredDifference=s.asm.Ca).apply(null,arguments)},Am=s._Step=function(){return(Am=s._Step=s.asm.Da).apply(null,arguments)},xm=s._StridedSlice=function(){return(xm=s._StridedSlice=s.asm.Ea).apply(null,arguments)},bm=s._Sub=function(){return(bm=s._Sub=s.asm.Fa).apply(null,arguments)},vm=s._Sum=function(){return(vm=s._Sum=s.asm.Ga).apply(null,arguments)},wm=s._Tan=function(){return(wm=s._Tan=s.asm.Ha).apply(null,arguments)},km=s._Tanh=function(){return(km=s._Tanh=s.asm.Ia).apply(null,arguments)},Im=s._Tile=function(){return(Im=s._Tile=s.asm.Ja).apply(null,arguments)},Sm=s._TopK=function(){return(Sm=s._TopK=s.asm.Ka).apply(null,arguments)},Nm=s._Transform=function(){return(Nm=s._Transform=s.asm.La).apply(null,arguments)},Tm=s._Transpose=function(){return(Tm=s._Transpose=s.asm.Ma).apply(null,arguments)},Cm=s.__FusedMatMul=function(){return(Cm=s.__FusedMatMul=s.asm.Na).apply(null,arguments)},Em=s._malloc=function(){return(Em=s._malloc=s.asm.Oa).apply(null,arguments)},Rm=s._free=function(){return(Rm=s._free=s.asm.Pa).apply(null,arguments)},_p=s.___errno_location=function(){return(_p=s.___errno_location=s.asm.Qa).apply(null,arguments)},Pp=s.stackSave=function(){return(Pp=s.stackSave=s.asm.Ra).apply(null,arguments)},Lp=s.stackRestore=function(){return(Lp=s.stackRestore=s.asm.Sa).apply(null,arguments)},wu=s.stackAlloc=function(){return(wu=s.stackAlloc=s.asm.Ta).apply(null,arguments)};s.cwrap=K;var ro;function Mm(Y){this.name="ExitStatus",this.message="Program terminated with exit("+Y+")",this.status=Y}or=function Y(){ro||ku(),ro||(or=Y)};function ku(Y){if(Y=Y||d,ma>0||(na(),ma>0))return;function ae(){ro||(ro=!0,s.calledRun=!0,!O&&(Pn(),dn(),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),tn()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),ae()},1)):ae()}if(s.run=ku,s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return ku(),r.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModule=n)}),uS=xt((e,t)=>{(function(n,a,r){function s(u){var d=this,p=l();d.next=function(){var c=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=c-(d.c=c|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(u),d.s0<0&&(d.s0+=1),d.s1-=p(u),d.s1<0&&(d.s1+=1),d.s2-=p(u),d.s2<0&&(d.s2+=1),p=null}function i(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function o(u,d){var p=new s(u),c=d&&d.state,h=p.next;return h.int32=function(){return p.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,c&&(typeof c=="object"&&i(c,p),h.state=function(){return i(p,{})}),h}function l(){var u=4022871197,d=function(p){p=String(p);for(var c=0;c>>0,h-=u,h*=u,u=h>>>0,h-=u,u+=h*4294967296}return(u>>>0)*23283064365386963e-26};return d}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),dS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var c=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^c^c>>>8},l===(l|0)?u.x=l:d+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),pS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this,d="";u.next=function(){var c=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(c^c<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var p=0;p>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var d=new s(l),p=u&&u.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),cS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this;u.next=function(){var p=u.x,c=u.i,h,m,f;return h=p[c],h^=h>>>7,m=h^h<<24,h=p[c+1&7],m^=h^h>>>10,h=p[c+3&7],m^=h^h>>>3,h=p[c+4&7],m^=h^h<<7,h=p[c+7&7],h=h^h<<13,m^=h^h<<9,p[c]=m,u.i=c+1&7,m};function d(p,c){var h,m,f=[];if(c===(c|0))m=f[0]=c;else for(c=""+c,h=0;h0;--h)p.next()}d(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var d=new s(l),p=u&&u.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.x&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),hS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this;u.next=function(){var p=u.w,c=u.X,h=u.i,m,f;return u.w=p=p+1640531527|0,f=c[h+34&127],m=c[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=c[h]=f^m,u.i=h,f+(p^p>>>16)|0};function d(p,c){var h,m,f,g,y,A=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),f=0,g=-32;g>>15,m^=m<<4,m^=m>>>13,g>=0&&(y=y+1640531527|0,h=A[g&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(A[(c&&c.length||0)&127]=-1),f=127,g=4*128;g>0;--g)m=A[f+34&127],h=A[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,A[f]=m^h;p.w=y,p.X=A,p.i=f}d(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var d=new s(l),p=u&&u.state,c=function(){return(d.next()>>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(p.X&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),fS=xt((e,t)=>{(function(n,a,r){function s(l){var u=this,d="";u.next=function(){var c=u.b,h=u.c,m=u.d,f=u.a;return c=c<<25^c>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-c|0,u.b=c=c<<20^c>>>12^h,u.c=h=h-m|0,u.d=m<<16^h>>>16^f,u.a=f-c|0},u.a=0,u.b=0,u.c=2654435769|0,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=d.next,c.quick=c,p&&(typeof p=="object"&&i(p,d),c.state=function(){return i(d,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),mS=xt((e,t)=>{(function(n,a,r){var s=256,i=6,o=52,l="random",u=r.pow(s,i),d=r.pow(2,o),p=d*2,c=s-1,h;function m(b,w,N){var C=[];w=w==!0?{entropy:!0}:w||{};var E=A(y(w.entropy?[b,v(a)]:b==null?x():b,3),C),_=new f(C),$=function(){for(var S=_.g(i),z=u,O=0;S=p;)S/=2,z/=2,O>>>=1;return(S+O)/z};return $.int32=function(){return _.g(4)|0},$.quick=function(){return _.g(4)/4294967296},$.double=$,A(v(_.S),a),(w.pass||N||function(S,z,O,W){return W&&(W.S&&g(W,_),S.state=function(){return g(_,{})}),O?(r[l]=S,z):S})($,E,"global"in w?w.global:this==r,w.state)}function f(b){var w,N=b.length,C=this,E=0,_=C.i=C.j=0,$=C.S=[];for(N||(b=[N++]);E{var n=uS(),a=dS(),r=pS(),s=cS(),i=hS(),o=fS(),l=mS();l.alea=n,l.xor128=a,l.xorwow=r,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),gS=xt(()=>{}),_m={};Fe(_m,{bin:()=>P5,browser:()=>U5,default:()=>yS,dependencies:()=>j5,description:()=>R5,devDependencies:()=>B5,jsdelivr:()=>D5,license:()=>W5,main:()=>F5,miniprogram:()=>_5,module:()=>$5,name:()=>C5,private:()=>M5,repository:()=>L5,scripts:()=>V5,types:()=>z5,unpkg:()=>O5,version:()=>E5});var C5="@tensorflow/tfjs",E5="3.7.0",R5="An open-source machine learning framework.",M5=!1,F5="dist/tf.node.js",$5="dist/index.js",D5="dist/tf.min.js",O5="dist/tf.min.js",z5="dist/index.d.ts",_5="dist/miniprogram",P5={"tfjs-custom-module":"dist/tools/custom_module/cli.js"},L5={type:"git",url:"https://github.com/tensorflow/tfjs.git"},W5="Apache-2.0",B5={"@babel/core":"^7.9.0","@babel/polyfill":"^7.10.4","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@types/argparse":"^1.0.38","@types/jasmine":"2.8.7","@types/node":"~10.17.50","@types/shelljs":"^0.8.4","@types/yargs":"^15.0.7","clang-format":"~1.2.2",commander:"~2.14.1",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.2","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.5.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~4.2.2",shelljs:"~0.8.1","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"1.0.0-pre.50"},V5={build:"tsc && yarn build-cli && yarn bundle","build-ci":"tsc && yarn build-cli && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-converter":"cd ../tfjs-converter && yarn && yarn build","build-converter-ci":"cd ../tfjs-converter && yarn && yarn build-ci","build-data":"cd ../tfjs-data && yarn && yarn build","build-data-ci":"cd ../tfjs-data && yarn && yarn build-ci","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-converter && yarn build-data && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-converter-ci && yarn build-data-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-cli":"tsc --project ./tools/custom_module/tsconfig.json && chmod +x ./dist/tools/custom_module/cli.js","run-custom-build":"ts-node -s ./tools/custom_module/cli.ts","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && yarn build && karma start","test-dev":"karma start","test-tools":"ts-node --project ./tools/custom_module/tsconfig.json run_tools_tests.ts","test-ci":"./scripts/test-ci.sh"},j5={"@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-backend-webgl":"3.7.0","@tensorflow/tfjs-converter":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@tensorflow/tfjs-data":"3.7.0","@tensorflow/tfjs-layers":"3.7.0",argparse:"^1.0.10",chalk:"^4.1.0","core-js":"3","regenerator-runtime":"^0.13.5",yargs:"^16.0.3"},U5={"node-fetch":!1,util:!1,crypto:!1},yS={name:C5,version:E5,description:R5,private:M5,main:F5,module:$5,jsdelivr:D5,unpkg:O5,types:z5,miniprogram:_5,bin:P5,repository:L5,license:W5,devDependencies:B5,scripts:V5,dependencies:j5,browser:U5},Pm={};Fe(Pm,{browser:()=>lx,default:()=>AS,dependencies:()=>ox,description:()=>q5,devDependencies:()=>sx,engines:()=>nx,jsdelivr:()=>Z5,"jsnext:main":()=>Q5,license:()=>rx,main:()=>K5,miniprogram:()=>tx,module:()=>ex,name:()=>H5,private:()=>X5,repository:()=>ax,scripts:()=>ix,sideEffects:()=>ux,types:()=>J5,unpkg:()=>Y5,version:()=>G5});var H5="@tensorflow/tfjs-core",G5="3.7.0",q5="Hardware-accelerated JavaScript library for machine intelligence",X5=!1,K5="dist/tf-core.node.js",Z5="dist/tf-core.min.js",Y5="dist/tf-core.min.js",J5="dist/index.d.ts",Q5="dist/index.js",ex="dist/index.js",tx="dist/miniprogram",nx={yarn:">= 1.3.2"},ax={type:"git",url:"https://github.com/tensorflow/tfjs-core.git"},rx="Apache-2.0",sx={"@bazel/bazelisk":"^1.3.0","@bazel/typescript":"^0.27.8","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"link:../tfjs-backend-cpu","@types/jasmine":"~3.0.0","@types/node":"~9.6.0","@types/node-fetch":"~2.1.2","clang-format":"~1.2.4",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"6.3.2","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~3.1.0","karma-jasmine":"~4.0.1","karma-typescript":"~5.5.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~5.3.0","rollup-plugin-visualizer":"~3.3.2",shelljs:"~0.8.3","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"~1.0.0-pre.21",yargs:"~13.2.2"},ix={"build-ci":"./scripts/enumerate-tests.js --ci && tsc && yarn bundle-ci && yarn build-test-snippets",build:"node ./scripts/enumerate-tests.js && tsc && yarn bundle",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-npm":"./scripts/build-npm.sh","build-deps":"yarn build && yarn build-cpu-backend","build-cpu-backend":"cd ../tfjs-backend-cpu && yarn && yarn build","build-cpu-backend-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build:bazel":"bazelisk build //...","build-test-snippets":"yarn tsc --project ./scripts/test_snippets/tsconfig.json","format-all":"clang-format -i -style=Google --glob=src/**/*.ts","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build && rollup -c && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-webworker":"karma start --worker","run-browserstack":"karma start --browserstack","test-bundle-size":"./scripts/test-bundle-size.js","test-node":"rimraf dist/ && yarn build-deps && yarn build && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-dev":"tsc && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_node.js","test-async-backends":"rimraf dist/ && yarn build && ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-async-backends-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-snippets":"yarn build && yarn build-cpu-backend && ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts","test-snippets-ci":"ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts"},ox={"@types/long":"^4.0.1","@types/offscreencanvas":"~2019.3.0","@types/seedrandom":"2.4.27","@types/webgl-ext":"0.0.30",long:"4.0.0","node-fetch":"~2.6.1",seedrandom:"2.4.3"},lx={"node-fetch":!1,util:!1,crypto:!1,worker_threads:!1},ux=["./dist/index.js","./dist/engine.js","./dist/tensor.js","./dist/base_side_effects.js","./dist/flags.js","./dist/platforms/*.js","./dist/register_all_gradients.js","./dist/public/chained_ops/*.js","./dist/io/*.js"],AS={name:H5,version:G5,description:q5,private:X5,main:K5,jsdelivr:Z5,unpkg:Y5,types:J5,"jsnext:main":Q5,module:ex,miniprogram:tx,engines:nx,repository:ax,license:rx,devDependencies:sx,scripts:ix,dependencies:ox,browser:lx,sideEffects:ux},Lm={};Fe(Lm,{browser:()=>Nx,default:()=>xS,dependencies:()=>Sx,description:()=>cx,devDependencies:()=>wx,jsdelivr:()=>mx,"jsnext:main":()=>Ax,license:()=>vx,main:()=>fx,miniprogram:()=>bx,module:()=>xx,name:()=>dx,peerDependencies:()=>Ix,private:()=>hx,scripts:()=>kx,types:()=>yx,unpkg:()=>gx,version:()=>px});var dx="@tensorflow/tfjs-data",px="3.7.0",cx="TensorFlow Data API in JavaScript",hx=!1,fx="dist/tf-data.node.js",mx="dist/tf-data.min.js",gx="dist/tf-data.min.js",yx="dist/index.d.ts",Ax="dist/index.js",xx="dist/index.js",bx="dist/miniprogram",vx="Apache-2.0",wx={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@tensorflow/tfjs-layers":"3.7.0","@types/jasmine":"~2.5.53","@types/seedrandom":"^2.4.27","@types/utf8":"~2.1.6","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",nyc:"^15.1.0",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~7.0.0",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"^1.0.0-pre.50"},kx={build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-backend-cpu-ci","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-dev":"tsc && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-browsers":"karma start --browsers='Chrome,Firefox'","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/test_node.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts",coverage:"yarn nyc yarn ts-node --transpile-only -P tsconfig.test.json src/test_node.ts",lint:"tslint -p . -t verbose"},Ix={"@tensorflow/tfjs-core":"3.7.0",seedrandom:"~2.4.3"},Sx={"@types/node-fetch":"^2.1.2","node-fetch":"~2.6.1"},Nx={fs:!1,"node-fetch":!1,string_decoder:!1,crypto:!1},xS={name:dx,version:px,description:cx,private:hx,main:fx,jsdelivr:mx,unpkg:gx,types:yx,"jsnext:main":Ax,module:xx,miniprogram:bx,license:vx,devDependencies:wx,scripts:kx,peerDependencies:Ix,dependencies:Sx,browser:Nx},Wm={};Fe(Wm,{default:()=>bS,description:()=>Ex,devDependencies:()=>Lx,jsdelivr:()=>zx,"jsnext:main":()=>Dx,license:()=>Rx,main:()=>Fx,miniprogram:()=>Px,module:()=>Ox,name:()=>Tx,peerDependencies:()=>Bx,private:()=>Mx,scripts:()=>Wx,types:()=>$x,unpkg:()=>_x,version:()=>Cx});var Tx="@tensorflow/tfjs-layers",Cx="3.7.0",Ex="TensorFlow layers API in JavaScript",Rx="Apache-2.0 AND MIT",Mx=!1,Fx="dist/tf-layers.node.js",$x="dist/index.d.ts",Dx="dist/index.js",Ox="dist/index.js",zx="dist/tf-layers.min.js",_x="dist/tf-layers.min.js",Px="dist/miniprogram",Lx={"@babel/polyfill":"^7.8.7","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-backend-webgl":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@types/jasmine":"~2.5.53","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},Wx={prep:"yarn install && yarn build-ci",build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-npm":"./scripts/build-npm.sh",format:"./tools/clang_format_ts.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts","run-browserstack":"karma start --browsers='bs_chrome_mac' --singleRun --reporters='dots,karma-typescript'",lint:"tslint -p . -t verbose"},Bx={"@tensorflow/tfjs-core":"3.7.0"},bS={name:Tx,version:Cx,description:Ex,license:Rx,private:Mx,main:Fx,types:$x,"jsnext:main":Dx,module:Ox,jsdelivr:zx,unpkg:_x,miniprogram:Px,devDependencies:Lx,scripts:Wx,peerDependencies:Bx},Bm={};Fe(Bm,{default:()=>vS,description:()=>Ux,devDependencies:()=>tb,jsdelivr:()=>Zx,"jsnext:main":()=>Gx,license:()=>Qx,main:()=>Hx,miniprogram:()=>Yx,module:()=>qx,name:()=>Vx,peerDependencies:()=>eb,repository:()=>Jx,scripts:()=>nb,types:()=>Xx,unpkg:()=>Kx,version:()=>jx});var Vx="@tensorflow/tfjs-converter",jx="3.7.0",Ux="Tensorflow model converter for javascript",Hx="dist/tf-converter.node.js",Gx="dist/index.js",qx="dist/index.js",Xx="dist/index.d.ts",Kx="dist/tf-converter.min.js",Zx="dist/tf-converter.min.js",Yx="dist/miniprogram",Jx={type:"git",url:"https://github.com/tensorflow/tfjs-converter.git"},Qx="Apache-2.0",eb={"@tensorflow/tfjs-core":"3.7.0"},tb={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-replace":"^2.3.3","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.7.0","@tensorflow/tfjs-core":"3.7.0","@types/argparse":"^1.0.38","@types/deep-equal":"^1.0.1","@types/jasmine":"~2.8.6","@types/long":"~3.0.32","@types/node-fetch":"1.6.9",ajv:"~6.3.0",argparse:"^1.0.10","babel-core":"~6.26.3","babel-plugin-external-helpers":"~6.22.0","babel-preset-env":"~1.7.0","clang-format":"~1.2.2",copyfiles:"~1.2.0","deep-equal":"^1.0.1","jasmine-core":"~3.5.0","node-fetch":"~2.6.1",opn:"~5.1.0",protobufjs:"~6.8.6",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-morph":"^7.1.3","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"~0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},nb={build:"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle","build-ci":"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && yarn gen-json --test && yarn gen-kernel2ops && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/run_tests.ts","test-dev":"tsc && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts",lint:"tslint -p . -t verbose","make-version":"sh -c ./scripts/make-version","gen-doc":"ts-node -s ./scripts/gen_doc.ts","gen-json":"ts-node -s ./scripts/gen_json.ts","model-summary":"ts-node -s ./tools/model_summary.ts",pb2json:"ts-node -s ./tools/pb2json_converter.ts","build-pip-package":"yarn gen-json --test && cd python && ./build-pip-package.sh --test /tmp/tfjs-pips","run-python-tests":"yarn gen-json --test && cd python && ./run-python-tests.sh","gen-kernel2ops":"ts-node -s scripts/kernels_to_ops.ts --out metadata/kernel2op.json"},vS={name:Vx,version:jx,description:Ux,main:Hx,"jsnext:main":Gx,module:qx,types:Xx,unpkg:Kx,jsdelivr:Zx,miniprogram:Yx,repository:Jx,license:Qx,peerDependencies:eb,devDependencies:tb,scripts:nb},wS=1e-7,kS=1e-4,Up=class{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}},Eu=class{refCount(e){return ga("refCount")}incRef(e){return ga("incRef")}timerAvailable(){return!0}time(e){return ga("time")}read(e){return ga("read")}readSync(e){return ga("readSync")}numDataIds(){return ga("numDataIds")}disposeData(e,t){return ga("disposeData")}write(e,t,n){return ga("write")}move(e,t,n,a,r){return ga("move")}memory(){return ga("memory")}floatPrecision(){return ga("floatPrecision")}epsilon(){return this.floatPrecision()===32?wS:kS}dispose(){return ga("dispose")}};function ga(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function ab(e){let t=e.length,n=0,a=0;for(;t>0;)a=Math.random()*t|0,t--,n=e[t],e[t]=e[a],e[a]=n}function IS(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,a,r,s=0;for(;n>0;)s=Math.random()*n|0,n--,a=e[n],r=t[n],e[n]=e[s],t[n]=t[s],e[s]=a,t[s]=r}function Ru(e,t,n){return Math.max(e,Math.min(t,n))}function SS(e){return e%2==0?e:e+1}function NS(e){let t=0;for(let n=0;nn+` Shapes ${e} and ${t} must match`)}function ys(e){D(e!=null,()=>"The input to the tensor constructor must be a non-null value.")}function As(e,t=[],n=!1){if(t==null&&(t=[]),Array.isArray(e)||on(e)&&!n)for(let a=0;a0,n){return new Promise((a,r)=>{let s=0,i=()=>{if(e()){a();return}s++;let o=t(s);if(n!=null&&s>=n){r();return}setTimeout(i,o)};i()})}function DS(e,t){let n=1,a=-1;for(let s=0;s=0)n*=e[s];else if(e[s]===-1){if(a!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${a} and dim ${s}`);a=s}else if(e[s]<0)throw Error(`Shapes can not be < 0. Found ${e[s]} at dim ${s}`);if(a===-1){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(n===0)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);let r=e.slice();return r[a]=t/n,r}function ya(e,t){let n=t.length;return e=e==null?t.map((a,r)=>r):[].concat(e),D(e.every(a=>a>=-n&&a`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),D(e.every(a=>qt(a)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(a=>a<0?n+a:a)}function rb(e,t){let n=[],a=[],r=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||r?null:ya(t,e).sort(),i=0;for(let o=0;oo)&&e[o]===1&&(n.push(e[o]),a.push(o)),s[i]<=o&&i++}e[o]!==1&&(n.push(e[o]),a.push(o))}return{newShape:n,keptDims:a}}function sb(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else throw new Error(`Unknown data type ${e}`);return n}function ib(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else if(e==="string")n=new Array(t);else throw new Error(`Unknown data type ${e}`);return n}function ob(e,t){for(let n=0;nt+=n.length),t}function $r(e){return typeof e=="string"||e instanceof String}function db(e){return typeof e=="boolean"}function pb(e){return typeof e=="number"}function Hp(e){return Array.isArray(e)?Hp(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":pb(e)?"float32":$r(e)?"string":db(e)?"bool":"float32"}function Dr(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Gp(e,t){for(let n=t;n=0;--a)n[a]=n[a+1]*e[a+1];return n}function cb(e,t,n,a=!1){let r=new Array;if(t.length===1){let s=t[0]*(a?2:1);for(let i=0;il*u)*(a?2:1);for(let l=0;lr*s)*(n?2:1);if(a===0)return[];if(a!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return cb(0,e,t,n)}function jm(e,t){let n=qp(e,t);for(let a=0;aa*r,1);if(t==null||t==="float32")return fo(e,new Float32Array(n));if(t==="int32")return fo(e,new Int32Array(n));if(t==="bool")return fo(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function Um(e){e.forEach(t=>{D(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function _S(e,t,n){if(t===0)return 0;if(t===1)return e[0];let a=e[e.length-1];for(let r=0;r{let[n,a]=t.split(":");this.urlFlags[n]=BS(n,a)})}};function LS(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...a)=>(WS(t,a[0],a[1]),a.join("="))),t}function WS(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}function BS(e,t){if(t=t.toLowerCase(),t==="true"||t==="false")return t==="true";if(`${+t}`===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}function te(){return sa}var sa=null;function VS(e){sa=e}var Gm;function mb(){if(Gm==null){let e;if(typeof window!="undefined")e=window;else if(typeof global!="undefined")e=global;else if(typeof process!="undefined")e=process;else if(typeof self!="undefined")e=self;else throw new Error("Could not find a global object");Gm=e}return Gm}function jS(){let e=mb();return e._tfGlobals==null&&(e._tfGlobals=new Map),e._tfGlobals}function qm(e,t){let n=jS();if(n.has(e))return n.get(e);{let a=t();return n.set(e,a),n.get(e)}}var mo="Abs",go="Acos",yo="Acosh",Or="Add",xs="AddN",Ao="All",xo="Any",bs="ArgMax",Fu="ArgMin",bo="Asin",vo="Asinh",wo="Atan",ko="Atanh",Io="Atan2",vs="AvgPool",Xp="AvgPoolGrad",$u="AvgPool3D",Kp="AvgPool3DGrad",ws="BatchMatMul",Du="BatchToSpaceND",Zp="Bincount",gb="BroadcastTo",ks="Cast",Is="Ceil",zr="ClipByValue",Yp="Complex",Ou="ComplexAbs",So="Concat",Ss="Conv2D",Jp="Conv2DBackpropFilter",Ns="Conv2DBackpropInput",zu="Conv3D",Qp="Conv3DBackpropFilterV2",ec="Conv3DBackpropInputV2",Ts="Cos",No="Cosh",Cs="Cumsum",To="CropAndResize",tc="DenseBincount",Co="DepthToSpace",Es="DepthwiseConv2dNative",nc="DepthwiseConv2dNativeBackpropFilter",ac="DepthwiseConv2dNativeBackpropInput",rc="Diag",_u="Dilation2D",sc="Dilation2DBackpropInput",ic="Dilation2DBackpropFilter",Rs="RealDiv",oc="Einsum",Eo="Elu",lc="EluGrad",Ro="Erf",Mo="Equal",Ms="Exp",Fo="ExpandDims",$o="Expm1",uc="FFT",Pu="Fill",Do="FlipLeftRight",Fs="Floor",$s="FloorDiv",Ds="FusedBatchNorm",Oo="GatherV2",zo="GatherNd",_o="Greater",Os="GreaterEqual",zs="Identity",dc="IFFT",pc="Imag",Po="IsFinite",Lo="IsInf",Wo="IsNan",_s="LeakyRelu",Bo="Less",Vo="LessEqual",cc="LinSpace",Ps="Log",jo="Log1p",Uo="LogicalAnd",Lu="LogicalNot",Wu="LogicalOr",yb="LogSoftmax",Bu="LRN",hc="LRNGrad",Ls="Max",Ws="Maximum",Bs="MaxPool",fc="MaxPoolGrad",Vu="MaxPool3D",mc="MaxPool3DGrad",gc="MaxPoolWithArgmax",Vs="Mean",js="Min",Us="Minimum",Hs="MirrorPad",Ho="Mod",yc="Multinomial",Gs="Multiply",Go="Neg",qo="NotEqual",Xo="NonMaxSuppressionV3",Ko="NonMaxSuppressionV4",Zo="NonMaxSuppressionV5",Yo="OnesLike",qs="OneHot",Jo="Pack",Xs="PadV2",US="Pool",Ks="Pow",Zs="Prelu",Qo="Prod",ju="Range",Ac="Real",el="Reciprocal",Ys="Relu",tl="Reshape",Uu="ResizeNearestNeighbor",xc="ResizeNearestNeighborGrad",Js="ResizeBilinear",bc="ResizeBilinearGrad",Qs="Relu6",ei="Reverse",ti="Round",ni="Rsqrt",nl="ScatterNd",al="Select",rl="Selu",sl="Slice",ai="Sin",il="Sinh",ol="Sign",ri="Sigmoid",ll="Softplus",si="Sqrt",ii="Sum",Hu="SpaceToBatchND",ul="SplitV",oi="Softmax",vc="SparseFillEmptyRows",wc="SparseReshape",kc="SparseSegmentMean",Ic="SparseSegmentSum",Sc="SparseToDense",li="SquaredDifference",Gu="Square",dl="StridedSlice",Nc="StringNGrams",Tc="StringSplit",Cc="StringToHashBucketFast",ui="Sub",di="Tan",pi="Tanh",_r="Tile",pl="TopK",cl="Transform",ci="Transpose",Ec="Unique",hl="Unpack",qu="UnsortedSegmentSum",fl="ZerosLike",Pr="Step",Rc="FromPixels",ml="RotateWithOffset",hi="_FusedMatMul",fi="FusedConv2D",mi="FusedDepthwiseConv2D",gl=qm("kernelRegistry",()=>new Map),Xu=qm("gradRegistry",()=>new Map);function Mc(e,t){let n=Km(e,t);return gl.get(n)}function Xm(e){return Xu.get(e)}function yl(e){let t=gl.entries(),n=[];for(;;){let{done:a,value:r}=t.next();if(a)break;let[s,i]=r,[o]=s.split("_");o===e&&n.push(i)}return n}function gi(e){let{kernelName:t,backendName:n}=e,a=Km(t,n);gl.has(a)&&console.warn(`The kernel '${t}' for backend '${n}' is already registered`),gl.set(a,e)}function Ab(e){let{kernelName:t}=e;Xu.has(t)&&te().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${t}'`),Xu.set(t,e)}function HS(e,t){let n=Km(e,t);if(!gl.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);gl.delete(n)}function GS(e){if(!Xu.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);Xu.delete(e)}function qS(e,t){yl(e).forEach(n=>{let a=Object.assign({},n,{backendName:t});gi(a)})}function Km(e,t){return`${t}_${e}`}var k={};Fe(k,{arraysEqual:()=>cr,assert:()=>D,assertNonNegativeIntegerDimensions:()=>Um,assertNonNull:()=>ys,assertShapesMatch:()=>cn,bytesFromStringArray:()=>ub,bytesPerElement:()=>Vm,checkConversionForErrors:()=>ob,clamp:()=>Ru,computeStrides:()=>ho,createScalarValue:()=>QS,createShuffledIndices:()=>FS,decodeString:()=>Dc,distSquared:()=>CS,encodeString:()=>Yu,fetch:()=>tN,fingerPrint64:()=>JS,flatten:()=>As,getArrayFromDType:()=>ib,getTypedArrayFromDType:()=>sb,hasEncodingLoss:()=>OS,hexToLong:()=>Ku,indexToLoc:()=>PS,inferDtype:()=>Hp,inferFromImplicitShape:()=>DS,isBoolean:()=>db,isFunction:()=>Dr,isInt:()=>qt,isNumber:()=>pb,isPromise:()=>Hm,isScalarShape:()=>ES,isString:()=>$r,isTypedArray:()=>on,isValidDtype:()=>lb,locToIndex:()=>_S,makeOnesTypedArray:()=>jm,makeZerosNestedTypedArray:()=>zS,makeZerosTypedArray:()=>qp,nearestDivisor:()=>Gp,nearestLargerEven:()=>SS,now:()=>Zu,parseAxisParam:()=>ya,randUniform:()=>TS,repeatedTry:()=>$S,rightPad:()=>Mu,shuffle:()=>ab,shuffleCombo:()=>IS,sizeFromShape:()=>Mt,sizeToSquarishShape:()=>MS,squeezeShape:()=>rb,sum:()=>NS,tanh:()=>RS,toNestedArray:()=>fo,toTypedArray:()=>$c});var xb=gs(ZI()),yi=xb.default||xb;function Ku(e){return yi.fromString(e,!0,16)}var bb=Ku("c3a5c85c97cb3127"),Ai=Ku("b492b66fbe98f273"),hn=Ku("9ae16a3b2f90404f");function Zm(e){return e.xor(e.shru(47))}function vb(e,t,n){let a=e.slice(t,t+n);return yi.fromBytes(Array.from(a),!0,!0)}function pt(e,t){return vb(e,t,8)}function wb(e,t){return vb(e,t,4)}function Xt(e,t){return t===0?e:e.shru(t).or(e.shl(64-t))}function Lr(e,t,n=Ku("9ddfea08eb382d69")){let a=e.xor(t).mul(n);a=a.xor(a.shru(47));let r=t.xor(a).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function XS(e,t,n,a,r,s){r=r.add(e),s=Xt(s.add(r).add(a),21);let i=r;return r=r.add(t),r=r.add(n),s=s.add(Xt(r,44)),[r.add(a),s.add(i)]}function Fc(e,t,n,a){return XS(pt(e,t),pt(e,t+8),pt(e,t+16),pt(e,t+24),n,a)}function KS(e,t=e.length){if(t>=8){let n=hn.add(t*2),a=pt(e,0).add(hn),r=pt(e,t-8),s=Xt(r,37).mul(n).add(a),i=Xt(a,25).add(r).mul(n);return Lr(s,i,n)}if(t>=4){let n=hn.add(t*2),a=wb(e,0);return Lr(a.shl(3).add(t),wb(e,t-4),n)}if(t>0){let n=e[0],a=e[t>>1],r=e[t-1],s=n+(a<<8),i=t+(r<<2);return Zm(hn.mul(s).xor(bb.mul(i))).mul(hn)}return hn}function ZS(e,t=e.length){let n=hn.add(t*2),a=pt(e,0).mul(Ai),r=pt(e,8),s=pt(e,t-8).mul(n),i=pt(e,t-16).mul(hn);return Lr(Xt(a.add(r),43).add(Xt(s,30)).add(i),a.add(Xt(r.add(hn),18)).add(s),n)}function YS(e,t=e.length){let n=hn.add(t*2),a=pt(e,0).mul(hn),r=pt(e,8),s=pt(e,t-8).mul(n),i=pt(e,t-16).mul(hn),o=Xt(a.add(r),43).add(Xt(s,30)).add(i),l=Lr(o,a.add(Xt(r.add(hn),18)).add(s),n),u=pt(e,16).mul(n),d=pt(e,24),p=o.add(pt(e,t-32)).mul(n),c=l.add(pt(e,t-24)).mul(n);return Lr(Xt(u.add(d),43).add(Xt(p,30)).add(c),u.add(Xt(d.add(a),18)).add(p),n)}function JS(e,t=e.length){let n=yi.fromNumber(81,!0);if(t<=32)return t<=16?KS(e,t):ZS(e,t);if(t<=64)return YS(e,t);let a=n,r=n.mul(Ai).add(113),s=Zm(r.mul(hn).add(113)).mul(hn),i=[yi.UZERO,yi.UZERO],o=[yi.UZERO,yi.UZERO];a=a.mul(hn).add(pt(e,0));let l=0,u=(t-1>>6)*64,d=u+(t-1&63)-63;do a=Xt(a.add(r).add(i[0]).add(pt(e,l+8)),37).mul(Ai),r=Xt(r.add(i[1]).add(pt(e,l+48)),42).mul(Ai),a=a.xor(o[1]),r=r.add(i[0]).add(pt(e,l+40)),s=Xt(s.add(o[0]),33).mul(Ai),i=Fc(e,l,i[1].mul(Ai),a.add(o[0])),o=Fc(e,l+32,s.add(o[1]),r.add(pt(e,l+16))),[s,a]=[a,s],l+=64;while(l!==u);let p=Ai.add(s.and(255).shl(1));return l=d,o[0]=o[0].add(t-1&63),i[0]=i[0].add(o[0]),o[0]=o[0].add(i[0]),a=Xt(a.add(r).add(i[0]).add(pt(e,l+8)),37).mul(p),r=Xt(r.add(i[1]).add(pt(e,l+48)),42).mul(p),a=a.xor(o[1].mul(9)),r=r.add(i[0].mul(9).add(pt(e,l+40))),s=Xt(s.add(o[0]),33).mul(p),i=Fc(e,l,i[1].mul(p),a.add(o[0])),o=Fc(e,l+32,s.add(o[1]),r.add(pt(e,l+16))),[s,a]=[a,s],Lr(Lr(i[0],o[0],p).add(Zm(r).mul(bb)).add(s),Lr(i[1],o[1],p).add(a),p)}function QS(e,t){return t==="string"?Yu(e):$c([e],t)}function eN(e,t){return e instanceof Float32Array&&t==="float32"||e instanceof Int32Array&&t==="int32"||e instanceof Uint8Array&&t==="bool"}function $c(e,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=As(e)),te().getBool("DEBUG")&&ob(e,t),eN(e,t))return e;if(t==null||t==="float32"||t==="complex64")return new Float32Array(e);if(t==="int32")return new Int32Array(e);if(t==="bool"){let n=new Uint8Array(e.length);for(let a=0;a{a=n()},s,i=Zu();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(r);else{r();for(let o of a)o.dataSync();s=Promise.resolve({kernelMs:Zu()-i})}if(te().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let o=0;o{aN(u,l.dtype,e)})}return{kernelName:e,outputs:a,inputs:t,timeMs:s.then(o=>o.kernelMs),extraInfo:s.then(o=>o.getExtraProfileInfo!=null?o.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:n,timeMs:a,inputs:r,extraInfo:s}=e;n.forEach(i=>{Promise.all([i.data(),a,s]).then(o=>{this.logger.logKernelProfile(t,i,o[0],o[1],r,o[2])})})}};function aN(e,t,n){if(t!=="float32")return!1;for(let a=0;a0?m:""} `}}console.log(`%c${o} %c${i} %c${l}D ${d} %c${u} %c${p} %c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function sN(e,t,n){let a={},r={};for(let l=0;la[f.id]=!0),h=!0,r[u.id]=!0;break}if(h)break}}let s={};s[n.id]=!0;let i={};for(let l=e.length-1;l>=0;l--){let u=e[l],d=u.inputs;for(let p=0;p=0;r--){let s=t[r],i=[];if(s.outputs.forEach(l=>{let u=e[l.id];u!=null?i.push(u):i.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let o=s.gradient(i);for(let l in s.inputs){if(!(l in o))throw new Error(`Cannot backprop through input ${l}. Available gradients found: ${Object.keys(o)}.`);let u=n(()=>o[l]());if(u.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${l} must have 'float32' dtype, but has '${u.dtype}'`);let d=s.inputs[l];if(!cr(u.shape,d.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${l}' has shape '${u.shape}', which does not match the shape of the input '${d.shape}'`);if(e[d.id]==null)e[d.id]=u;else{let p=e[d.id];e[d.id]=a(p,u),p.dispose()}}}}var kb=20,Ju=3,Ym=7;function oN(e,t,n,a){let r=ho(t),s=lN(e,t,n,r),i=t.length,o=Oc(e,t,n,r,s),l=["Tensor"];return a&&(l.push(` dtype: ${n}`),l.push(` rank: ${i}`),l.push(` shape: [${t}]`),l.push(" values:")),l.push(o.map(u=>" "+u).join(` +`)),l.join(` +`)}function lN(e,t,n,a){let r=Mt(t),s=a[a.length-1],i=new Array(s).fill(0),o=t.length,l=n==="complex64"?ed(e):e;if(o>1)for(let u=0;ukb){let g=Ju*i,y=Array.from(e.slice(0,g)),A=Array.from(e.slice((o-Ju)*i,o*i));return n==="complex64"&&(y=ed(y),A=ed(A)),["["+y.map((x,v)=>Qu(x,r[v],n)).join(", ")+", ..., "+A.map((x,v)=>Qu(x,r[o-Ju+v],n)).join(", ")+"]"]}let f=n==="complex64"?ed(e):Array.from(e);return["["+f.map((g,y)=>Qu(g,r[y],n)).join(", ")+"]"]}let u=t.slice(1),d=a.slice(1),p=a[0]*i,c=[];if(o>kb){for(let f=0;f`Length of values '${a}' 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=n||ib(t,this.size),this.strides=ho(e)}set(e,...t){t.length===0&&(t=[0]),D(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let n=this.locToIndex(t);this.values[n]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let a of e){if(a<0||a>=this.shape[t]){let r=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(r)}t++}let n=e[e.length-1];for(let a=0;aDc(n))}catch(n){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();let e=ja().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>Dc(t))}catch(t){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();let e=await ja().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(ja().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Al.print(this,e)}clone(){return this.throwIfDisposed(),Al.clone(this)}toString(e=!1){let t=this.dataSync();return oN(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Al.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),ja().makeVariable(this,e,t,n)}};Object.defineProperty(Be,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function ee(){return qm("Tensor",()=>Be)}ee();var td=class extends Be{constructor(e,t,n,a){super(e.shape,e.dtype,e.dataId,a);this.trainable=t,this.name=n}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(!cr(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);ja().disposeTensor(this),this.dataId=e.dataId,ja().incRef(this,null)}dispose(){ja().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(td,Symbol.hasInstance,{value:e=>e instanceof Be&&e.assign!=null&&e.assign instanceof Function});var Sa={};Fe(Sa,{assertTypesMatch:()=>Sb,getTensorsInContainer:()=>a1,isTensorInList:()=>fN,makeTypesMatch:()=>It});var Jm;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(Jm||(Jm={}));var Qm;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(Qm||(Qm={}));var e1;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(e1||(e1={}));var t1;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(t1||(t1={}));var n1;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(n1||(n1={}));var hN={float32:t1,int32:Qm,bool:e1,complex64:n1};function Aa(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return hN[e][t]}function zc(e){return Aa(e,"int32")}function It(e,t){if(e.dtype===t.dtype)return[e,t];let n=Aa(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Sb(e,t){D(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function fN(e,t){return t.some(n=>n.id===e.id)}function a1(e){let t=[],n=new Set;return Nb(e,t,n),t}function Nb(e,t,n){if(e==null)return;if(e instanceof Be){t.push(e);return}if(!mN(e))return;let a=e;for(let r in a){let s=a[r];n.has(s)||(n.add(s),Nb(s,t,n))}}function mN(e){return Array.isArray(e)||typeof e=="object"}function r1(e){return e.kernelName!=null}var Tb=class{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(let e in this.registeredVariables)this.registeredVariables[e].dispose()}},nd=class{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Tb}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){yl(e).forEach(t=>{t.disposeFunc!=null&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{let n=t.factory();if(n&&!(n instanceof Eu)&&typeof n.then=="function"){let a=++this.pendingBackendInitId,r=n.then(s=>a(athis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(a),()=>(a=t(),a instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),a))}scopedRun(e,t,n){e();try{let a=n();return t(),a}catch(a){throw t(),a}}nextTensorId(){return nd.nextTensorId++}nextVariableId(){return nd.nextVariableId++}clone(e){let t=P.runKernel(zs,{x:e}),n={x:e},a=s=>({x:()=>{let i="float32",o={x:s},l={dtype:i};return P.runKernel(ks,o,l)}}),r=[];return this.addTapeNode(this.state.activeScope.name,n,[t],a,r,{}),t}runKernel(e,t,n){if(Mc(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){let a=this.backend.numDataIds(),r=0;n.forEach(o=>{r+=o.dtype==="complex64"?3:1});let s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=a-t-r-s;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[],a=this.isTapeOn(),r=this.state.numBytes,s=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let o,l=r1(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(r1(e)){let{kernelName:h,inputs:m,attrs:f}=e;this.backendName==null&&this.backend;let g=Mc(h,this.backendName);D(g!=null,()=>`Cannot find registered kernel '${h}' for backend '${this.backendName}'`),i=()=>{let y=this.backend.numDataIds();o=g.kernelFunc({inputs:m,attrs:f,backend:this.backend});let A=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(h,y,A);let x=A.map(v=>{if(v.rank!=null)return v;let{dataId:b,shape:w,dtype:N}=v;return this.makeTensorFromDataId(b,w,N)});if(a){let v=this.getTensorsForGradient(h,m,x);n=this.saveTensorsForBackwardMode(v)}return x}}else{let{forwardFunc:h}=e,m=f=>{!a||(n=f.map(g=>this.keep(this.clone(g))))};i=()=>{let f=this.backend.numDataIds();o=this.tidy(()=>h(this.backend,m));let g=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,f,g),g}}let{inputs:u,attrs:d}=e,p=r1(e)?null:e.backwardsFunc,c;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=i():(c=this.profiler.profileKernel(l,u,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(c),t=c.outputs)}),a&&this.addTapeNode(l,u,t,p,n,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map(h=>u[h]!=null?u[h].shape:null),outputShapes:t.map(h=>h.shape),kernelTimeMs:c.timeMs,extraInfo:c.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(e,t,n){let a=Xm(e);if(a!=null){let r=a.inputsToSave||[],s=a.outputsToSave||[],i;a.saveAllInputs?(D(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(l=>t[l])):i=r.map(l=>t[l]);let o=n.filter((l,u)=>s[u]);return i.concat(o)}return[]}makeTensor(e,t,n,a){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",a=a||this.backend;let r=e;n==="string"&&$r(e[0])&&(r=e.map(o=>Yu(o)));let s=a.write(r,t,n),i=new Be(t,n,s,this.nextTensorId());if(this.trackTensor(i,a),n==="string"){let o=this.state.tensorInfo.get(s),l=ub(r);this.state.numBytes+=l-o.bytes,o.bytes=l}return i}makeTensorFromDataId(e,t,n,a){n=n||"float32";let r=new Be(t,n,e,this.nextTensorId());return this.trackTensor(r,a),r}makeVariable(e,t=!0,n,a){n=n||this.nextVariableId().toString(),a!=null&&a!==e.dtype&&(e=e.cast(a));let r=new td(e,t,n,this.nextTensorId());if(this.state.registeredVariables[r.name]!=null)throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let n=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(n=e.size*Vm(e.dtype)),this.state.numBytes+=n,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:n})),e instanceof td||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;let 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"){let n=e.size*Vm(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(let e in this.state.registeredVariables){let 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(){let 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;let t=this.state.numBytes,n=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(a=>a.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(let a of this.state.activeProfile.kernels)a.kernelTimeMs=await a.kernelTimeMs,a.extraInfo=await a.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,n,a,r,s){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=Xm(e);o!=null&&(a=o.gradFunc),a!=null&&(i.gradient=l=>(l=l.map((u,d)=>{if(u==null){let p=n[d],c=qp(p.size,p.dtype);return this.makeTensor(c,p.shape,p.dtype)}return u}),a(l.length>1?l:l[0],r,s))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){let t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){let t=a1(e),n=new Set(t.map(r=>r.id));for(let r=0;r{!r.kept&&r.scopeId===a.id&&this.track(r)})}gradients(e,t,n,a=!1){if(D(t.length>0,()=>"gradients() received an empty list of xs."),n!=null&&n.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);let r=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));D(r instanceof Be,()=>"The result y returned by f() must be a tensor.");let s=sN(this.state.activeTape,t,r);if(!a&&s.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",()=>{let i={};i[r.id]=n==null?gN(r.shape):n,iN(i,s,l=>this.tidy(l),yN);let o=t.map(l=>i[l.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(l=>{for(let u of l.saved)u.dispose()}),this.state.activeTape=null),{value:r,grads:o}})}customGrad(e){return D(Dr(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{D(t.every(i=>i instanceof Be),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,a={};t.forEach((i,o)=>{a[o]=i});let r=(i,o)=>(n=e(...t,o),D(n.value instanceof Be,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),D(Dr(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),s=(i,o)=>{let l=n.gradFunc(i,o),u=Array.isArray(l)?l:[l];D(u.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(...)."),D(u.every(p=>p instanceof Be),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");let d={};return u.forEach((p,c)=>{d[c]=()=>p}),d};return this.runKernelFunc({forwardFunc:r,backwardsFunc:s,inputs:a})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){let t=Zu(),n=await this.backend.time(e);return n.wallMs=Zu()-t,n}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 Tb;for(let e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};nd.nextTensorId=0;nd.nextVariableId=0;function gN(e){let t=jm(Mt(e),"float32");return P.makeTensor(t,e,"float32")}function Cb(){let e=mb();if(e._tfengine==null){let t=new fb(e);e._tfengine=new nd(t)}return VS(e._tfengine.ENV),dN(()=>e._tfengine),e._tfengine}var P=Cb();function yN(e,t){let n={a:e,b:t};return P.runKernel(Or,n)}var ad={};Fe(ad,{isBrowser:()=>Eb,isMobile:()=>xN});function AN(){return typeof navigator!="undefined"&&navigator!=null}function xN(e){if(e||AN()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||window.opera;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(t)||/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(t.substr(0,4))}return!1}function Eb(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var Na=te();Na.registerFlag("DEBUG",()=>!1,e=>{e&&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.")});Na.registerFlag("IS_BROWSER",()=>Eb());Na.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");Na.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Na.registerFlag("PROD",()=>!1);Na.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>Na.getBool("DEBUG"));Na.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);Na.registerFlag("IS_TEST",()=>!1);Na.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0);Na.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);function Ua(e,t){let n=e;if(on(e))return t==="string"?[]:[e.length];if(!Array.isArray(e))return[];let a=[];for(;Array.isArray(n)||on(n)&&t!=="string";)a.push(n.length),n=n[0];return Array.isArray(e)&&te().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Rb(e,a,[]),a}function Rb(e,t,n){if(n=n||[],!Array.isArray(e)&&!on(e)){D(t.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}D(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),D(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let a=t.slice(1);for(let r=0;r=0&&(r=a),Mb(a,r,t,n),e==null||!on(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string"){let o=e==null?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${o}'`)}let s=Ua(e,r);!on(e)&&!Array.isArray(e)&&(e=[e]);let i=r!=="string"?$c(e,r):As(e,[],!0);return P.makeTensor(i,s,r)}function rd(e,t,n,a="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((r,s)=>M(r,`${t}[${s}]`,n,a))}var Fb="__op";function L(e){let t=Object.keys(e);if(t.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0],a=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+Fb;let r=(...s)=>{P.startScope(n);try{let i=a(...s);return Hm(i)&&console.error("Cannot return a Promise inside of tidy."),P.endScope(i),i}catch(i){throw P.endScope(null),i}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}function bN(e,t){let n=M(e,"real","complex"),a=M(t,"imag","complex");cn(n.shape,a.shape,`real and imag shapes, ${n.shape} and ${a.shape}, must match in call to tf.complex().`);let r={real:n,imag:a};return P.runKernel(Yp,r)}var Wr=L({complex_:bN});function Br(e,t,n,a){if(a==null&&(a=Hp(e)),a==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!on(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="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(t!=null){Um(t);let r=Mt(t),s=Mt(n);D(r===s,()=>`Based on the provided shape, [${t}], the tensor should have ${r} values but has ${s}`);for(let i=0;i`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return!on(e)&&!Array.isArray(e)&&(e=[e]),t=t||n,e=a!=="string"?$c(e,a):As(e,[],!0),P.makeTensor(e,t,a)}function ln(e,t,n){let a=Ua(e,n);return Br(e,t,a,n)}var s1={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},_c=4;async function vN(e,t){let n=[],a=[],r=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let c=await l.bytes(),h=c.reduce((g,y)=>g+y.length,0)+_c*c.length,m=new Uint8Array(h),f=0;for(let g=0;g{if(t+=s.byteLength,n.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}`)});let a=new Uint8Array(t),r=0;return n.forEach(s=>{a.set(new Uint8Array(s.buffer),r),r+=s.byteLength}),a.buffer}var i1=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function Db(e){return i1?Buffer.byteLength(e):new Blob([e]).size}function kN(e){if(i1)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),n="";for(let a=0,r=t.length;a{t+=r.byteLength});let n=new Uint8Array(t),a=0;return e.forEach(r=>{n.set(new Uint8Array(r),a),a+=r.byteLength}),n.buffer}function Ob(e){let t="/";for(e=e.trim();e.endsWith(t);)e=e.slice(0,e.length-1);let n=e.split(t);return n[n.length-1]}function sd(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:e.modelTopology==null?0:Db(JSON.stringify(e.modelTopology)),weightSpecsBytes:e.weightSpecs==null?0:Db(JSON.stringify(e.weightSpecs)),weightDataBytes:e.weightData==null?0:e.weightData.byteLength}}function SN(){let e=n=>{let a=n<<13,r=0;for(;(a&8388608)==0;)r-=8388608,a<<=1;return a&=~8388608,r+=947912704,a|r},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let n=1024;n<2048;n++)t[n]=939524096+(n-1024<<13);return t}function NN(){let e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}function TN(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function CN(){let e=SN(),t=NN(),n=TN();return a=>{let r=new ArrayBuffer(4*a.length),s=new Uint32Array(r);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(r)}}var Et=class{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return Et.instance==null&&(Et.instance=new Et),Et.instance}static registerSaveRouter(e){Et.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Et.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Et.getHandlers(e,"save")}static getLoadHandlers(e,t){return Et.getHandlers(e,"load",t)}static getHandlers(e,t,n){let a=[];return(t==="load"?Et.getInstance().loadRouters:Et.getInstance().saveRouters).forEach(r=>{let s=r(e,n);s!==null&&a.push(s)}),a}},EN=e=>Et.registerSaveRouter(e),RN=e=>Et.registerLoadRouter(e),MN=e=>Et.getSaveHandlers(e),FN=(e,t)=>Et.getLoadHandlers(e,t),l1="tensorflowjs",u1=1,xi="models_store",Vr="model_info_store";function zb(){if(!te().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e=typeof window=="undefined"?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function d1(e){let t=e.result;t.createObjectStore(xi,{keyPath:"modelPath"}),t.createObjectStore(Vr,{keyPath:"modelPath"})}var bi=class{constructor(e){if(this.indexedDB=zb(),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((n,a)=>{let r=this.indexedDB.open(l1,u1);r.onupgradeneeded=()=>d1(r),r.onsuccess=()=>{let s=r.result;if(t==null){let i=s.transaction(xi,"readonly"),o=i.objectStore(xi).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),a(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));n(o.result.modelArtifacts)},o.onerror=l=>(s.close(),a(o.error)),i.oncomplete=()=>s.close()}else{let i=sd(t),o=s.transaction(Vr,"readwrite"),l=o.objectStore(Vr),u=l.put({modelPath:this.modelPath,modelArtifactsInfo:i}),d;u.onsuccess=()=>{d=s.transaction(xi,"readwrite");let p=d.objectStore(xi).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i});p.onsuccess=()=>n({modelArtifactsInfo:i}),p.onerror=c=>{l=o.objectStore(Vr);let h=l.delete(this.modelPath);h.onsuccess=()=>(s.close(),a(p.error)),h.onerror=m=>(s.close(),a(p.error))}},u.onerror=p=>(s.close(),a(u.error)),o.oncomplete=()=>{d==null?s.close():d.oncomplete=()=>s.close()}}},r.onerror=s=>a(r.error)})}};bi.URL_SCHEME="indexeddb://";var _b=e=>te().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(bi.URL_SCHEME)?$N(e.slice(bi.URL_SCHEME.length)):null;Et.registerSaveRouter(_b);Et.registerLoadRouter(_b);function $N(e){return new bi(e)}function DN(e){return e.startsWith(bi.URL_SCHEME)?e.slice(bi.URL_SCHEME.length):e}var ON=class{constructor(){this.indexedDB=zb()}async listModels(){return new Promise((e,t)=>{let n=this.indexedDB.open(l1,u1);n.onupgradeneeded=()=>d1(n),n.onsuccess=()=>{let a=n.result,r=a.transaction(Vr,"readonly"),s=r.objectStore(Vr).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(a.close(),t(s.error)),r.oncomplete=()=>a.close()},n.onerror=a=>t(n.error)})}async removeModel(e){return e=DN(e),new Promise((t,n)=>{let a=this.indexedDB.open(l1,u1);a.onupgradeneeded=()=>d1(a),a.onsuccess=()=>{let r=a.result,s=r.transaction(Vr,"readwrite"),i=s.objectStore(Vr),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let u=i.delete(e),d=()=>{l=r.transaction(xi,"readwrite");let p=l.objectStore(xi).delete(e);p.onsuccess=()=>t(o.result.modelArtifactsInfo),p.onerror=c=>n(o.error)};u.onsuccess=d,u.onerror=p=>(d(),r.close(),n(o.error))}},o.onerror=u=>(r.close(),n(o.error)),s.oncomplete=()=>{l==null?r.close():l.oncomplete=()=>r.close()}},a.onerror=r=>n(a.error)})}},hr="/",xl="tensorflowjs_models",Pb="info",zN="model_topology",_N="weight_specs",PN="weight_data",LN="model_metadata";function Lb(e){return{info:[xl,e,Pb].join(hr),topology:[xl,e,zN].join(hr),weightSpecs:[xl,e,_N].join(hr),weightData:[xl,e,PN].join(hr),modelMetadata:[xl,e,LN].join(hr)}}function WN(e){let t=e.split(hr);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(hr)}function BN(e){return e.startsWith(vi.URL_SCHEME)?e.slice(vi.URL_SCHEME.length):e}var vi=class{constructor(e){if(!te().getBool("IS_BROWSER")||typeof window=="undefined"||typeof window.localStorage=="undefined")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=Lb(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.");{let t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),a=sd(e);try{this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,kN(e.weightData));let r={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};return e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer),this.LS.setItem(this.keys.modelMetadata,JSON.stringify(r)),{modelArtifactsInfo:a}}catch(r){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${a.modelTopologyBytes}, weightSpecsBytes=${a.weightSpecsBytes}, weightDataBytes=${a.weightDataBytes}.`)}}}async load(){let 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.");let t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(n==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;let a=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(a==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=a;let r=this.LS.getItem(this.keys.modelMetadata);if(r!=null){let i=JSON.parse(r);t.format=i.format,t.generatedBy=i.generatedBy,t.convertedBy=i.convertedBy,i.signature!=null&&(t.signature=i.signature),i.userDefinedMetadata!=null&&(t.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(t.modelInitializer=i.modelInitializer)}let s=this.LS.getItem(this.keys.weightData);if(s==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=IN(s),t}};vi.URL_SCHEME="localstorage://";var Wb=e=>te().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(vi.URL_SCHEME)?VN(e.slice(vi.URL_SCHEME.length)):null;Et.registerSaveRouter(Wb);Et.registerLoadRouter(Wb);function VN(e){return new vi(e)}var jN=class{constructor(){D(te().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),D(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=xl+hr,n=hr+Pb;for(let a=0;a"scheme must not be undefined or null."),e.endsWith(bl)&&(e=e.slice(0,e.indexOf(bl))),D(e.length>0,()=>"scheme must not be an empty string.");let n=ia.getInstance();D(n.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){let t=this.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}};function Pc(e){if(e.indexOf(bl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${ia.getSchemes().join(",")}`);return{scheme:e.split(bl)[0],path:e.split(bl)[1]}}async function Bb(e,t,n=!1){D(e!==t,()=>`Old path and new path are the same: '${e}'`);let a=Et.getLoadHandlers(e);D(a.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),D(a.length<2,()=>`Copying failed because more than one (${a.length}) load handlers for source URL ${e}.`);let r=a[0],s=Et.getSaveHandlers(t);D(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),D(s.length<2,()=>`Copying failed because more than one (${a.length}) save handlers for destination URL ${t}.`);let i=s[0],o=Pc(e).scheme,l=Pc(e).path,u=o===Pc(e).scheme,d=await r.load();n&&u&&await ia.getManager(o).removeModel(l);let p=await i.save(d);return n&&!u&&await ia.getManager(o).removeModel(l),p.modelArtifactsInfo}async function UN(){let e=ia.getSchemes(),t={};for(let n of e){let a=await ia.getManager(n).listModels();for(let r in a){let s=n+bl+r;t[s]=a[r]}}return t}async function HN(e){let t=Pc(e);return ia.getManager(t.scheme).removeModel(t.path)}async function GN(e,t){return Bb(e,t,!1)}async function qN(e,t){return Bb(e,t,!0)}var XN=class{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)}};if(te().get("IS_BROWSER")){te().setPlatform("browser",new XN);try{ia.registerManager(vi.URL_SCHEME,new jN)}catch(e){}try{ia.registerManager(bi.URL_SCHEME,new ON)}catch(e){}}var KN={importFetch:()=>YI()},p1,ZN=class{constructor(){this.util=co("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return te().global.fetch!=null?te().global.fetch(e,t):(p1==null&&(p1=KN.importFetch()),p1(e,t))}now(){let 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)}};te().get("IS_NODE")&&te().setPlatform("node",new ZN);function Ve(e,t="float32",n){return t=t||"float32",Um(e),new Lt(e,t,n)}function YN(e,t){let n=M(e,"x","cast");if(!lb(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&n.dtype!=="string"||t!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");let a={x:n},r={dtype:t};return P.runKernel(ks,a,r)}var ge=L({cast_:YN});function JN(e){let t={x:M(e,"x","clone","string_or_numeric")};return P.runKernel(zs,t)}var Ha=L({clone_:JN});function Vb(e,t=!1){console.log(e.toString(t))}Cb();var QN={buffer:Ve,cast:ge,clone:Ha,print:Vb};pN(QN);var En={};Fe(En,{browserFiles:()=>iT,browserHTTPRequest:()=>pT,concatenateArrayBuffers:()=>o1,copyModel:()=>GN,decodeWeights:()=>$b,encodeWeights:()=>vN,fromMemory:()=>hT,getLoadHandlers:()=>FN,getModelArtifactsInfoForJSON:()=>sd,getSaveHandlers:()=>MN,http:()=>f1,isHTTPScheme:()=>h1,listModels:()=>UN,loadWeights:()=>oT,moveModel:()=>qN,registerLoadRouter:()=>RN,registerSaveRouter:()=>EN,removeModel:()=>HN,weightsLoaderFactory:()=>Gb,withSaveHandler:()=>fT});var eT="model",tT=".json",nT=".weights.bin";function jb(e){return new Promise(t=>setTimeout(t)).then(e)}var vl=class{constructor(e){if(!te().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(vl.URL_SCHEME)&&(e=e.slice(vl.URL_SCHEME.length)),(e==null||e.length===0)&&(e=eT),this.modelTopologyFileName=e+tT,this.weightDataFileName=e+nT}async save(e){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer);let r=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor;if(s.download=this.modelTopologyFileName,s.href=r,await jb(()=>s.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let i=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;i.download=this.weightDataFileName,i.href=t,await jb(()=>i.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:sd(e)}}}};vl.URL_SCHEME="downloads://";var aT=class{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.files=e}async load(){let e=this.files[0],t=this.files.slice(1);return new Promise((n,a)=>{let r=new FileReader;r.onload=s=>{let i=JSON.parse(s.target.result),o=i.modelTopology;if(o==null){a(new Error(`modelTopology field is missing from file ${e.name}`));return}t.length===0&&n({modelTopology:o});let l=i.weightsManifest;if(l==null){a(new Error(`weightManifest field is missing from file ${e.name}`));return}let u;try{u=this.checkManifestAndWeightFiles(l,t)}catch(h){a(h);return}let d=[],p=[],c=[];l.forEach(h=>{h.paths.forEach(m=>{p.push(m),c.push(null)}),d.push(...h.weights)}),l.forEach(h=>{h.paths.forEach(m=>{let f=new FileReader;f.onload=g=>{let y=g.target.result,A=p.indexOf(m);if(c[A]=y,c.indexOf(null)===-1){let x={modelTopology:o,weightSpecs:d,weightData:o1(c),format:i.format,generatedBy:i.generatedBy,convertedBy:i.convertedBy};i.signature!=null&&(x.signature=i.signature),i.userDefinedMetadata!=null&&(x.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(x.modelInitializer=i.modelInitializer),n(x)}},f.onerror=g=>a(`Failed to weights data from file of path '${m}'.`),f.readAsArrayBuffer(u[m])})})},r.onerror=s=>a(`Failed to read model topology and weights manifest JSON from file '${e.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(e)})}checkManifestAndWeightFiles(e,t){let n=[],a=t.map(s=>Ob(s.name)),r={};for(let s of e)s.paths.forEach(i=>{let o=Ob(i);if(n.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(n.push(o),a.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);r[i]=t[a.indexOf(o)]});if(n.length!==t.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${t.length}).`);return r}},rT=e=>te().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(vl.URL_SCHEME)?sT(e.slice(vl.URL_SCHEME.length)):null;Et.registerSaveRouter(rT);function sT(e="model"){return new vl(e)}function iT(e){return new aT(e)}function Ub(e,t,n,a){i(e),n=n==null?0:n,a=a==null?1:a,o(n,a);let r=0,s=l=>(l.then(u=>{let d=n+ ++r/e.length*(a-n);return t(d),u}),l);function i(l){D(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,u){D(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),D(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),D(u>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${u}`)}return Promise.all(e.map(s))}async function Hb(e,t){t==null&&(t={});let n=t.fetchFunc==null?te().platform.fetch:t.fetchFunc,a=e.map(u=>n(u,t.requestInit,{isBinary:!0})),r=0,s=.5,i=(t.onProgress==null?await Promise.all(a):await Ub(a,t.onProgress,r,s)).map(u=>u.arrayBuffer()),o=.5,l=1;return t.onProgress==null?await Promise.all(i):await Ub(i,t.onProgress,o,l)}async function oT(e,t="",n,a){return Gb(r=>Hb(r,{requestInit:a}))(e,t,n)}function Gb(e){return async(t,n="",a)=>{let r=t.map(()=>!1),s={},i=a!=null?a.map(()=>!1):[],o=[];if(t.forEach((h,m)=>{let f=0;h.weights.forEach(g=>{let y="quantization"in g?g.quantization.dtype:g.dtype,A=s1[y]*Mt(g.shape),x=()=>{r[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:g,groupOffset:f,sizeBytes:A})};a!=null?a.forEach((v,b)=>{v===g.name&&(x(),i[b]=!0)}):x(),o.push(g.name),f+=A})}),!i.every(h=>h)){let h=a.filter((m,f)=>!i[f]);throw new Error(`Could not find weights in manifest with names: ${h.join(", ")}. +Manifest JSON has weights with names: ${o.join(", ")}.`)}let l=r.reduce((h,m,f)=>(m&&h.push(f),h),[]),u=[];l.forEach(h=>{t[h].paths.forEach(m=>{let f=n+(n.endsWith("/")?"":"/")+m;u.push(f)})});let d=await e(u),p={},c=0;return l.forEach(h=>{let m=t[h].paths.length,f=0;for(let x=0;x{let v=g.slice(x.groupOffset,x.groupOffset+x.sizeBytes),b=$b(v,[x.manifestEntry]);for(let w in b)p[w]=b[w]}),c+=m}),p}}var lT="application/octet-stream",uT="application/json",c1=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(D(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=te().platform.fetch,D(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&D(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||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;let n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer),t.body.append("model.json",new Blob([JSON.stringify(a)],{type:uT}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:lT}),"model.weights.bin");let r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:sd(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){let 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(h){let m=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?m+=" 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.":m+=" Please make sure the server is serving valid JSON for this request.",new Error(m)}let n=t.modelTopology,a=t.weightsManifest,r=t.generatedBy,s=t.convertedBy,i=t.format,o=t.signature,l=t.userDefinedMetadata;if(n==null&&a==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);let u,d;a!=null&&([u,d]=await this.loadWeights(a));let p={modelTopology:n,weightSpecs:u,weightData:d,generatedBy:r,convertedBy:s,format:i};o!=null&&(p.signature=o),l!=null&&(p.userDefinedMetadata=l);let c=t.modelInitializer;return c&&(p.modelInitializer=c),p}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[n,a]=dT(t),r=this.weightPathPrefix||n,s=[];for(let u of e)s.push(...u.weights);let i=[],o=[];for(let u of e)for(let d of u.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(d)):i.push(r+d+a);this.weightUrlConverter&&i.push(...await Promise.all(o));let l=await Hb(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,o1(l)]}};c1.URL_SCHEME_REGEX=/^https?:\/\//;function dT(e){let t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),a=e.substring(0,t),r=n>t?e.substring(n):"";return[a+"/",r]}function h1(e){return e.match(c1.URL_SCHEME_REGEX)!=null}var qb=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let n=!0;if(Array.isArray(e)?n=e.every(a=>h1(a)):n=h1(e),n)return f1(e,t)}return null};Et.registerSaveRouter(qb);Et.registerLoadRouter(qb);function f1(e,t){return new c1(e,t)}function pT(e,t){return f1(e,t)}var m1=class{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}},cT=class{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}};function hT(e,t,n,a){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new m1(e):(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 m1({modelTopology:e})):(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 m1({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:a}))}function fT(e){return new cT(e)}var Xb={};Fe(Xb,{confusionMatrix:()=>xT});function mT(e,t,n=!1,a=!1){let r=M(e,"a","matMul"),s=M(t,"b","matMul");[r,s]=It(r,s);let i={a:r,b:s},o={transposeA:n,transposeB:a};return P.runKernel(ws,i,o)}var je=L({matMul_:mT});function gT(e,t,n=1,a=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let r={indices:M(e,"indices","oneHot","int32")},s={depth:t,onValue:n,offValue:a};return P.runKernel(qs,r,s)}var wl=L({oneHot_:gT});function yT(e,t){let n=M(e,"x","transpose");if(t==null&&(t=n.shape.map((s,i)=>i).reverse()),D(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(s=>{D(s>=0&&s`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let a={x:n},r={perm:t};return P.runKernel(ci,a,r)}var Qe=L({transpose_:yT});function AT(e,t,n){let a=M(e,"labels","confusionMatrix"),r=M(t,"predictions","confusionMatrix");D(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),D(a.rank===1,()=>`Expected the rank of labels to be 1, but got ${a.rank}`),D(r.rank===1,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),D(a.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${a.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),D(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);let s=wl(ge(a,"int32"),n),i=wl(ge(r,"int32"),n),o=Qe(s),l=je(o,i);return ge(l,"int32")}var xT=L({confusionMatrix_:AT}),oa={};Fe(oa,{fromPixels:()=>NT,fromPixelsAsync:()=>IT,toPixels:()=>ST});function Lc(e,t,n){if(ys(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let a=Ua(e,n);if(a.length!==3&&a.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Br(e,t,a,n)}var kl;function Kb(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(e==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,a=!1,r=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)a=!0;else if(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)r=!0;else if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)s=!0;else if(e.getContext!=null)i=!0;else if(typeof ImageBitmap!="undefined"&&e 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 ${e.constructor.name}`);if(r){let c=2;if(r&&e.readyState element.")}if(Mc(Rc,P.backendName)!=null){let c={pixels:e},h={numChannels:t};return P.runKernel(Rc,c,h)}let[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height],d;i?d=e.getContext("2d").getImageData(0,0,l,u).data:a||n?d=e.data:(s||r||o)&&(kl==null&&(kl=document.createElement("canvas").getContext("2d")),kl.canvas.width=l,kl.canvas.height=u,kl.drawImage(e,0,0,l,u),d=kl.getImageData(0,0,l,u).data);let p;if(t===4)p=new Int32Array(d);else{let c=l*u;p=new Int32Array(c*t);for(let h=0;h4||s===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);let i=await n.data(),o=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(r*a*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${h}.`)}else if(n.dtype==="int32"&&(h<0||h>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${h}.`);s===1?(d[0]=h*o,d[1]=h*o,d[2]=h*o):d[c]=h*o}let p=u*4;l[p+0]=Math.round(d[0]),l[p+1]=Math.round(d[1]),l[p+2]=Math.round(d[2]),l[p+3]=Math.round(d[3])}if(t!=null){t.width=r,t.height=a;let u=t.getContext("2d"),d=new ImageData(l,r,a);u.putImageData(d,0,0)}return n!==e&&n.dispose(),l}var NT=L({fromPixels_:Kb}),g1={};Fe(g1,{prepareAndValidate:()=>Zb});function Zb(e,t){let n=e.shape.length,a=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(a<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${a}.`);if(t.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[a-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[a-1]} vs. ${n}`);if(Mt(e.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let r=t.shape,s=r[r.length-1],i=1;for(let p=0;pp/u),1].slice(0,s);return[l,i,u,d]}var y1={};Fe(y1,{calculateShapes:()=>Yb,validateInput:()=>x1,validateUpdateShape:()=>A1});function A1(e,t,n){let a=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${a}, and batchDim: ${r}.`;if(n.rank1?t.shape[a-1]:1,s=n.length,i=1;for(let p=r;pTT,computeFlatOffset:()=>ET,computeOutShape:()=>Jb,getNormalizedAxes:()=>n3,isSliceContinous:()=>CT,maskToAxes:()=>Wc,parseSliceParams:()=>l3,sliceInfo:()=>RT,startForAxis:()=>i3,startIndicesWithElidedDims:()=>a3,stopForAxis:()=>o3,stopIndicesWithElidedDims:()=>r3,stridesForAxis:()=>s3,stridesWithElidedDims:()=>Qb});function TT(e,t,n){let a=e.shape.length;D(a===t.length,()=>`Error in slice${a}D: Length of begin ${t} must match the rank of the array (${a}).`),D(a===n.length,()=>`Error in slice${a}D: Length of size ${n} must match the rank of the array (${a}).`);for(let r=0;r`Error in slice${a}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`)}function Wc(e){let t=[],n=0;for(;e>0;)e&1&&t.push(n),e/=2,n++;return t}function Jb(e,t,n){let a=[];for(let r=0;r0){let h=t[0],m=n+1;d=a3(i,h,m,a,e),p=r3(o,h,m,r,e),c=Qb(s,h,m,e)}else for(let h=0;h-1)s[o]=0;else{let l=e3(t,n,o),u=a[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=e3(t,n,o),u=a[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=a[r];return i<0&&(i+=l),i=Ru(0,i,l-1),i}function o3(e,t,n,a,r,s){let i=t[r],o=n[r]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=a[r];return i<0&&(i+=l),o>0?i=Ru(0,i,l):i=Ru(-1,i,l-1),i}function CT(e,t,n){let a=n.length;for(let r=0;r1){a=r;break}for(let r=a+1;r0||n[r]!==e[r])return!1;return!0}function ET(e,t){let n=e.length>0?e[e.length-1]:1;for(let a=0;a{D(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return n==null?s=new Array(r).fill(-1):typeof n=="number"?s=[n,...new Array(r-1).fill(-1)]:n.lengthi>=0?i:(D(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-a[o])),[a,s]}function RT(e,t,n,a,r,s,i,o,l){let u=t.slice(),d=n.slice(),p=a;a==null&&(p=new Array(u.length));let c=Wc(i);if(c.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(i!==0&&o!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(i!==0&&l!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let h=e.length-u.length,m=Wc(o),f=e.slice();m.forEach(w=>{u[w]=0,d[w]=1,f.splice(w,0,1)});let{begin:g,end:y,strides:A}=n3(f,c,h,u,d,p,r,s,i);u=g,d=y,p=A;let x=Wc(l);x.forEach(w=>{d[w]=u[w]+1,p[w]=1});let v=Jb(u,d,p),b=v.filter((w,N)=>x.indexOf(N)===-1);return{nonStrided:p.every(w=>w===1),$begin:u,$end:d,$strides:p,size:v,newShape:f,outShape:b}}var re={};Fe(re,{Serializable:()=>u3,SerializationMap:()=>wi,registerClass:()=>jr});var u3=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},wi=class{constructor(){this.classNameMap={}}static getMap(){return wi.instance==null&&(wi.instance=new wi),wi.instance}static register(e){wi.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function jr(e){D(e.className!=null,()=>"Class being registered does not have the static className property defined."),D(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),D(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),wi.register(e)}var d3={};Fe(d3,{TEST_EPSILON_FLOAT16:()=>p3,encodeStrings:()=>c3,expectArrayBuffersEqual:()=>_T,expectArraysClose:()=>FT,expectArraysEqual:()=>DT,expectNumbersClose:()=>OT,expectPromiseToFail:()=>$T,expectValuesInRange:()=>zT,testEpsilon:()=>b1});var MT=.001,p3=.1;function FT(e,t,n){return n==null&&(n=b1()),v1(e,t,(a,r)=>w1(a,r,n))}function b1(){return P.backend.floatPrecision()===32?MT:p3}function v1(e,t,n){let a=!0;if((on(e)||on(t))&&(a=!1),on(e)&&on(t)&&(a=!0),a){let i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error(`Arrays are of different type. Actual: ${i}. Expected: ${o}`)}if(Array.isArray(e)&&Array.isArray(t)){let i=Ua(e),o=Ua(t);if(!cr(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let r=on(e)?e:As(e),s=on(t)?t:As(t);if(r.length!==s.length)throw new Error(`Arrays have different lengths actual: ${r.length} vs expected: ${s.length}. Actual: ${r}. -Expected: ${s}.`);for(let i=0;it.fail(),()=>t())}function $T(e,t){let n=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return $r(e)||$r(e[0])||$r(t)||$r(t[0])?v1(e,n,(a,r)=>a==r):v1(e,t,(a,r)=>w1(a,r,0))}function DT(e,t,n){if(n==null&&(n=b1()),!w1(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function w1(e,t,n){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function OT(e,t,n){for(let a=0;an)throw new Error(`Value out of range:${e[a]} low: ${t}, high: ${n}`)}function zT(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function p3(e){for(let t=0;tt.dispose())}function Kt(e){return P.keep(e)}function jT(e){return P.time(e)}function UT(e){return P.setBackend(e)}function HT(){return P.ready()}function GT(){return P.backendName}function qT(e){P.removeBackend(e)}function I1(e){return P.findBackend(e)}function XT(e){return P.findBackendFactory(e)}function kl(e,t,n=1){return P.registerBackend(e,t,n)}function c3(){return P.backend}function KT(e,t){te().setPlatform(e,t)}function ZT(e,t){let n=M(e,"a","add"),a=M(t,"b","add");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Or,r)}var ie=L({add_:ZT});function YT(e,t){let n=M(e,"a","floorDiv"),a=M(t,"b","floorDiv");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel($s,r)}var Vc=L({floorDiv_:YT});function JT(e,t){let n=M(e,"a","div"),a=M(t,"b","div");if([n,a]=It(n,a),n.dtype==="int32"&&a.dtype==="int32")return Vc(n,a);let r={a:n,b:a},s={};return P.runKernel(Rs,r,s)}var me=L({div_:JT});function QT(e,t){let n=M(e,"a","mul"),a=M(t,"b","mul");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Gs,r)}var B=L({mul_:QT});function eC(e){let t=M(e,"x","abs");if(t.dtype==="complex64"){let n={x:t};return P.runKernel(Ou,n)}else{let n={x:t};return P.runKernel(fo,n)}}var Wt=L({abs_:eC});function tC(e){let t={x:M(e,"x","acos")};return P.runKernel(mo,t)}var S1=L({acos_:tC});function nC(e){let t={x:M(e,"x","acosh")};return P.runKernel(go,t)}var N1=L({acosh_:nC});function aC(e){D(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),D(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((r,s)=>M(r,`tensors${s}`,"addN")),n=t[0];t.forEach(r=>{if(r.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!cr(r.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let a=t;return P.runKernel(xs,a)}var jc=L({addN_:aC});function rC(e,t=null,n=!1){let a={x:M(e,"x","all","bool")},r={axis:t,keepDims:n};return P.runKernel(yo,a,r)}var Uc=L({all_:rC});function sC(e,t=null,n=!1){let a={x:M(e,"x","any","bool")},r={axis:t,keepDims:n};return P.runKernel(Ao,a,r)}var id=L({any_:sC});function iC(e,t=0){let n={x:M(e,"x","argMax")},a={axis:t};return P.runKernel(bs,n,a)}var ki=L({argMax_:iC});function oC(e,t=0){let n={x:M(e,"x","argMin")},a={axis:t};return P.runKernel(Fu,n,a)}var T1=L({argMin_:oC});function lC(e){let t={x:M(e,"x","asin")};return P.runKernel(xo,t)}var C1=L({asin_:lC});function uC(e){let t={x:M(e,"x","asinh")};return P.runKernel(bo,t)}var E1=L({asinh_:uC});function dC(e){let t={x:M(e,"x","atan")};return P.runKernel(vo,t)}var R1=L({atan_:dC});function pC(e,t){let n=M(e,"a","atan2"),a=M(t,"b","atan2");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(ko,r)}var M1=L({atan2_:pC});function cC(e){let t={x:M(e,"x","atanh")};return P.runKernel(wo,t)}var F1=L({atanh_:cC});function hC(e,t,n,a,r="NHWC",s){let i=e[3],o=[...t,i],u=m3(r);return od(e,o,n,s,a,null,null,u)}function h3(e,t,n,a,r,s,i="channelsLast"){let[o,u]=Hc(t),l;if(i==="channelsLast")l=[o,u,e[3],e[3]];else if(i==="channelsFirst")l=[o,u,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return od(e,l,n,a,r,s,!1,i)}function fC(e,t,n,a,r,s,i="NDHWC"){let[o,u,l]=D1(t),d,p;if(i==="NDHWC")p="channelsLast",d=[o,u,l,e[4],e[4]];else if(i==="NCDHW")p="channelsFirst",d=[o,u,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return f3(e,d,n,a,r,!1,p,s)}function od(e,t,n,a,r,s,i=!1,o="channelsLast"){let[u,l,d,p]=[-1,-1,-1,-1];if(o==="channelsLast")[u,l,d,p]=e;else if(o==="channelsFirst")[u,p,l,d]=e;else throw new Error(`Unknown dataFormat ${o}`);let[c,h,,m]=t,[f,g]=Hc(n),[y,A]=Hc(a),x=Il(c,y),v=Il(h,A),{padInfo:b,outHeight:w,outWidth:N}=yC(r,l,d,f,g,x,v,s,o),C=i?m*p:m,E;return o==="channelsFirst"?E=[u,C,w,N]:o==="channelsLast"&&(E=[u,w,N,C]),{batchSize:u,dataFormat:o,inHeight:l,inWidth:d,inChannels:p,outHeight:w,outWidth:N,outChannels:C,padInfo:b,strideHeight:f,strideWidth:g,filterHeight:c,filterWidth:h,effectiveFilterHeight:x,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:A,inShape:e,outShape:E,filterShape:t}}function f3(e,t,n,a,r,s=!1,i="channelsLast",o){let[u,l,d,p,c]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[u,l,d,p,c]=e;else if(i==="channelsFirst")[u,c,l,d,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,m,f,,g]=t,[y,A,x]=D1(n),[v,b,w]=D1(a),N=Il(h,v),C=Il(m,b),E=Il(f,w),{padInfo:_,outDepth:$,outHeight:S,outWidth:z}=AC(r,l,d,p,y,A,x,N,C,E,o),O=s?g*c:g,W;return i==="channelsFirst"?W=[u,O,$,S,z]:i==="channelsLast"&&(W=[u,$,S,z,O]),{batchSize:u,dataFormat:i,inDepth:l,inHeight:d,inWidth:p,inChannels:c,outDepth:$,outHeight:S,outWidth:z,outChannels:O,padInfo:_,strideDepth:y,strideHeight:A,strideWidth:x,filterDepth:h,filterHeight:m,filterWidth:f,effectiveFilterDepth:N,effectiveFilterHeight:C,effectiveFilterWidth:E,dilationDepth:v,dilationHeight:b,dilationWidth:w,inShape:e,outShape:W,filterShape:t}}function mC(e,t,n,a,r){a==null&&(a=$1(e,t,n));let s=e[0],i=e[1],o=Ii((s-t+2*a)/n+1,r),u=Ii((i-t+2*a)/n+1,r);return[o,u]}function gC(e,t,n,a,r,s){r==null&&(r=$1(e,t,a));let i=e[0],o=e[1],u=e[2],l=Ii((i-t+2*r)/a+1,s),d=Ii((o-t+2*r)/a+1,s),p=Ii((u-t+2*r)/a+1,s);return[l,d,p,n]}function $1(e,t,n,a=1){let r=Il(t,a);return Math.floor((e[0]*(n-1)-n+r)/2)}function Hc(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function D1(e){return typeof e=="number"?[e,e,e]:e}function Il(e,t){return t<=1?e:e+(e-1)*(t-1)}function yC(e,t,n,a,r,s,i,o,u){let l,d,p;if(typeof e=="number"){l={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let c=mC([t,n],s,a,e,o);d=c[0],p=c[1]}else if(e==="same"){d=Math.ceil(t/a),p=Math.ceil(n/r);let c=Math.max(0,(d-1)*a+s-t),h=Math.max(0,(p-1)*r+i-n),m=Math.floor(c/2),f=c-m,g=Math.floor(h/2),y=h-g;l={top:m,bottom:f,left:g,right:y,type:"SAME"}}else if(e==="valid")l={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-s+1)/a),p=Math.ceil((n-i+1)/r);else if(typeof e=="object"){let c=u==="channelsLast"?e[1][0]:e[2][0],h=u==="channelsLast"?e[1][1]:e[2][1],m=u==="channelsLast"?e[2][0]:e[3][0],f=u==="channelsLast"?e[2][1]:e[3][1];l={top:c,bottom:h,left:m,right:f,type:c===0&&h===0&&m===0&&f===0?"VALID":"EXPLICIT"},d=Ii((t-s+c+h)/a+1,o),p=Ii((n-i+m+f)/r+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:l,outHeight:d,outWidth:p}}function AC(e,t,n,a,r,s,i,o,u,l,d){let p,c,h,m;if(typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=gC([t,n,a,1],o,1,r,e,d);c=f[0],h=f[1],m=f[2]}else if(e==="same"){c=Math.ceil(t/r),h=Math.ceil(n/s),m=Math.ceil(a/i);let f=(c-1)*r+o-t,g=(h-1)*s+u-n,y=(m-1)*i+l-a,A=Math.floor(f/2),x=f-A,v=Math.floor(g/2),b=g-v,w=Math.floor(y/2),N=y-w;p={top:v,bottom:b,left:w,right:N,front:A,back:x,type:"SAME"}}else if(e==="valid")p={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},c=Math.ceil((t-o+1)/r),h=Math.ceil((n-u+1)/s),m=Math.ceil((a-l+1)/i);else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:c,outHeight:h,outWidth:m}}function Ii(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Ur(e){let[t,n,a]=Hc(e);return t===1&&n===1&&a===1}function Ga(e,t){return Ur(e)||Ur(t)}function m3(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function xC(e,t){let n={x:M(e,"x","reshape","string_or_numeric")},a={shape:t};return P.runKernel(el,n,a)}var q=L({reshape_:xC});function bC(e,t,n,a,r){let s=M(e,"x","avgPool","float32"),i=1;D(Ga(n,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);let o=s,u=!1;s.rank===3&&(u=!0,o=q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),D(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),r!=null&&D(qt(a),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let l={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=P.runKernel(vs,l,d);return p=ge(p,s.dtype),u?q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var ld=L({avgPool_:bC});function vC(e,t,n,a,r,s="NDHWC"){let i=M(e,"x","avgPool3d","float32"),o=i,u=!1;i.rank===4&&(u=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),D(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),D(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&D(qt(a),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let l={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=P.runKernel($u,l,d);return p=ge(p,o.dtype),u?q(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var O1=L({avgPool3d_:vC});function wC(e,t=0){D(e.length>=1,()=>"Pass at least one tensor to concat");let n=rd(e,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${s.dtype}. `)}),n.length===1)return Ha(n[0]);let a=n,r={axis:t};return P.runKernel(Io,a,r)}var lt=L({concat_:wC});function kC(e){let t={x:M(e,"x","sigmoid")};return P.runKernel(ri,t)}var Rn=L({sigmoid_:kC});function IC(e,t,n){let a=M(e,"x","slice","string_or_numeric");if(a.rank===0)throw new Error("Slicing scalar is not possible");let r={x:a},s={begin:t,size:n};return P.runKernel(rl,r,s)}var Re=L({slice_:IC});function SC(e){let t={x:M(e,"x","tanh")};return P.runKernel(pi,t)}var Si=L({tanh_:SC});function NC(e,t,n,a,r,s){let i=M(e,"forgetBias","basicLSTMCell"),o=M(t,"lstmKernel","basicLSTMCell"),u=M(n,"lstmBias","basicLSTMCell"),l=M(a,"data","basicLSTMCell"),d=M(r,"c","basicLSTMCell"),p=M(s,"h","basicLSTMCell"),c=lt([l,p],1),h=je(c,o),m=ie(h,u),f=m.shape[0],g=m.shape[1]/4,y=[f,g],A=Re(m,[0,0],y),x=Re(m,[0,g],y),v=Re(m,[0,g*2],y),b=Re(m,[0,g*3],y),w=ie(B(Rn(A),Si(x)),B(d,Rn(ie(i,v)))),N=B(Si(w),Rn(b));return[w,N]}var TC=L({basicLSTMCell_:NC});function CC(e,t,n){let a=M(e,"x","batchToSpaceND"),r=t.reduce((o,u)=>o*u);D(a.rank>=1+t.length,()=>`input rank is ${a.rank} but should be > than blockShape.length ${t.length}`),D(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),D(a.shape[0]%r==0,()=>`input tensor batch is ${a.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`);let s={x:a},i={blockShape:t,crops:n};return P.runKernel(Du,s,i)}var ud=L({batchToSpaceND_:CC});function EC(e){let t;return e.rank===0||e.rank===1?t=q(e,[1,1,1,e.size]):e.rank===2?t=q(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=q(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function RC(e,t,n,a,r,s){s==null&&(s=.001);let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),u=M(n,"variance","batchNorm"),l;r!=null&&(l=M(r,"scale","batchNorm"));let d;a!=null&&(d=M(a,"offset","batchNorm")),D(o.rank===u.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),D(d==null||o.rank===d.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),D(l==null||o.rank===l.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let p={x:EC(i),scale:l,offset:d,mean:o,variance:u},c={varianceEpsilon:s},h=P.runKernel(Ds,p,c);return q(h,i.shape)}var Ni=L({batchNorm_:RC});function MC(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),u=M(n,"variance","batchNorm"),l;r!=null&&(l=M(r,"scale","batchNorm"));let d;return a!=null&&(d=M(a,"offset","batchNorm")),D(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),D(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),D(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${u.rank}.`),l!=null&&D(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${l.rank}.`),d!=null&&D(d.rank===2||d.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${d.rank}.`),Ni(i,o,u,d,l,s)}var g3=L({batchNorm2d_:MC});function FC(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),u=M(n,"variance","batchNorm"),l;r!=null&&(l=M(r,"scale","batchNorm"));let d;return a!=null&&(d=M(a,"offset","batchNorm")),D(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),D(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),D(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${u.rank}.`),l!=null&&D(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${l.rank}.`),d!=null&&D(d.rank===3||d.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${d.rank}.`),Ni(i,o,u,d,l,s)}var y3=L({batchNorm3d_:FC});function $C(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),u=M(n,"variance","batchNorm"),l;r!=null&&(l=M(r,"scale","batchNorm"));let d;return a!=null&&(d=M(a,"offset","batchNorm")),D(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),D(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),D(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${u.rank}.`),l!=null&&D(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${l.rank}.`),d!=null&&D(d.rank===4||d.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${d.rank}.`),Ni(i,o,u,d,l,s)}var A3=L({batchNorm4d_:$C});function DC(e,t,n){let a=M(e,"x","bincount"),r=M(t,"weights","bincount");D(a.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${a.dtype}`),D(n>=0,()=>`size must be non-negative, but got ${n}.`),D(r.size===a.size||r.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${a.shape}, weights shape: ${r.shape}.`);let s={x:a,weights:r},i={size:n};return P.runKernel(Zp,s,i)}var z1=L({bincount_:DC});function OC(e,t){let n=M(e,"broadcastTo","x"),a=n.shape;if(t.some(u=>!(u>0)||u%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){let u=n.shape.slice();for(;u.length=0;u--)if(r[u]===t[u])s[u]=1;else if(n.shape[u]!==1)throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${t}].`);if(s.map((u,l)=>u>1?l:-1).filter(u=>u>=0).length===0)return Ha(n);let i={x:n},o={reps:s};return P.runKernel(_r,i,o)}var Sl=L({broadcastTo_:OC});function zC(e){let t={x:M(e,"x","ceil")};return P.runKernel(Is,t)}var _1=L({ceil_:zC});function _C(e,t,n){let a=M(e,"x","clipByValue");D(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);let r={x:a},s={clipValueMin:t,clipValueMax:n};return P.runKernel(zr,r,s)}var Mn=L({clipByValue_:_C});function PC(e){return lt(e,0)}var x3=L({concat1d_:PC});function LC(e,t){return lt(e,t)}var Nl=L({concat2d_:LC});function WC(e,t){return lt(e,t)}var b3=L({concat3d_:WC});function BC(e,t){return lt(e,t)}var v3=L({concat4d_:BC});function VC(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","conv2d"),u=M(t,"filter","conv2d"),l=o,d=!1;o.rank===3&&(d=!0,l=q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),D(l.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${l.rank}.`),D(u.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${u.rank}.`),i!=null&&D(qt(a),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p=r==="NHWC"?l.shape[3]:l.shape[1];D(p===u.shape[2],()=>`Error in conv2d: depth of input (${p}) must match input depth for filter ${u.shape[2]}.`),D(Ga(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);let c={x:l,filter:u},h={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},m=P.runKernel(Ss,c,h);return d?q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var mr=L({conv2d_:VC});function jC(e,t,n,a,r="NWC",s=1,i){let o=M(e,"x","conv1d"),u=M(t,"filter","conv1d"),l=o,d=!1;o.rank===2&&(d=!0,l=q(o,[1,o.shape[0],o.shape[1]])),D(l.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${l.rank}.`),D(u.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${u.rank}.`),i!=null&&D(qt(a),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),D(l.shape[2]===u.shape[1],()=>`Error in conv1d: depth of input (${l.shape[2]}) must match input depth for filter ${u.shape[1]}.`),D(Ga(n,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`),D(r==="NWC",()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`);let p=q(u,[1,u.shape[0],u.shape[1],u.shape[2]]),c=q(l,[l.shape[0],1,l.shape[1],l.shape[2]]),h=mr(c,p,[1,n],a,"NHWC",[1,s],i);return d?q(h,[h.shape[2],h.shape[3]]):q(h,[h.shape[0],h.shape[2],h.shape[3]])}var Gc=L({conv1d_:jC});function UC(e,t,n,a,r,s="NHWC",i){D(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,u=t,l=!1;t.rank===3&&(l=!0,u=q(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),D(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),D(u.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${u.rank}`),D(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);let d=s==="NHWC"?o[3]:o[1],p=s==="NHWC"?u.shape[3]:u.shape[1];D(d===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${d}) must match input depth for filter ${n.shape[2]}.`),D(p===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${p}) must match output depth for filter ${n.shape[3]}.`),i!=null&&D(qt(r),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let c={dy:u,filter:n},h={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,inputShape:o},m=P.runKernel(Ns,c,h);return l?q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var P1=L({conv2DBackpropInput_:UC});function HC(e,t,n,a,r,s){let i=M(e,"x","conv2dTranspose"),o=M(t,"filter","conv2dTranspose");return P1(n,i,o,a,r,"NHWC",s)}var qc=L({conv2dTranspose_:HC});function GC(e,t,n,a,r="NDHWC",s=[1,1,1]){let i=M(e,"x","conv3d"),o=M(t,"filter","conv3d"),u=i,l=!1;i.rank===4&&(l=!0,u=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),D(u.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${u.rank}.`),D(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),D(u.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${u.shape[4]}) must match input depth for filter ${o.shape[3]}.`),D(Ga(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),D(r==="NDHWC",()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`);let d={x:u,filter:o},p={strides:n,pad:a,dataFormat:r,dilations:s},c=P.runKernel(zu,d,p);return l?q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var L1=L({conv3d_:GC});function qC(e,t,n,a,r){D(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,i=t,o=!1;t.rank===4&&(o=!0,i=q(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);let u=s[4],l=i.shape[4];D(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),D(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),D(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),D(u===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[3]}.`),D(l===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${l}) must match output depth for filter ${n.shape[4]}.`);let d={dy:i,filter:n},p={pad:r,strides:a,inputShape:s},c=P.runKernel(ec,d,p);return o?q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var w3=L({conv3DBackpropInput_:qC});function XC(e,t,n,a,r){let s=M(e,"x","conv3dTranspose"),i=M(t,"filter","conv3dTranspose");return w3(n,s,i,a,r)}var k3=L({conv3dTranspose_:XC});function KC(e){let t={x:M(e,"x","cos")};return P.runKernel(Ts,t)}var dd=L({cos_:KC});function ZC(e){let t={x:M(e,"x","cosh")};return P.runKernel(So,t)}var Xc=L({cosh_:ZC});function YC(e,t=0,n=!1,a=!1){let r={x:M(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:a};return P.runKernel(Cs,r,s)}var Kc=L({cumsum_:YC});function JC(e,t,n,a=!1){let r=M(e,"x","denseBincount"),s=M(t,"weights","denseBincount");D(r.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`),D(r.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`),D(n>=0,()=>`size must be non-negative, but got ${n}.`),D(s.size===r.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${s.shape}.`);let i={x:r,weights:s},o={size:n,binaryOutput:a};return P.runKernel(tc,i,o)}var I3=L({denseBincount_:JC});function QC(e,t,n="NHWC"){let a=M(e,"x","depthToSpace"),r=n==="NHWC"?a.shape[1]:a.shape[2],s=n==="NHWC"?a.shape[2]:a.shape[3],i=n==="NHWC"?a.shape[3]:a.shape[1];D(r*t>=0,()=>`Negative dimension size caused by overflow when multiplying +Expected: ${s}.`)}}function $T(e,t){e().then(()=>t.fail(),()=>t())}function DT(e,t){let n=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return $r(e)||$r(e[0])||$r(t)||$r(t[0])?v1(e,n,(a,r)=>a==r):v1(e,t,(a,r)=>w1(a,r,0))}function OT(e,t,n){if(n==null&&(n=b1()),!w1(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function w1(e,t,n){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function zT(e,t,n){for(let a=0;an)throw new Error(`Value out of range:${e[a]} low: ${t}, high: ${n}`)}function _T(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function c3(e){for(let t=0;tt.dispose())}function Kt(e){return P.keep(e)}function UT(e){return P.time(e)}function HT(e){return P.setBackend(e)}function GT(){return P.ready()}function qT(){return P.backendName}function XT(e){P.removeBackend(e)}function I1(e){return P.findBackend(e)}function KT(e){return P.findBackendFactory(e)}function Il(e,t,n=1){return P.registerBackend(e,t,n)}function h3(){return P.backend}function ZT(e,t){te().setPlatform(e,t)}function YT(e,t){let n=M(e,"a","add"),a=M(t,"b","add");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Or,r)}var ie=L({add_:YT});function JT(e,t){let n=M(e,"a","floorDiv"),a=M(t,"b","floorDiv");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel($s,r)}var Vc=L({floorDiv_:JT});function QT(e,t){let n=M(e,"a","div"),a=M(t,"b","div");if([n,a]=It(n,a),n.dtype==="int32"&&a.dtype==="int32")return Vc(n,a);let r={a:n,b:a},s={};return P.runKernel(Rs,r,s)}var me=L({div_:QT});function eC(e,t){let n=M(e,"a","mul"),a=M(t,"b","mul");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Gs,r)}var B=L({mul_:eC});function tC(e){let t=M(e,"x","abs");if(t.dtype==="complex64"){let n={x:t};return P.runKernel(Ou,n)}else{let n={x:t};return P.runKernel(mo,n)}}var Wt=L({abs_:tC});function nC(e){let t={x:M(e,"x","acos")};return P.runKernel(go,t)}var S1=L({acos_:nC});function aC(e){let t={x:M(e,"x","acosh")};return P.runKernel(yo,t)}var N1=L({acosh_:aC});function rC(e){D(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),D(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((r,s)=>M(r,`tensors${s}`,"addN")),n=t[0];t.forEach(r=>{if(r.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!cr(r.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let a=t;return P.runKernel(xs,a)}var jc=L({addN_:rC});function sC(e,t=null,n=!1){let a={x:M(e,"x","all","bool")},r={axis:t,keepDims:n};return P.runKernel(Ao,a,r)}var Uc=L({all_:sC});function iC(e,t=null,n=!1){let a={x:M(e,"x","any","bool")},r={axis:t,keepDims:n};return P.runKernel(xo,a,r)}var id=L({any_:iC});function oC(e,t=0){let n={x:M(e,"x","argMax")},a={axis:t};return P.runKernel(bs,n,a)}var ki=L({argMax_:oC});function lC(e,t=0){let n={x:M(e,"x","argMin")},a={axis:t};return P.runKernel(Fu,n,a)}var T1=L({argMin_:lC});function uC(e){let t={x:M(e,"x","asin")};return P.runKernel(bo,t)}var C1=L({asin_:uC});function dC(e){let t={x:M(e,"x","asinh")};return P.runKernel(vo,t)}var E1=L({asinh_:dC});function pC(e){let t={x:M(e,"x","atan")};return P.runKernel(wo,t)}var R1=L({atan_:pC});function cC(e,t){let n=M(e,"a","atan2"),a=M(t,"b","atan2");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Io,r)}var M1=L({atan2_:cC});function hC(e){let t={x:M(e,"x","atanh")};return P.runKernel(ko,t)}var F1=L({atanh_:hC});function fC(e,t,n,a,r="NHWC",s){let i=e[3],o=[...t,i],l=g3(r);return od(e,o,n,s,a,null,null,l)}function f3(e,t,n,a,r,s,i="channelsLast"){let[o,l]=Hc(t),u;if(i==="channelsLast")u=[o,l,e[3],e[3]];else if(i==="channelsFirst")u=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return od(e,u,n,a,r,s,!1,i)}function mC(e,t,n,a,r,s,i="NDHWC"){let[o,l,u]=D1(t),d,p;if(i==="NDHWC")p="channelsLast",d=[o,l,u,e[4],e[4]];else if(i==="NCDHW")p="channelsFirst",d=[o,l,u,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return m3(e,d,n,a,r,!1,p,s)}function od(e,t,n,a,r,s,i=!1,o="channelsLast"){let[l,u,d,p]=[-1,-1,-1,-1];if(o==="channelsLast")[l,u,d,p]=e;else if(o==="channelsFirst")[l,p,u,d]=e;else throw new Error(`Unknown dataFormat ${o}`);let[c,h,,m]=t,[f,g]=Hc(n),[y,A]=Hc(a),x=Sl(c,y),v=Sl(h,A),{padInfo:b,outHeight:w,outWidth:N}=AC(r,u,d,f,g,x,v,s,o),C=i?m*p:m,E;return o==="channelsFirst"?E=[l,C,w,N]:o==="channelsLast"&&(E=[l,w,N,C]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:d,inChannels:p,outHeight:w,outWidth:N,outChannels:C,padInfo:b,strideHeight:f,strideWidth:g,filterHeight:c,filterWidth:h,effectiveFilterHeight:x,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:A,inShape:e,outShape:E,filterShape:t}}function m3(e,t,n,a,r,s=!1,i="channelsLast",o){let[l,u,d,p,c]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,u,d,p,c]=e;else if(i==="channelsFirst")[l,c,u,d,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,m,f,,g]=t,[y,A,x]=D1(n),[v,b,w]=D1(a),N=Sl(h,v),C=Sl(m,b),E=Sl(f,w),{padInfo:_,outDepth:$,outHeight:S,outWidth:z}=xC(r,u,d,p,y,A,x,N,C,E,o),O=s?g*c:g,W;return i==="channelsFirst"?W=[l,O,$,S,z]:i==="channelsLast"&&(W=[l,$,S,z,O]),{batchSize:l,dataFormat:i,inDepth:u,inHeight:d,inWidth:p,inChannels:c,outDepth:$,outHeight:S,outWidth:z,outChannels:O,padInfo:_,strideDepth:y,strideHeight:A,strideWidth:x,filterDepth:h,filterHeight:m,filterWidth:f,effectiveFilterDepth:N,effectiveFilterHeight:C,effectiveFilterWidth:E,dilationDepth:v,dilationHeight:b,dilationWidth:w,inShape:e,outShape:W,filterShape:t}}function gC(e,t,n,a,r){a==null&&(a=$1(e,t,n));let s=e[0],i=e[1],o=Ii((s-t+2*a)/n+1,r),l=Ii((i-t+2*a)/n+1,r);return[o,l]}function yC(e,t,n,a,r,s){r==null&&(r=$1(e,t,a));let i=e[0],o=e[1],l=e[2],u=Ii((i-t+2*r)/a+1,s),d=Ii((o-t+2*r)/a+1,s),p=Ii((l-t+2*r)/a+1,s);return[u,d,p,n]}function $1(e,t,n,a=1){let r=Sl(t,a);return Math.floor((e[0]*(n-1)-n+r)/2)}function Hc(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function D1(e){return typeof e=="number"?[e,e,e]:e}function Sl(e,t){return t<=1?e:e+(e-1)*(t-1)}function AC(e,t,n,a,r,s,i,o,l){let u,d,p;if(typeof e=="number"){u={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let c=gC([t,n],s,a,e,o);d=c[0],p=c[1]}else if(e==="same"){d=Math.ceil(t/a),p=Math.ceil(n/r);let c=Math.max(0,(d-1)*a+s-t),h=Math.max(0,(p-1)*r+i-n),m=Math.floor(c/2),f=c-m,g=Math.floor(h/2),y=h-g;u={top:m,bottom:f,left:g,right:y,type:"SAME"}}else if(e==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-s+1)/a),p=Math.ceil((n-i+1)/r);else if(typeof e=="object"){let c=l==="channelsLast"?e[1][0]:e[2][0],h=l==="channelsLast"?e[1][1]:e[2][1],m=l==="channelsLast"?e[2][0]:e[3][0],f=l==="channelsLast"?e[2][1]:e[3][1];u={top:c,bottom:h,left:m,right:f,type:c===0&&h===0&&m===0&&f===0?"VALID":"EXPLICIT"},d=Ii((t-s+c+h)/a+1,o),p=Ii((n-i+m+f)/r+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outHeight:d,outWidth:p}}function xC(e,t,n,a,r,s,i,o,l,u,d){let p,c,h,m;if(typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=yC([t,n,a,1],o,1,r,e,d);c=f[0],h=f[1],m=f[2]}else if(e==="same"){c=Math.ceil(t/r),h=Math.ceil(n/s),m=Math.ceil(a/i);let f=(c-1)*r+o-t,g=(h-1)*s+l-n,y=(m-1)*i+u-a,A=Math.floor(f/2),x=f-A,v=Math.floor(g/2),b=g-v,w=Math.floor(y/2),N=y-w;p={top:v,bottom:b,left:w,right:N,front:A,back:x,type:"SAME"}}else if(e==="valid")p={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},c=Math.ceil((t-o+1)/r),h=Math.ceil((n-l+1)/s),m=Math.ceil((a-u+1)/i);else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:c,outHeight:h,outWidth:m}}function Ii(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Ur(e){let[t,n,a]=Hc(e);return t===1&&n===1&&a===1}function Ga(e,t){return Ur(e)||Ur(t)}function g3(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function bC(e,t){let n={x:M(e,"x","reshape","string_or_numeric")},a={shape:t};return P.runKernel(tl,n,a)}var q=L({reshape_:bC});function vC(e,t,n,a,r){let s=M(e,"x","avgPool","float32"),i=1;D(Ga(n,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),D(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),r!=null&&D(qt(a),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let u={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=P.runKernel(vs,u,d);return p=ge(p,s.dtype),l?q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var ld=L({avgPool_:vC});function wC(e,t,n,a,r,s="NDHWC"){let i=M(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),D(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),D(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&D(qt(a),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let u={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=P.runKernel($u,u,d);return p=ge(p,o.dtype),l?q(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var O1=L({avgPool3d_:wC});function kC(e,t=0){D(e.length>=1,()=>"Pass at least one tensor to concat");let n=rd(e,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${s.dtype}. `)}),n.length===1)return Ha(n[0]);let a=n,r={axis:t};return P.runKernel(So,a,r)}var lt=L({concat_:kC});function IC(e){let t={x:M(e,"x","sigmoid")};return P.runKernel(ri,t)}var Rn=L({sigmoid_:IC});function SC(e,t,n){let a=M(e,"x","slice","string_or_numeric");if(a.rank===0)throw new Error("Slicing scalar is not possible");let r={x:a},s={begin:t,size:n};return P.runKernel(sl,r,s)}var Re=L({slice_:SC});function NC(e){let t={x:M(e,"x","tanh")};return P.runKernel(pi,t)}var Si=L({tanh_:NC});function TC(e,t,n,a,r,s){let i=M(e,"forgetBias","basicLSTMCell"),o=M(t,"lstmKernel","basicLSTMCell"),l=M(n,"lstmBias","basicLSTMCell"),u=M(a,"data","basicLSTMCell"),d=M(r,"c","basicLSTMCell"),p=M(s,"h","basicLSTMCell"),c=lt([u,p],1),h=je(c,o),m=ie(h,l),f=m.shape[0],g=m.shape[1]/4,y=[f,g],A=Re(m,[0,0],y),x=Re(m,[0,g],y),v=Re(m,[0,g*2],y),b=Re(m,[0,g*3],y),w=ie(B(Rn(A),Si(x)),B(d,Rn(ie(i,v)))),N=B(Si(w),Rn(b));return[w,N]}var CC=L({basicLSTMCell_:TC});function EC(e,t,n){let a=M(e,"x","batchToSpaceND"),r=t.reduce((o,l)=>o*l);D(a.rank>=1+t.length,()=>`input rank is ${a.rank} but should be > than blockShape.length ${t.length}`),D(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),D(a.shape[0]%r==0,()=>`input tensor batch is ${a.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`);let s={x:a},i={blockShape:t,crops:n};return P.runKernel(Du,s,i)}var ud=L({batchToSpaceND_:EC});function RC(e){let t;return e.rank===0||e.rank===1?t=q(e,[1,1,1,e.size]):e.rank===2?t=q(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=q(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function MC(e,t,n,a,r,s){s==null&&(s=.001);let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),u;r!=null&&(u=M(r,"scale","batchNorm"));let d;a!=null&&(d=M(a,"offset","batchNorm")),D(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),D(d==null||o.rank===d.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),D(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let p={x:RC(i),scale:u,offset:d,mean:o,variance:l},c={varianceEpsilon:s},h=P.runKernel(Ds,p,c);return q(h,i.shape)}var Ni=L({batchNorm_:MC});function FC(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),u;r!=null&&(u=M(r,"scale","batchNorm"));let d;return a!=null&&(d=M(a,"offset","batchNorm")),D(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),D(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),D(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),u!=null&&D(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),d!=null&&D(d.rank===2||d.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${d.rank}.`),Ni(i,o,l,d,u,s)}var y3=L({batchNorm2d_:FC});function $C(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),u;r!=null&&(u=M(r,"scale","batchNorm"));let d;return a!=null&&(d=M(a,"offset","batchNorm")),D(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),D(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),D(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),u!=null&&D(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),d!=null&&D(d.rank===3||d.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${d.rank}.`),Ni(i,o,l,d,u,s)}var A3=L({batchNorm3d_:$C});function DC(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),u;r!=null&&(u=M(r,"scale","batchNorm"));let d;return a!=null&&(d=M(a,"offset","batchNorm")),D(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),D(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),D(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),u!=null&&D(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),d!=null&&D(d.rank===4||d.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${d.rank}.`),Ni(i,o,l,d,u,s)}var x3=L({batchNorm4d_:DC});function OC(e,t,n){let a=M(e,"x","bincount"),r=M(t,"weights","bincount");D(a.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${a.dtype}`),D(n>=0,()=>`size must be non-negative, but got ${n}.`),D(r.size===a.size||r.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${a.shape}, weights shape: ${r.shape}.`);let s={x:a,weights:r},i={size:n};return P.runKernel(Zp,s,i)}var z1=L({bincount_:OC});function zC(e,t){let n=M(e,"broadcastTo","x"),a=n.shape;if(t.some(l=>!(l>0)||l%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){let l=n.shape.slice();for(;l.length=0;l--)if(r[l]===t[l])s[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${t}].`);if(s.map((l,u)=>l>1?u:-1).filter(l=>l>=0).length===0)return Ha(n);let i={x:n},o={reps:s};return P.runKernel(_r,i,o)}var Nl=L({broadcastTo_:zC});function _C(e){let t={x:M(e,"x","ceil")};return P.runKernel(Is,t)}var _1=L({ceil_:_C});function PC(e,t,n){let a=M(e,"x","clipByValue");D(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);let r={x:a},s={clipValueMin:t,clipValueMax:n};return P.runKernel(zr,r,s)}var Mn=L({clipByValue_:PC});function LC(e){return lt(e,0)}var b3=L({concat1d_:LC});function WC(e,t){return lt(e,t)}var Tl=L({concat2d_:WC});function BC(e,t){return lt(e,t)}var v3=L({concat3d_:BC});function VC(e,t){return lt(e,t)}var w3=L({concat4d_:VC});function jC(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","conv2d"),l=M(t,"filter","conv2d"),u=o,d=!1;o.rank===3&&(d=!0,u=q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),D(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),D(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),i!=null&&D(qt(a),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p=r==="NHWC"?u.shape[3]:u.shape[1];D(p===l.shape[2],()=>`Error in conv2d: depth of input (${p}) must match input depth for filter ${l.shape[2]}.`),D(Ga(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);let c={x:u,filter:l},h={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},m=P.runKernel(Ss,c,h);return d?q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var mr=L({conv2d_:jC});function UC(e,t,n,a,r="NWC",s=1,i){let o=M(e,"x","conv1d"),l=M(t,"filter","conv1d"),u=o,d=!1;o.rank===2&&(d=!0,u=q(o,[1,o.shape[0],o.shape[1]])),D(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),D(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),i!=null&&D(qt(a),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),D(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),D(Ga(n,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`),D(r==="NWC",()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`);let p=q(l,[1,l.shape[0],l.shape[1],l.shape[2]]),c=q(u,[u.shape[0],1,u.shape[1],u.shape[2]]),h=mr(c,p,[1,n],a,"NHWC",[1,s],i);return d?q(h,[h.shape[2],h.shape[3]]):q(h,[h.shape[0],h.shape[2],h.shape[3]])}var Gc=L({conv1d_:UC});function HC(e,t,n,a,r,s="NHWC",i){D(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,l=t,u=!1;t.rank===3&&(u=!0,l=q(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),D(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),D(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),D(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);let d=s==="NHWC"?o[3]:o[1],p=s==="NHWC"?l.shape[3]:l.shape[1];D(d===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${d}) must match input depth for filter ${n.shape[2]}.`),D(p===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${p}) must match output depth for filter ${n.shape[3]}.`),i!=null&&D(qt(r),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let c={dy:l,filter:n},h={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,inputShape:o},m=P.runKernel(Ns,c,h);return u?q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var P1=L({conv2DBackpropInput_:HC});function GC(e,t,n,a,r,s){let i=M(e,"x","conv2dTranspose"),o=M(t,"filter","conv2dTranspose");return P1(n,i,o,a,r,"NHWC",s)}var qc=L({conv2dTranspose_:GC});function qC(e,t,n,a,r="NDHWC",s=[1,1,1]){let i=M(e,"x","conv3d"),o=M(t,"filter","conv3d"),l=i,u=!1;i.rank===4&&(u=!0,l=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),D(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),D(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),D(l.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`),D(Ga(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),D(r==="NDHWC",()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`);let d={x:l,filter:o},p={strides:n,pad:a,dataFormat:r,dilations:s},c=P.runKernel(zu,d,p);return u?q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var L1=L({conv3d_:qC});function XC(e,t,n,a,r){D(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,i=t,o=!1;t.rank===4&&(o=!0,i=q(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);let l=s[4],u=i.shape[4];D(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),D(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),D(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),D(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),D(u===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`);let d={dy:i,filter:n},p={pad:r,strides:a,inputShape:s},c=P.runKernel(ec,d,p);return o?q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var k3=L({conv3DBackpropInput_:XC});function KC(e,t,n,a,r){let s=M(e,"x","conv3dTranspose"),i=M(t,"filter","conv3dTranspose");return k3(n,s,i,a,r)}var I3=L({conv3dTranspose_:KC});function ZC(e){let t={x:M(e,"x","cos")};return P.runKernel(Ts,t)}var dd=L({cos_:ZC});function YC(e){let t={x:M(e,"x","cosh")};return P.runKernel(No,t)}var Xc=L({cosh_:YC});function JC(e,t=0,n=!1,a=!1){let r={x:M(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:a};return P.runKernel(Cs,r,s)}var Kc=L({cumsum_:JC});function QC(e,t,n,a=!1){let r=M(e,"x","denseBincount"),s=M(t,"weights","denseBincount");D(r.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`),D(r.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`),D(n>=0,()=>`size must be non-negative, but got ${n}.`),D(s.size===r.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${s.shape}.`);let i={x:r,weights:s},o={size:n,binaryOutput:a};return P.runKernel(tc,i,o)}var S3=L({denseBincount_:QC});function eE(e,t,n="NHWC"){let a=M(e,"x","depthToSpace"),r=n==="NHWC"?a.shape[1]:a.shape[2],s=n==="NHWC"?a.shape[2]:a.shape[3],i=n==="NHWC"?a.shape[3]:a.shape[1];D(r*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${r} and ${t} for depthToSpace with input shape ${a.shape}`),D(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${s} and ${t} for depthToSpace with input shape - ${a.shape}`),D(i%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${a.shape}`);let o={x:a},u={blockSize:t,dataFormat:n};return P.runKernel(To,o,u)}var W1=L({depthToSpace_:QC});function eE(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","depthwiseConv2d"),u=M(t,"filter","depthwiseConv2d"),l=o,d=!1;o.rank===3&&(d=!0,l=q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),D(l.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${l.rank}.`),D(u.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${u.rank}.`),D(l.shape[3]===u.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`),i!=null&&D(qt(a),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p={x:l,filter:u},c={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},h=P.runKernel(Es,p,c);return d?q(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var Tl=L({depthwiseConv2d_:eE});function tE(e){let t={x:M(e,"x","diag")};return P.runKernel(rc,t)}var nE=L({diag_:tE});function aE(e,t,n,a,r=[1,1],s="NHWC"){let i=M(e,"x","dilation2d"),o=M(t,"filter","dilation2d");D(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),D(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),D(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let u=i,l=!1;i.rank===3&&(u=q(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=!0);let d={x:u,filter:o},p={strides:n,pad:a,dilations:r},c=P.runKernel(_u,d,p);return l?q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var B1=L({dilation2d_:aE});function rE(e,t){let n=e.length,a=[];for(let r=0;r1&&i===1&&a.unshift(s)}return a}function Bt(e,t){let n=[];for(let a=0;a1)&&n.unshift(s)}return n}function mt(e,t){let n=[],a=Math.max(e.length,t.length);for(let r=0;r`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${a.rank}.`);let r=n.rank===1?n.size:n.shape[1],s=a.rank===1?a.size:a.shape[0];if(D(r===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${s}.`),n.rank===1&&a.rank===1){let i=q(n,[1,-1]),o=q(a,[-1,1]),u=je(i,o);return q(u,[])}else if(n.rank===1&&a.rank===2){let i=q(n,[1,-1]),o=q(a,[a.shape[0],a.shape[1]]),u=je(i,o);return q(u,[u.size])}else if(n.rank===2&&a.rank===1){let i=q(a,[-1,1]),o=je(n,i);return q(o,[o.size])}else{let i=q(a,[a.shape[0],a.shape[1]]);return je(n,i)}}var S3=L({dot_:uE});function dE(e,...t){let n=t.map((r,s)=>M(r,`tensors${s}`,"einsum")),a={equation:e};return P.runKernel(oc,n,a)}var N3=L({einsum_:dE});function pE(e){let t={x:M(e,"x","elu")};return P.runKernel(Co,t)}var Cl=L({elu_:pE});function cE(e){let t=M(e,"x","erf");D(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=ge(t,"float32"));let n={x:t};return P.runKernel(Eo,n)}var j1=L({erf_:cE});function hE(e){let t={x:M(e,"x","exp")};return P.runKernel(Ms,t)}var la=L({exp_:hE});function fE(e,t=0){let n=M(e,"x","expandDims","string_or_numeric");D(t<=n.rank,()=>"Axis must be <= rank of the tensor");let a={input:n},r={dim:t};return P.runKernel(Mo,a,r)}var mn=L({expandDims_:fE});function mE(e){let t={x:M(e,"x","expm1")};return P.runKernel(Fo,t)}var U1=L({expm1_:mE});function gE(e,t){let n=M(e,"x","tile","string_or_numeric");D(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);let a={x:n},r={reps:t};return P.runKernel(_r,a,r)}var Gr=L({tile_:gE});function yE(e,t,n,a="float32"){t==null&&(t=e);let r=Ve([e,t],a),s=e<=t?e:t;for(let o=0;o`Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${s.rank}.`),D(qt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=q(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let u={x:i},l={depthRadius:t,bias:n,alpha:a,beta:r},d=P.runKernel(Bu,u,l);return o?q(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var q1=L({localResponseNormalization_:EE});function RE(e){let t={x:M(e,"x","log")};return P.runKernel(Ps,t)}var Bn=L({log_:RE});function ME(e){let t={x:M(e,"x","log1p")};return P.runKernel(Vo,t)}var Jc=L({log1p_:ME});function FE(e){return D(Dr(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{let a=M(t,"x","tf.grad","string_or_numeric"),r=n!=null?M(n,"dy","tf.grad"):null;return P.tidy(()=>{let{value:s,grads:i}=P.gradients(()=>e(a),[a],r);return r!=null&&cn(s.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Qc(i),i[0]})}}function $E(e){return D(Dr(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{D(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let a=rd(t,"args","tf.grads","string_or_numeric"),r=n!=null?M(n,"dy","tf.grads"):null;return P.tidy(()=>{let{value:s,grads:i}=P.gradients(()=>e(...a),a,r);return r!=null&&cn(s.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Qc(i),i})}}function DE(e){return D(Dr(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{D(t instanceof Be,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),D(n==null||n instanceof Be,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:a,value:r}=P.gradients(()=>e(t),[t],n);return Qc(a),{grad:a[0],value:r}}}function OE(e){return D(Dr(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{D(Array.isArray(t)&&t.every(r=>r instanceof Be),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),D(n==null||n instanceof Be,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let a=P.gradients(()=>e(...t),t,n);return n!=null&&cn(a.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Qc(a.grads),a}}function R3(e,t){D(Dr(e),()=>"The f passed in variableGrads(f) must be a function"),D(t==null||Array.isArray(t)&&t.every(l=>l instanceof td),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let n=t!=null;if(!n){t=[];for(let l in P.registeredVariables)t.push(P.registeredVariables[l])}let a=n?t.filter(l=>!l.trainable):null,r=t.length;t=t.filter(l=>l.trainable),D(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`);let s=!0,{value:i,grads:o}=P.gradients(e,t,null,s);D(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()."),D(i.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let u={};return t.forEach((l,d)=>{o[d]!=null&&(u[l.name]=o[d])}),a!=null&&a.forEach(l=>u[l.name]=null),{value:i,grads:u}}function qa(e){return P.customGrad(e)}function Qc(e){if(e.filter(t=>t==null).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.`)}function zE(e){let t={x:M(e,"x","neg")};return P.runKernel(Ho,t)}var St=L({neg_:zE});function _E(e){let t={x:M(e,"x","softplus")};return P.runKernel(ol,t)}var Ci=L({softplus_:_E});function PE(e){let t=M(e,"x","logSigmoid");return qa(n=>({value:St(Ci(St(n))),gradFunc:a=>B(a,Rn(St(n)))}))(t)}var M3=L({logSigmoid_:PE});function LE(e,t=null,n=!1){let a={x:M(e,"x","max")},r={reductionIndices:t,keepDims:n};return P.runKernel(Ls,a,r)}var Vn=L({max_:LE});function WE(e,t){let n=M(e,"a","sub"),a=M(t,"b","sub");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(ui,r)}var ye=L({sub_:WE});function BE(e,t=null,n=!1){let a=M(e,"x","sum");a.dtype==="bool"&&(a=ge(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return P.runKernel(ii,r,s)}var Se=L({sum_:BE});function VE(e,t=-1){let n=M(e,"logits","logSoftmax");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return qa((a,r)=>{let s=!0,i=Vn(a,t,!0),o=ye(a,i),u=ye(ge(o,"float32"),Bn(Se(la(o),t,s)));return r([u]),{value:u,gradFunc:(l,d)=>{let[p]=d,c=!0,h=la(p);return ye(l,B(Se(l,t,c),h))}}})(n)}var eh=L({logSoftmax_:VE});function X1(e,t){for(let n=0;ne[s]);return[n,r]}function Ei(e,t){let n=t.map(a=>1);return F3(e,n,t)}function jE(e,t,n){D(X1(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function D3(e,t){if(X1(e,t))return null;let n=[];for(let a=0;an.push(a)),n}function K1(e){return e.map((t,n)=>[n,t]).sort((t,n)=>t[1]-n[1]).map(t=>t[0])}function UE(e,t){let n=[];for(let a=t-e;a`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),D(Ga(n,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),r!=null&&D(qt(a),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let l={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=P.runKernel(Bs,l,d);return u?q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var hd=L({maxPool_:ZE});function YE(e,t=[1,1,1],n,a,r,s="NDHWC"){let i=M(e,"x","maxPool3d"),o=i,u=!1;i.rank===4&&(u=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),D(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),D(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&D(qt(a),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let l={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=P.runKernel(Vu,l,d);return u?q(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var Y1=L({maxPool3d_:YE});function JE(e,t,n,a,r=!1){let s={x:M(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:a,includeBatchInIndex:r},o=P.runKernel(gc,s,i);return{result:o[0],indexes:o[1]}}var z3=L({maxPoolWithArgmax_:JE});function QE(e,t){let n=M(e,"a","maximum"),a=M(t,"b","maximum");[n,a]=It(n,a),n.dtype==="bool"&&(n=ge(n,"int32"),a=ge(a,"int32")),mt(n.shape,a.shape);let r={a:n,b:a};return P.runKernel(Ws,r)}var Xa=L({maximum_:QE});function eR(e,t=null,n=!1){let a={x:M(e,"x","mean")},r={axis:t,keepDims:n};return P.runKernel(Vs,a,r)}var Nt=L({mean_:eR});function $t(e,t="float32"){if(t==="complex64"){let a=$t(e,"float32"),r=$t(e,"float32");return Wr(a,r)}let n=qp(Mt(e),t);return P.makeTensor(n,e,t)}function jn(e,t="float32"){if(t==="complex64"){let a=jn(e,"float32"),r=$t(e,"float32");return Wr(a,r)}let n=jm(Mt(e),t);return P.makeTensor(n,e,t)}function tR(e,t,{indexing:n="xy"}={}){if(n!=="xy"&&n!=="ij")throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(e===void 0)return[];let a=M(e,"x","meshgrid",e instanceof Be?e.dtype:"float32");if(t===void 0)return[a];let r=M(t,"y","meshgrid",t instanceof Be?t.dtype:"float32"),s=Mt(a.shape),i=Mt(r.shape);return n==="xy"?(a=q(a,[1,-1]),r=q(r,[-1,1]),[je(jn([i,1],a.dtype),a),je(r,jn([1,s],r.dtype))]):(a=q(a,[-1,1]),r=q(r,[1,-1]),[je(a,jn([1,i],a.dtype)),je(jn([s,1],r.dtype),r)])}function nR(e,t=null,n=!1){let a={x:M(e,"x","min")},r={axis:t,keepDims:n};return P.runKernel(js,a,r)}var fd=L({min_:nR});function aR(e,t){let n=M(e,"a","minimum"),a=M(t,"b","minimum");[n,a]=It(n,a),n.dtype==="bool"&&(n=ge(n,"int32"),a=ge(a,"int32")),mt(n.shape,a.shape);let r={a:n,b:a};return P.runKernel(Us,r)}var Ml=L({minimum_:aR});function rR(e,t,n){D(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);let a=M(e,"x","mirrorPad");if(a.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");D(t.length===a.rank,()=>`Padding doesn't match input. Must be ${a.rank}. Got ${t.length}.`);let r=n==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),D(t[o][0]>=0&&t[o][0]<=a.shape[o]-r&&t[o][1]>=0&&t[o][1]<=a.shape[o]-r,()=>`Padding in dimension ${o} cannot be greater than or equal to ${a.shape[o]-r} or less than 0 for input of shape ${a.shape}`);let s={paddings:t,mode:n},i={x:a};return P.runKernel(Hs,i,s)}var J1=L({mirrorPad_:rR});function sR(e,t){let n=M(e,"a","mod"),a=M(t,"b","mod");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Uo,r)}var Q1=L({mod_:sR});function iR(e){let t=M(e,"x","square"),n={};return P.runKernel("Square",{x:t},n)}var ot=L({square_:iR});function oR(e,t=null,n=!1){e=M(e,"x","moments");let a=ya(t,e.shape),r=Nt(e,a,n),s=r.shape;n||(s=Ei(r.shape,a));let i=ot(ye(ge(e,"float32"),q(r,s))),o=Nt(i,a,n);return{mean:r,variance:o}}var nh=L({moments_:oR});function lR(e,t,n,a){let r=M(t,"data","multiRNNCell"),s=rd(n,"c","multiRNNCell"),i=rd(a,"h","multiRNNCell"),o=r,u=[];for(let p=0;p2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();let o={logits:i===1?q(r,[1,-1]):r},u={numSamples:t,seed:n,normalized:a},l=P.runKernel(yc,o,u);return i===1?q(l,[l.size]):l}var _3=L({multinomial_:dR});function pR(e,t){let n=M(e,"a","notEqual","string_or_numeric"),a=M(t,"b","notEqual","string_or_numeric");[n,a]=It(n,a),mt(n.shape,a.shape);let r={a:n,b:a};return P.runKernel(Go,r)}var Ri=L({notEqual_:pR});function cR(e){let t={x:M(e,"x","onesLike")};return P.runKernel(Zo,t)}var Un=L({onesLike_:cR});function hR(e,t){let n=M(e,"v1","outerProduct"),a=M(t,"v2","outerProduct");D(n.rank===1&&a.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${a.rank}.`);let r=q(n,[-1,1]),s=q(a,[1,-1]);return je(r,s)}var fR=L({outerProduct_:hR});function mR(e,t,n=0){let a=M(e,"x","pad");if(a.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let r={paddings:t,constantValue:n},s={x:a};return P.runKernel(Xs,s,r)}var gr=L({pad_:mR});function gR(e,t,n=0){return D(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),gr(e,[t],n)}var yR=L({pad1d_:gR});function AR(e,t,n=0){return D(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),gr(e,t,n)}var xR=L({pad2d_:AR});function bR(e,t,n=0){return D(t.length===3&&t[0].length===2&&t[1].length===2&&t[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),gr(e,t,n)}var vR=L({pad3d_:bR});function wR(e,t,n=0){return D(t.length===4&&t[0].length===2&&t[1].length===2&&t[2].length===2&&t[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),gr(e,t,n)}var kR=L({pad4d_:wR});function IR(e,t,n){let a=M(e,"x","spaceToBatchND");D(a.rank>=1+t.length,()=>`input rank ${a.rank} should be > than [blockShape] ${t.length}`),D(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),D(a.shape.reduce((i,o,u)=>u>0&&u<=t.length?i&&(o+n[u-1][0]+n[u-1][1])%t[u-1]==0:i,!0),()=>`input spatial dimensions ${a.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);let r={x:a},s={blockShape:t,paddings:n};return P.runKernel(Hu,r,s)}var md=L({spaceToBatchND_:IR});function SR(e,t,n,a,r,s){r==null&&(r=[1,1]),s==null&&(s=1),a===0&&(a="valid");let i=M(e,"x","maxPool"),o=i,u=!1;i.rank===3&&(u=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2]])),D(Ga(s,r),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${r}'`);let l=h3(o.shape,t,s,r,a),d=[l.dilationHeight,l.dilationWidth],p;a==="same"?p=TR([l.filterHeight,l.filterWidth],d):p=[[0,0],[0,0]];let c=d[0]===1&&d[1]===1,[h,m]=NR([l.inHeight,l.inWidth],d,p),f=c?a:"valid",g=c?o:md(o,d,h),y=(n==="avg"?()=>ld(g,t,s,f):()=>hd(g,t,s,f))(),A=c?y:ud(y,d,m);return u?q(A,[A.shape[1],A.shape[2],A.shape[3]]):A}function NR(e,t,n){let a=n.map(d=>d[0]),r=n.map(d=>d[1]),s=e.concat(a,r),i=t.map((d,p)=>(d-s[p]%d)%d),o=r.map((d,p)=>d+i[p]),u=t.map((d,p)=>[a[p],o[p]]),l=t.map((d,p)=>[0,i[p]]);return[u,l]}function TR(e,t){let n=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),a=n.map(s=>Math.floor(s/2)),r=n.map((s,i)=>s-a[i]);return n.map((s,i)=>[a[i],r[i]])}var P3=L({pool_:SR});function CR(e,t){let n=M(e,"base","pow"),a=M(t,"exp","pow");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Ks,r)}var yr=L({pow_:CR});function ER(e,t){let n=M(e,"x","prelu"),a=M(t,"alpha","prelu"),r={x:n,alpha:a};return P.runKernel(Zs,r)}var gd=L({prelu_:ER});function RR(e,t=null,n=!1){let a=M(e,"x","prod");a.dtype==="bool"&&(a=ge(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return P.runKernel(Jo,r,s)}var ah=L({prod_:RR});function MR(e,t,n){let a=Mt(e),r=null;if(n==null||n==="float32")r=new Float32Array(a);else if(n==="int32")r=new Int32Array(a);else if(n==="bool")r=new Uint8Array(a);else throw new Error(`Unknown data type ${n}`);for(let s=0;s=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*a*i,t=this.mean+this.stdDev*r*i,(!this.truncated||this.isValidTruncated(e))&&(n=!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}},$R=class{constructor(e,t,n,a){this.alpha=e,this.beta=1/t,this.dtype=n;let r=a||Math.random();this.randu=eg.alea(r.toString()),this.randn=new tg(0,1,n,!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,n,a,r,s;for(;;){do a=this.randn.nextValue(),s=1+this.c*a;while(s<=0);if(s*=s*s,e=a*a,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),r=this.randu(),rthis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=n,a==null&&(a=Math.random()),typeof a=="number"&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=eg.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function OR(e,t,n=1,a="float32",r){if(n==null&&(n=1),a==null&&(a="float32"),a!=="float32"&&a!=="int32")throw new Error(`Unsupported data type ${a}`);let s=new $R(t,n,a,r),i=Ve(e,a);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),Hn(t,0)}var HR=L({reverse1d_:UR});function GR(e,t){let n=M(e,"x","reverse");return D(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),Hn(n,t)}var qR=L({reverse2d_:GR});function XR(e,t){let n=M(e,"x","reverse");return D(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),Hn(n,t)}var KR=L({reverse3d_:XR});function ZR(e,t){let n=M(e,"x","reverse");return D(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),Hn(n,t)}var YR=L({reverse4d_:ZR});function JR(e){let t={x:M(e,"x","round")};return P.runKernel(ti,t)}var sh=L({round_:JR});function QR(e){let t={x:M(e,"x","rsqrt")};return P.runKernel(ni,t)}var ih=L({rsqrt_:QR});function ke(e,t){if((on(e)&&t!=="string"||Array.isArray(e))&&t!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(t==="string"&&on(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Br(e,[],[],t)}function eM(e){let t={x:M(e,"x","selu")};return P.runKernel(al,t)}var oh=L({selu_:eM});function tM(e,t,n,a,r,s=[1,1],i="NHWC"){let o=M(e,"x","separableConv2d"),u=M(t,"depthwiseFilter","separableConv2d"),l=M(n,"pointwiseFilter","separableConv2d"),d=o,p=!1;if(o.rank===3&&(p=!0,d=q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),i==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");D(d.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${d.rank}.`),D(u.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${u.rank}.`),D(l.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${u.rank}.`),D(l.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${l.shape[0]}.`),D(l.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${l.shape[1]}.`);let c=u.shape[2],h=u.shape[3];D(l.shape[2]===c*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${c*h}, but got ${l.shape[2]}.`);let m=Tl(d,u,a,r,i,s),f=mr(m,l,1,"valid",i);return p?q(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var ag=L({separableConv2d_:tM});async function nM(e,t){let n=M(e,"x","setdiff1d"),a=M(t,"y","setdiff1d");D(n.dtype===a.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${a.dtype}).`),D(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),D(a.rank===1,()=>`y should be 1D tensor, but got y (${a.shape}).`);let r=await n.data(),s=await a.data(),i=new Set(s),o=0;for(let d=0;d`slice1d expects a rank-1 tensor, but got a rank-${a.rank} tensor`),Re(a,[t],[n])}var dh=L({slice1d_:iM});function oM(e,t,n){let a=M(e,"x","slice2d");return D(a.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${a.rank} tensor`),Re(a,t,n)}var sg=L({slice2d_:oM});function lM(e,t,n){let a=M(e,"x","slice3d");return D(a.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${a.rank} tensor`),Re(a,t,n)}var ph=L({slice3d_:lM});function uM(e,t,n){let a=M(e,"x","slice4d");return D(a.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${a.rank} tensor`),Re(a,t,n)}var Ad=L({slice4d_:uM});function dM(e,t=-1){let n=M(e,"logits","softmax","float32");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);let a={logits:n},r={dim:t};return P.runKernel(oi,a,r)}var xd=L({softmax_:dM});function pM(e){D(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return P.runKernel(uc,t)}var bd=L({fft_:pM});function cM(e){D(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return P.runKernel(dc,t)}var Dl=L({ifft_:cM});function hM(e){let t=e.shape[e.shape.length-1],n=e.size/t,a;if(t<=2){let r=q(e,[n,t]);a=Dl(r)}else{let r=[n,2*(t-1)],s=q(yd(e),[n,t]),i=q(Zc(e),[n,t]),o=Hn(Re(s,[0,1],[n,t-2]),1),u=B(Hn(Re(i,[0,1],[n,t-2]),1),ke(-1)),l=lt([s,o],1),d=lt([i,u],1),p=q(Wr(l,d),[r[0],r[1]]);a=Dl(p)}if(a=yd(a),e.rank===3&&e.shape[0]!==0){let r=a,s=e.shape[0];a=q(a,[s,a.shape[0]/s,a.shape[1]]),r.dispose()}return a}var ch=L({irfft_:hM});function fM(e,t,n=0){let a={x:M(e,"x","split")},r={numOrSizeSplits:t,axis:n};return P.runKernel(ll,a,r)}var Zt=L({split_:fM});function mM(e,t){D(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],a=e.size/n,r;if(t!=null&&t0),f=e.shape.map(g=>g);f[e.shape.length-1]=t,r=Re(e,m,f),n=t}else if(t!=null&&t>n){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-n,r=lt([e,$t(m)],e.shape.length-1),n=t}else r=e;let s=Ge(r),i=q(Wr(r,s),[a,n]),o=bd(i),u=Math.floor(n/2)+1,l=yd(o),d=Zc(o),p=Zt(l,[u,n-u],l.shape.length-1),c=Zt(d,[u,n-u],d.shape.length-1),h=r.shape.slice();return h[r.shape.length-1]=u,q(Wr(p[0],c[0]),h)}var vd=L({rfft_:mM});function gM(e){let t={x:M(e,"x","sqrt")};return P.runKernel(si,t)}var an=L({sqrt_:gM});function yM(e,t){let n=M(e,"a","squaredDifference"),a=M(t,"b","squaredDifference");[n,a]=It(n,a),mt(n.shape,a.shape);let r={a:n,b:a},s={};return P.runKernel(li,r,s)}var hh=L({squaredDifference_:yM});function AM(e,t){let n=M(e,"x","squeeze");return q(n,ab(n.shape,t).newShape)}var Vt=L({squeeze_:AM});function xM(e,t=0){let n=rd(e,"tensors","stack","string_or_numeric");D(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&D(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");let a=n,r={axis:t};return P.runKernel(Yo,a,r)}var gn=L({stack_:xM});function bM(e,t=0){let n={x:M(e,"x","step")},a={alpha:t};return P.runKernel(Pr,n,a)}var Ol=L({step_:bM});function vM(e,t,n,a,r=0,s=0,i=0,o=0,u=0){let l={x:M(e,"x","stridedSlice","string_or_numeric")},d={begin:t,end:n,strides:a,beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:u};return P.runKernel(ul,l,d)}var ig=L({stridedSlice_:vM});function wM(e){let t={x:M(e,"x","tan")};return P.runKernel(di,t)}var og=L({tan_:wM});function Dt(e,t){ys(e);let n=Ua(e,t);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Br(e,null,n,t)}function Ta(e,t,n){if(ys(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let a=Ua(e,n);if(a.length!==2&&a.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Br(e,t,a,n)}function kM(e,t,n){if(ys(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let a=Ua(e,n);if(a.length!==4&&a.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Br(e,t,a,n)}function IM(e,t,n){if(ys(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let a=Ua(e,n);if(a.length!==5&&a.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Br(e,t,a,n)}function SM(e,t,n){if(ys(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let a=Ua(e,n);if(a.length!==6&&a.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||a,Br(e,t,a,n)}function NM(e,t=1,n=!0){let a=M(e,"x","topk");if(a.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");let r=a.shape[a.shape.length-1];if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);let s={x:a},i={k:t,sorted:n},[o,u]=P.runKernel(dl,s,i);return{values:o,indices:u}}var lg=L({topk_:NM});function TM(e,t=0,n=1,a,r){if(a!=null&&a==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new tg(t,n,a,!0,r),i=Ve(e,a);for(let o=0;o0,()=>"The input tensor must be at least 1D");let a={x:n},r={axis:t},[s,i]=P.runKernel(Ec,a,r);return{values:s,indices:i}}var mh=L({unique_:CM});function EM(e,t,n){let a=M(e,"x","unsortedSegmentSum"),r=M(t,"segmentIds","unsortedSegmentSum","int32");D(qt(n),()=>"numSegments must be of dtype int");let s={x:a,segmentIds:r},i={numSegments:n};return P.runKernel(qu,s,i)}var ug=L({unsortedSegmentSum_:EM});function RM(e,t=0){let n=M(e,"x","unstack","string_or_numeric");D(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);let a={value:n},r={axis:t};return P.runKernel(cl,a,r)}var Gn=L({unstack_:RM});function B3(e,t=!0,n,a){return P.makeVariable(e,t,n,a)}function V3(e,t){let n=[];for(let s=0;s0,()=>"mask cannot be scalar"),cn(o.slice(s,s+i),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let u=1;for(let f=s;f"Shape mismatch in v and x");let u=ke(1),l=ye(u,o),d=B(ye(i,s),l);if(r){D(a!=null,()=>"When using zeroDebias: true, step is required.");let p=M(a,"step","movingAverage");d=me(d,ye(u,yr(o,p)))}return ie(s,d)}var zM=L({movingAverage_:OM});function _M(e,t,n){let a=M(e,"indices","scatterND","int32"),r=M(t,"updates","scatterND");x1(r,a,n);let s={indices:a,updates:r},i={shape:n};return P.runKernel(tl,s,i)}var U3=L({scatterND_:_M});function PM(e,t,n,a){if(e.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let r=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);let i=t.size;if(!(t.rank===0||t.rank===1&&i===r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==a.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function LM(e,t,n,a=0){let r=M(e,"sparseIndices","sparseToDense","int32"),s=M(t,"sparseValues","sparseToDense"),i=M(a,"defaultValue","sparseToDense",s.dtype);PM(r,s,n,i);let o={sparseIndices:r,sparseValues:s,defaultValue:i},u={outputShape:n};return P.runKernel(Sc,o,u)}var pg=L({sparseToDense_:LM});function WM(e,t){let n=M(t,"indices","gatherND","int32"),a={params:M(e,"x","gatherND","string_or_numeric"),indices:n};return P.runKernel(Oo,a)}var H3=L({gatherND_:WM});function BM(e,t){if(t==null)return e.shape.slice();if(cr(e.shape,t))return t;if(e.shape.length===t.length){let n=[];for(let a=0;a`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`),D(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof Be?r.clone():r;let s=BM(r,n),i=1-t,o=me(Rl(ie(Fl(s,0,1,"float32",a),i)),i);return B(r,o)}var G3=L({dropout_:VM});function q3(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function cg(e,t,n){let a=1-e%2,r=new Float32Array(e);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${a.rank}`),D(a.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${a.rank} and targets rank ${r.rank}`),cn(a.shape.slice(0,a.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=a.shape[a.shape.length-1];D(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);let i=await a.data(),o=await r.data(),[u,l]=[i.length/s,s],d=rb("bool",u);for(let p=0;pg.value-f.value),d[p]=0;for(let f=0;fqM,depthwiseConv2d:()=>YM,matMul:()=>QM});function HM(e,t,n,a,r,s="NHWC",i){let o=e;e.rank===3&&(o=q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let u=t;u.rank===3&&(u=q(t,[1,t.shape[0],t.shape[1],t.shape[2]])),D(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),D(u.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${u.shape}.`),D(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);let l=s==="NHWC"?o.shape[3]:o.shape[1],d=s==="NHWC"?u.shape[3]:u.shape[1];D(l===n[2],()=>`Error in conv2dDerFilter: depth of input ${l}) must match input depth in filter (${n[2]}.`),D(d===n[3],()=>`Error in conv2dDerFilter: depth of dy (${d}) must match output depth for filter (${n[3]}).`),i!=null&&D(qt(r),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let p={x:o,dy:u},c={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,filterShape:n};return P.runKernel(Jp,p,c)}var hg=L({conv2DBackpropFilter_:HM});function yh(e,t,n){if(n==null||n==="linear")return e;if(n==="relu")return B(e,Ol(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Ah(e,t){let n=t,a=Bt(e.shape,t.shape);return a.length>0&&(n=Se(n,a)),q(n,e.shape)}function xh(e,t,n,a){if(t==="linear")return e;if(t==="relu")return Ka(e);if(t==="elu")return Cl(e);if(t==="relu6")return rh(e);if(t==="prelu")return gd(e,n);if(t==="leakyrelu")return pd(e,a);if(t==="sigmoid")return Rn(e);throw new Error(`Unknown fused activation ${t}.`)}var bh=(e,t)=>!(e>0)||t==="linear";function GM({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:u="linear",preluActivationWeights:l,leakyreluAlpha:d}){if(u=u||"linear",bh(P.state.gradientDepth,u)===!1){let b=mr(e,t,n,a,r,s,i);return o!=null&&(b=ie(b,o)),xh(b,u,l,d)}let p=M(e,"x","conv2d"),c=M(t,"filter","conv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=q(p,[1,p.shape[0],p.shape[1],p.shape[2]])),D(h.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),D(c.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${c.rank}.`),i!=null&&D(qt(a),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),D(h.shape[3]===c.shape[2],()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${c.shape[2]}.`),D(Ga(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),D(r==="NHWC",()=>`Error in conv2d: got dataFormat of ${r} but only NHWC is currently supported.`);let f=od(h.shape,c.shape,n,s,a,i),g;o!=null&&(g=M(o,"bias","fused conv2d"),[g]=It(g,p),mt(f.outShape,g.shape));let y;l!=null&&(y=M(l,"prelu weights","fused conv2d"));let A=(b,w)=>{let[N,C,E,_]=w,$=yh(b,E,u);D(Ur(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let S=P1(C.shape,$,N,n,a),z=hg(C,$,N.shape,n,a),O=[S,z];if(_!=null){let W=Ah(_,$);O.push(W)}return O},x={x:h,filter:c,bias:g,preluActivationWeights:y},v={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:u,leakyreluAlpha:d};return o==null?qa((b,w,N)=>{let C=P.runKernel(fi,x,v);return N([w,b,C]),m&&(C=q(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:A}})(h,c):qa((b,w,N,C)=>{let E=P.runKernel(fi,x,v);return C([w,b,E,N]),m&&(E=q(E,[E.shape[1],E.shape[2],E.shape[3]])),{value:E,gradFunc:A}})(h,c,g)}var qM=L({fusedConv2d_:GM});function XM(e,t,n,a,r,s=[1,1],i){let o=e;e.rank===3&&(o=q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let u=t;u.rank===3&&(u=q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l={x:o,dy:u},d={strides:a,pad:r,dimRoundingMode:i,dilations:s,filterShape:n};return P.runKernel(nc,l,d)}var X3=L({depthwiseConv2dNativeBackpropFilter_:XM});function KM(e,t,n,a,r,s=[1,1],i){let o=t,u=!1;t.rank===3&&(u=!0,o=q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l={dy:o,filter:n},d={strides:a,pad:r,dimRoundingMode:i,dilations:s,inputShape:e},p=P.runKernel(ac,l,d);return u?q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var K3=L({depthwiseConv2dNativeBackpropInput_:KM});function ZM({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:u="linear",preluActivationWeights:l,leakyreluAlpha:d}){if(bh(P.state.gradientDepth,u)===!1){let b=Tl(e,t,n,a,r,s,i);return o!=null&&(b=ie(b,o)),xh(b,u,l,d)}let p=M(e,"x","depthwiseConv2d"),c=M(t,"filter","depthwiseConv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=q(p,[1,p.shape[0],p.shape[1],p.shape[2]])),D(h.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),D(c.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${c.rank}.`),D(h.shape[3]===c.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`),s==null&&(s=[1,1]),D(Ga(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),i!=null&&D(qt(a),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${i} but got pad ${a}.`);let f=od(h.shape,c.shape,n,s,a,i,!0),g;o!=null&&(g=M(o,"bias","fused conv2d"),[g]=It(g,p),mt(f.outShape,g.shape));let y;l!=null&&(y=M(l,"prelu weights","fused depthwiseConv2d"));let A=(b,w)=>{D(Ur(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[N,C,E,_]=w,$=yh(b,E,u),S=K3(C.shape,$,N,n,a,s,i),z=X3(C,$,N.shape,n,a,s,i);if(_!=null){let O=Ah(g,$);return[S,z,O]}return[S,z]},x={x:h,filter:c,bias:g,preluActivationWeights:y},v={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:u,leakyreluAlpha:d};return o==null?qa((b,w,N)=>{let C=P.runKernel(mi,x,v);return N([w,b,C]),m&&(C=q(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:A}})(h,c):qa((b,w,N,C)=>{let E=P.runKernel(mi,x,v);return C([w,b,E,N]),m&&(E=q(E,[E.shape[1],E.shape[2],E.shape[3]])),{value:E,gradFunc:A}})(h,c,g)}var YM=L({fusedDepthwiseConv2d_:ZM});function JM({a:e,b:t,transposeA:n=!1,transposeB:a=!1,bias:r,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o}){if(bh(P.state.gradientDepth,s)===!1){let _=je(e,t,n,a);return r!=null&&(_=ie(_,r)),xh(_,s,i,o)}let u=M(e,"a","fused matMul"),l=M(t,"b","fused matMul");[u,l]=It(u,l);let d=n?u.shape[u.rank-2]:u.shape[u.rank-1],p=a?l.shape[l.rank-1]:l.shape[l.rank-2],c=n?u.shape[u.rank-1]:u.shape[u.rank-2],h=a?l.shape[l.rank-2]:l.shape[l.rank-1],m=u.shape.slice(0,-2),f=l.shape.slice(0,-2),g=Mt(m),y=Mt(f);D(u.rank>=2&&l.rank>=2&&u.rank===l.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${u.rank} and ${l.rank}.`),D(cr(m,f),()=>`Error in fused matMul: outer dimensions (${m}) and (${f}) of Tensors with shapes ${u.shape} and ${l.shape} must match.`),D(d===p,()=>`Error in fused matMul: inner shapes (${d}) and (${p}) of Tensors with shapes ${u.shape} and ${l.shape} and transposeA=${n} and transposeB=${a} must match.`);let A=u.shape.slice(0,-2).concat([c,h]),x=n?q(u,[g,d,c]):q(u,[g,c,d]),v=a?q(l,[y,h,p]):q(l,[y,p,h]),b;r!=null&&(b=M(r,"bias","fused matMul"),[b]=It(b,u),mt(A,b.shape));let w;i!=null&&(w=M(i,"prelu weights","fused matMul"));let N=(_,$)=>{let[S,z,O,W]=$,G=yh(q(_,O.shape),O,s),H,J;if(!n&&!a?(H=je(G,z,!1,!0),J=je(S,G,!0,!1)):!n&&a?(H=je(G,z,!1,!1),J=je(G,S,!0,!1)):n&&!a?(H=je(z,G,!1,!0),J=je(S,G,!1,!1)):(H=je(z,G,!0,!0),J=je(G,S,!0,!0)),r!=null){let K=Ah(W,G);return[H,J,K]}else return[H,J]},C={a:x,b:v,bias:b,preluActivationWeights:w},E={transposeA:n,transposeB:a,activation:s,leakyreluAlpha:o};return r==null?qa((_,$,S)=>{let z=P.runKernel(hi,C,E);return S([_,$,z]),{value:q(z,A),gradFunc:N}})(x,v):qa((_,$,S,z)=>{let O=P.runKernel(hi,C,E);return z([_,$,O,S]),{value:q(O,A),gradFunc:N}})(x,v,b)}var QM=L({fusedMatMul_:JM});function eF(e){return cg(e,.54,.46)}var tF=L({hammingWindow_:eF});function nF(e){return cg(e,.5,.5)}var Z3=L({hannWindow_:nF});function aF(e,t,n,a=!1,r=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Re(e,s,t)),s+=n;if(a)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),D(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${l},4] but had shape ${o.shape}.`),D(u.rank===1&&u.shape[0]===l,()=>`Error in cropAndResize: boxInd must be have size [${l}] but had shape ${o.shape}.`),D(a.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${a.length}.`),D(a[0]>=1&&a[1]>=1,()=>`cropSize must be atleast [1,1], but was ${a}`),D(r==="bilinear"||r==="nearest",()=>`method must be bilinear or nearest, but was ${r}`);let d={image:i,boxes:o,boxInd:u},p={method:r,extrapolationValue:s,cropSize:a};return P.runKernel(No,d,p)}var oF=L({cropAndResize_:iF});function lF(e){let t=M(e,"image","flipLeftRight","float32");D(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let n={image:t};return P.runKernel($o,n,{})}var uF=L({flipLeftRight_:lF});function dF(e,t,n=0,a=.5){let r=M(e,"image","rotateWithOffset","float32");D(r.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`);let s={image:r},i={radians:t,fillValue:n,center:a};return P.runKernel(fl,s,i)}var pF=L({rotateWithOffset_:dF});function zl(e,t,n,a,r,s){a==null&&(a=.5),r==null&&(r=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return n=Math.min(n,i),D(0<=a&&a<=1,()=>`iouThreshold must be in [0, 1], but was '${a}'`),D(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),D(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),D(t.rank===1,()=>"scores must be a 1D tensor"),D(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),D(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s}}function cF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppression"),i=M(t,"scores","nonMaxSuppression"),o=zl(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let u={maxOutputSize:n,iouThreshold:a,scoreThreshold:r};return P.runKernel(qo,{boxes:s,scores:i},u)}var hF=L({nonMaxSuppression_:cF});function fF(e,t,n){let a=mF(e,t,n),r=a<0?-(a+1):a;e.splice(r,0,t)}function mF(e,t,n){return yF(e,t,n||gF)}function gF(e,t){return e>t?1:e>>1);let o=n(t,e[s]);o>0?a=s+1:(r=s,i=!o)}return i?a:-a-1}function J3(e,t,n,a,r){return fg(e,t,n,a,r,0)}function Q3(e,t,n,a,r,s){return fg(e,t,n,a,r,0,!1,s,!0)}function e7(e,t,n,a,r,s){return fg(e,t,n,a,r,s,!0)}function fg(e,t,n,a,r,s,i=!1,o=!1,u=!1){let l=[];for(let g=0;gr&&l.push({score:t[g],boxIndex:g,suppressBeginIndex:0});l.sort(t7);let d=s>0?-.5/s:0,p=[],c=[];for(;p.length0;){let g=l.pop(),{score:y,boxIndex:A,suppressBeginIndex:x}=g;if(y=x;--b){let w=AF(e,A,p[b]);if(w>=a){v=!0;break}if(g.score=g.score*xF(a,d,w),g.score<=r)break}g.suppressBeginIndex=p.length,v||(g.score===y?(p.push(A),c.push(g.score)):g.score>r&&fF(l,g,t7))}let h=p.length,m=n-h;o&&m>0&&(p.push(...new Array(m).fill(0)),c.push(...new Array(m).fill(0)));let f={selectedIndices:p};return i&&(f.selectedScores=c),u&&(f.validOutputs=h),f}function AF(e,t,n){let a=e.subarray(t*4,t*4+4),r=e.subarray(n*4,n*4+4),s=Math.min(a[0],a[2]),i=Math.min(a[1],a[3]),o=Math.max(a[0],a[2]),u=Math.max(a[1],a[3]),l=Math.min(r[0],r[2]),d=Math.min(r[1],r[3]),p=Math.max(r[0],r[2]),c=Math.max(r[1],r[3]),h=(o-s)*(u-i),m=(p-l)*(c-d);if(h<=0||m<=0)return 0;let f=Math.max(s,l),g=Math.max(i,d),y=Math.min(o,p),A=Math.min(u,c),x=Math.max(y-f,0)*Math.max(A-g,0);return x/(h+m-x)}function xF(e,t,n){let a=Math.exp(t*n*n);return n<=e?a:0}function t7(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function bF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppressionAsync"),i=M(t,"scores","nonMaxSuppressionAsync"),o=zl(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let u=await Promise.all([s.data(),i.data()]),l=u[0],d=u[1],{selectedIndices:p}=J3(l,d,n,a,r);return s!==e&&s.dispose(),i!==t&&i.dispose(),Dt(p,"int32")}var vF=bF;function wF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),u=zl(i,o,n,a,r,s);n=u.maxOutputSize,a=u.iouThreshold,r=u.scoreThreshold,s=u.softNmsSigma;let l={boxes:i,scores:o},d={maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s},p=P.runKernel(Ko,l,d);return{selectedIndices:p[0],selectedScores:p[1]}}var kF=L({nonMaxSuppressionWithScore_:wF});async function IF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),u=zl(i,o,n,a,r,s);n=u.maxOutputSize,a=u.iouThreshold,r=u.scoreThreshold,s=u.softNmsSigma;let l=await Promise.all([i.data(),o.data()]),d=l[0],p=l[1],{selectedIndices:c,selectedScores:h}=e7(d,p,n,a,r,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Dt(c,"int32"),selectedScores:Dt(h)}}var SF=IF;function NF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),u=zl(i,o,n,a,r,null),l=u.maxOutputSize,d=u.iouThreshold,p=u.scoreThreshold,c={boxes:i,scores:o},h={maxOutputSize:l,iouThreshold:d,scoreThreshold:p,padToMaxOutputSize:s},m=P.runKernel(Xo,c,h);return{selectedIndices:m[0],validOutputs:m[1]}}var TF=L({nonMaxSuppressionPadded_:NF});async function CF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),u=zl(i,o,n,a,r,null),l=u.maxOutputSize,d=u.iouThreshold,p=u.scoreThreshold,[c,h]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=Q3(c,h,l,d,p,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Dt(m,"int32"),validOutputs:ke(f,"int32")}}var EF=CF;function RF(e,t,n=!1,a=!1){let r=M(e,"images","resizeBilinear");D(r.rank===3||r.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`),D(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),D(a===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},u={alignCorners:n,halfPixelCenters:a,size:t},l=P.runKernel(Js,o,u);return i?q(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var n7=L({resizeBilinear_:RF});function MF(e,t,n=!1,a=!1){let r=M(e,"images","resizeNearestNeighbor");D(r.rank===3||r.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`),D(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),D(r.dtype==="float32"||r.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),D(a===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},u={alignCorners:n,halfPixelCenters:a,size:t},l=P.runKernel(Uu,o,u);return i?q(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var a7=L({resizeNearestNeighbor_:MF});function FF(e,t="binary",n=!1,a=.5){let r=M(e,"image","threshold"),s=.2989,i=.587,o=.114,u=r.shape[0]*r.shape[1],l=B(Dt([a]),255),d,p,c,h;if(D(r.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`),D(r.shape[2]===3||r.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`),D(r.dtype==="int32"||r.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`),D(t==="otsu"||t==="binary",()=>`Method must be binary or otsu, but was ${t}`),r.shape[2]===3){[d,p,c]=Zt(r,[1,1,1],-1);let f=B(d,s),g=B(p,i),y=B(c,o);h=ie(ie(f,g),y)}else h=e;if(t==="otsu"){let f=z1(ge(sh(h),"int32"),ln([]),256);l=$F(f,u)}let m=n?Xr(h,l):Wn(h,l);return ge(B(m,255),"int32")}function $F(e,t){let n=Dt([-1]),a=Dt([0]),r=Dt([0]),s,i,o,u,l,d;for(let p=0;p`Error in transform: image must be rank 4,but got rank ${i.rank}.`),D(o.rank===2&&(o.shape[0]===i.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),D(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let u={image:i,transforms:o},l={interpolation:n,fillMode:a,fillValue:r,outputShape:s};return P.runKernel(pl,u,l)}var zF=L({transform_:OF});function _F(e,t,n){D(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),D(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);let a=M(e,"a","bandPart");D(a.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${a.rank}.`);let r=a.shape,[s,i]=a.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=i))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`);t<0&&(t=s),n<0&&(n=i);let o=q($l(0,s,1,"int32"),[-1,1]),u=$l(0,i,1,"int32"),l=ye(o,u),d=xa(Xr(l,ke(+t,"int32")),qr(l,ke(-n,"int32"))),p=$t([s,i],a.dtype);return q(gn(Gn(q(a,[-1,s,i])).map(c=>un(d,c,p))),r)}var PF=L({bandPart_:_F});function LF(e){let t;if(Array.isArray(e)){t=!1,D(e!=null&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let r=e[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[s].shape[0]} vs. ${r})`)}else t=!0,e=Zt(e,e.shape[0],0).map(r=>Vt(r,[0]));D(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let n=[],a=e;for(let r=0;r{let s=a[r];if(r>0)for(let i=0;i=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),e.rank===2)return r7(e,t);{let n=e.shape.slice(0,e.shape.length-2).reduce((u,l)=>u*l),a=Gn(q(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];a.forEach(u=>{let[l,d]=r7(u,t);r.push(l),s.push(d)});let i=q(gn(r,0),e.shape),o=q(gn(s,0),e.shape);return[i,o]}}function r7(e,t=!1){return P.tidy(()=>{D(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let n=e.shape[0],a=e.shape[1],r=H1(n),s=Ha(e),i=Ta([[1]],[1,1]),o=Ha(i),u=n>=a?a:n;for(let l=0;l{let h=Re(s,[l,l],[n-l,1]),m=gh(h),f=Re(s,[l,l],[1,1]),g=un(Wn(f,0),Ta([[-1]]),Ta([[1]])),y=ye(f,B(g,m)),A=me(h,y);A.shape[0]===1?o=Ha(i):o=lt([i,Re(A,[1,0],[A.shape[0]-1,A.shape[1]])],0);let x=St(me(je(g,y),m)),v=Re(s,[l,0],[n-l,a]),b=B(x,o),w=Qe(o);if(l===0)s=ye(v,je(b,je(w,v)));else{let E=ye(v,je(b,je(w,v)));s=lt([Re(s,[0,0],[l,a]),E],0)}let N=Qe(b),C=Re(r,[0,l],[n,r.shape[1]-l]);if(l===0)r=ye(C,je(je(C,o),N));else{let E=ye(C,je(je(C,o),N));r=lt([Re(r,[0,0],[n,l]),E],1)}return[o,s,r]}),he([d,p,c])}return!t&&n>a&&(r=Re(r,[0,0],[n,a]),s=Re(s,[0,0],[a,a])),[r,s]})}var VF=L({qr_:BF}),yn;(function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(yn||(yn={}));function jF(e,t,n=yn.SUM_BY_NONZERO_WEIGHTS){let a=M(e,"losses","computeWeightedLoss"),r=null;t!=null&&(r=M(t,"weights","computeWeightedLoss"));let s=r==null?a:B(a,r);if(n===yn.NONE)return s;if(n===yn.SUM)return Se(s);if(n===yn.MEAN){if(r==null)return Nt(s);{let i=a.size/r.size,o=me(Se(s),Se(r));return i>1?me(o,ke(i)):o}}if(n===yn.SUM_BY_NONZERO_WEIGHTS){if(r==null)return me(Se(s),ke(a.size));{let i=B(r,jn(a.shape)),o=ge(Se(Ri(i,ke(0))),"float32");return me(Se(s),o)}}throw Error(`Unknown reduction: ${n}`)}var Ar=L({computeWeightedLoss_:jF});function UF(e,t,n,a=yn.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","absoluteDifference"),s=M(t,"predictions","absoluteDifference"),i=null;n!=null&&(i=M(n,"weights","absoluteDifference")),cn(r.shape,s.shape,"Error in absoluteDifference: ");let o=Wt(ye(r,s));return Ar(o,i,a)}var HF=L({absoluteDifference_:UF});function GF(e,t,n,a,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","cosineDistance"),i=M(t,"predictions","cosineDistance"),o=null;a!=null&&(o=M(a,"weights","cosineDistance")),cn(s.shape,i.shape,"Error in cosineDistance: ");let u=ke(1),l=ye(u,Se(B(s,i),n,!0));return Ar(l,o,r)}var qF=L({cosineDistance_:GF});function XF(e,t,n,a=yn.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","hingeLoss"),s=M(t,"predictions","hingeLoss"),i=null;n!=null&&(i=M(n,"weights","hingeLoss")),cn(r.shape,s.shape,"Error in hingeLoss: ");let o=ke(1);r=ye(B(ke(2),r),o);let u=Ka(ye(o,B(r,s)));return Ar(u,i,a)}var KF=L({hingeLoss_:XF});function ZF(e,t,n,a=1,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","huberLoss"),i=M(t,"predictions","huberLoss"),o=null;n!=null&&(o=M(n,"weights","huberLoss")),cn(s.shape,i.shape,"Error in huberLoss: ");let u=ke(a),l=Wt(ye(i,s)),d=Ml(l,u),p=ye(l,d),c=ie(B(ke(.5),ot(d)),B(u,p));return Ar(c,o,r)}var YF=L({huberLoss_:ZF});function JF(e,t,n,a=1e-7,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","logLoss"),i=M(t,"predictions","logLoss"),o=null;n!=null&&(o=M(n,"weights","logLoss")),cn(s.shape,i.shape,"Error in logLoss: ");let u=ke(1),l=ke(a),d=St(B(s,Bn(ie(i,l)))),p=B(ye(u,s),Bn(ie(ye(u,i),l))),c=ye(d,p);return Ar(c,o,r)}var QF=L({logLoss_:JF});function e$(e,t,n,a=yn.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","meanSquaredError"),s=M(t,"predictions","meanSquaredError"),i=null;n!=null&&(i=M(n,"weights","meanSquaredError")),cn(r.shape,s.shape,"Error in meanSquaredError: ");let o=hh(r,s);return Ar(o,i,a)}var t$=L({meanSquaredError_:e$});function n$(e,t){let n=M(e,"labels","sigmoidCrossEntropyWithLogits"),a=M(t,"logits","sigmoidCrossEntropyWithLogits");cn(n.shape,a.shape,"Error in sigmoidCrossEntropyWithLogits: ");let r=Ka(a),s=B(a,n),i=Jc(la(St(Wt(a))));return ie(ye(r,s),i)}function a$(e,t,n,a=0,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"multiClassLabels","sigmoidCrossEntropy"),i=M(t,"logits","sigmoidCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","sigmoidCrossEntropy")),cn(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),a>0){let l=ke(a),d=ke(1),p=ke(.5);s=ie(B(s,ye(d,l)),B(p,l))}let u=n$(s,i);return Ar(u,o,r)}var r$=L({sigmoidCrossEntropy_:a$});function s$(e,t,n=-1){if(n===-1&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return qa((a,r,s)=>{let i=Z1(r,[n],!0),o=ye(ge(r,"float32"),i);s([a,o]);let u=St(B(o,a));return{value:Se(u,[n]),gradFunc:(l,d)=>{let[p,c]=d,h=Ei(l.shape,[n]);return[B(q(l,h),ye(ge(p,"float32"),la(c))),B(q(l,h),ye(la(c),ge(p,"float32")))]}}})(e,t)}function i$(e,t,n,a=0,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"onehotLabels","softmaxCrossEntropy"),i=M(t,"logits","softmaxCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","softmaxCrossEntropy")),cn(s.shape,i.shape,"Error in softmaxCrossEntropy: "),a>0){let l=ke(a),d=ke(1),p=ke(s.shape[1]);s=ie(B(s,ye(d,l)),me(l,p))}let u=s$(s,i);return Ar(u,o,r)}var o$=L({softmaxCrossEntropy_:i$});function l$(e,t,n,a){let r=M(e,"indices","sparseFillEmptyRows"),s=M(t,"values","sparseFillEmptyRows"),i=M(n,"denseShape","sparseFillEmptyRows"),o=M(a,"defaultValue","sparseFillEmptyRows",s.dtype);if(r.rank!==2)throw new Error(`Indices should be Tensor2D but received shape - ${r.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(i.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${i.shape}`);if(o.rank!==0)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);let u={indices:r,values:s,denseShape:i,defaultValue:o},l=P.runKernel(vc,u);return{outputIndices:l[0],outputValues:l[1],emptyRowIndicator:l[2],reverseIndexMap:l[3]}}var u$=L({sparseFillEmptyRows_:l$});function d$(e,t,n){let a=M(e,"inputIndices","sparseReshape"),r=M(t,"inputShape","sparseReshape"),s=M(n,"newShape","sparseReshape");if(a.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape - ${a.shape}`);if(r.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let i={inputIndices:a,inputShape:r,newShape:s},o=P.runKernel(wc,i);return{outputIndices:o[0],outputShape:o[1]}}var p$=L({sparseReshape_:d$});function c$(e,t,n){let a=M(e,"data","sparseSegmentMean"),r=M(t,"indices","sparseSegmentMean"),s=M(n,"segmentIds","sparseSegmentMean");if(a.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape + ${a.shape}`),D(i%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${a.shape}`);let o={x:a},l={blockSize:t,dataFormat:n};return P.runKernel(Co,o,l)}var W1=L({depthToSpace_:eE});function tE(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","depthwiseConv2d"),l=M(t,"filter","depthwiseConv2d"),u=o,d=!1;o.rank===3&&(d=!0,u=q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),D(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),D(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),D(u.shape[3]===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${u.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`),i!=null&&D(qt(a),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p={x:u,filter:l},c={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},h=P.runKernel(Es,p,c);return d?q(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var Cl=L({depthwiseConv2d_:tE});function nE(e){let t={x:M(e,"x","diag")};return P.runKernel(rc,t)}var aE=L({diag_:nE});function rE(e,t,n,a,r=[1,1],s="NHWC"){let i=M(e,"x","dilation2d"),o=M(t,"filter","dilation2d");D(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),D(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),D(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let l=i,u=!1;i.rank===3&&(l=q(i,[1,i.shape[0],i.shape[1],i.shape[2]]),u=!0);let d={x:l,filter:o},p={strides:n,pad:a,dilations:r},c=P.runKernel(_u,d,p);return u?q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var B1=L({dilation2d_:rE});function sE(e,t){let n=e.length,a=[];for(let r=0;r1&&i===1&&a.unshift(s)}return a}function Bt(e,t){let n=[];for(let a=0;a1)&&n.unshift(s)}return n}function mt(e,t){let n=[],a=Math.max(e.length,t.length);for(let r=0;r`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${a.rank}.`);let r=n.rank===1?n.size:n.shape[1],s=a.rank===1?a.size:a.shape[0];if(D(r===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${s}.`),n.rank===1&&a.rank===1){let i=q(n,[1,-1]),o=q(a,[-1,1]),l=je(i,o);return q(l,[])}else if(n.rank===1&&a.rank===2){let i=q(n,[1,-1]),o=q(a,[a.shape[0],a.shape[1]]),l=je(i,o);return q(l,[l.size])}else if(n.rank===2&&a.rank===1){let i=q(a,[-1,1]),o=je(n,i);return q(o,[o.size])}else{let i=q(a,[a.shape[0],a.shape[1]]);return je(n,i)}}var N3=L({dot_:dE});function pE(e,...t){let n=t.map((r,s)=>M(r,`tensors${s}`,"einsum")),a={equation:e};return P.runKernel(oc,n,a)}var T3=L({einsum_:pE});function cE(e){let t={x:M(e,"x","elu")};return P.runKernel(Eo,t)}var El=L({elu_:cE});function hE(e){let t=M(e,"x","erf");D(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=ge(t,"float32"));let n={x:t};return P.runKernel(Ro,n)}var j1=L({erf_:hE});function fE(e){let t={x:M(e,"x","exp")};return P.runKernel(Ms,t)}var la=L({exp_:fE});function mE(e,t=0){let n=M(e,"x","expandDims","string_or_numeric");D(t<=n.rank,()=>"Axis must be <= rank of the tensor");let a={input:n},r={dim:t};return P.runKernel(Fo,a,r)}var mn=L({expandDims_:mE});function gE(e){let t={x:M(e,"x","expm1")};return P.runKernel($o,t)}var U1=L({expm1_:gE});function yE(e,t){let n=M(e,"x","tile","string_or_numeric");D(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);let a={x:n},r={reps:t};return P.runKernel(_r,a,r)}var Gr=L({tile_:yE});function AE(e,t,n,a="float32"){t==null&&(t=e);let r=Ve([e,t],a),s=e<=t?e:t;for(let o=0;o`Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${s.rank}.`),D(qt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=q(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},u={depthRadius:t,bias:n,alpha:a,beta:r},d=P.runKernel(Bu,l,u);return o?q(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var q1=L({localResponseNormalization_:RE});function ME(e){let t={x:M(e,"x","log")};return P.runKernel(Ps,t)}var Bn=L({log_:ME});function FE(e){let t={x:M(e,"x","log1p")};return P.runKernel(jo,t)}var Jc=L({log1p_:FE});function $E(e){return D(Dr(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{let a=M(t,"x","tf.grad","string_or_numeric"),r=n!=null?M(n,"dy","tf.grad"):null;return P.tidy(()=>{let{value:s,grads:i}=P.gradients(()=>e(a),[a],r);return r!=null&&cn(s.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Qc(i),i[0]})}}function DE(e){return D(Dr(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{D(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let a=rd(t,"args","tf.grads","string_or_numeric"),r=n!=null?M(n,"dy","tf.grads"):null;return P.tidy(()=>{let{value:s,grads:i}=P.gradients(()=>e(...a),a,r);return r!=null&&cn(s.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Qc(i),i})}}function OE(e){return D(Dr(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{D(t instanceof Be,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),D(n==null||n instanceof Be,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:a,value:r}=P.gradients(()=>e(t),[t],n);return Qc(a),{grad:a[0],value:r}}}function zE(e){return D(Dr(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{D(Array.isArray(t)&&t.every(r=>r instanceof Be),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),D(n==null||n instanceof Be,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let a=P.gradients(()=>e(...t),t,n);return n!=null&&cn(a.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Qc(a.grads),a}}function M3(e,t){D(Dr(e),()=>"The f passed in variableGrads(f) must be a function"),D(t==null||Array.isArray(t)&&t.every(u=>u instanceof td),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let n=t!=null;if(!n){t=[];for(let u in P.registeredVariables)t.push(P.registeredVariables[u])}let a=n?t.filter(u=>!u.trainable):null,r=t.length;t=t.filter(u=>u.trainable),D(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`);let s=!0,{value:i,grads:o}=P.gradients(e,t,null,s);D(o.some(u=>u!=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()."),D(i.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let l={};return t.forEach((u,d)=>{o[d]!=null&&(l[u.name]=o[d])}),a!=null&&a.forEach(u=>l[u.name]=null),{value:i,grads:l}}function qa(e){return P.customGrad(e)}function Qc(e){if(e.filter(t=>t==null).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.`)}function _E(e){let t={x:M(e,"x","neg")};return P.runKernel(Go,t)}var St=L({neg_:_E});function PE(e){let t={x:M(e,"x","softplus")};return P.runKernel(ll,t)}var Ci=L({softplus_:PE});function LE(e){let t=M(e,"x","logSigmoid");return qa(n=>({value:St(Ci(St(n))),gradFunc:a=>B(a,Rn(St(n)))}))(t)}var F3=L({logSigmoid_:LE});function WE(e,t=null,n=!1){let a={x:M(e,"x","max")},r={reductionIndices:t,keepDims:n};return P.runKernel(Ls,a,r)}var Vn=L({max_:WE});function BE(e,t){let n=M(e,"a","sub"),a=M(t,"b","sub");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(ui,r)}var ye=L({sub_:BE});function VE(e,t=null,n=!1){let a=M(e,"x","sum");a.dtype==="bool"&&(a=ge(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return P.runKernel(ii,r,s)}var Se=L({sum_:VE});function jE(e,t=-1){let n=M(e,"logits","logSoftmax");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return qa((a,r)=>{let s=!0,i=Vn(a,t,!0),o=ye(a,i),l=ye(ge(o,"float32"),Bn(Se(la(o),t,s)));return r([l]),{value:l,gradFunc:(u,d)=>{let[p]=d,c=!0,h=la(p);return ye(u,B(Se(u,t,c),h))}}})(n)}var eh=L({logSoftmax_:jE});function X1(e,t){for(let n=0;ne[s]);return[n,r]}function Ei(e,t){let n=t.map(a=>1);return $3(e,n,t)}function UE(e,t,n){D(X1(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function O3(e,t){if(X1(e,t))return null;let n=[];for(let a=0;an.push(a)),n}function K1(e){return e.map((t,n)=>[n,t]).sort((t,n)=>t[1]-n[1]).map(t=>t[0])}function HE(e,t){let n=[];for(let a=t-e;a`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),D(Ga(n,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),r!=null&&D(qt(a),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let u={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=P.runKernel(Bs,u,d);return l?q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var hd=L({maxPool_:YE});function JE(e,t=[1,1,1],n,a,r,s="NDHWC"){let i=M(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),D(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),D(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&D(qt(a),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let u={x:o},d={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=P.runKernel(Vu,u,d);return l?q(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var Y1=L({maxPool3d_:JE});function QE(e,t,n,a,r=!1){let s={x:M(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:a,includeBatchInIndex:r},o=P.runKernel(gc,s,i);return{result:o[0],indexes:o[1]}}var _3=L({maxPoolWithArgmax_:QE});function eR(e,t){let n=M(e,"a","maximum"),a=M(t,"b","maximum");[n,a]=It(n,a),n.dtype==="bool"&&(n=ge(n,"int32"),a=ge(a,"int32")),mt(n.shape,a.shape);let r={a:n,b:a};return P.runKernel(Ws,r)}var Xa=L({maximum_:eR});function tR(e,t=null,n=!1){let a={x:M(e,"x","mean")},r={axis:t,keepDims:n};return P.runKernel(Vs,a,r)}var Nt=L({mean_:tR});function $t(e,t="float32"){if(t==="complex64"){let a=$t(e,"float32"),r=$t(e,"float32");return Wr(a,r)}let n=qp(Mt(e),t);return P.makeTensor(n,e,t)}function jn(e,t="float32"){if(t==="complex64"){let a=jn(e,"float32"),r=$t(e,"float32");return Wr(a,r)}let n=jm(Mt(e),t);return P.makeTensor(n,e,t)}function nR(e,t,{indexing:n="xy"}={}){if(n!=="xy"&&n!=="ij")throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(e===void 0)return[];let a=M(e,"x","meshgrid",e instanceof Be?e.dtype:"float32");if(t===void 0)return[a];let r=M(t,"y","meshgrid",t instanceof Be?t.dtype:"float32"),s=Mt(a.shape),i=Mt(r.shape);return n==="xy"?(a=q(a,[1,-1]),r=q(r,[-1,1]),[je(jn([i,1],a.dtype),a),je(r,jn([1,s],r.dtype))]):(a=q(a,[-1,1]),r=q(r,[1,-1]),[je(a,jn([1,i],a.dtype)),je(jn([s,1],r.dtype),r)])}function aR(e,t=null,n=!1){let a={x:M(e,"x","min")},r={axis:t,keepDims:n};return P.runKernel(js,a,r)}var fd=L({min_:aR});function rR(e,t){let n=M(e,"a","minimum"),a=M(t,"b","minimum");[n,a]=It(n,a),n.dtype==="bool"&&(n=ge(n,"int32"),a=ge(a,"int32")),mt(n.shape,a.shape);let r={a:n,b:a};return P.runKernel(Us,r)}var Fl=L({minimum_:rR});function sR(e,t,n){D(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);let a=M(e,"x","mirrorPad");if(a.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");D(t.length===a.rank,()=>`Padding doesn't match input. Must be ${a.rank}. Got ${t.length}.`);let r=n==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),D(t[o][0]>=0&&t[o][0]<=a.shape[o]-r&&t[o][1]>=0&&t[o][1]<=a.shape[o]-r,()=>`Padding in dimension ${o} cannot be greater than or equal to ${a.shape[o]-r} or less than 0 for input of shape ${a.shape}`);let s={paddings:t,mode:n},i={x:a};return P.runKernel(Hs,i,s)}var J1=L({mirrorPad_:sR});function iR(e,t){let n=M(e,"a","mod"),a=M(t,"b","mod");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Ho,r)}var Q1=L({mod_:iR});function oR(e){let t=M(e,"x","square"),n={};return P.runKernel("Square",{x:t},n)}var ot=L({square_:oR});function lR(e,t=null,n=!1){e=M(e,"x","moments");let a=ya(t,e.shape),r=Nt(e,a,n),s=r.shape;n||(s=Ei(r.shape,a));let i=ot(ye(ge(e,"float32"),q(r,s))),o=Nt(i,a,n);return{mean:r,variance:o}}var nh=L({moments_:lR});function uR(e,t,n,a){let r=M(t,"data","multiRNNCell"),s=rd(n,"c","multiRNNCell"),i=rd(a,"h","multiRNNCell"),o=r,l=[];for(let p=0;p2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();let o={logits:i===1?q(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:a},u=P.runKernel(yc,o,l);return i===1?q(u,[u.size]):u}var P3=L({multinomial_:pR});function cR(e,t){let n=M(e,"a","notEqual","string_or_numeric"),a=M(t,"b","notEqual","string_or_numeric");[n,a]=It(n,a),mt(n.shape,a.shape);let r={a:n,b:a};return P.runKernel(qo,r)}var Ri=L({notEqual_:cR});function hR(e){let t={x:M(e,"x","onesLike")};return P.runKernel(Yo,t)}var Un=L({onesLike_:hR});function fR(e,t){let n=M(e,"v1","outerProduct"),a=M(t,"v2","outerProduct");D(n.rank===1&&a.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${a.rank}.`);let r=q(n,[-1,1]),s=q(a,[1,-1]);return je(r,s)}var mR=L({outerProduct_:fR});function gR(e,t,n=0){let a=M(e,"x","pad");if(a.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let r={paddings:t,constantValue:n},s={x:a};return P.runKernel(Xs,s,r)}var gr=L({pad_:gR});function yR(e,t,n=0){return D(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),gr(e,[t],n)}var AR=L({pad1d_:yR});function xR(e,t,n=0){return D(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),gr(e,t,n)}var bR=L({pad2d_:xR});function vR(e,t,n=0){return D(t.length===3&&t[0].length===2&&t[1].length===2&&t[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),gr(e,t,n)}var wR=L({pad3d_:vR});function kR(e,t,n=0){return D(t.length===4&&t[0].length===2&&t[1].length===2&&t[2].length===2&&t[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),gr(e,t,n)}var IR=L({pad4d_:kR});function SR(e,t,n){let a=M(e,"x","spaceToBatchND");D(a.rank>=1+t.length,()=>`input rank ${a.rank} should be > than [blockShape] ${t.length}`),D(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),D(a.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+n[l-1][0]+n[l-1][1])%t[l-1]==0:i,!0),()=>`input spatial dimensions ${a.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);let r={x:a},s={blockShape:t,paddings:n};return P.runKernel(Hu,r,s)}var md=L({spaceToBatchND_:SR});function NR(e,t,n,a,r,s){r==null&&(r=[1,1]),s==null&&(s=1),a===0&&(a="valid");let i=M(e,"x","maxPool"),o=i,l=!1;i.rank===3&&(l=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2]])),D(Ga(s,r),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${r}'`);let u=f3(o.shape,t,s,r,a),d=[u.dilationHeight,u.dilationWidth],p;a==="same"?p=CR([u.filterHeight,u.filterWidth],d):p=[[0,0],[0,0]];let c=d[0]===1&&d[1]===1,[h,m]=TR([u.inHeight,u.inWidth],d,p),f=c?a:"valid",g=c?o:md(o,d,h),y=(n==="avg"?()=>ld(g,t,s,f):()=>hd(g,t,s,f))(),A=c?y:ud(y,d,m);return l?q(A,[A.shape[1],A.shape[2],A.shape[3]]):A}function TR(e,t,n){let a=n.map(d=>d[0]),r=n.map(d=>d[1]),s=e.concat(a,r),i=t.map((d,p)=>(d-s[p]%d)%d),o=r.map((d,p)=>d+i[p]),l=t.map((d,p)=>[a[p],o[p]]),u=t.map((d,p)=>[0,i[p]]);return[l,u]}function CR(e,t){let n=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),a=n.map(s=>Math.floor(s/2)),r=n.map((s,i)=>s-a[i]);return n.map((s,i)=>[a[i],r[i]])}var L3=L({pool_:NR});function ER(e,t){let n=M(e,"base","pow"),a=M(t,"exp","pow");[n,a]=It(n,a);let r={a:n,b:a};return P.runKernel(Ks,r)}var yr=L({pow_:ER});function RR(e,t){let n=M(e,"x","prelu"),a=M(t,"alpha","prelu"),r={x:n,alpha:a};return P.runKernel(Zs,r)}var gd=L({prelu_:RR});function MR(e,t=null,n=!1){let a=M(e,"x","prod");a.dtype==="bool"&&(a=ge(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return P.runKernel(Qo,r,s)}var ah=L({prod_:MR});function FR(e,t,n){let a=Mt(e),r=null;if(n==null||n==="float32")r=new Float32Array(a);else if(n==="int32")r=new Int32Array(a);else if(n==="bool")r=new Uint8Array(a);else throw new Error(`Unknown data type ${n}`);for(let s=0;s=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*a*i,t=this.mean+this.stdDev*r*i,(!this.truncated||this.isValidTruncated(e))&&(n=!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}},DR=class{constructor(e,t,n,a){this.alpha=e,this.beta=1/t,this.dtype=n;let r=a||Math.random();this.randu=eg.alea(r.toString()),this.randn=new tg(0,1,n,!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,n,a,r,s;for(;;){do a=this.randn.nextValue(),s=1+this.c*a;while(s<=0);if(s*=s*s,e=a*a,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),r=this.randu(),rthis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=n,a==null&&(a=Math.random()),typeof a=="number"&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=eg.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function zR(e,t,n=1,a="float32",r){if(n==null&&(n=1),a==null&&(a="float32"),a!=="float32"&&a!=="int32")throw new Error(`Unsupported data type ${a}`);let s=new DR(t,n,a,r),i=Ve(e,a);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),Hn(t,0)}var GR=L({reverse1d_:HR});function qR(e,t){let n=M(e,"x","reverse");return D(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),Hn(n,t)}var XR=L({reverse2d_:qR});function KR(e,t){let n=M(e,"x","reverse");return D(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),Hn(n,t)}var ZR=L({reverse3d_:KR});function YR(e,t){let n=M(e,"x","reverse");return D(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),Hn(n,t)}var JR=L({reverse4d_:YR});function QR(e){let t={x:M(e,"x","round")};return P.runKernel(ti,t)}var sh=L({round_:QR});function eM(e){let t={x:M(e,"x","rsqrt")};return P.runKernel(ni,t)}var ih=L({rsqrt_:eM});function ke(e,t){if((on(e)&&t!=="string"||Array.isArray(e))&&t!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(t==="string"&&on(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Br(e,[],[],t)}function tM(e){let t={x:M(e,"x","selu")};return P.runKernel(rl,t)}var oh=L({selu_:tM});function nM(e,t,n,a,r,s=[1,1],i="NHWC"){let o=M(e,"x","separableConv2d"),l=M(t,"depthwiseFilter","separableConv2d"),u=M(n,"pointwiseFilter","separableConv2d"),d=o,p=!1;if(o.rank===3&&(p=!0,d=q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),i==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");D(d.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${d.rank}.`),D(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),D(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),D(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),D(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let c=l.shape[2],h=l.shape[3];D(u.shape[2]===c*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${c*h}, but got ${u.shape[2]}.`);let m=Cl(d,l,a,r,i,s),f=mr(m,u,1,"valid",i);return p?q(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var ag=L({separableConv2d_:nM});async function aM(e,t){let n=M(e,"x","setdiff1d"),a=M(t,"y","setdiff1d");D(n.dtype===a.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${a.dtype}).`),D(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),D(a.rank===1,()=>`y should be 1D tensor, but got y (${a.shape}).`);let r=await n.data(),s=await a.data(),i=new Set(s),o=0;for(let d=0;d`slice1d expects a rank-1 tensor, but got a rank-${a.rank} tensor`),Re(a,[t],[n])}var dh=L({slice1d_:oM});function lM(e,t,n){let a=M(e,"x","slice2d");return D(a.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${a.rank} tensor`),Re(a,t,n)}var sg=L({slice2d_:lM});function uM(e,t,n){let a=M(e,"x","slice3d");return D(a.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${a.rank} tensor`),Re(a,t,n)}var ph=L({slice3d_:uM});function dM(e,t,n){let a=M(e,"x","slice4d");return D(a.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${a.rank} tensor`),Re(a,t,n)}var Ad=L({slice4d_:dM});function pM(e,t=-1){let n=M(e,"logits","softmax","float32");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);let a={logits:n},r={dim:t};return P.runKernel(oi,a,r)}var xd=L({softmax_:pM});function cM(e){D(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return P.runKernel(uc,t)}var bd=L({fft_:cM});function hM(e){D(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return P.runKernel(dc,t)}var Ol=L({ifft_:hM});function fM(e){let t=e.shape[e.shape.length-1],n=e.size/t,a;if(t<=2){let r=q(e,[n,t]);a=Ol(r)}else{let r=[n,2*(t-1)],s=q(yd(e),[n,t]),i=q(Zc(e),[n,t]),o=Hn(Re(s,[0,1],[n,t-2]),1),l=B(Hn(Re(i,[0,1],[n,t-2]),1),ke(-1)),u=lt([s,o],1),d=lt([i,l],1),p=q(Wr(u,d),[r[0],r[1]]);a=Ol(p)}if(a=yd(a),e.rank===3&&e.shape[0]!==0){let r=a,s=e.shape[0];a=q(a,[s,a.shape[0]/s,a.shape[1]]),r.dispose()}return a}var ch=L({irfft_:fM});function mM(e,t,n=0){let a={x:M(e,"x","split")},r={numOrSizeSplits:t,axis:n};return P.runKernel(ul,a,r)}var Zt=L({split_:mM});function gM(e,t){D(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],a=e.size/n,r;if(t!=null&&t0),f=e.shape.map(g=>g);f[e.shape.length-1]=t,r=Re(e,m,f),n=t}else if(t!=null&&t>n){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-n,r=lt([e,$t(m)],e.shape.length-1),n=t}else r=e;let s=Ge(r),i=q(Wr(r,s),[a,n]),o=bd(i),l=Math.floor(n/2)+1,u=yd(o),d=Zc(o),p=Zt(u,[l,n-l],u.shape.length-1),c=Zt(d,[l,n-l],d.shape.length-1),h=r.shape.slice();return h[r.shape.length-1]=l,q(Wr(p[0],c[0]),h)}var vd=L({rfft_:gM});function yM(e){let t={x:M(e,"x","sqrt")};return P.runKernel(si,t)}var an=L({sqrt_:yM});function AM(e,t){let n=M(e,"a","squaredDifference"),a=M(t,"b","squaredDifference");[n,a]=It(n,a),mt(n.shape,a.shape);let r={a:n,b:a},s={};return P.runKernel(li,r,s)}var hh=L({squaredDifference_:AM});function xM(e,t){let n=M(e,"x","squeeze");return q(n,rb(n.shape,t).newShape)}var Vt=L({squeeze_:xM});function bM(e,t=0){let n=rd(e,"tensors","stack","string_or_numeric");D(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&D(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");let a=n,r={axis:t};return P.runKernel(Jo,a,r)}var gn=L({stack_:bM});function vM(e,t=0){let n={x:M(e,"x","step")},a={alpha:t};return P.runKernel(Pr,n,a)}var zl=L({step_:vM});function wM(e,t,n,a,r=0,s=0,i=0,o=0,l=0){let u={x:M(e,"x","stridedSlice","string_or_numeric")},d={begin:t,end:n,strides:a,beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return P.runKernel(dl,u,d)}var ig=L({stridedSlice_:wM});function kM(e){let t={x:M(e,"x","tan")};return P.runKernel(di,t)}var og=L({tan_:kM});function Dt(e,t){ys(e);let n=Ua(e,t);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Br(e,null,n,t)}function Ta(e,t,n){if(ys(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let a=Ua(e,n);if(a.length!==2&&a.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Br(e,t,a,n)}function IM(e,t,n){if(ys(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let a=Ua(e,n);if(a.length!==4&&a.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Br(e,t,a,n)}function SM(e,t,n){if(ys(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let a=Ua(e,n);if(a.length!==5&&a.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Br(e,t,a,n)}function NM(e,t,n){if(ys(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let a=Ua(e,n);if(a.length!==6&&a.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||a,Br(e,t,a,n)}function TM(e,t=1,n=!0){let a=M(e,"x","topk");if(a.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");let r=a.shape[a.shape.length-1];if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);let s={x:a},i={k:t,sorted:n},[o,l]=P.runKernel(pl,s,i);return{values:o,indices:l}}var lg=L({topk_:TM});function CM(e,t=0,n=1,a,r){if(a!=null&&a==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new tg(t,n,a,!0,r),i=Ve(e,a);for(let o=0;o0,()=>"The input tensor must be at least 1D");let a={x:n},r={axis:t},[s,i]=P.runKernel(Ec,a,r);return{values:s,indices:i}}var mh=L({unique_:EM});function RM(e,t,n){let a=M(e,"x","unsortedSegmentSum"),r=M(t,"segmentIds","unsortedSegmentSum","int32");D(qt(n),()=>"numSegments must be of dtype int");let s={x:a,segmentIds:r},i={numSegments:n};return P.runKernel(qu,s,i)}var ug=L({unsortedSegmentSum_:RM});function MM(e,t=0){let n=M(e,"x","unstack","string_or_numeric");D(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);let a={value:n},r={axis:t};return P.runKernel(hl,a,r)}var Gn=L({unstack_:MM});function V3(e,t=!0,n,a){return P.makeVariable(e,t,n,a)}function j3(e,t){let n=[];for(let s=0;s0,()=>"mask cannot be scalar"),cn(o.slice(s,s+i),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let f=s;f"Shape mismatch in v and x");let l=ke(1),u=ye(l,o),d=B(ye(i,s),u);if(r){D(a!=null,()=>"When using zeroDebias: true, step is required.");let p=M(a,"step","movingAverage");d=me(d,ye(l,yr(o,p)))}return ie(s,d)}var _M=L({movingAverage_:zM});function PM(e,t,n){let a=M(e,"indices","scatterND","int32"),r=M(t,"updates","scatterND");x1(r,a,n);let s={indices:a,updates:r},i={shape:n};return P.runKernel(nl,s,i)}var H3=L({scatterND_:PM});function LM(e,t,n,a){if(e.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let r=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);let i=t.size;if(!(t.rank===0||t.rank===1&&i===r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==a.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function WM(e,t,n,a=0){let r=M(e,"sparseIndices","sparseToDense","int32"),s=M(t,"sparseValues","sparseToDense"),i=M(a,"defaultValue","sparseToDense",s.dtype);LM(r,s,n,i);let o={sparseIndices:r,sparseValues:s,defaultValue:i},l={outputShape:n};return P.runKernel(Sc,o,l)}var pg=L({sparseToDense_:WM});function BM(e,t){let n=M(t,"indices","gatherND","int32"),a={params:M(e,"x","gatherND","string_or_numeric"),indices:n};return P.runKernel(zo,a)}var G3=L({gatherND_:BM});function VM(e,t){if(t==null)return e.shape.slice();if(cr(e.shape,t))return t;if(e.shape.length===t.length){let n=[];for(let a=0;a`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`),D(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof Be?r.clone():r;let s=VM(r,n),i=1-t,o=me(Ml(ie($l(s,0,1,"float32",a),i)),i);return B(r,o)}var q3=L({dropout_:jM});function X3(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function cg(e,t,n){let a=1-e%2,r=new Float32Array(e);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${a.rank}`),D(a.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${a.rank} and targets rank ${r.rank}`),cn(a.shape.slice(0,a.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=a.shape[a.shape.length-1];D(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);let i=await a.data(),o=await r.data(),[l,u]=[i.length/s,s],d=sb("bool",l);for(let p=0;pg.value-f.value),d[p]=0;for(let f=0;fXM,depthwiseConv2d:()=>JM,matMul:()=>eF});function GM(e,t,n,a,r,s="NHWC",i){let o=e;e.rank===3&&(o=q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=q(t,[1,t.shape[0],t.shape[1],t.shape[2]])),D(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),D(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),D(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);let u=s==="NHWC"?o.shape[3]:o.shape[1],d=s==="NHWC"?l.shape[3]:l.shape[1];D(u===n[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`),D(d===n[3],()=>`Error in conv2dDerFilter: depth of dy (${d}) must match output depth for filter (${n[3]}).`),i!=null&&D(qt(r),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let p={x:o,dy:l},c={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,filterShape:n};return P.runKernel(Jp,p,c)}var hg=L({conv2DBackpropFilter_:GM});function yh(e,t,n){if(n==null||n==="linear")return e;if(n==="relu")return B(e,zl(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Ah(e,t){let n=t,a=Bt(e.shape,t.shape);return a.length>0&&(n=Se(n,a)),q(n,e.shape)}function xh(e,t,n,a){if(t==="linear")return e;if(t==="relu")return Ka(e);if(t==="elu")return El(e);if(t==="relu6")return rh(e);if(t==="prelu")return gd(e,n);if(t==="leakyrelu")return pd(e,a);if(t==="sigmoid")return Rn(e);throw new Error(`Unknown fused activation ${t}.`)}var bh=(e,t)=>!(e>0)||t==="linear";function qM({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:d}){if(l=l||"linear",bh(P.state.gradientDepth,l)===!1){let b=mr(e,t,n,a,r,s,i);return o!=null&&(b=ie(b,o)),xh(b,l,u,d)}let p=M(e,"x","conv2d"),c=M(t,"filter","conv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=q(p,[1,p.shape[0],p.shape[1],p.shape[2]])),D(h.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),D(c.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${c.rank}.`),i!=null&&D(qt(a),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),D(h.shape[3]===c.shape[2],()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${c.shape[2]}.`),D(Ga(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),D(r==="NHWC",()=>`Error in conv2d: got dataFormat of ${r} but only NHWC is currently supported.`);let f=od(h.shape,c.shape,n,s,a,i),g;o!=null&&(g=M(o,"bias","fused conv2d"),[g]=It(g,p),mt(f.outShape,g.shape));let y;u!=null&&(y=M(u,"prelu weights","fused conv2d"));let A=(b,w)=>{let[N,C,E,_]=w,$=yh(b,E,l);D(Ur(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let S=P1(C.shape,$,N,n,a),z=hg(C,$,N.shape,n,a),O=[S,z];if(_!=null){let W=Ah(_,$);O.push(W)}return O},x={x:h,filter:c,bias:g,preluActivationWeights:y},v={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:d};return o==null?qa((b,w,N)=>{let C=P.runKernel(fi,x,v);return N([w,b,C]),m&&(C=q(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:A}})(h,c):qa((b,w,N,C)=>{let E=P.runKernel(fi,x,v);return C([w,b,E,N]),m&&(E=q(E,[E.shape[1],E.shape[2],E.shape[3]])),{value:E,gradFunc:A}})(h,c,g)}var XM=L({fusedConv2d_:qM});function KM(e,t,n,a,r,s=[1,1],i){let o=e;e.rank===3&&(o=q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={x:o,dy:l},d={strides:a,pad:r,dimRoundingMode:i,dilations:s,filterShape:n};return P.runKernel(nc,u,d)}var K3=L({depthwiseConv2dNativeBackpropFilter_:KM});function ZM(e,t,n,a,r,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={dy:o,filter:n},d={strides:a,pad:r,dimRoundingMode:i,dilations:s,inputShape:e},p=P.runKernel(ac,u,d);return l?q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var Z3=L({depthwiseConv2dNativeBackpropInput_:ZM});function YM({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:d}){if(bh(P.state.gradientDepth,l)===!1){let b=Cl(e,t,n,a,r,s,i);return o!=null&&(b=ie(b,o)),xh(b,l,u,d)}let p=M(e,"x","depthwiseConv2d"),c=M(t,"filter","depthwiseConv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=q(p,[1,p.shape[0],p.shape[1],p.shape[2]])),D(h.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),D(c.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${c.rank}.`),D(h.shape[3]===c.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`),s==null&&(s=[1,1]),D(Ga(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),i!=null&&D(qt(a),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${i} but got pad ${a}.`);let f=od(h.shape,c.shape,n,s,a,i,!0),g;o!=null&&(g=M(o,"bias","fused conv2d"),[g]=It(g,p),mt(f.outShape,g.shape));let y;u!=null&&(y=M(u,"prelu weights","fused depthwiseConv2d"));let A=(b,w)=>{D(Ur(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[N,C,E,_]=w,$=yh(b,E,l),S=Z3(C.shape,$,N,n,a,s,i),z=K3(C,$,N.shape,n,a,s,i);if(_!=null){let O=Ah(g,$);return[S,z,O]}return[S,z]},x={x:h,filter:c,bias:g,preluActivationWeights:y},v={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:d};return o==null?qa((b,w,N)=>{let C=P.runKernel(mi,x,v);return N([w,b,C]),m&&(C=q(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:A}})(h,c):qa((b,w,N,C)=>{let E=P.runKernel(mi,x,v);return C([w,b,E,N]),m&&(E=q(E,[E.shape[1],E.shape[2],E.shape[3]])),{value:E,gradFunc:A}})(h,c,g)}var JM=L({fusedDepthwiseConv2d_:YM});function QM({a:e,b:t,transposeA:n=!1,transposeB:a=!1,bias:r,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o}){if(bh(P.state.gradientDepth,s)===!1){let _=je(e,t,n,a);return r!=null&&(_=ie(_,r)),xh(_,s,i,o)}let l=M(e,"a","fused matMul"),u=M(t,"b","fused matMul");[l,u]=It(l,u);let d=n?l.shape[l.rank-2]:l.shape[l.rank-1],p=a?u.shape[u.rank-1]:u.shape[u.rank-2],c=n?l.shape[l.rank-1]:l.shape[l.rank-2],h=a?u.shape[u.rank-2]:u.shape[u.rank-1],m=l.shape.slice(0,-2),f=u.shape.slice(0,-2),g=Mt(m),y=Mt(f);D(l.rank>=2&&u.rank>=2&&l.rank===u.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${l.rank} and ${u.rank}.`),D(cr(m,f),()=>`Error in fused matMul: outer dimensions (${m}) and (${f}) of Tensors with shapes ${l.shape} and ${u.shape} must match.`),D(d===p,()=>`Error in fused matMul: inner shapes (${d}) and (${p}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${a} must match.`);let A=l.shape.slice(0,-2).concat([c,h]),x=n?q(l,[g,d,c]):q(l,[g,c,d]),v=a?q(u,[y,h,p]):q(u,[y,p,h]),b;r!=null&&(b=M(r,"bias","fused matMul"),[b]=It(b,l),mt(A,b.shape));let w;i!=null&&(w=M(i,"prelu weights","fused matMul"));let N=(_,$)=>{let[S,z,O,W]=$,G=yh(q(_,O.shape),O,s),H,J;if(!n&&!a?(H=je(G,z,!1,!0),J=je(S,G,!0,!1)):!n&&a?(H=je(G,z,!1,!1),J=je(G,S,!0,!1)):n&&!a?(H=je(z,G,!1,!0),J=je(S,G,!1,!1)):(H=je(z,G,!0,!0),J=je(G,S,!0,!0)),r!=null){let K=Ah(W,G);return[H,J,K]}else return[H,J]},C={a:x,b:v,bias:b,preluActivationWeights:w},E={transposeA:n,transposeB:a,activation:s,leakyreluAlpha:o};return r==null?qa((_,$,S)=>{let z=P.runKernel(hi,C,E);return S([_,$,z]),{value:q(z,A),gradFunc:N}})(x,v):qa((_,$,S,z)=>{let O=P.runKernel(hi,C,E);return z([_,$,O,S]),{value:q(O,A),gradFunc:N}})(x,v,b)}var eF=L({fusedMatMul_:QM});function tF(e){return cg(e,.54,.46)}var nF=L({hammingWindow_:tF});function aF(e){return cg(e,.5,.5)}var Y3=L({hannWindow_:aF});function rF(e,t,n,a=!1,r=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Re(e,s,t)),s+=n;if(a)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),D(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${o.shape}.`),D(l.rank===1&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`),D(a.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${a.length}.`),D(a[0]>=1&&a[1]>=1,()=>`cropSize must be atleast [1,1], but was ${a}`),D(r==="bilinear"||r==="nearest",()=>`method must be bilinear or nearest, but was ${r}`);let d={image:i,boxes:o,boxInd:l},p={method:r,extrapolationValue:s,cropSize:a};return P.runKernel(To,d,p)}var lF=L({cropAndResize_:oF});function uF(e){let t=M(e,"image","flipLeftRight","float32");D(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let n={image:t};return P.runKernel(Do,n,{})}var dF=L({flipLeftRight_:uF});function pF(e,t,n=0,a=.5){let r=M(e,"image","rotateWithOffset","float32");D(r.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`);let s={image:r},i={radians:t,fillValue:n,center:a};return P.runKernel(ml,s,i)}var cF=L({rotateWithOffset_:pF});function _l(e,t,n,a,r,s){a==null&&(a=.5),r==null&&(r=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return n=Math.min(n,i),D(0<=a&&a<=1,()=>`iouThreshold must be in [0, 1], but was '${a}'`),D(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),D(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),D(t.rank===1,()=>"scores must be a 1D tensor"),D(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),D(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s}}function hF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppression"),i=M(t,"scores","nonMaxSuppression"),o=_l(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let l={maxOutputSize:n,iouThreshold:a,scoreThreshold:r};return P.runKernel(Xo,{boxes:s,scores:i},l)}var fF=L({nonMaxSuppression_:hF});function mF(e,t,n){let a=gF(e,t,n),r=a<0?-(a+1):a;e.splice(r,0,t)}function gF(e,t,n){return AF(e,t,n||yF)}function yF(e,t){return e>t?1:e>>1);let o=n(t,e[s]);o>0?a=s+1:(r=s,i=!o)}return i?a:-a-1}function Q3(e,t,n,a,r){return fg(e,t,n,a,r,0)}function e7(e,t,n,a,r,s){return fg(e,t,n,a,r,0,!1,s,!0)}function t7(e,t,n,a,r,s){return fg(e,t,n,a,r,s,!0)}function fg(e,t,n,a,r,s,i=!1,o=!1,l=!1){let u=[];for(let g=0;gr&&u.push({score:t[g],boxIndex:g,suppressBeginIndex:0});u.sort(n7);let d=s>0?-.5/s:0,p=[],c=[];for(;p.length0;){let g=u.pop(),{score:y,boxIndex:A,suppressBeginIndex:x}=g;if(y=x;--b){let w=xF(e,A,p[b]);if(w>=a){v=!0;break}if(g.score=g.score*bF(a,d,w),g.score<=r)break}g.suppressBeginIndex=p.length,v||(g.score===y?(p.push(A),c.push(g.score)):g.score>r&&mF(u,g,n7))}let h=p.length,m=n-h;o&&m>0&&(p.push(...new Array(m).fill(0)),c.push(...new Array(m).fill(0)));let f={selectedIndices:p};return i&&(f.selectedScores=c),l&&(f.validOutputs=h),f}function xF(e,t,n){let a=e.subarray(t*4,t*4+4),r=e.subarray(n*4,n*4+4),s=Math.min(a[0],a[2]),i=Math.min(a[1],a[3]),o=Math.max(a[0],a[2]),l=Math.max(a[1],a[3]),u=Math.min(r[0],r[2]),d=Math.min(r[1],r[3]),p=Math.max(r[0],r[2]),c=Math.max(r[1],r[3]),h=(o-s)*(l-i),m=(p-u)*(c-d);if(h<=0||m<=0)return 0;let f=Math.max(s,u),g=Math.max(i,d),y=Math.min(o,p),A=Math.min(l,c),x=Math.max(y-f,0)*Math.max(A-g,0);return x/(h+m-x)}function bF(e,t,n){let a=Math.exp(t*n*n);return n<=e?a:0}function n7(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function vF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppressionAsync"),i=M(t,"scores","nonMaxSuppressionAsync"),o=_l(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),u=l[0],d=l[1],{selectedIndices:p}=Q3(u,d,n,a,r);return s!==e&&s.dispose(),i!==t&&i.dispose(),Dt(p,"int32")}var wF=vF;function kF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),l=_l(i,o,n,a,r,s);n=l.maxOutputSize,a=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let u={boxes:i,scores:o},d={maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s},p=P.runKernel(Zo,u,d);return{selectedIndices:p[0],selectedScores:p[1]}}var IF=L({nonMaxSuppressionWithScore_:kF});async function SF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),l=_l(i,o,n,a,r,s);n=l.maxOutputSize,a=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let u=await Promise.all([i.data(),o.data()]),d=u[0],p=u[1],{selectedIndices:c,selectedScores:h}=t7(d,p,n,a,r,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Dt(c,"int32"),selectedScores:Dt(h)}}var NF=SF;function TF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),l=_l(i,o,n,a,r,null),u=l.maxOutputSize,d=l.iouThreshold,p=l.scoreThreshold,c={boxes:i,scores:o},h={maxOutputSize:u,iouThreshold:d,scoreThreshold:p,padToMaxOutputSize:s},m=P.runKernel(Ko,c,h);return{selectedIndices:m[0],validOutputs:m[1]}}var CF=L({nonMaxSuppressionPadded_:TF});async function EF(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),l=_l(i,o,n,a,r,null),u=l.maxOutputSize,d=l.iouThreshold,p=l.scoreThreshold,[c,h]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=e7(c,h,u,d,p,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Dt(m,"int32"),validOutputs:ke(f,"int32")}}var RF=EF;function MF(e,t,n=!1,a=!1){let r=M(e,"images","resizeBilinear");D(r.rank===3||r.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`),D(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),D(a===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:a,size:t},u=P.runKernel(Js,o,l);return i?q(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var a7=L({resizeBilinear_:MF});function FF(e,t,n=!1,a=!1){let r=M(e,"images","resizeNearestNeighbor");D(r.rank===3||r.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`),D(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),D(r.dtype==="float32"||r.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),D(a===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:a,size:t},u=P.runKernel(Uu,o,l);return i?q(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var r7=L({resizeNearestNeighbor_:FF});function $F(e,t="binary",n=!1,a=.5){let r=M(e,"image","threshold"),s=.2989,i=.587,o=.114,l=r.shape[0]*r.shape[1],u=B(Dt([a]),255),d,p,c,h;if(D(r.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`),D(r.shape[2]===3||r.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`),D(r.dtype==="int32"||r.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`),D(t==="otsu"||t==="binary",()=>`Method must be binary or otsu, but was ${t}`),r.shape[2]===3){[d,p,c]=Zt(r,[1,1,1],-1);let f=B(d,s),g=B(p,i),y=B(c,o);h=ie(ie(f,g),y)}else h=e;if(t==="otsu"){let f=z1(ge(sh(h),"int32"),ln([]),256);u=DF(f,l)}let m=n?Xr(h,u):Wn(h,u);return ge(B(m,255),"int32")}function DF(e,t){let n=Dt([-1]),a=Dt([0]),r=Dt([0]),s,i,o,l,u,d;for(let p=0;p`Error in transform: image must be rank 4,but got rank ${i.rank}.`),D(o.rank===2&&(o.shape[0]===i.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),D(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let l={image:i,transforms:o},u={interpolation:n,fillMode:a,fillValue:r,outputShape:s};return P.runKernel(cl,l,u)}var _F=L({transform_:zF});function PF(e,t,n){D(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),D(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);let a=M(e,"a","bandPart");D(a.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${a.rank}.`);let r=a.shape,[s,i]=a.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=i))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`);t<0&&(t=s),n<0&&(n=i);let o=q(Dl(0,s,1,"int32"),[-1,1]),l=Dl(0,i,1,"int32"),u=ye(o,l),d=xa(Xr(u,ke(+t,"int32")),qr(u,ke(-n,"int32"))),p=$t([s,i],a.dtype);return q(gn(Gn(q(a,[-1,s,i])).map(c=>un(d,c,p))),r)}var LF=L({bandPart_:PF});function WF(e){let t;if(Array.isArray(e)){t=!1,D(e!=null&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let r=e[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[s].shape[0]} vs. ${r})`)}else t=!0,e=Zt(e,e.shape[0],0).map(r=>Vt(r,[0]));D(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let n=[],a=e;for(let r=0;r{let s=a[r];if(r>0)for(let i=0;i=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),e.rank===2)return s7(e,t);{let n=e.shape.slice(0,e.shape.length-2).reduce((l,u)=>l*u),a=Gn(q(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];a.forEach(l=>{let[u,d]=s7(l,t);r.push(u),s.push(d)});let i=q(gn(r,0),e.shape),o=q(gn(s,0),e.shape);return[i,o]}}function s7(e,t=!1){return P.tidy(()=>{D(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let n=e.shape[0],a=e.shape[1],r=H1(n),s=Ha(e),i=Ta([[1]],[1,1]),o=Ha(i),l=n>=a?a:n;for(let u=0;u{let h=Re(s,[u,u],[n-u,1]),m=gh(h),f=Re(s,[u,u],[1,1]),g=un(Wn(f,0),Ta([[-1]]),Ta([[1]])),y=ye(f,B(g,m)),A=me(h,y);A.shape[0]===1?o=Ha(i):o=lt([i,Re(A,[1,0],[A.shape[0]-1,A.shape[1]])],0);let x=St(me(je(g,y),m)),v=Re(s,[u,0],[n-u,a]),b=B(x,o),w=Qe(o);if(u===0)s=ye(v,je(b,je(w,v)));else{let E=ye(v,je(b,je(w,v)));s=lt([Re(s,[0,0],[u,a]),E],0)}let N=Qe(b),C=Re(r,[0,u],[n,r.shape[1]-u]);if(u===0)r=ye(C,je(je(C,o),N));else{let E=ye(C,je(je(C,o),N));r=lt([Re(r,[0,0],[n,u]),E],1)}return[o,s,r]}),he([d,p,c])}return!t&&n>a&&(r=Re(r,[0,0],[n,a]),s=Re(s,[0,0],[a,a])),[r,s]})}var jF=L({qr_:VF}),yn;(function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(yn||(yn={}));function UF(e,t,n=yn.SUM_BY_NONZERO_WEIGHTS){let a=M(e,"losses","computeWeightedLoss"),r=null;t!=null&&(r=M(t,"weights","computeWeightedLoss"));let s=r==null?a:B(a,r);if(n===yn.NONE)return s;if(n===yn.SUM)return Se(s);if(n===yn.MEAN){if(r==null)return Nt(s);{let i=a.size/r.size,o=me(Se(s),Se(r));return i>1?me(o,ke(i)):o}}if(n===yn.SUM_BY_NONZERO_WEIGHTS){if(r==null)return me(Se(s),ke(a.size));{let i=B(r,jn(a.shape)),o=ge(Se(Ri(i,ke(0))),"float32");return me(Se(s),o)}}throw Error(`Unknown reduction: ${n}`)}var Ar=L({computeWeightedLoss_:UF});function HF(e,t,n,a=yn.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","absoluteDifference"),s=M(t,"predictions","absoluteDifference"),i=null;n!=null&&(i=M(n,"weights","absoluteDifference")),cn(r.shape,s.shape,"Error in absoluteDifference: ");let o=Wt(ye(r,s));return Ar(o,i,a)}var GF=L({absoluteDifference_:HF});function qF(e,t,n,a,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","cosineDistance"),i=M(t,"predictions","cosineDistance"),o=null;a!=null&&(o=M(a,"weights","cosineDistance")),cn(s.shape,i.shape,"Error in cosineDistance: ");let l=ke(1),u=ye(l,Se(B(s,i),n,!0));return Ar(u,o,r)}var XF=L({cosineDistance_:qF});function KF(e,t,n,a=yn.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","hingeLoss"),s=M(t,"predictions","hingeLoss"),i=null;n!=null&&(i=M(n,"weights","hingeLoss")),cn(r.shape,s.shape,"Error in hingeLoss: ");let o=ke(1);r=ye(B(ke(2),r),o);let l=Ka(ye(o,B(r,s)));return Ar(l,i,a)}var ZF=L({hingeLoss_:KF});function YF(e,t,n,a=1,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","huberLoss"),i=M(t,"predictions","huberLoss"),o=null;n!=null&&(o=M(n,"weights","huberLoss")),cn(s.shape,i.shape,"Error in huberLoss: ");let l=ke(a),u=Wt(ye(i,s)),d=Fl(u,l),p=ye(u,d),c=ie(B(ke(.5),ot(d)),B(l,p));return Ar(c,o,r)}var JF=L({huberLoss_:YF});function QF(e,t,n,a=1e-7,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","logLoss"),i=M(t,"predictions","logLoss"),o=null;n!=null&&(o=M(n,"weights","logLoss")),cn(s.shape,i.shape,"Error in logLoss: ");let l=ke(1),u=ke(a),d=St(B(s,Bn(ie(i,u)))),p=B(ye(l,s),Bn(ie(ye(l,i),u))),c=ye(d,p);return Ar(c,o,r)}var e$=L({logLoss_:QF});function t$(e,t,n,a=yn.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","meanSquaredError"),s=M(t,"predictions","meanSquaredError"),i=null;n!=null&&(i=M(n,"weights","meanSquaredError")),cn(r.shape,s.shape,"Error in meanSquaredError: ");let o=hh(r,s);return Ar(o,i,a)}var n$=L({meanSquaredError_:t$});function a$(e,t){let n=M(e,"labels","sigmoidCrossEntropyWithLogits"),a=M(t,"logits","sigmoidCrossEntropyWithLogits");cn(n.shape,a.shape,"Error in sigmoidCrossEntropyWithLogits: ");let r=Ka(a),s=B(a,n),i=Jc(la(St(Wt(a))));return ie(ye(r,s),i)}function r$(e,t,n,a=0,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"multiClassLabels","sigmoidCrossEntropy"),i=M(t,"logits","sigmoidCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","sigmoidCrossEntropy")),cn(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),a>0){let u=ke(a),d=ke(1),p=ke(.5);s=ie(B(s,ye(d,u)),B(p,u))}let l=a$(s,i);return Ar(l,o,r)}var s$=L({sigmoidCrossEntropy_:r$});function i$(e,t,n=-1){if(n===-1&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return qa((a,r,s)=>{let i=Z1(r,[n],!0),o=ye(ge(r,"float32"),i);s([a,o]);let l=St(B(o,a));return{value:Se(l,[n]),gradFunc:(u,d)=>{let[p,c]=d,h=Ei(u.shape,[n]);return[B(q(u,h),ye(ge(p,"float32"),la(c))),B(q(u,h),ye(la(c),ge(p,"float32")))]}}})(e,t)}function o$(e,t,n,a=0,r=yn.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"onehotLabels","softmaxCrossEntropy"),i=M(t,"logits","softmaxCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","softmaxCrossEntropy")),cn(s.shape,i.shape,"Error in softmaxCrossEntropy: "),a>0){let u=ke(a),d=ke(1),p=ke(s.shape[1]);s=ie(B(s,ye(d,u)),me(u,p))}let l=i$(s,i);return Ar(l,o,r)}var l$=L({softmaxCrossEntropy_:o$});function u$(e,t,n,a){let r=M(e,"indices","sparseFillEmptyRows"),s=M(t,"values","sparseFillEmptyRows"),i=M(n,"denseShape","sparseFillEmptyRows"),o=M(a,"defaultValue","sparseFillEmptyRows",s.dtype);if(r.rank!==2)throw new Error(`Indices should be Tensor2D but received shape + ${r.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(i.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${i.shape}`);if(o.rank!==0)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);let l={indices:r,values:s,denseShape:i,defaultValue:o},u=P.runKernel(vc,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var d$=L({sparseFillEmptyRows_:u$});function p$(e,t,n){let a=M(e,"inputIndices","sparseReshape"),r=M(t,"inputShape","sparseReshape"),s=M(n,"newShape","sparseReshape");if(a.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape + ${a.shape}`);if(r.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let i={inputIndices:a,inputShape:r,newShape:s},o=P.runKernel(wc,i);return{outputIndices:o[0],outputShape:o[1]}}var c$=L({sparseReshape_:p$});function h$(e,t,n){let a=M(e,"data","sparseSegmentMean"),r=M(t,"indices","sparseSegmentMean"),s=M(n,"segmentIds","sparseSegmentMean");if(a.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${s.shape}`);let i={data:a,indices:r,segmentIds:s};return P.runKernel(kc,i)}var h$=L({sparseSegmentMean_:c$});function f$(e,t,n){let a=M(e,"data","sparseSegmentSum"),r=M(t,"indices","sparseSegmentSum"),s=M(n,"segmentIds","sparseSegmentSum");if(a.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape + ${s.shape}`);let i={data:a,indices:r,segmentIds:s};return P.runKernel(kc,i)}var f$=L({sparseSegmentMean_:h$});function m$(e,t,n){let a=M(e,"data","sparseSegmentSum"),r=M(t,"indices","sparseSegmentSum"),s=M(n,"segmentIds","sparseSegmentSum");if(a.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${s.shape}`);let i={data:a,indices:r,segmentIds:s};return P.runKernel(Ic,i)}var m$=L({sparseSegmentSum_:f$});function g$(e,t,n,a,r,s,i,o){let u=M(e,"data","stringNGrams","string");if(u.dtype!=="string")throw new Error("Data must be of datatype string");if(u.shape.length!==1)throw new Error(`Data must be a vector, saw: ${u.shape}`);let l=M(t,"dataSplits","stringNGrams");if(l.dtype!=="int32")throw new Error("Data splits must be of datatype int32");let d={separator:n,nGramWidths:a,leftPad:r,rightPad:s,padWidth:i,preserveShortSequences:o},p={data:u,dataSplits:l},c=P.runKernel(Nc,p,d);return{nGrams:c[0],nGramsSplits:c[1]}}var y$=L({stringNGrams_:g$});function A$(e,t,n=!0){let a=M(e,"input","stringSplit","string"),r=M(t,"delimiter","stringSplit","string");if(a.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${a.shape}`);if(r.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);let s={skipEmpty:n},i={input:a,delimiter:r},o=P.runKernel(Tc,i,s);return{indices:o[0],values:o[1],shape:o[2]}}var x$=L({stringSplit_:A$});function b$(e,t){let n=M(e,"input","stringToHashBucketFast","string"),a={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");let r={input:n};return P.runKernel(Cc,r,a)}var v$=L({stringToHashBucketFast_:b$}),w$={fft:bd,ifft:Dl,rfft:vd,irfft:ch},k$={hammingWindow:tF,hannWindow:Z3,frame:Y3,stft:sF},De={flipLeftRight:uF,resizeNearestNeighbor:a7,resizeBilinear:n7,rotateWithOffset:pF,cropAndResize:oF,nonMaxSuppression:hF,nonMaxSuppressionAsync:vF,nonMaxSuppressionWithScore:kF,nonMaxSuppressionWithScoreAsync:SF,nonMaxSuppressionPadded:TF,nonMaxSuppressionPaddedAsync:EF,threshold:DF,transform:zF},s7={bandPart:PF,gramSchmidt:WF,qr:VF},I$={absoluteDifference:HF,computeWeightedLoss:Ar,cosineDistance:qF,hingeLoss:KF,huberLoss:YF,logLoss:QF,meanSquaredError:t$,sigmoidCrossEntropy:r$,softmaxCrossEntropy:o$},wd={sparseFillEmptyRows:u$,sparseReshape:p$,sparseSegmentMean:h$,sparseSegmentSum:m$},vh={stringNGrams:y$,stringSplit:x$,stringToHashBucketFast:v$},xr=class extends l3{minimize(e,t=!1,n){let{value:a,grads:r}=this.computeGradients(e,n);if(n!=null){let s=n.map(i=>({name:i.name,tensor:r[i.name]}));this.applyGradients(s)}else this.applyGradients(r);return he(r),t?a:(a.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return R3(e,t)}dispose(){this.iterations_!=null&&he(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:ke(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(xr,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var wh=class extends xr{constructor(e,t,n=null){super();this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],n==null&&(this.epsilon=P.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t],r=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:V(()=>Ge(a).variable(r))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:V(()=>Ge(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;V(()=>{let u=ie(B(i,this.rho),B(ot(s),1-this.rho)),l=B(me(an(ie(o,this.epsilon)),an(ie(i,this.epsilon))),s),d=ie(B(o,this.rho),B(ot(l),1-this.rho));i.assign(u),o.assign(d);let p=ie(B(l,-this.learningRate),a);a.assign(p)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(he(this.accumulatedGrads.map(e=>e.variable)),he(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let 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);let t=e.length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};wh.className="Adadelta";jr(wh);var kh=class extends xr{constructor(e,t=.1){super();this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t];if(this.accumulatedGrads[n]==null){let i=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:V(()=>El(a.shape,this.initialAccumulatorValue).variable(i))}}let r=Array.isArray(e)?e[n].tensor:e[t];if(r==null)return;let s=this.accumulatedGrads[n].variable;V(()=>{let i=ie(s,ot(r));s.assign(i);let o=ie(B(me(r,an(ie(i,P.backend.epsilon()))),-this.learningRate),a);a.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&he(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);let t=!1;this.accumulatedGrads=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};kh.className="Adagrad";jr(kh);var Ih=class extends xr{constructor(e,t,n,a=null){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],V(()=>{this.accBeta1=ke(t).variable(),this.accBeta2=ke(n).variable()}),a==null&&(this.epsilon=P.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);V(()=>{let n=ye(1,this.accBeta1),a=ye(1,this.accBeta2);t.forEach((r,s)=>{let i=P.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:V(()=>Ge(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${r}/v`,variable:V(()=>Ge(i).variable(o))});let u=Array.isArray(e)?e[s].tensor:e[r];if(u==null)return;let l=this.accumulatedFirstMoment[s].variable,d=this.accumulatedSecondMoment[s].variable,p=ie(B(l,this.beta1),B(u,1-this.beta1)),c=ie(B(d,this.beta2),B(ot(u),1-this.beta2)),h=me(p,n),m=me(c,a);l.assign(p),d.assign(c);let f=ie(B(me(h,ie(an(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(B(this.accBeta1,this.beta1)),this.accBeta2.assign(B(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&he(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&he(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let 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),V(()=>{this.accBeta1.assign(yr(this.beta1,this.iterations_+1)),this.accBeta2.assign(yr(this.beta2,this.iterations_+1))});let t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}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)}};Ih.className="Adam";jr(Ih);var Sh=class extends xr{constructor(e,t,n,a=null,r=0){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],V(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(t).variable()}),a==null&&(this.epsilon=P.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);V(()=>{let n=ye(1,this.accBeta1),a=me(-this.learningRate,ie(B(this.iteration,this.decay),1));t.forEach((r,s)=>{let i=P.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:Ge(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${r}/v`,variable:Ge(i).variable(o)});let u=Array.isArray(e)?e[s].tensor:e[r];if(u==null)return;let l=this.accumulatedFirstMoment[s].variable,d=this.accumulatedWeightedInfNorm[s].variable,p=ie(B(l,this.beta1),B(u,1-this.beta1)),c=B(d,this.beta2),h=Wt(u),m=Xa(c,h);l.assign(p),d.assign(m);let f=ie(B(me(a,n),me(p,ie(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(ie(this.iteration,1)),this.accBeta1.assign(B(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&he(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&he(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)}};Sh.className="Adamax";jr(Sh);var kd=class extends xr{constructor(e){super();this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=Array.isArray(e)?e[n].tensor:e[t];if(a==null)return;let r=P.registeredVariables[t];V(()=>{let s=ie(B(this.c,a),r);r.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Kt(ke(-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)}};kd.className="SGD";jr(kd);var Nh=class extends kd{constructor(e,t,n=!1){super(e);this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t];if(this.accumulations[n]==null){let i=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:V(()=>Ge(a).variable(i))}}let r=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];s!=null&&V(()=>{let i,o=ie(B(this.m,r),s);this.useNesterov?i=ie(B(this.c,ie(s,B(o,this.m))),a):i=ie(B(this.c,o),a),r.assign(o),a.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&he(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);let t=!1;this.accumulations=e.map(n=>({originalName:n.name,variable:n.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)}};Nh.className="Momentum";jr(Nh);var Th=class extends xr{constructor(e,t=.9,n=0,a=null,r=!1){super();if(this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=a,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,a==null&&(this.epsilon=P.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t],r=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:V(()=>Ge(a).variable(r))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:V(()=>Ge(a).variable(r))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:V(()=>Ge(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;V(()=>{let u=ie(B(i,this.decay),B(ot(s),1-this.decay));if(this.centered){let l=this.accumulatedMeanGrads[n].variable,d=ie(B(l,this.decay),B(s,1-this.decay)),p=me(B(s,this.learningRate),an(ye(u,ie(ot(d),this.epsilon)))),c=ie(B(o,this.momentum),p);i.assign(u),l.assign(d),o.assign(c);let h=ye(a,c);a.assign(h)}else{let l=ie(B(i,this.decay),B(ot(s),1-this.decay)),d=ie(B(o,this.momentum),me(B(s,this.learningRate),an(ie(l,this.epsilon))));i.assign(l),o.assign(d);let p=ye(a,d);a.assign(p)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&he(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&he(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&he(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){let 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})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})))}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)}};Th.className="RMSProp";jr(Th);var Mi=class{static sgd(e){return new kd(e)}static momentum(e,t,n=!1){return new Nh(e,t,n)}static rmsprop(e,t=.9,n=0,a=null,r=!1){return new Th(e,t,n,a,r)}static adam(e=.001,t=.9,n=.999,a=null){return new Ih(e,t,n,a)}static adadelta(e=.001,t=.95,n=null){return new wh(e,t,n)}static adamax(e=.002,t=.9,n=.999,a=null,r=0){return new Sh(e,t,n,a,r)}static adagrad(e,t=.1){return new kh(e,t)}},Fi={sgd:Mi.sgd,momentum:Mi.momentum,adadelta:Mi.adadelta,adagrad:Mi.adagrad,rmsprop:Mi.rmsprop,adamax:Mi.adamax,adam:Mi.adam},S$=(()=>typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e())();function Ch(){return new Promise(e=>S$(()=>e()))}var F={};Fe(F,{ERF_A1:()=>z$,ERF_A2:()=>_$,ERF_A3:()=>P$,ERF_A4:()=>L$,ERF_A5:()=>W$,ERF_P:()=>O$,PARALLELIZE_THRESHOLD:()=>mg,SELU_SCALE:()=>o7,SELU_SCALEALPHA:()=>i7,applyActivation:()=>xh,assertAndGetBroadcastShape:()=>mt,assertAxesAreInnerMostDims:()=>jE,assertParamsConsistent:()=>N$,assignToTypedArray:()=>X$,axesAreInnerMostDims:()=>X1,calculateShapes:()=>Zb,checkEinsumDimSizes:()=>eD,combineLocations:()=>F3,complexWithEvenIndex:()=>H$,complexWithOddIndex:()=>G$,computeConv2DInfo:()=>od,computeConv3DInfo:()=>f3,computeDefaultPad:()=>$1,computeDilation2DInfo:()=>hC,computeOptimalWindowSize:()=>C$,computeOutAndReduceShapes:()=>$3,computeOutShape:()=>T$,computePool2DInfo:()=>h3,computePool3DInfo:()=>fC,convertConv2DDataFormat:()=>m3,decodeEinsumEquation:()=>J$,eitherStridesOrDilationsAreOne:()=>Ga,expandShapeToKeepDim:()=>Ei,exponent:()=>Z$,exponents:()=>K$,fromStringArrayToUint8:()=>uD,fromUint8ToStringArray:()=>lD,getAxesPermutation:()=>D3,getBroadcastDims:()=>rE,getComplexWithIndex:()=>q$,getEinsumComputePath:()=>tD,getEinsumPermutation:()=>Q$,getFusedBiasGradient:()=>Ah,getFusedDyActivation:()=>yh,getImageCenter:()=>E$,getInnerMostAxes:()=>UE,getPermuted:()=>M$,getReductionAxes:()=>Bt,getReshaped:()=>R$,getReshapedPermuted:()=>F$,getSliceBeginCoords:()=>$$,getSliceSize:()=>D$,getUndoAxesPermutation:()=>K1,isIdentityPermutation:()=>nD,log:()=>V$,mergeRealAndImagArrays:()=>j$,prepareAndValidate:()=>Kb,prepareSplitSize:()=>rD,segment_util:()=>d7,shouldFuse:()=>bh,slice_util:()=>fn,splitRealAndImagArrays:()=>U$,tupleValuesAreOne:()=>Ur,upcastType:()=>Aa,validateInput:()=>x1,validateUpdateShape:()=>A1,warn:()=>B$});function N$(e,t){let n=e[0].length;e.forEach((r,s)=>{D(r.length===n,()=>`Error in concat${n}D: rank of tensors[${s}] must be the same as the rank of the rest (${n})`)}),D(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`);let a=e[0];e.forEach((r,s)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${s}] (${r}) does not match the shape of the rest (${a}) along the non-concatenated axis ${s}.`)})}function T$(e,t){let n=e[0].slice();for(let a=1;a=t*2+1||i%2==1?s.push(i):r.push(i);a.push(...r),a.push(0),a.push(...s)}return a}function F$(e,t,n,a=!0){let r=[];a?r.push(e[0]/n):r.push(e[0]*n);for(let s=1;s/g,l7=",",u7="...";function J$(e,t){e=e.replace(/\s/g,"");let n=(e.length-e.replace(Y$,"").length)/gg.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${gg}").`);let[a,r]=e.split(gg);D(a.indexOf(u7)===-1,()=>`The ellipsis notation ("${u7}") is not supported yet.`);let s=a.split(l7),i=s.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let o=[];for(let c=0;cm.indexOf(h)!==-1))throw new Error(`Output subscripts contain the label ${h} not present in the input subscripts.`);o.indexOf(h)===-1&&o.push(h)}for(let c=0;cr!==-1),{permutationIndices:n,expandDims:a}}function eD(e,t,n){let a=new Array(e);for(let r=0;r`Expected dimension ${a[t[r][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function tD(e,t){let n=e,a=[],r=0;e.length===0&&n.push(-1),r=e.length+1;for(let i=0;it===n)}function aD(e,t){let n=[];for(let a=0;a"Number of splits must evenly divide the axis."),a=new Array(t).fill(e.shape[n]/t);else{let r=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);D(r<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let i=t.reduce((o,u)=>u>0?o+u:o);t[s]=e.shape[n]-i}D(e.shape[n]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),a=t}return a}var d7={};Fe(d7,{collectGatherOpShapeInfo:()=>oD,computeOutShape:()=>iD,segOpComputeOptimalWindowSize:()=>sD});function sD(e,t){let n=!1,a;for(e<=mg?(a=e,n=!0):a=Gp(e,Math.floor(Math.sqrt(e)));!n;)a>t||a===e?n=!0:a=Gp(e,a+1);return a}function iD(e,t,n){let a=[],r=e.length;for(let s=0;sr))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${a}`);if(a<0&&(a+=r),a>s)throw new Error(`batchDims (${a}) must be less than rank(x) ( - ${s}).`);if(nDc(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function uD(e){return e.map(t=>Yu(t))}var Za={};Fe(Za,{nonMaxSuppressionV3Impl:()=>J3,nonMaxSuppressionV4Impl:()=>Q3,nonMaxSuppressionV5Impl:()=>e7,whereImpl:()=>V3});function we(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&k.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var dD=Za.whereImpl,Eh=class extends Eu{constructor(){super();this.blockSize=48,this.firstUse=!0,this.data=new Up(this,fr())}nextDataId(){return Eh.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,te().get("IS_NODE")&&F.warn(` + ${s.shape}`);let i={data:a,indices:r,segmentIds:s};return P.runKernel(Ic,i)}var g$=L({sparseSegmentSum_:m$});function y$(e,t,n,a,r,s,i,o){let l=M(e,"data","stringNGrams","string");if(l.dtype!=="string")throw new Error("Data must be of datatype string");if(l.shape.length!==1)throw new Error(`Data must be a vector, saw: ${l.shape}`);let u=M(t,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");let d={separator:n,nGramWidths:a,leftPad:r,rightPad:s,padWidth:i,preserveShortSequences:o},p={data:l,dataSplits:u},c=P.runKernel(Nc,p,d);return{nGrams:c[0],nGramsSplits:c[1]}}var A$=L({stringNGrams_:y$});function x$(e,t,n=!0){let a=M(e,"input","stringSplit","string"),r=M(t,"delimiter","stringSplit","string");if(a.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${a.shape}`);if(r.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);let s={skipEmpty:n},i={input:a,delimiter:r},o=P.runKernel(Tc,i,s);return{indices:o[0],values:o[1],shape:o[2]}}var b$=L({stringSplit_:x$});function v$(e,t){let n=M(e,"input","stringToHashBucketFast","string"),a={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");let r={input:n};return P.runKernel(Cc,r,a)}var w$=L({stringToHashBucketFast_:v$}),k$={fft:bd,ifft:Ol,rfft:vd,irfft:ch},I$={hammingWindow:nF,hannWindow:Y3,frame:J3,stft:iF},De={flipLeftRight:dF,resizeNearestNeighbor:r7,resizeBilinear:a7,rotateWithOffset:cF,cropAndResize:lF,nonMaxSuppression:fF,nonMaxSuppressionAsync:wF,nonMaxSuppressionWithScore:IF,nonMaxSuppressionWithScoreAsync:NF,nonMaxSuppressionPadded:CF,nonMaxSuppressionPaddedAsync:RF,threshold:OF,transform:_F},i7={bandPart:LF,gramSchmidt:BF,qr:jF},S$={absoluteDifference:GF,computeWeightedLoss:Ar,cosineDistance:XF,hingeLoss:ZF,huberLoss:JF,logLoss:e$,meanSquaredError:n$,sigmoidCrossEntropy:s$,softmaxCrossEntropy:l$},wd={sparseFillEmptyRows:d$,sparseReshape:c$,sparseSegmentMean:f$,sparseSegmentSum:g$},vh={stringNGrams:A$,stringSplit:b$,stringToHashBucketFast:w$},xr=class extends u3{minimize(e,t=!1,n){let{value:a,grads:r}=this.computeGradients(e,n);if(n!=null){let s=n.map(i=>({name:i.name,tensor:r[i.name]}));this.applyGradients(s)}else this.applyGradients(r);return he(r),t?a:(a.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return M3(e,t)}dispose(){this.iterations_!=null&&he(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:ke(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(xr,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var wh=class extends xr{constructor(e,t,n=null){super();this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],n==null&&(this.epsilon=P.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t],r=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:V(()=>Ge(a).variable(r))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:V(()=>Ge(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;V(()=>{let l=ie(B(i,this.rho),B(ot(s),1-this.rho)),u=B(me(an(ie(o,this.epsilon)),an(ie(i,this.epsilon))),s),d=ie(B(o,this.rho),B(ot(u),1-this.rho));i.assign(l),o.assign(d);let p=ie(B(u,-this.learningRate),a);a.assign(p)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(he(this.accumulatedGrads.map(e=>e.variable)),he(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let 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);let t=e.length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};wh.className="Adadelta";jr(wh);var kh=class extends xr{constructor(e,t=.1){super();this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t];if(this.accumulatedGrads[n]==null){let i=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:V(()=>Rl(a.shape,this.initialAccumulatorValue).variable(i))}}let r=Array.isArray(e)?e[n].tensor:e[t];if(r==null)return;let s=this.accumulatedGrads[n].variable;V(()=>{let i=ie(s,ot(r));s.assign(i);let o=ie(B(me(r,an(ie(i,P.backend.epsilon()))),-this.learningRate),a);a.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&he(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);let t=!1;this.accumulatedGrads=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};kh.className="Adagrad";jr(kh);var Ih=class extends xr{constructor(e,t,n,a=null){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],V(()=>{this.accBeta1=ke(t).variable(),this.accBeta2=ke(n).variable()}),a==null&&(this.epsilon=P.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);V(()=>{let n=ye(1,this.accBeta1),a=ye(1,this.accBeta2);t.forEach((r,s)=>{let i=P.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:V(()=>Ge(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${r}/v`,variable:V(()=>Ge(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let u=this.accumulatedFirstMoment[s].variable,d=this.accumulatedSecondMoment[s].variable,p=ie(B(u,this.beta1),B(l,1-this.beta1)),c=ie(B(d,this.beta2),B(ot(l),1-this.beta2)),h=me(p,n),m=me(c,a);u.assign(p),d.assign(c);let f=ie(B(me(h,ie(an(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(B(this.accBeta1,this.beta1)),this.accBeta2.assign(B(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&he(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&he(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let 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),V(()=>{this.accBeta1.assign(yr(this.beta1,this.iterations_+1)),this.accBeta2.assign(yr(this.beta2,this.iterations_+1))});let t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}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)}};Ih.className="Adam";jr(Ih);var Sh=class extends xr{constructor(e,t,n,a=null,r=0){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],V(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(t).variable()}),a==null&&(this.epsilon=P.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);V(()=>{let n=ye(1,this.accBeta1),a=me(-this.learningRate,ie(B(this.iteration,this.decay),1));t.forEach((r,s)=>{let i=P.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:Ge(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${r}/v`,variable:Ge(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let u=this.accumulatedFirstMoment[s].variable,d=this.accumulatedWeightedInfNorm[s].variable,p=ie(B(u,this.beta1),B(l,1-this.beta1)),c=B(d,this.beta2),h=Wt(l),m=Xa(c,h);u.assign(p),d.assign(m);let f=ie(B(me(a,n),me(p,ie(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(ie(this.iteration,1)),this.accBeta1.assign(B(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&he(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&he(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)}};Sh.className="Adamax";jr(Sh);var kd=class extends xr{constructor(e){super();this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=Array.isArray(e)?e[n].tensor:e[t];if(a==null)return;let r=P.registeredVariables[t];V(()=>{let s=ie(B(this.c,a),r);r.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Kt(ke(-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)}};kd.className="SGD";jr(kd);var Nh=class extends kd{constructor(e,t,n=!1){super(e);this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t];if(this.accumulations[n]==null){let i=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:V(()=>Ge(a).variable(i))}}let r=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];s!=null&&V(()=>{let i,o=ie(B(this.m,r),s);this.useNesterov?i=ie(B(this.c,ie(s,B(o,this.m))),a):i=ie(B(this.c,o),a),r.assign(o),a.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&he(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);let t=!1;this.accumulations=e.map(n=>({originalName:n.name,variable:n.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)}};Nh.className="Momentum";jr(Nh);var Th=class extends xr{constructor(e,t=.9,n=0,a=null,r=!1){super();if(this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=a,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,a==null&&(this.epsilon=P.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=P.registeredVariables[t],r=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:V(()=>Ge(a).variable(r))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:V(()=>Ge(a).variable(r))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:V(()=>Ge(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;V(()=>{let l=ie(B(i,this.decay),B(ot(s),1-this.decay));if(this.centered){let u=this.accumulatedMeanGrads[n].variable,d=ie(B(u,this.decay),B(s,1-this.decay)),p=me(B(s,this.learningRate),an(ye(l,ie(ot(d),this.epsilon)))),c=ie(B(o,this.momentum),p);i.assign(l),u.assign(d),o.assign(c);let h=ye(a,c);a.assign(h)}else{let u=ie(B(i,this.decay),B(ot(s),1-this.decay)),d=ie(B(o,this.momentum),me(B(s,this.learningRate),an(ie(u,this.epsilon))));i.assign(u),o.assign(d);let p=ye(a,d);a.assign(p)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&he(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&he(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&he(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){let 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})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})))}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)}};Th.className="RMSProp";jr(Th);var Mi=class{static sgd(e){return new kd(e)}static momentum(e,t,n=!1){return new Nh(e,t,n)}static rmsprop(e,t=.9,n=0,a=null,r=!1){return new Th(e,t,n,a,r)}static adam(e=.001,t=.9,n=.999,a=null){return new Ih(e,t,n,a)}static adadelta(e=.001,t=.95,n=null){return new wh(e,t,n)}static adamax(e=.002,t=.9,n=.999,a=null,r=0){return new Sh(e,t,n,a,r)}static adagrad(e,t=.1){return new kh(e,t)}},Fi={sgd:Mi.sgd,momentum:Mi.momentum,adadelta:Mi.adadelta,adagrad:Mi.adagrad,rmsprop:Mi.rmsprop,adamax:Mi.adamax,adam:Mi.adam},N$=(()=>typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e())();function Ch(){return new Promise(e=>N$(()=>e()))}var F={};Fe(F,{ERF_A1:()=>_$,ERF_A2:()=>P$,ERF_A3:()=>L$,ERF_A4:()=>W$,ERF_A5:()=>B$,ERF_P:()=>z$,PARALLELIZE_THRESHOLD:()=>mg,SELU_SCALE:()=>l7,SELU_SCALEALPHA:()=>o7,applyActivation:()=>xh,assertAndGetBroadcastShape:()=>mt,assertAxesAreInnerMostDims:()=>UE,assertParamsConsistent:()=>T$,assignToTypedArray:()=>K$,axesAreInnerMostDims:()=>X1,calculateShapes:()=>Yb,checkEinsumDimSizes:()=>tD,combineLocations:()=>$3,complexWithEvenIndex:()=>G$,complexWithOddIndex:()=>q$,computeConv2DInfo:()=>od,computeConv3DInfo:()=>m3,computeDefaultPad:()=>$1,computeDilation2DInfo:()=>fC,computeOptimalWindowSize:()=>E$,computeOutAndReduceShapes:()=>D3,computeOutShape:()=>C$,computePool2DInfo:()=>f3,computePool3DInfo:()=>mC,convertConv2DDataFormat:()=>g3,decodeEinsumEquation:()=>Q$,eitherStridesOrDilationsAreOne:()=>Ga,expandShapeToKeepDim:()=>Ei,exponent:()=>Y$,exponents:()=>Z$,fromStringArrayToUint8:()=>dD,fromUint8ToStringArray:()=>uD,getAxesPermutation:()=>O3,getBroadcastDims:()=>sE,getComplexWithIndex:()=>X$,getEinsumComputePath:()=>nD,getEinsumPermutation:()=>eD,getFusedBiasGradient:()=>Ah,getFusedDyActivation:()=>yh,getImageCenter:()=>R$,getInnerMostAxes:()=>HE,getPermuted:()=>F$,getReductionAxes:()=>Bt,getReshaped:()=>M$,getReshapedPermuted:()=>$$,getSliceBeginCoords:()=>D$,getSliceSize:()=>O$,getUndoAxesPermutation:()=>K1,isIdentityPermutation:()=>aD,log:()=>j$,mergeRealAndImagArrays:()=>U$,prepareAndValidate:()=>Zb,prepareSplitSize:()=>sD,segment_util:()=>p7,shouldFuse:()=>bh,slice_util:()=>fn,splitRealAndImagArrays:()=>H$,tupleValuesAreOne:()=>Ur,upcastType:()=>Aa,validateInput:()=>x1,validateUpdateShape:()=>A1,warn:()=>V$});function T$(e,t){let n=e[0].length;e.forEach((r,s)=>{D(r.length===n,()=>`Error in concat${n}D: rank of tensors[${s}] must be the same as the rank of the rest (${n})`)}),D(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`);let a=e[0];e.forEach((r,s)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${s}] (${r}) does not match the shape of the rest (${a}) along the non-concatenated axis ${s}.`)})}function C$(e,t){let n=e[0].slice();for(let a=1;a=t*2+1||i%2==1?s.push(i):r.push(i);a.push(...r),a.push(0),a.push(...s)}return a}function $$(e,t,n,a=!0){let r=[];a?r.push(e[0]/n):r.push(e[0]*n);for(let s=1;s/g,u7=",",d7="...";function Q$(e,t){e=e.replace(/\s/g,"");let n=(e.length-e.replace(J$,"").length)/gg.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${gg}").`);let[a,r]=e.split(gg);D(a.indexOf(d7)===-1,()=>`The ellipsis notation ("${d7}") is not supported yet.`);let s=a.split(u7),i=s.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let o=[];for(let c=0;cm.indexOf(h)!==-1))throw new Error(`Output subscripts contain the label ${h} not present in the input subscripts.`);o.indexOf(h)===-1&&o.push(h)}for(let c=0;cr!==-1),{permutationIndices:n,expandDims:a}}function tD(e,t,n){let a=new Array(e);for(let r=0;r`Expected dimension ${a[t[r][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function nD(e,t){let n=e,a=[],r=0;e.length===0&&n.push(-1),r=e.length+1;for(let i=0;it===n)}function rD(e,t){let n=[];for(let a=0;a"Number of splits must evenly divide the axis."),a=new Array(t).fill(e.shape[n]/t);else{let r=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);D(r<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let i=t.reduce((o,l)=>l>0?o+l:o);t[s]=e.shape[n]-i}D(e.shape[n]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),a=t}return a}var p7={};Fe(p7,{collectGatherOpShapeInfo:()=>lD,computeOutShape:()=>oD,segOpComputeOptimalWindowSize:()=>iD});function iD(e,t){let n=!1,a;for(e<=mg?(a=e,n=!0):a=Gp(e,Math.floor(Math.sqrt(e)));!n;)a>t||a===e?n=!0:a=Gp(e,a+1);return a}function oD(e,t,n){let a=[],r=e.length;for(let s=0;sr))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${a}`);if(a<0&&(a+=r),a>s)throw new Error(`batchDims (${a}) must be less than rank(x) ( + ${s}).`);if(nDc(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function dD(e){return e.map(t=>Yu(t))}var Za={};Fe(Za,{nonMaxSuppressionV3Impl:()=>Q3,nonMaxSuppressionV4Impl:()=>e7,nonMaxSuppressionV5Impl:()=>t7,whereImpl:()=>j3});function we(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&k.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var pD=Za.whereImpl,Eh=class extends Eu{constructor(){super();this.blockSize=48,this.firstUse=!0,this.data=new Up(this,fr())}nextDataId(){return Eh.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,te().get("IS_NODE")&&F.warn(` ============================ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details. -============================`));let a={id:this.nextDataId()};return this.data.set(a,{values:e,dtype:n,refCount:1}),a}makeTensorInfo(e,t,n){let a;if(t==="string"&&n!=null&&n.length>0&&k.isString(n[0])){let r=n.map(s=>k.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return{dataId:a,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){let t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){let t=this.data.get(e);t.refCount--}}move(e,t,n,a,r){this.data.set(e,{values:t,dtype:a,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:n}=this.data.get(e);if(t==="complex64"){let a=this.readSync(n.real.dataId),r=this.readSync(n.imag.dataId);return F.mergeRealAndImagArrays(a,r)}return this.data.get(e).values}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>k.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return Ve(e.shape,e.dtype,n)}makeOutput(e,t,n){let a=this.write(e,t,n);return fr().makeTensorFromDataId(a,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(e);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=k.now();return e(),{kernelMs:k.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){we([e],"where");let t=this.readSync(e.dataId);return dD(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};Eh.nextDataId=0;var yg={};Fe(yg,{addImpl:()=>c7,bincountImpl:()=>xg,bincountReduceImpl:()=>h7,ceilImpl:()=>f7,concatImpl:()=>bg,equalImpl:()=>m7,expImpl:()=>y7,expm1Impl:()=>x7,floorImpl:()=>b7,gatherNdImpl:()=>v7,gatherV2Impl:()=>w7,greaterEqualImpl:()=>I7,greaterImpl:()=>k7,lessEqualImpl:()=>N7,lessImpl:()=>S7,linSpaceImpl:()=>T7,logImpl:()=>C7,maxImpl:()=>E7,maximumImpl:()=>R7,minimumImpl:()=>M7,multiplyImpl:()=>vg,negImpl:()=>F7,notEqualImpl:()=>$7,prodImpl:()=>D7,rangeImpl:()=>kg,rsqrtImpl:()=>O7,simpleAbsImpl:()=>p7,sliceImpl:()=>Fh,sparseFillEmptyRowsImpl:()=>z7,sparseReshapeImpl:()=>_7,sparseSegmentReductionImpl:()=>Ig,squaredDifferenceImpl:()=>P7,stridedSliceImpl:()=>L7,stringNGramsImpl:()=>W7,stringSplitImpl:()=>B7,stringToHashBucketFastImpl:()=>V7,subImpl:()=>j7,tileImpl:()=>U7,topKImpl:()=>H7,transposeImpl:()=>wg,uniqueImpl:()=>G7});function p7(e){let t=new Float32Array(e.length);for(let n=0;n{let{x:t}=e.inputs,n=e.backend;we(t,"abs");let a=new Float32Array(k.sizeFromShape(t.shape)),r=n.data.get(t.dataId).values;return a=p7(r),n.makeOutput(a,t.shape,"float32")},cD={kernelName:fo,backendName:"cpu",kernelFunc:pD};function Ot(e){return(t,n,a,r,s)=>{let i=F.assertAndGetBroadcastShape(t,n),o=i.length,u=k.computeStrides(i),l=k.sizeFromShape(i),d=k.getTypedArrayFromDType(s,l),p=t.length,c=n.length,h=k.computeStrides(t),m=k.computeStrides(n),f=F.getBroadcastDims(t,i),g=F.getBroadcastDims(n,i);if(f.length+g.length===0)for(let y=0;yx[N]=0);let v=k.locToIndex(x,p,h),b=A.slice(-c);g.forEach(N=>b[N]=0);let w=k.locToIndex(b,c,m);d[y]=e(a[v],r[w])}return[d,i]}}function qn(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,o=n.makeTensorInfo(a.shape,"complex64"),u=n.data.get(o.dataId);return u.complexTensorInfos={real:n.makeTensorInfo(a.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",i)},o}var hD={kernelName:Yp,backendName:"cpu",kernelFunc:qn};function Rh(e,t,n="float32"){if(n==="complex64"){let r=Rh(e,t,"float32"),s=Rh(e,t,"float32");return qn({inputs:{real:r,imag:s},backend:e})}let a=k.makeZerosTypedArray(k.sizeFromShape(t),n);return e.makeTensorInfo(t,n,a)}function Ya(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var fD={kernelName:zs,backendName:"cpu",kernelFunc:Ya};function $i(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.data.get(a.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}var mD={kernelName:Ac,backendName:"cpu",kernelFunc:$i};function Zr(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Ya({inputs:{x:r},backend:n});let i=Rh(n,r.shape,r.dtype),o=Zr({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),u=qn({inputs:{real:o,imag:i},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),u}if(r.dtype==="complex64"){let i=$i({inputs:{input:r},backend:n}),o=Zr({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!k.hasEncodingLoss(r.dtype,s)){let i=Ya({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32"){let i=n.data.get(r.dataId).values,o=Int32Array.from(i);return n.makeTensorInfo(r.shape,"int32",o)}if(s==="bool"){let i=n.data.get(r.dataId).values,o=k.toTypedArray([0],r.dtype),[u,l]=Ot((d,p)=>d!==p?1:0)(r.shape,[],i,o,"bool");return n.makeTensorInfo(l,"bool",u)}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var gD={kernelName:ks,backendName:"cpu",kernelFunc:Zr};function Yt(e,t,n,a){return n==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,u=s;we([i,o],e);let l=u.data.get(i.dataId).values,d=u.data.get(o.dataId).values,p=i.dtype==="string"?F.fromUint8ToStringArray(l):l,c=i.dtype==="string"?F.fromUint8ToStringArray(d):d,h=a||i.dtype,[m,f]=t(i.shape,o.shape,p,c,h);return u.makeTensorInfo(f,h,m)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,u=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let l=Zr({inputs:{x:i},backend:u,attrs:{dtype:"complex64"}}),d=u.data.get(l.dataId),p=d.complexTensorInfos.real,c=d.complexTensorInfos.imag,h=u.data.get(p.dataId).values,m=u.data.get(c.dataId).values,f=Zr({inputs:{x:o},backend:u,attrs:{dtype:"complex64"}}),g=u.data.get(f.dataId),y=g.complexTensorInfos.real,A=g.complexTensorInfos.imag,x=u.data.get(y.dataId).values,v=u.data.get(A.dataId).values,[b,w,N]=n(i.shape,o.shape,h,m,x,v),C=u.makeTensorInfo(N,"float32",b),E=u.makeTensorInfo(N,"float32",w),_=qn({inputs:{real:C,imag:E},backend:u});return u.disposeIntermediateTensorInfo(l),u.disposeIntermediateTensorInfo(f),u.disposeIntermediateTensorInfo(C),u.disposeIntermediateTensorInfo(E),_}else{let l=u.data.get(i.dataId).values,d=u.data.get(o.dataId).values,p=a||i.dtype,[c,h]=t(i.shape,o.shape,l,d,p);return u.makeTensorInfo(h,p,c)}}}function Ag(e){return(t,n,a,r,s,i)=>{let o=F.assertAndGetBroadcastShape(t,n),u=k.sizeFromShape(o),l=o.length,d=k.computeStrides(o),p=k.getTypedArrayFromDType("float32",u),c=k.getTypedArrayFromDType("float32",u),h=F.getBroadcastDims(t,o),m=F.getBroadcastDims(n,o),f=F.mergeRealAndImagArrays(a,r),g=F.mergeRealAndImagArrays(s,i),y=t.length,A=k.computeStrides(t),x=n.length,v=k.computeStrides(n);if(h.length+m.length===0)for(let b=0;bN[S]=0);let C=k.locToIndex(N,y,A),E=w.slice(-x);m.forEach(S=>E[S]=0);let _=k.locToIndex(E,x,v),$=e(f[C*2],f[C*2+1],g[_*2],g[_*2+1]);p[b]=$.real,c[b]=$.imag}return[p,c,o]}}var c7=Ot((e,t)=>e+t),yD=Ag((e,t,n,a)=>({real:e+n,imag:t+a})),Id=Yt(Or,c7,yD),AD={kernelName:Or,backendName:"cpu",kernelFunc:Id};function xg(e,t,n,a,r){let s=k.sizeFromShape(a),i=k.makeZerosTypedArray(r,n);for(let o=0;o=r||(s>0?i[u]+=t[o]:i[u]+=1)}return i}function h7(e,t,n,a=!1){let r=e.shape[0],s=e.shape[1],i=Ve([r,n],t.dtype);for(let o=0;o=n||(a?i.set(1,o,l):t.size>0?i.set(i.get(o,l)+t.get(o,u),o,l):i.set(i.get(o,l)+1,o,l))}return i}function _l(e){return(t,n,a)=>{let r=k.getTypedArrayFromDType(n,t.length);for(let s=0;s{let{x:i}=a;if(we(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,u=o.data.get(i.dataId).values,l=k.sizeFromShape(i.shape),d=n||i.dtype,p=k.getArrayFromDType(d,l);for(let c=0;c{let{x:i}=a;if(we(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,u=o.data.get(i.dataId).values,l=n||i.dtype,d=t(u,l,r);return o.makeTensorInfo(i.shape,l,d)}}var f7=_l(e=>Math.ceil(e)),xD=Pl(Is,f7),bD={kernelName:Is,backendName:"cpu",kernelFunc:xD};function bg(e,t,n,a){let r=k.getArrayFromDType(n,k.sizeFromShape(t));if(a&&n!=="string"){let s=0;e.forEach(i=>{let o=k.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=n==="string"?F.fromUint8ToStringArray(i.vals):i.vals,u=0;for(let l=0;le===t?1:0),g7=Yt(Ro,m7,null,"bool"),vD={kernelName:Ro,backendName:"cpu",kernelFunc:g7},y7=_l(e=>Math.exp(e)),A7=Pl(Ms,y7),wD={kernelName:Ms,backendName:"cpu",kernelFunc:A7},x7=_l(e=>Math.expm1(e)),kD=Pl(Fo,x7),ID={kernelName:Fo,backendName:"cpu",kernelFunc:kD},b7=_l(e=>Math.floor(e)),SD=Pl(Fs,b7),ND={kernelName:Fs,backendName:"cpu",kernelFunc:SD};function v7(e,t,n,a,r,s,i,o,u){let l=Ve([a,s],n);for(let d=0;d=u/s)throw new Error(`Invalid indices: ${p} does not index into ${o}`);for(let h=0;he>t?1:0),TD=Yt(zo,k7,null,"bool"),CD={kernelName:zo,backendName:"cpu",kernelFunc:TD},I7=Ot((e,t)=>e>=t?1:0),ED=Yt(Os,I7,null,"bool"),RD={kernelName:Os,backendName:"cpu",kernelFunc:ED},S7=Ot((e,t)=>ee<=t?1:0),$D=Yt(Bo,N7,null,"bool"),DD={kernelName:Bo,backendName:"cpu",kernelFunc:$D};function T7(e,t,n){let a=(t-e)/(n-1),r=k.makeZerosTypedArray(n,"float32");r[0]=e;for(let s=1;sMath.log(e)),OD=Pl(Ps,C7),zD={kernelName:Ps,backendName:"cpu",kernelFunc:OD};function E7(e,t,n,a){let r=k.getTypedArrayFromDType(a,k.sizeFromShape(n));for(let s=0;so)&&(o=l)}r[s]=o}return r}var R7=Ot((e,t)=>Math.max(e,t)),_D=Yt(Ws,R7),PD={kernelName:Ws,backendName:"cpu",kernelFunc:_D},M7=Ot((e,t)=>Math.min(e,t)),LD=Yt(Us,M7),WD={kernelName:Us,backendName:"cpu",kernelFunc:LD},vg=Ot((e,t)=>e*t),BD=Ag((e,t,n,a)=>({real:e*n-t*a,imag:e*a+t*n})),Mh=Yt(Gs,vg,BD),VD={kernelName:Gs,backendName:"cpu",kernelFunc:Mh};function F7(e,t,n){let a=k.createScalarValue(-1,n);return vg([],t,a,e,n)}function jD(e){let{inputs:t,backend:n}=e,{x:a}=t;we(a,"neg");let r=n.data.get(a.dataId).values,[s,i]=F7(r,a.shape,a.dtype);return n.makeTensorInfo(i,a.dtype,s)}var UD={kernelName:Ho,backendName:"cpu",kernelFunc:jD},$7=Ot((e,t)=>e!==t?1:0),HD=Yt(Go,$7,null,"bool"),GD={kernelName:Go,backendName:"cpu",kernelFunc:HD};function wg(e,t,n,a,r){let s=t.length,i=k.sizeFromShape(t),o=k.computeStrides(t),u=k.computeStrides(r),l=k.getTypedArrayFromDType(n,k.sizeFromShape(r));for(let d=0;dn.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(y,g,m)}var KD={kernelName:Jo,backendName:"cpu",kernelFunc:XD};function kg(e,t,n,a){let r=e===t,s=e1;if(r||s||i)return k.makeZerosTypedArray(0,a);let o=Math.abs(Math.ceil((t-e)/n)),u=k.makeZerosTypedArray(o,a);t1/Math.sqrt(e)),ZD=Pl(ni,O7),YD={kernelName:ni,backendName:"cpu",kernelFunc:ZD};function Fh(e,t,n,a,r){let s=fn.isSliceContinous(a,t,n),i=k.sizeFromShape(n),o=k.computeStrides(a);if(s){let p=fn.computeFlatOffset(t,o);return r==="string"?e.slice(p,p+i):e.subarray(p,p+i)}let u=r==="string"?F.fromUint8ToStringArray(e):e,l=Ve(a,r,u),d=Ve(n,r);for(let p=0;pm+t[f]);d.set(l.get(...h),...c)}return r==="string"?F.fromStringArrayToUint8(d.values):d.values}function Di(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a;we(r,"slice");let[o,u]=fn.parseSliceParams(r,s,i);fn.assertParamsValid(r,o,u);let l=n.data.get(r.dataId).values,d=Fh(l,o,u,r.shape,r.dtype);return n.makeTensorInfo(u,r.dtype,d)}var JD={kernelName:rl,backendName:"cpu",kernelFunc:Di};function z7(e,t,n,a,r,s,i){let o=t[0],u=s[0],l=new Array(u),d=new Array(o),p=t[1];if(u===0){if(o!==0)throw new Error(`Received SparseTensor with denseShape[0] = 0 but - indices.shape[0] = ${o}`);let g=k.getArrayFromDType(n,0),y=k.getArrayFromDType(r,0);return[g,[0,p],y,l,d]}let c=!0,h=0,m=new Array(u).fill(0);for(let g=0;g=u)throw new Error(`indices(${g}, 0) is invalid: ${y} >= ${u}`);++m[y],c=c&&y>=h,h=y}let f=!0;for(let g=0;g0&&(m[g]+=m[g-1])}if(f&&c){let g=e,y=a;for(let A=0;A0){h[c-1]=1;for(let g=c-2;g>=0;--g)h[g]=h[g+1]*a[g+1]}let m=[];if(o>0){m[o-1]=1;for(let g=o-2;g>=0;--g)m[g]=m[g+1]*u[g+1]}let f=k.getArrayFromDType(n,i*o);for(let g=0;g0?r[o-1]+1:0;if(d<0)throw new Error("segment ids must be >= 0");let p=t.slice();p[0]=d;let c=p.reduce((A,x)=>A*x,1),h=k.getArrayFromDType(n,c);if(o===0)return d>0&&h.fill(i),[h,p];if(d<=0)throw new Error("segment ids must be >= 0");let m=0,f=1,g=0,y=r[m];for(;;){let A=0;if(f=A)throw new Error("segment ids are not increasing")}if(y<0||y>=d)throw new Error(`Segment id ${y} out of range [0, ${d}), possibly because segmentIds input is not sorted.`);y>g&&h.fill(i,g*l,y*l);for(let x=m;x=u[0])throw new Error(`Bad: indices[${x}] == ${a[x]} out of range [0, ${u[0]})`);for(let b=0;bo)break}return g{let n=e-t;return n*n}),QD=Yt(li,P7),eO={kernelName:li,backendName:"cpu",kernelFunc:QD};function L7(e,t,n,a){let r=Ve(e,t.dtype);for(let s=0;s0?0:i-o),c=0;c+=u*this.leftPad.length;for(let g=0;gg.forEach(y=>h[m++]=y);for(let g=0;g0){f(e[p+d-1]);for(let g=0;g0){let o=t[0];if(o!==0)throw new Error(`First split value must be 0, got ${o}`);for(let u=1;u=o;if(l=l&&t[u]<=n,!l)throw new Error(`Invalid split value ${t[u]}, must be in [${o}, ${n}]`);o=t[u]}if(o!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${o}`)}let r=a-1,s=k.getArrayFromDType("int32",a);if(n===0||a===0){let o=new Array(n);for(let u=0;u<=r;++u)s[u]=0;return[o,s]}s[0]=0;for(let o=1;o<=r;++o){let u=t[o]-t[o-1],l=0;this.nGramWidths.forEach(d=>{l+=this.getNumNGrams(u,d)}),this.preserveShort&&u>0&&l===0&&(l=1),s[o]=s[o-1]+l}let i=new Array(s[r]);for(let o=0;o{let p=t[o+1]-t[o],c=this.getNumNGrams(p,d);this.createNGrams(e,u,i,l,c,d),l+=c}),this.preserveShort&&l===s[o]){let d=t[o+1]-t[o];if(d===0)continue;let p=d+2*this.padWidth,c=1;this.createNGrams(e,u,i,l,c,p)}}return[i,s]}};function W7(e,t,n,a,r,s,i,o){return new tO(n,a,r,s,i,o).compute(e,t)}function nO(e,t,n){if(!e.length)return[];if(t.length===0){let s=new Array(e.length);for(let i=0;ie-t),aO=Ag((e,t,n,a)=>({real:e-n,imag:t-a})),Sg=Yt(ui,j7,aO),rO={kernelName:ui,backendName:"cpu",kernelFunc:Sg};function U7(e,t){let n=new Array(e.rank);for(let r=0;rx.value-A.value);let f=p*a,g=u.subarray(f,f+a),y=l.subarray(f,f+a);for(let A=0;A{for(let g=0;gnew Eh,1);var X7=rt(Co,e=>e>=0?e:Math.exp(e)-1),sO={kernelName:Co,backendName:"cpu",kernelFunc:X7};function K7(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a;we([r],"leakyRelu");let i=k.sizeFromShape(r.shape),o=n.data.get(r.dataId).values,u=k.getTypedArrayFromDType("float32",i);for(let l=0;le<0?t*e:e);function Z7(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t;we([a,r],"prelu");let s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,[o,u]=oO(a.shape,r.shape,s,i,a.dtype);return n.makeTensorInfo(u,a.dtype,o)}var lO={kernelName:Zs,backendName:"cpu",kernelFunc:Z7},Y7=rt(Ys,e=>Math.max(0,e)),uO={kernelName:Ys,backendName:"cpu",kernelFunc:Y7},J7=rt(Qs,e=>Math.min(Math.max(0,e),6)),dO={kernelName:Qs,backendName:"cpu",kernelFunc:J7},Q7=rt(ri,e=>1/(1+Math.exp(-e))),pO={kernelName:ri,backendName:"cpu",kernelFunc:Q7};function Ng(e,t,n,a,r){if(n==="linear")return Ya({inputs:{x:t},backend:e});if(n==="relu")return Y7({inputs:{x:t},backend:e});if(n==="elu")return X7({inputs:{x:t},backend:e});if(n==="relu6")return J7({inputs:{x:t},backend:e});if(n==="prelu")return Z7({inputs:{x:t,alpha:a},backend:e});if(n==="leakyrelu")return K7({inputs:{x:t},backend:e,attrs:{alpha:r}});if(n==="sigmoid")return Q7({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function gt(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=k.sizeFromShape(r.shape),o=k.inferFromImplicitShape(s,i),u=k.sizeFromShape(o);k.assert(i===u,()=>`The new shape (${o}) has ${u} elements and the old shape (${r.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`),n.incRef(r.dataId);let l=n.data.get(r.dataId);if(l.complexTensorInfos!=null){let d=l.complexTensorInfos.real,p=l.complexTensorInfos.imag;d.shape=o,p.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}var cO={kernelName:el,backendName:"cpu",kernelFunc:gt};function ev(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;we([r,s],"matMul");let u=r.shape.length,l=s.shape.length,d=i?r.shape[u-2]:r.shape[u-1],p=o?s.shape[l-1]:s.shape[l-2],c=i?r.shape[u-1]:r.shape[u-2],h=o?s.shape[l-2]:s.shape[l-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=k.sizeFromShape(m),y=k.sizeFromShape(f),A=g===y||g===1||y===1;k.assert(u>=2&&l>=2&&A,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(g>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);k.assert(d===p,()=>`Error in matMul: inner shapes (${d}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[g,d,c]:[g,c,d],b=o?[y,h,p]:[y,p,h],w=gt({inputs:{x:r},backend:n,attrs:{shape:v}}),N=gt({inputs:{x:s},backend:n,attrs:{shape:b}}),C=i?w.shape[1]:w.shape[2],E=i?w.shape[2]:w.shape[1],_=o?N.shape[1]:N.shape[2],$=Math.max(g,y),S=n.data.get(w.dataId).values,z=n.data.get(N.dataId).values,O=k.computeStrides(w.shape),W=k.computeStrides(N.shape),[G,H,J]=i?[O[0],1,O[1]]:[O[0],O[1],1],[K,ne,Q]=o?[1,W[1],W[0]]:[W[1],1,W[0]],se=E*_,Z=Ve([$,E,_],w.dtype),le=Z.values,oe=n.blockSize;for(let xe=0;xe<$;xe++)for(let fe=0;feMath.acos(e)),yO={kernelName:mo,backendName:"cpu",kernelFunc:gO},AO=rt(go,e=>Math.acosh(e)),xO={kernelName:go,backendName:"cpu",kernelFunc:AO};function bO(e){let{inputs:t,backend:n}=e,a=t;we(t,"addN");let r=a.map(o=>n.data.get(o.dataId).values),s=Ve(a[0].shape,a[0].dtype),i=s.values;for(let o=0;oA&&(A=b,x=v)}h[g]=x}return l.forEach(g=>n.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(d,"int32",h)}var TO={kernelName:bs,backendName:"cpu",kernelFunc:NO};function CO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a;we(r,"argMin");let i=k.parseAxisParam(s,r.shape),o=F.getAxesPermutation(i,r.shape.length),u=r,l=[];o!=null&&(u=ua({inputs:{x:r},backend:n,attrs:{perm:o}}),l.push(u),i=F.getInnerMostAxes(i.length,u.shape.length)),i=[i[0]],F.assertAxesAreInnerMostDims("argMin",i,u.shape.length);let[d,p]=F.computeOutAndReduceShapes(u.shape,i),c=k.sizeFromShape(d),h=k.makeZerosTypedArray(c,"int32"),m=k.sizeFromShape(p),f=n.data.get(u.dataId).values;for(let g=0;gn.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(d,"int32",h)}var EO={kernelName:Fu,backendName:"cpu",kernelFunc:CO},RO=rt(xo,e=>Math.asin(e)),MO={kernelName:xo,backendName:"cpu",kernelFunc:RO},FO=rt(bo,e=>Math.asinh(e)),$O={kernelName:bo,backendName:"cpu",kernelFunc:FO},DO=rt(vo,e=>Math.atan(e)),OO={kernelName:vo,backendName:"cpu",kernelFunc:DO},zO=Ot((e,t)=>Math.atan2(e,t)),_O=Yt(ko,zO),PO={kernelName:ko,backendName:"cpu",kernelFunc:_O},LO=rt(wo,e=>Math.atanh(e)),WO={kernelName:wo,backendName:"cpu",kernelFunc:LO};function Tg(e,t,n,a,r,s){let i=r.strideHeight,o=r.strideWidth,u=r.dilationHeight,l=r.dilationWidth,d=r.effectiveFilterHeight,p=r.effectiveFilterWidth,c=r.padInfo.top,h=r.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=Ve(r.outShape,n),g=f.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],A=r.outShape[2]*r.outShape[3],x=r.outShape[3];for(let v=0;vH?H=oe:s==="avg"&&(J+=oe,K++)}if(isNaN(H))break}let ne=S+z*x+N;g[ne]=s==="avg"?J/K:H}}}return f}function tv(e,t,n,a,r=!1,s=!1){let i=Ve(a.outShape,"int32"),o=a.strideHeight,u=a.strideWidth,l=a.dilationHeight,d=a.dilationWidth,p=a.effectiveFilterHeight,c=a.effectiveFilterWidth,h=a.padInfo.top,m=a.padInfo.left,f=Ve(t,n,e);for(let g=0;g_&&(_=G,r?$=s?((g*a.inHeight+S)*a.inWidth+O)*a.inChannels+y:(S*a.inWidth+O)*a.inChannels+y:$=z*c+W)}}i.set($,g,A,w,y)}}return i}function nv(e,t,n,a,r,s){let i=r.strideDepth,o=r.strideHeight,u=r.strideWidth,l=r.dilationDepth,d=r.dilationHeight,p=r.dilationWidth,c=r.effectiveFilterDepth,h=r.effectiveFilterHeight,m=r.effectiveFilterWidth,f=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,A=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=Ve(r.outShape,n),v=x.values,b=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],w=r.outShape[2]*r.outShape[3]*r.outShape[4],N=r.outShape[3]*r.outShape[4],C=r.outShape[4];for(let E=0;ENe?Ne=Ue:s==="avg"&&(Te+=Ue,Oe++),isNaN(Ne))break}if(isNaN(Ne))break}if(isNaN(Ne))break}let Pe=fe+S;v[Pe]=s==="avg"?Te/Oe:Ne}}}}return x}function BO(e,t){let n=Ve(t.outShape,"int32"),a=t.strideDepth,r=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,u=t.dilationWidth,l=t.effectiveFilterDepth,d=t.effectiveFilterHeight,p=t.effectiveFilterWidth,c=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=z&&(z=Q,O=G*d*p+J*d+ne)}}}n.set(O,f,y,b,E,g)}}}return n}function VO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;we(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:u}=a,l=1;k.assert(F.eitherStridesOrDilationsAreOne(i,l),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${l}'`);let d=F.computePool2DInfo(r.shape,s,i,l,o,u),p;if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))p=Ya({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=k.computeStrides(r.shape),m=Tg(c,r.shape,r.dtype,h,d,"avg");p=n.makeTensorInfo(d.outShape,r.dtype,m.values)}return p}var jO={kernelName:vs,backendName:"cpu",kernelFunc:VO};function UO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:u,dataFormat:l}=a;we(r,"avgPool3d");let d=F.computePool3DInfo(r.shape,s,i,1,o,u,l),p=n.data.get(r.dataId).values,c=nv(p,r.shape,r.dtype,k.computeStrides(r.shape),d,"avg");return n.makeTensorInfo(c.shape,"float32",c.values)}var HO={kernelName:$u,backendName:"cpu",kernelFunc:UO};function GO(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:u,dimRoundingMode:l}=a;we([r,s],"avgPool3DGrad");let d=F.computePool3DInfo(s.shape,i,o,1,u,l),p=d.strideDepth,c=d.strideHeight,h=d.strideWidth,m=d.filterDepth,f=d.filterHeight,g=d.filterWidth,y=d.dilationDepth,A=d.dilationHeight,x=d.dilationWidth,v=d.effectiveFilterDepth,b=d.effectiveFilterHeight,w=d.effectiveFilterWidth,N=v-1-d.padInfo.front,C=w-1-d.padInfo.left,E=b-1-d.padInfo.top,_=Ve(s.shape,"float32"),$=1/(m*f*g),S=n.bufferSync(r);for(let z=0;z=d.outDepth||Math.floor(Z)!==Z))for(let le=0;le=d.outHeight||Math.floor(oe)!==oe))for(let xe=0;xe=d.outWidth||Math.floor(fe)!==fe||(Q+=S.get(z,Z,oe,fe,O))}}}_.set(Q*$,z,W,G,H,O)}return n.makeTensorInfo(_.shape,_.dtype,_.values)}var qO={kernelName:Kp,backendName:"cpu",kernelFunc:GO};function XO(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;we([r,s],"avgPoolGrad");let{filterSize:o,strides:u,pad:l}=a,d=F.computePool2DInfo(i.shape,o,u,1,l),p=d.strideHeight,c=d.strideWidth,h=d.filterHeight,m=d.filterWidth,f=d.dilationHeight,g=d.dilationWidth,y=d.effectiveFilterHeight,A=d.effectiveFilterWidth,x=A-1-d.padInfo.left,v=y-1-d.padInfo.top,b=Ve(i.shape,"float32"),w=1/(h*m),N=n.data.get(r.dataId).values,C=Ve(r.shape,"float32",N);for(let E=0;E=d.outHeight||Math.floor(H)!==H))for(let J=0;J=d.outWidth||Math.floor(K)!==K||(W+=C.get(E,H,K,_))}}b.set(W*w,E,$,S,_)}return n.makeTensorInfo(b.shape,b.dtype,b.values)}var KO={kernelName:Xp,backendName:"cpu",kernelFunc:XO};function ZO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,scale:s,offset:i,mean:o,variance:u}=t;k.assert(o.shape.length===u.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),k.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),k.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),we([r,o,u,s,i],"batchNorm");let{varianceEpsilon:l}=a;l==null&&(l=.001);let d=n.data.get(r.dataId).values,p=n.data.get(o.dataId).values,c=n.data.get(u.dataId).values,h=s?n.data.get(s.dataId).values:new Float32Array([1]),m=i?n.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(d.length),g=m.length,y=h.length,A=c.length,x=p.length,v=0,b=0,w=0,N=0;for(let C=0;C=g&&(v=0),b>=x&&(b=0),w>=y&&(w=0),N>=A&&(N=0);return n.makeTensorInfo(r.shape,r.dtype,f)}var YO={kernelName:Ds,backendName:"cpu",kernelFunc:ZO};function JO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;we([r],"batchToSpaceND");let o=s.reduce((y,A)=>y*A),u=F.getReshaped(r.shape,s,o),l=F.getPermuted(u.length,s.length),d=F.getReshapedPermuted(r.shape,s,o),p=F.getSliceBeginCoords(i,s.length),c=F.getSliceSize(d,i,s.length),h=gt({inputs:{x:r},backend:n,attrs:{shape:u}}),m=ua({inputs:{x:h},backend:n,attrs:{perm:l}}),f=gt({inputs:{x:m},backend:n,attrs:{shape:d}}),g=Di({inputs:{x:f},backend:n,attrs:{begin:p,size:c}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),g}var QO={kernelName:Du,backendName:"cpu",kernelFunc:JO};function ez(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,l=xg(o,u,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,l)}var tz={kernelName:Zp,backendName:"cpu",kernelFunc:ez},nz=rt(zr,(e,t)=>{let n=t;return e>n.clipValueMax?n.clipValueMax:e{let{x:t}=e.inputs,n=e.backend,a=new Float32Array(k.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=n.data.get(s.dataId).values,u=n.data.get(i.dataId).values;for(let l=0;lf.shape),s);if(k.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(f=>k.sizeFromShape(f.shape)>0);if(o.length===1)return Ya({inputs:{x:o[0]},backend:n});let u=o.map(f=>f.shape);if(F.assertParamsConsistent(u,s),o[0].dtype==="complex64"){let f=o.map(v=>$i({inputs:{input:v},backend:n})),g=o.map(v=>Ll({inputs:{input:v},backend:n})),y=Wl({inputs:f,backend:n,attrs:{axis:s}}),A=Wl({inputs:g,backend:n,attrs:{axis:s}}),x=qn({inputs:{real:y,imag:A},backend:n});return f.forEach(v=>n.disposeIntermediateTensorInfo(v)),g.forEach(v=>n.disposeIntermediateTensorInfo(v)),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(A),x}let l=o.map(f=>{let g=k.sizeFromShape(f.shape.slice(s));return gt({inputs:{x:f},backend:n,attrs:{shape:[-1,g]}})}),d=l.map(f=>({vals:n.data.get(f.dataId).values,shape:f.shape}));i=F.computeOutShape(l.map(f=>f.shape),1);let p=l[0].shape[0]===1,c=bg(d,i,t[0].dtype,p),h=F.computeOutShape(o.map(f=>f.shape),s),m=n.makeTensorInfo(h,t[0].dtype,c);return l.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var oz={kernelName:Io,backendName:"cpu",kernelFunc:Wl};function av(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:u,dilations:l,dimRoundingMode:d}=a;we([r,s],"conv2d");let p=F.convertConv2DDataFormat(u),c=F.computeConv2DInfo(r.shape,s.shape,i,l,o,d,!1,p),h=c.filterHeight,m=c.filterWidth,f=c.dilationHeight,g=c.dilationWidth,y=c.padInfo.left,A=c.padInfo.top,x=c.dataFormat==="channelsLast",v=new Lt(c.outShape,r.dtype),b=k.computeStrides(r.shape),w=k.computeStrides(s.shape),N=b[0],C=x?b[1]:b[2],E=x?b[2]:1,_=x?1:b[1],$=v.strides[0],S=x?v.strides[1]:v.strides[2],z=x?v.strides[2]:1,O=x?1:v.strides[1],W=n.data.get(r.dataId).values,G=n.data.get(s.dataId).values,H=v.values;for(let J=0;J=c.inHeight)continue;let xe=le*w[0],fe=K+oe*C;for(let Ne=0;Ne=c.inWidth)continue;let tt=xe+Pe*w[1],nt=fe+ze*E,it=tt;for(let Ze=0;Ze=l.inDepth)continue;let J=G*E[0],K=$+H*C[1];for(let ne=0;ne=l.inHeight)continue;let oe=J+Z*E[1],xe=K+le*C[2];for(let fe=0;fe=l.inWidth)continue;let ze=oe+Oe*E[2],tt=xe+Pe*l.inChannels,nt=ze;for(let it=0;itMath.cos(e)),bz={kernelName:Ts,backendName:"cpu",kernelFunc:xz},vz=rt(So,e=>Math.cosh(e)),wz={kernelName:So,backendName:"cpu",kernelFunc:vz};function kz(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:u,extrapolationValue:l}=a,[d,p,c,h]=r.shape,m=s.shape[0],[f,g]=o,y=Ve([m,f,g,h],"float32"),A=n.data.get(s.dataId).values,x=n.data.get(i.dataId).values,v=n.data.get(r.dataId).values,b=k.computeStrides(r.shape),w=k.computeStrides(y.shape);for(let N=0;N=d)continue;let O=f>1?($-E)*(p-1)/(f-1):0,W=g>1?(S-_)*(c-1)/(g-1):0;for(let G=0;G1?E*(p-1)+G*O:.5*(E+$)*(p-1);if(H<0||H>p-1){for(let J=0;J1?_*(c-1)+Q*W:.5*(_+S)*(c-1);if(se<0||se>c-1){for(let xe=0;xe1?_*(c-1)+J*W:.5*(_+S)*(c-1);if(K<0||K>c-1){for(let se=0;sey+m-A-1:(y,A)=>y+A;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`),k.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],u=r.shape[1],l=r.shape[2],d=r.shape[3],p=u*s,c=l*s,h=d/(s*s),m=n.data.get(r.dataId).values,f=new Float32Array(o*p*c*h),g=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let h=F.computeConv2DInfo(r.shape,s.shape,i,c,o,l,!0),{filterHeight:m,filterWidth:f,dilationHeight:g,dilationWidth:y,padInfo:A}=h,x=A.left,v=A.top,b=h.outChannels/h.inChannels,w=new Lt(h.outShape,r.dtype),N=n.data.get(r.dataId).values,C=n.data.get(s.dataId).values,E=w.values;for(let _=0;_=h.inHeight)continue;let J=G*p[0],K=$+H*d[1];for(let ne=0;ne=h.inWidth)continue;let oe=J+Z*p[1],xe=K+le*h.inChannels,fe=Q,Ne=oe;for(let Te=0;Te{let{x:a,filter:r}=e,{strides:s,pad:i,dilations:o}=n,u=t,l=u.data.get(a.dataId).values,d=a.shape.length,p=u.data.get(r.dataId).values,c=r.shape.length,{batchSize:h,inHeight:m,inWidth:f,inChannels:g,outHeight:y,outWidth:A,padInfo:x,strideHeight:v,strideWidth:b,filterHeight:w,filterWidth:N,dilationHeight:C,dilationWidth:E,outShape:_}=F.computeDilation2DInfo(a.shape,r.shape,s,i,"NHWC",o),$=k.sizeFromShape(_),S=_.length,z=k.getArrayFromDType(a.dtype,$);for(let O=0;O=0&&Z=0&&oene&&(ne=Ne)}}}let Q=k.locToIndex([O,W,H,K],S,k.computeStrides(_));z[Q]=ne}}}return{dataId:u.write(k.toTypedArray(z,a.dtype),_,a.dtype),shape:_,dtype:a.dtype}}},Lz={kernelName:ic,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:u}=n,l=t,d=k.toNestedArray(a.shape,l.data.get(a.dataId).values),p=k.toNestedArray(r.shape,l.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:A,strideHeight:x,strideWidth:v,filterHeight:b,filterWidth:w,dilationHeight:N,dilationWidth:C,outShape:E}=F.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",u);k.assert(s.rank===E.length,()=>`Error in ${ic}, dy must have the same rank as output ${E.length}, but got ${s.rank}`);let _=k.toNestedArray(E,l.data.get(s.dataId).values),$=k.makeZerosNestedTypedArray(r.shape,r.dtype);for(let S=0;S=0&&se=0&&leJ&&(J=oe,K=Q,ne=Z)}}}$[K][ne][H]+=_[S][z][W][H]}}}return{dataId:l.write(k.toTypedArray($,a.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Wz={kernelName:sc,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:u}=n,l=t,d=k.toNestedArray(a.shape,l.data.get(a.dataId).values),p=k.toNestedArray(r.shape,l.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:A,strideHeight:x,strideWidth:v,filterHeight:b,filterWidth:w,dilationHeight:N,dilationWidth:C,outShape:E}=F.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",u);k.assert(s.rank===E.length,()=>`Error in ${sc}, dy must have the same rank as output ${E.length}, but got ${s.rank}`);let _=k.toNestedArray(E,l.data.get(s.dataId).values),$=k.makeZerosNestedTypedArray(a.shape,a.dtype);for(let S=0;S=0&&se=0&&leJ&&(J=oe,K=se,ne=le)}}}$[S][K][ne][H]+=_[S][z][W][H]}}}return{dataId:l.write(k.toTypedArray($,a.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}};function Sd(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;we(r,"sum");let o;r.dtype==="bool"?o=Zr({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):o=Ya({inputs:{x:r},backend:n});let u=o.shape.length,l=k.parseAxisParam(s,o.shape),d=F.getAxesPermutation(l,u),p=l,c=o;d!=null&&(c=ua({inputs:{x:o},backend:n,attrs:{perm:d}}),p=F.getInnerMostAxes(p.length,u)),F.assertAxesAreInnerMostDims("sum",p,c.shape.length);let[h,m]=F.computeOutAndReduceShapes(c.shape,p),f=F.upcastType(c.dtype,"int32"),g=Rh(n,h,f),y=k.sizeFromShape(m),A=n.data.get(g.dataId).values,x=n.data.get(c.dataId).values;for(let v=0;v=0&&(c=Sd({inputs:{x:c},backend:n,attrs:{axis:l[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var jz={kernelName:oc,backendName:"cpu",kernelFunc:Vz};function Uz(e){let{inputs:t,backend:n}=e,{dy:a,y:r}=t;we([a,r],"eluGrad");let s=new Float32Array(k.sizeFromShape(r.shape)),i=n.data.get(r.dataId).values,o=n.data.get(a.dataId).values;for(let u=0;u=1?s[u]=o[u]:s[u]=o[u]*(l+1)}return n.makeTensorInfo(r.shape,"float32",s)}var Hz={kernelName:lc,backendName:"cpu",kernelFunc:Uz},Gz=F.ERF_P,qz=F.ERF_A1,Xz=F.ERF_A2,Kz=F.ERF_A3,Zz=F.ERF_A4,Yz=F.ERF_A5,Jz=rt(Eo,e=>{let t=Math.sign(e),n=Math.abs(e),a=1/(1+Gz*n);return t*(1-((((Yz*a+Zz)*a+Kz)*a+Xz)*a+qz)*a*Math.exp(-n*n))}),Qz={kernelName:Eo,backendName:"cpu",kernelFunc:Jz};function $h(e){let{inputs:t,backend:n,attrs:a}=e,{input:r}=t,{dim:s}=a,i=r.shape.length,o=r.shape.slice(),u=s;return s<0&&(k.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),u=i+s+1),o.splice(u,0,1),gt({inputs:{x:r},backend:n,attrs:{shape:o}})}var e_={kernelName:Mo,backendName:"cpu",kernelFunc:$h},t_=Ot((e,t)=>e/t),Cg=Yt(Rs,t_),Eg={kernelName:Rs,backendName:"cpu",kernelFunc:Cg};function sv(e,t,n){let a=e.shape,r=a[0],s=a[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,u=i.complexTensorInfos.imag,l=[r,s],d=k.sizeFromShape(l),p=k.getTypedArrayFromDType("float32",d),c=k.getTypedArrayFromDType("float32",d);for(let g=0;g{let{image:a}=e,r=n,s=k.getTypedArrayFromDType(a.dtype,k.sizeFromShape(a.shape)),[i,o,u,l]=a.shape,d=r.data.get(a.dataId).values;for(let p=0;p=0&&xMath.floor(e/t)),p_=Yt($s,d_,null,"int32"),c_={kernelName:$s,backendName:"cpu",kernelFunc:p_};function h_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:u,pad:l,dataFormat:d,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=av({inputs:{x:r,filter:s},backend:n,attrs:{strides:u,pad:l,dataFormat:d,dilations:p,dimRoundingMode:c}});if(i){let g=f;f=Id({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(g)}if(h){let g=f;f=Ng(n,f,h,o,m),n.disposeIntermediateTensorInfo(g)}return f}var f_={kernelName:fi,backendName:"cpu",kernelFunc:h_};function m_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:u,pad:l,dataFormat:d,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=rv({inputs:{x:r,filter:s},backend:n,attrs:{strides:u,pad:l,dataFormat:d,dilations:p,dimRoundingMode:c}});if(i){let g=f;f=Id({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(g)}if(h){let g=f;f=Ng(n,f,h,o,m),n.disposeIntermediateTensorInfo(g)}return f}var g_={kernelName:mi,backendName:"cpu",kernelFunc:m_};function y_(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=k.sizeFromShape(a.shape),i=r.shape,o=i[i.length-1],[u,l,d,p]=F.prepareAndValidate(a,r);if(l===0)return n.makeTensorInfo(u,a.dtype,[]);let c=n.data.get(r.dataId).values,h=n.bufferSync(a),m=v7(c,h,a.dtype,l,o,d,p,a.shape,s);return n.makeTensorInfo(u,a.dtype,m.values)}var A_={kernelName:Oo,backendName:"cpu",kernelFunc:y_};function x_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,indices:s}=t,{axis:i,batchDims:o}=a;we([r,s],"gatherV2");let u=o;o==null&&(u=0);let l=k.sizeFromShape(s.shape),d=k.parseAxisParam(i,r.shape)[0],p=F.segment_util.collectGatherOpShapeInfo(r,s,d,u),c=gt({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),h=gt({inputs:{x:s},backend:n,attrs:{shape:[p.batchSize,l/p.batchSize]}}),m=[p.batchSize,p.outerSize,l/p.batchSize,p.sliceSize],f=n.bufferSync(h),g=n.bufferSync(c),y=w7(g,f,m);return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.makeTensorInfo(p.outputShape,y.dtype,y.values)}var b_={kernelName:Do,backendName:"cpu",kernelFunc:x_};function v_(e){let{inputs:t,backend:n}=e,{input:a}=t,r=k.sizeFromShape(a.shape),s=a.shape[a.shape.length-1],i=r/s,o=gt({inputs:{x:a},backend:n,attrs:{shape:[i,s]}}),u=sv(o,!0,n),l=gt({inputs:{x:u},backend:n,attrs:{shape:a.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(u),l}var w_={kernelName:dc,backendName:"cpu",kernelFunc:v_},k_=rt(_o,e=>Number.isFinite(e)?1:0,"bool"),I_={kernelName:_o,backendName:"cpu",kernelFunc:k_},S_=rt(Po,e=>Math.abs(e)===Infinity?1:0,"bool"),N_={kernelName:Po,backendName:"cpu",kernelFunc:S_},T_=rt(Lo,e=>Number.isNaN(e)?1:0,"bool"),C_={kernelName:Lo,backendName:"cpu",kernelFunc:T_};function E_(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=T7(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var R_={kernelName:cc,backendName:"cpu",kernelFunc:E_},M_=rt(Vo,e=>Math.log1p(e)),F_={kernelName:Vo,backendName:"cpu",kernelFunc:M_},$_=Ot((e,t)=>e&&t),D_=Yt(jo,$_,null,"bool"),O_={kernelName:jo,backendName:"cpu",kernelFunc:D_},z_=rt(Lu,e=>e?0:1,"bool"),__={kernelName:Lu,backendName:"cpu",kernelFunc:z_},P_=Ot((e,t)=>e||t),L_=Yt(Wu,P_,null,"bool"),W_={kernelName:Wu,backendName:"cpu",kernelFunc:L_};function B_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:u}=a;we(r,"LRN");let l=r.shape[3],d=l-1,p=n.data.get(r.dataId).values,c=k.sizeFromShape(r.shape),h=new Float32Array(c);function m(f){let g=f%l,y=f-g+Math.max(0,g-s),A=f-g+Math.min(g+s,d),x=0;for(;y<=A;y++){let v=p[y];x+=v*v}return x}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${l}'`);let d=F.computePool2DInfo(r.shape,s,i,l,o,u),p;if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))p=Ya({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=k.computeStrides(r.shape),m=Tg(c,r.shape,r.dtype,h,d,"max");p=n.makeTensorInfo(d.outShape,r.dtype,m.values)}return p}var q_={kernelName:Bs,backendName:"cpu",kernelFunc:G_};function X_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:u,dataFormat:l}=a;we(r,"maxPool3d");let d=F.computePool3DInfo(r.shape,s,i,1,o,u,l),p=n.data.get(r.dataId).values,c=nv(p,r.shape,r.dtype,k.computeStrides(r.shape),d,"max");return n.makeTensorInfo(c.shape,"float32",c.values)}var K_={kernelName:Vu,backendName:"cpu",kernelFunc:X_};function Z_(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:u,dimRoundingMode:l}=a;we([r,s],"maxPool3DGrad");let d=F.computePool3DInfo(s.shape,i,o,1,u,l),p=n.bufferSync(s),c=BO(p,d),h=d.strideDepth,m=d.strideHeight,f=d.strideWidth,g=d.dilationDepth,y=d.dilationHeight,A=d.dilationWidth,x=d.effectiveFilterDepth,v=d.effectiveFilterHeight,b=d.effectiveFilterWidth,w=x-1-d.padInfo.front,N=b-1-d.padInfo.left,C=v-1-d.padInfo.top,E=Ve(s.shape,"float32"),_=n.bufferSync(r);for(let $=0;$=d.outDepth||Math.floor(Q)!==Q))for(let se=0;se=d.outHeight||Math.floor(Z)!==Z))for(let le=0;le=d.outWidth||Math.floor(oe)!==oe)continue;let xe=x*v*b-1-c.get($,Q,Z,oe,S),fe=ne*v*b+se*b+le,Ne=xe===fe?1:0;Ne!==0&&(K+=_.get($,Q,Z,oe,S)*Ne)}}}E.set(K,$,z,O,W,S)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}var Y_={kernelName:mc,backendName:"cpu",kernelFunc:Z_};function J_(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s,output:i}=t,o=s;we([s,i],"maxPoolGrad");let{filterSize:u,strides:l,pad:d,dimRoundingMode:p}=a,c=F.computePool2DInfo(o.shape,u,l,1,d,p),h=n.data.get(o.dataId).values,m=Ve(c.outShape,o.dtype,tv(h,o.shape,o.dtype,c).values),f=c.strideHeight,g=c.strideWidth,y=c.dilationHeight,A=c.dilationWidth,x=c.effectiveFilterHeight,v=c.effectiveFilterWidth,b=v-1-c.padInfo.left,w=x-1-c.padInfo.top,N=Ve(o.shape,"float32"),C=n.data.get(r.dataId).values,E=Ve(r.shape,"float32",C);for(let _=0;_=c.outHeight||Math.floor(J)!==J))for(let K=0;K=c.outWidth||Math.floor(ne)!==ne)continue;let Q=x*v-1-m.get(_,J,ne,$),se=H*v+K,Z=Q===se?1:0;Z!==0&&(G+=E.get(_,J,ne,$)*Z)}}N.set(G,_,S,z,$)}return n.makeTensorInfo(N.shape,N.dtype,N.values)}var Q_={kernelName:fc,backendName:"cpu",kernelFunc:J_};function eP(e,t,n,a,r){let s=k.computeStrides(t),i=Tg(e,t,n,s,r,"max"),o=tv(e,t,n,r,!0,a);return[i.values,o.values]}var tP={kernelName:gc,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,u=n;we(a,"MaxPoolWithArgmax");let l=u.data.get(a.dataId).values,d=F.computePool2DInfo(a.shape,r,s,[1,1],i),[p,c]=eP(l,a.shape,a.dtype,o,d),h=u.write(p,d.outShape,a.dtype),m=u.write(c,d.outShape,a.dtype);return[{dataId:h,shape:d.outShape,dtype:a.dtype},{dataId:m,shape:d.outShape,dtype:"int32"}]}};function nP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=k.parseAxisParam(s,r.shape),u=F.computeOutAndReduceShapes(r.shape,o)[1],l=k.sizeFromShape(u),d=[],p=n.makeTensorInfo([],"float32",new Float32Array([l]));d.push(p);let c=Zr({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});d.push(c);let h=Cg({inputs:{a:c,b:p},backend:n});d.push(h);let m=Sd({inputs:{x:h},backend:n,attrs:{axis:s,keepDims:i}});return d.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var aP={kernelName:Vs,backendName:"cpu",kernelFunc:nP};function rP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;we(r,"min");let o=k.parseAxisParam(s,r.shape),u=o,l=F.getAxesPermutation(u,r.shape.length),d=r;l!=null&&(d=ua({inputs:{x:r},backend:n,attrs:{perm:l}}),u=F.getInnerMostAxes(u.length,r.shape.length)),F.assertAxesAreInnerMostDims("min",u,d.shape.length);let[p,c]=F.computeOutAndReduceShapes(d.shape,u),h=k.sizeFromShape(c),m=k.makeZerosTypedArray(k.sizeFromShape(p),d.dtype),f=n.data.get(d.dataId).values;for(let y=0;yA[0]+r.shape[x]+A[1]),u=s.map(A=>A[0]),l=s.map((A,x)=>A[0]+r.shape[x]),d=i==="reflect"?0:1,p=n.data.get(r.dataId).values,c=r.shape.length,h=k.computeStrides(r.shape),m=k.sizeFromShape(o),f=o.length,g=k.computeStrides(o),y=k.getTypedArrayFromDType(r.dtype,m);for(let A=0;A=l[b]&&(x[b]=(l[b]-1)*2-x[b]+d);x=x.map((b,w)=>b-u[w]);let v=k.locToIndex(x,c,h);y[A]=p[v]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}var oP={kernelName:Hs,backendName:"cpu",kernelFunc:iP},lP=Ot((e,t)=>{let n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),uP=Yt(Uo,lP),dP={kernelName:Uo,backendName:"cpu",kernelFunc:uP},pP=gs(S5());function ov(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=r.shape.length,o=s;if(o===-1&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);let u=k.parseAxisParam([o],r.shape),l=iv({inputs:{x:r},backend:n,attrs:{reductionIndices:u,keepDims:!1}}),d=F.expandShapeToKeepDim(l.shape,u),p=gt({inputs:{x:l},backend:n,attrs:{shape:d}}),c=Sg({inputs:{a:r,b:p},backend:n}),h=A7({inputs:{x:c},backend:n}),m=Sd({inputs:{x:h},backend:n,attrs:{axis:u,keepDims:!1}}),f=gt({inputs:{x:m},backend:n,attrs:{shape:d}}),g=Cg({inputs:{a:h,b:f},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),g}var cP={kernelName:oi,backendName:"cpu",kernelFunc:ov};function hP(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a;we(r,"multinomial");let u=o?r:ov({inputs:{logits:r},backend:n,attrs:{dim:-1}}),l=u.shape[0],d=u.shape[1],p=n.data.get(u.dataId).values,c=[l,s],h=k.makeZerosTypedArray(k.sizeFromShape(c),"int32");for(let m=0;m=0&&d[p]{k.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),k.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],u=t.map(d=>{let p=$h({inputs:{input:d},backend:n,attrs:{dim:r}});return o.push(p),p}),l=Wl({inputs:u,backend:n,attrs:{axis:r}});return o.forEach(d=>n.disposeIntermediateTensorInfo(d)),l}var CP={kernelName:Yo,backendName:"cpu",kernelFunc:uv};function EP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a;we(r,"pad");let o=s.map((y,A)=>y[0]+r.shape[A]+y[1]),u=s.map(y=>y[0]),l=n.data.get(r.dataId).values,d=k.sizeFromShape(r.shape),p=r.shape.length,c=k.computeStrides(r.shape),h=k.sizeFromShape(o),m=o.length,f=k.computeStrides(o),g=k.getTypedArrayFromDType(r.dtype,h);i!==0&&g.fill(i);for(let y=0;yv+u[b]),x=k.locToIndex(A,m,f);g[x]=l[y]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}var dv={kernelName:Xs,backendName:"cpu",kernelFunc:EP},RP=Ot((e,t)=>Math.pow(e,t)),MP=Yt(Ks,RP),FP={kernelName:Ks,backendName:"cpu",kernelFunc:MP};function $P(e){let{backend:t,attrs:n}=e,{start:a,stop:r,dtype:s,step:i}=n,o=kg(a,r,i,s);return t.makeTensorInfo([o.length],s,o)}var DP={kernelName:ju,backendName:"cpu",kernelFunc:$P},OP=rt(Qo,e=>1/e),zP={kernelName:Qo,backendName:"cpu",kernelFunc:OP};function _P(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a;we(r,"resizeBilinear");let u=k.computeStrides(r.shape),[l,d]=o,[p,c,h,m]=r.shape,f=n.data.get(r.dataId).values,g=new Float32Array(k.sizeFromShape([p,l,d,m])),y=[s&&l>1?c-1:c,s&&d>1?h-1:h],A=[s&&l>1?l-1:l,s&&d>1?d-1:d],x=0,v=y[0]/A[0],b=y[1]/A[1];for(let w=0;w1?l-1:l,i&&h>1?d-1:d],g=[i&&c>1?c-1:c,i&&h>1?h-1:h],y=f[0]/g[0],A=f[1]/g[1],x=n.data.get(s.dataId).values,v=0;for(let b=0;b1?c-1:c,s&&d>1?h-1:h],A=[s&&l>1?l-1:l,s&&d>1?d-1:d],x=y[0]/A[0],v=y[1]/A[1],b=0;for(let w=0;w1?d-1:d,i&&m>1?p-1:p],A=[i&&h>1?h-1:h,i&&m>1?m-1:m],x=y[0]/A[0],v=y[1]/A[1],b=1/x,w=1/v,N=Math.ceil(b)*2+2,C=Math.ceil(w)*2+2;for(let E=0;E=h)continue;let Z=_+se*u[1],le=se*x,oe=Math.min(d-1,i?Math.round(le):Math.floor(le));if($===oe)for(let xe=0;xe=m)continue;let Ne=Z+fe*u[2],Te=fe*v,Oe=Math.min(p-1,i?Math.round(Te):Math.floor(Te));W===Oe&&(ne+=g[Ne+K])}}f[G+K]=ne}}}}return n.makeTensorInfo(r.shape,r.dtype,f)}var UP={kernelName:xc,backendName:"cpu",kernelFunc:jP};function HP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a;we(r,"reverse");let i=r.shape.length,o=k.parseAxisParam(s,r.shape);if(i===0)return Ya({inputs:{x:r},backend:n});let u=new Lt(r.shape,r.dtype),l=n.bufferSync(r);for(let d=0;dc[h]=r.shape[h]-1-c[h]),u.set(l.get(...c),...p)}return n.makeTensorInfo(u.shape,u.dtype,u.values)}var GP={kernelName:ei,backendName:"cpu",kernelFunc:HP},qP={kernelName:fl,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,u=k.getTypedArrayFromDType(a.dtype,k.sizeFromShape(a.shape)),[l,d,p,c]=a.shape,[h,m]=F.getImageCenter(i,d,p),f=255,g=Math.sin(r),y=Math.cos(r),A=o.data.get(a.dataId).values;for(let x=0;x=0&&z=0&&O{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),KP={kernelName:ti,backendName:"cpu",kernelFunc:XP};function pv(e,t,n,a,r,s,i,o,u,l){let d=[a/r,r],p=e.values,c=t.values;if(a===0)return Ve(n,t.dtype);let h=Ve(d,t.dtype);h.values.fill(u);for(let m=0;m=a/r)throw new Error(`Invalid indices: ${f} does not index into ${n}`);for(let y=0;y1||r.shape.length===1?1:k.sizeFromShape(r.shape.slice(1));for(let m=0;me>=0?tL*e:eL*(Math.exp(e)-1)),aL={kernelName:al,backendName:"cpu",kernelFunc:nL},rL=rt(il,e=>e<0?-1:e>0?1:0),sL={kernelName:il,backendName:"cpu",kernelFunc:rL},iL=rt(ai,e=>Math.sin(e)),oL={kernelName:ai,backendName:"cpu",kernelFunc:iL},lL=rt(sl,e=>Math.sinh(e)),uL={kernelName:sl,backendName:"cpu",kernelFunc:lL},dL=11920928955078125e-23,cv=Math.log(dL)+2,pL=rt(ol,e=>{let t=e>-cv,n=e0&&k.isString(n[0])){let r=n.map(s=>k.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return{dataId:a,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){let t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){let t=this.data.get(e);t.refCount--}}move(e,t,n,a,r){this.data.set(e,{values:t,dtype:a,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:n}=this.data.get(e);if(t==="complex64"){let a=this.readSync(n.real.dataId),r=this.readSync(n.imag.dataId);return F.mergeRealAndImagArrays(a,r)}return this.data.get(e).values}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>k.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return Ve(e.shape,e.dtype,n)}makeOutput(e,t,n){let a=this.write(e,t,n);return fr().makeTensorFromDataId(a,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(e);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=k.now();return e(),{kernelMs:k.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){we([e],"where");let t=this.readSync(e.dataId);return pD(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};Eh.nextDataId=0;var yg={};Fe(yg,{addImpl:()=>h7,bincountImpl:()=>xg,bincountReduceImpl:()=>f7,ceilImpl:()=>m7,concatImpl:()=>bg,equalImpl:()=>g7,expImpl:()=>A7,expm1Impl:()=>b7,floorImpl:()=>v7,gatherNdImpl:()=>w7,gatherV2Impl:()=>k7,greaterEqualImpl:()=>S7,greaterImpl:()=>I7,lessEqualImpl:()=>T7,lessImpl:()=>N7,linSpaceImpl:()=>C7,logImpl:()=>E7,maxImpl:()=>R7,maximumImpl:()=>M7,minimumImpl:()=>F7,multiplyImpl:()=>vg,negImpl:()=>$7,notEqualImpl:()=>D7,prodImpl:()=>O7,rangeImpl:()=>kg,rsqrtImpl:()=>z7,simpleAbsImpl:()=>c7,sliceImpl:()=>Fh,sparseFillEmptyRowsImpl:()=>_7,sparseReshapeImpl:()=>P7,sparseSegmentReductionImpl:()=>Ig,squaredDifferenceImpl:()=>L7,stridedSliceImpl:()=>W7,stringNGramsImpl:()=>B7,stringSplitImpl:()=>V7,stringToHashBucketFastImpl:()=>j7,subImpl:()=>U7,tileImpl:()=>H7,topKImpl:()=>G7,transposeImpl:()=>wg,uniqueImpl:()=>q7});function c7(e){let t=new Float32Array(e.length);for(let n=0;n{let{x:t}=e.inputs,n=e.backend;we(t,"abs");let a=new Float32Array(k.sizeFromShape(t.shape)),r=n.data.get(t.dataId).values;return a=c7(r),n.makeOutput(a,t.shape,"float32")},hD={kernelName:mo,backendName:"cpu",kernelFunc:cD};function Ot(e){return(t,n,a,r,s)=>{let i=F.assertAndGetBroadcastShape(t,n),o=i.length,l=k.computeStrides(i),u=k.sizeFromShape(i),d=k.getTypedArrayFromDType(s,u),p=t.length,c=n.length,h=k.computeStrides(t),m=k.computeStrides(n),f=F.getBroadcastDims(t,i),g=F.getBroadcastDims(n,i);if(f.length+g.length===0)for(let y=0;yx[N]=0);let v=k.locToIndex(x,p,h),b=A.slice(-c);g.forEach(N=>b[N]=0);let w=k.locToIndex(b,c,m);d[y]=e(a[v],r[w])}return[d,i]}}function qn(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,o=n.makeTensorInfo(a.shape,"complex64"),l=n.data.get(o.dataId);return l.complexTensorInfos={real:n.makeTensorInfo(a.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",i)},o}var fD={kernelName:Yp,backendName:"cpu",kernelFunc:qn};function Rh(e,t,n="float32"){if(n==="complex64"){let r=Rh(e,t,"float32"),s=Rh(e,t,"float32");return qn({inputs:{real:r,imag:s},backend:e})}let a=k.makeZerosTypedArray(k.sizeFromShape(t),n);return e.makeTensorInfo(t,n,a)}function Ya(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var mD={kernelName:zs,backendName:"cpu",kernelFunc:Ya};function $i(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.data.get(a.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}var gD={kernelName:Ac,backendName:"cpu",kernelFunc:$i};function Zr(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Ya({inputs:{x:r},backend:n});let i=Rh(n,r.shape,r.dtype),o=Zr({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),l=qn({inputs:{real:o,imag:i},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=$i({inputs:{input:r},backend:n}),o=Zr({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!k.hasEncodingLoss(r.dtype,s)){let i=Ya({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32"){let i=n.data.get(r.dataId).values,o=Int32Array.from(i);return n.makeTensorInfo(r.shape,"int32",o)}if(s==="bool"){let i=n.data.get(r.dataId).values,o=k.toTypedArray([0],r.dtype),[l,u]=Ot((d,p)=>d!==p?1:0)(r.shape,[],i,o,"bool");return n.makeTensorInfo(u,"bool",l)}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var yD={kernelName:ks,backendName:"cpu",kernelFunc:Zr};function Yt(e,t,n,a){return n==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;we([i,o],e);let u=l.data.get(i.dataId).values,d=l.data.get(o.dataId).values,p=i.dtype==="string"?F.fromUint8ToStringArray(u):u,c=i.dtype==="string"?F.fromUint8ToStringArray(d):d,h=a||i.dtype,[m,f]=t(i.shape,o.shape,p,c,h);return l.makeTensorInfo(f,h,m)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let u=Zr({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),d=l.data.get(u.dataId),p=d.complexTensorInfos.real,c=d.complexTensorInfos.imag,h=l.data.get(p.dataId).values,m=l.data.get(c.dataId).values,f=Zr({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),g=l.data.get(f.dataId),y=g.complexTensorInfos.real,A=g.complexTensorInfos.imag,x=l.data.get(y.dataId).values,v=l.data.get(A.dataId).values,[b,w,N]=n(i.shape,o.shape,h,m,x,v),C=l.makeTensorInfo(N,"float32",b),E=l.makeTensorInfo(N,"float32",w),_=qn({inputs:{real:C,imag:E},backend:l});return l.disposeIntermediateTensorInfo(u),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(C),l.disposeIntermediateTensorInfo(E),_}else{let u=l.data.get(i.dataId).values,d=l.data.get(o.dataId).values,p=a||i.dtype,[c,h]=t(i.shape,o.shape,u,d,p);return l.makeTensorInfo(h,p,c)}}}function Ag(e){return(t,n,a,r,s,i)=>{let o=F.assertAndGetBroadcastShape(t,n),l=k.sizeFromShape(o),u=o.length,d=k.computeStrides(o),p=k.getTypedArrayFromDType("float32",l),c=k.getTypedArrayFromDType("float32",l),h=F.getBroadcastDims(t,o),m=F.getBroadcastDims(n,o),f=F.mergeRealAndImagArrays(a,r),g=F.mergeRealAndImagArrays(s,i),y=t.length,A=k.computeStrides(t),x=n.length,v=k.computeStrides(n);if(h.length+m.length===0)for(let b=0;bN[S]=0);let C=k.locToIndex(N,y,A),E=w.slice(-x);m.forEach(S=>E[S]=0);let _=k.locToIndex(E,x,v),$=e(f[C*2],f[C*2+1],g[_*2],g[_*2+1]);p[b]=$.real,c[b]=$.imag}return[p,c,o]}}var h7=Ot((e,t)=>e+t),AD=Ag((e,t,n,a)=>({real:e+n,imag:t+a})),Id=Yt(Or,h7,AD),xD={kernelName:Or,backendName:"cpu",kernelFunc:Id};function xg(e,t,n,a,r){let s=k.sizeFromShape(a),i=k.makeZerosTypedArray(r,n);for(let o=0;o=r||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function f7(e,t,n,a=!1){let r=e.shape[0],s=e.shape[1],i=Ve([r,n],t.dtype);for(let o=0;o=n||(a?i.set(1,o,u):t.size>0?i.set(i.get(o,u)+t.get(o,l),o,u):i.set(i.get(o,u)+1,o,u))}return i}function Pl(e){return(t,n,a)=>{let r=k.getTypedArrayFromDType(n,t.length);for(let s=0;s{let{x:i}=a;if(we(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,u=k.sizeFromShape(i.shape),d=n||i.dtype,p=k.getArrayFromDType(d,u);for(let c=0;c{let{x:i}=a;if(we(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,u=n||i.dtype,d=t(l,u,r);return o.makeTensorInfo(i.shape,u,d)}}var m7=Pl(e=>Math.ceil(e)),bD=Ll(Is,m7),vD={kernelName:Is,backendName:"cpu",kernelFunc:bD};function bg(e,t,n,a){let r=k.getArrayFromDType(n,k.sizeFromShape(t));if(a&&n!=="string"){let s=0;e.forEach(i=>{let o=k.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=n==="string"?F.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let u=0;ue===t?1:0),y7=Yt(Mo,g7,null,"bool"),wD={kernelName:Mo,backendName:"cpu",kernelFunc:y7},A7=Pl(e=>Math.exp(e)),x7=Ll(Ms,A7),kD={kernelName:Ms,backendName:"cpu",kernelFunc:x7},b7=Pl(e=>Math.expm1(e)),ID=Ll($o,b7),SD={kernelName:$o,backendName:"cpu",kernelFunc:ID},v7=Pl(e=>Math.floor(e)),ND=Ll(Fs,v7),TD={kernelName:Fs,backendName:"cpu",kernelFunc:ND};function w7(e,t,n,a,r,s,i,o,l){let u=Ve([a,s],n);for(let d=0;d=l/s)throw new Error(`Invalid indices: ${p} does not index into ${o}`);for(let h=0;he>t?1:0),CD=Yt(_o,I7,null,"bool"),ED={kernelName:_o,backendName:"cpu",kernelFunc:CD},S7=Ot((e,t)=>e>=t?1:0),RD=Yt(Os,S7,null,"bool"),MD={kernelName:Os,backendName:"cpu",kernelFunc:RD},N7=Ot((e,t)=>ee<=t?1:0),DD=Yt(Vo,T7,null,"bool"),OD={kernelName:Vo,backendName:"cpu",kernelFunc:DD};function C7(e,t,n){let a=(t-e)/(n-1),r=k.makeZerosTypedArray(n,"float32");r[0]=e;for(let s=1;sMath.log(e)),zD=Ll(Ps,E7),_D={kernelName:Ps,backendName:"cpu",kernelFunc:zD};function R7(e,t,n,a){let r=k.getTypedArrayFromDType(a,k.sizeFromShape(n));for(let s=0;so)&&(o=u)}r[s]=o}return r}var M7=Ot((e,t)=>Math.max(e,t)),PD=Yt(Ws,M7),LD={kernelName:Ws,backendName:"cpu",kernelFunc:PD},F7=Ot((e,t)=>Math.min(e,t)),WD=Yt(Us,F7),BD={kernelName:Us,backendName:"cpu",kernelFunc:WD},vg=Ot((e,t)=>e*t),VD=Ag((e,t,n,a)=>({real:e*n-t*a,imag:e*a+t*n})),Mh=Yt(Gs,vg,VD),jD={kernelName:Gs,backendName:"cpu",kernelFunc:Mh};function $7(e,t,n){let a=k.createScalarValue(-1,n);return vg([],t,a,e,n)}function UD(e){let{inputs:t,backend:n}=e,{x:a}=t;we(a,"neg");let r=n.data.get(a.dataId).values,[s,i]=$7(r,a.shape,a.dtype);return n.makeTensorInfo(i,a.dtype,s)}var HD={kernelName:Go,backendName:"cpu",kernelFunc:UD},D7=Ot((e,t)=>e!==t?1:0),GD=Yt(qo,D7,null,"bool"),qD={kernelName:qo,backendName:"cpu",kernelFunc:GD};function wg(e,t,n,a,r){let s=t.length,i=k.sizeFromShape(t),o=k.computeStrides(t),l=k.computeStrides(r),u=k.getTypedArrayFromDType(n,k.sizeFromShape(r));for(let d=0;dn.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(y,g,m)}var ZD={kernelName:Qo,backendName:"cpu",kernelFunc:KD};function kg(e,t,n,a){let r=e===t,s=e1;if(r||s||i)return k.makeZerosTypedArray(0,a);let o=Math.abs(Math.ceil((t-e)/n)),l=k.makeZerosTypedArray(o,a);t1/Math.sqrt(e)),YD=Ll(ni,z7),JD={kernelName:ni,backendName:"cpu",kernelFunc:YD};function Fh(e,t,n,a,r){let s=fn.isSliceContinous(a,t,n),i=k.sizeFromShape(n),o=k.computeStrides(a);if(s){let p=fn.computeFlatOffset(t,o);return r==="string"?e.slice(p,p+i):e.subarray(p,p+i)}let l=r==="string"?F.fromUint8ToStringArray(e):e,u=Ve(a,r,l),d=Ve(n,r);for(let p=0;pm+t[f]);d.set(u.get(...h),...c)}return r==="string"?F.fromStringArrayToUint8(d.values):d.values}function Di(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a;we(r,"slice");let[o,l]=fn.parseSliceParams(r,s,i);fn.assertParamsValid(r,o,l);let u=n.data.get(r.dataId).values,d=Fh(u,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,d)}var QD={kernelName:sl,backendName:"cpu",kernelFunc:Di};function _7(e,t,n,a,r,s,i){let o=t[0],l=s[0],u=new Array(l),d=new Array(o),p=t[1];if(l===0){if(o!==0)throw new Error(`Received SparseTensor with denseShape[0] = 0 but + indices.shape[0] = ${o}`);let g=k.getArrayFromDType(n,0),y=k.getArrayFromDType(r,0);return[g,[0,p],y,u,d]}let c=!0,h=0,m=new Array(l).fill(0);for(let g=0;g=l)throw new Error(`indices(${g}, 0) is invalid: ${y} >= ${l}`);++m[y],c=c&&y>=h,h=y}let f=!0;for(let g=0;g0&&(m[g]+=m[g-1])}if(f&&c){let g=e,y=a;for(let A=0;A0){h[c-1]=1;for(let g=c-2;g>=0;--g)h[g]=h[g+1]*a[g+1]}let m=[];if(o>0){m[o-1]=1;for(let g=o-2;g>=0;--g)m[g]=m[g+1]*l[g+1]}let f=k.getArrayFromDType(n,i*o);for(let g=0;g0?r[o-1]+1:0;if(d<0)throw new Error("segment ids must be >= 0");let p=t.slice();p[0]=d;let c=p.reduce((A,x)=>A*x,1),h=k.getArrayFromDType(n,c);if(o===0)return d>0&&h.fill(i),[h,p];if(d<=0)throw new Error("segment ids must be >= 0");let m=0,f=1,g=0,y=r[m];for(;;){let A=0;if(f=A)throw new Error("segment ids are not increasing")}if(y<0||y>=d)throw new Error(`Segment id ${y} out of range [0, ${d}), possibly because segmentIds input is not sorted.`);y>g&&h.fill(i,g*u,y*u);for(let x=m;x=l[0])throw new Error(`Bad: indices[${x}] == ${a[x]} out of range [0, ${l[0]})`);for(let b=0;bo)break}return g{let n=e-t;return n*n}),eO=Yt(li,L7),tO={kernelName:li,backendName:"cpu",kernelFunc:eO};function W7(e,t,n,a){let r=Ve(e,t.dtype);for(let s=0;s0?0:i-o),c=0;c+=l*this.leftPad.length;for(let g=0;gg.forEach(y=>h[m++]=y);for(let g=0;g0){f(e[p+d-1]);for(let g=0;g0){let o=t[0];if(o!==0)throw new Error(`First split value must be 0, got ${o}`);for(let l=1;l=o;if(u=u&&t[l]<=n,!u)throw new Error(`Invalid split value ${t[l]}, must be in [${o}, ${n}]`);o=t[l]}if(o!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${o}`)}let r=a-1,s=k.getArrayFromDType("int32",a);if(n===0||a===0){let o=new Array(n);for(let l=0;l<=r;++l)s[l]=0;return[o,s]}s[0]=0;for(let o=1;o<=r;++o){let l=t[o]-t[o-1],u=0;this.nGramWidths.forEach(d=>{u+=this.getNumNGrams(l,d)}),this.preserveShort&&l>0&&u===0&&(u=1),s[o]=s[o-1]+u}let i=new Array(s[r]);for(let o=0;o{let p=t[o+1]-t[o],c=this.getNumNGrams(p,d);this.createNGrams(e,l,i,u,c,d),u+=c}),this.preserveShort&&u===s[o]){let d=t[o+1]-t[o];if(d===0)continue;let p=d+2*this.padWidth,c=1;this.createNGrams(e,l,i,u,c,p)}}return[i,s]}};function B7(e,t,n,a,r,s,i,o){return new nO(n,a,r,s,i,o).compute(e,t)}function aO(e,t,n){if(!e.length)return[];if(t.length===0){let s=new Array(e.length);for(let i=0;ie-t),rO=Ag((e,t,n,a)=>({real:e-n,imag:t-a})),Sg=Yt(ui,U7,rO),sO={kernelName:ui,backendName:"cpu",kernelFunc:Sg};function H7(e,t){let n=new Array(e.rank);for(let r=0;rx.value-A.value);let f=p*a,g=l.subarray(f,f+a),y=u.subarray(f,f+a);for(let A=0;A{for(let g=0;gnew Eh,1);var K7=rt(Eo,e=>e>=0?e:Math.exp(e)-1),iO={kernelName:Eo,backendName:"cpu",kernelFunc:K7};function Z7(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a;we([r],"leakyRelu");let i=k.sizeFromShape(r.shape),o=n.data.get(r.dataId).values,l=k.getTypedArrayFromDType("float32",i);for(let u=0;ue<0?t*e:e);function Y7(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t;we([a,r],"prelu");let s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,[o,l]=lO(a.shape,r.shape,s,i,a.dtype);return n.makeTensorInfo(l,a.dtype,o)}var uO={kernelName:Zs,backendName:"cpu",kernelFunc:Y7},J7=rt(Ys,e=>Math.max(0,e)),dO={kernelName:Ys,backendName:"cpu",kernelFunc:J7},Q7=rt(Qs,e=>Math.min(Math.max(0,e),6)),pO={kernelName:Qs,backendName:"cpu",kernelFunc:Q7},ev=rt(ri,e=>1/(1+Math.exp(-e))),cO={kernelName:ri,backendName:"cpu",kernelFunc:ev};function Ng(e,t,n,a,r){if(n==="linear")return Ya({inputs:{x:t},backend:e});if(n==="relu")return J7({inputs:{x:t},backend:e});if(n==="elu")return K7({inputs:{x:t},backend:e});if(n==="relu6")return Q7({inputs:{x:t},backend:e});if(n==="prelu")return Y7({inputs:{x:t,alpha:a},backend:e});if(n==="leakyrelu")return Z7({inputs:{x:t},backend:e,attrs:{alpha:r}});if(n==="sigmoid")return ev({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function gt(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=k.sizeFromShape(r.shape),o=k.inferFromImplicitShape(s,i),l=k.sizeFromShape(o);k.assert(i===l,()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`),n.incRef(r.dataId);let u=n.data.get(r.dataId);if(u.complexTensorInfos!=null){let d=u.complexTensorInfos.real,p=u.complexTensorInfos.imag;d.shape=o,p.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}var hO={kernelName:tl,backendName:"cpu",kernelFunc:gt};function tv(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;we([r,s],"matMul");let l=r.shape.length,u=s.shape.length,d=i?r.shape[l-2]:r.shape[l-1],p=o?s.shape[u-1]:s.shape[u-2],c=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[u-2]:s.shape[u-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=k.sizeFromShape(m),y=k.sizeFromShape(f),A=g===y||g===1||y===1;k.assert(l>=2&&u>=2&&A,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(g>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);k.assert(d===p,()=>`Error in matMul: inner shapes (${d}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[g,d,c]:[g,c,d],b=o?[y,h,p]:[y,p,h],w=gt({inputs:{x:r},backend:n,attrs:{shape:v}}),N=gt({inputs:{x:s},backend:n,attrs:{shape:b}}),C=i?w.shape[1]:w.shape[2],E=i?w.shape[2]:w.shape[1],_=o?N.shape[1]:N.shape[2],$=Math.max(g,y),S=n.data.get(w.dataId).values,z=n.data.get(N.dataId).values,O=k.computeStrides(w.shape),W=k.computeStrides(N.shape),[G,H,J]=i?[O[0],1,O[1]]:[O[0],O[1],1],[K,ne,Q]=o?[1,W[1],W[0]]:[W[1],1,W[0]],se=E*_,Z=Ve([$,E,_],w.dtype),le=Z.values,oe=n.blockSize;for(let xe=0;xe<$;xe++)for(let fe=0;feMath.acos(e)),AO={kernelName:go,backendName:"cpu",kernelFunc:yO},xO=rt(yo,e=>Math.acosh(e)),bO={kernelName:yo,backendName:"cpu",kernelFunc:xO};function vO(e){let{inputs:t,backend:n}=e,a=t;we(t,"addN");let r=a.map(o=>n.data.get(o.dataId).values),s=Ve(a[0].shape,a[0].dtype),i=s.values;for(let o=0;oA&&(A=b,x=v)}h[g]=x}return u.forEach(g=>n.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(d,"int32",h)}var CO={kernelName:bs,backendName:"cpu",kernelFunc:TO};function EO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a;we(r,"argMin");let i=k.parseAxisParam(s,r.shape),o=F.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=ua({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=F.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],F.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[d,p]=F.computeOutAndReduceShapes(l.shape,i),c=k.sizeFromShape(d),h=k.makeZerosTypedArray(c,"int32"),m=k.sizeFromShape(p),f=n.data.get(l.dataId).values;for(let g=0;gn.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(d,"int32",h)}var RO={kernelName:Fu,backendName:"cpu",kernelFunc:EO},MO=rt(bo,e=>Math.asin(e)),FO={kernelName:bo,backendName:"cpu",kernelFunc:MO},$O=rt(vo,e=>Math.asinh(e)),DO={kernelName:vo,backendName:"cpu",kernelFunc:$O},OO=rt(wo,e=>Math.atan(e)),zO={kernelName:wo,backendName:"cpu",kernelFunc:OO},_O=Ot((e,t)=>Math.atan2(e,t)),PO=Yt(Io,_O),LO={kernelName:Io,backendName:"cpu",kernelFunc:PO},WO=rt(ko,e=>Math.atanh(e)),BO={kernelName:ko,backendName:"cpu",kernelFunc:WO};function Tg(e,t,n,a,r,s){let i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,d=r.effectiveFilterHeight,p=r.effectiveFilterWidth,c=r.padInfo.top,h=r.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=Ve(r.outShape,n),g=f.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],A=r.outShape[2]*r.outShape[3],x=r.outShape[3];for(let v=0;vH?H=oe:s==="avg"&&(J+=oe,K++)}if(isNaN(H))break}let ne=S+z*x+N;g[ne]=s==="avg"?J/K:H}}}return f}function nv(e,t,n,a,r=!1,s=!1){let i=Ve(a.outShape,"int32"),o=a.strideHeight,l=a.strideWidth,u=a.dilationHeight,d=a.dilationWidth,p=a.effectiveFilterHeight,c=a.effectiveFilterWidth,h=a.padInfo.top,m=a.padInfo.left,f=Ve(t,n,e);for(let g=0;g_&&(_=G,r?$=s?((g*a.inHeight+S)*a.inWidth+O)*a.inChannels+y:(S*a.inWidth+O)*a.inChannels+y:$=z*c+W)}}i.set($,g,A,w,y)}}return i}function av(e,t,n,a,r,s){let i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,d=r.dilationHeight,p=r.dilationWidth,c=r.effectiveFilterDepth,h=r.effectiveFilterHeight,m=r.effectiveFilterWidth,f=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,A=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=Ve(r.outShape,n),v=x.values,b=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],w=r.outShape[2]*r.outShape[3]*r.outShape[4],N=r.outShape[3]*r.outShape[4],C=r.outShape[4];for(let E=0;ENe?Ne=Ue:s==="avg"&&(Te+=Ue,Oe++),isNaN(Ne))break}if(isNaN(Ne))break}if(isNaN(Ne))break}let Pe=fe+S;v[Pe]=s==="avg"?Te/Oe:Ne}}}}return x}function VO(e,t){let n=Ve(t.outShape,"int32"),a=t.strideDepth,r=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,d=t.effectiveFilterHeight,p=t.effectiveFilterWidth,c=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=z&&(z=Q,O=G*d*p+J*d+ne)}}}n.set(O,f,y,b,E,g)}}}return n}function jO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;we(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,u=1;k.assert(F.eitherStridesOrDilationsAreOne(i,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=F.computePool2DInfo(r.shape,s,i,u,o,l),p;if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))p=Ya({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=k.computeStrides(r.shape),m=Tg(c,r.shape,r.dtype,h,d,"avg");p=n.makeTensorInfo(d.outShape,r.dtype,m.values)}return p}var UO={kernelName:vs,backendName:"cpu",kernelFunc:jO};function HO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=a;we(r,"avgPool3d");let d=F.computePool3DInfo(r.shape,s,i,1,o,l,u),p=n.data.get(r.dataId).values,c=av(p,r.shape,r.dtype,k.computeStrides(r.shape),d,"avg");return n.makeTensorInfo(c.shape,"float32",c.values)}var GO={kernelName:$u,backendName:"cpu",kernelFunc:HO};function qO(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=a;we([r,s],"avgPool3DGrad");let d=F.computePool3DInfo(s.shape,i,o,1,l,u),p=d.strideDepth,c=d.strideHeight,h=d.strideWidth,m=d.filterDepth,f=d.filterHeight,g=d.filterWidth,y=d.dilationDepth,A=d.dilationHeight,x=d.dilationWidth,v=d.effectiveFilterDepth,b=d.effectiveFilterHeight,w=d.effectiveFilterWidth,N=v-1-d.padInfo.front,C=w-1-d.padInfo.left,E=b-1-d.padInfo.top,_=Ve(s.shape,"float32"),$=1/(m*f*g),S=n.bufferSync(r);for(let z=0;z=d.outDepth||Math.floor(Z)!==Z))for(let le=0;le=d.outHeight||Math.floor(oe)!==oe))for(let xe=0;xe=d.outWidth||Math.floor(fe)!==fe||(Q+=S.get(z,Z,oe,fe,O))}}}_.set(Q*$,z,W,G,H,O)}return n.makeTensorInfo(_.shape,_.dtype,_.values)}var XO={kernelName:Kp,backendName:"cpu",kernelFunc:qO};function KO(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;we([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=a,d=F.computePool2DInfo(i.shape,o,l,1,u),p=d.strideHeight,c=d.strideWidth,h=d.filterHeight,m=d.filterWidth,f=d.dilationHeight,g=d.dilationWidth,y=d.effectiveFilterHeight,A=d.effectiveFilterWidth,x=A-1-d.padInfo.left,v=y-1-d.padInfo.top,b=Ve(i.shape,"float32"),w=1/(h*m),N=n.data.get(r.dataId).values,C=Ve(r.shape,"float32",N);for(let E=0;E=d.outHeight||Math.floor(H)!==H))for(let J=0;J=d.outWidth||Math.floor(K)!==K||(W+=C.get(E,H,K,_))}}b.set(W*w,E,$,S,_)}return n.makeTensorInfo(b.shape,b.dtype,b.values)}var ZO={kernelName:Xp,backendName:"cpu",kernelFunc:KO};function YO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,scale:s,offset:i,mean:o,variance:l}=t;k.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),k.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),k.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),we([r,o,l,s,i],"batchNorm");let{varianceEpsilon:u}=a;u==null&&(u=.001);let d=n.data.get(r.dataId).values,p=n.data.get(o.dataId).values,c=n.data.get(l.dataId).values,h=s?n.data.get(s.dataId).values:new Float32Array([1]),m=i?n.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(d.length),g=m.length,y=h.length,A=c.length,x=p.length,v=0,b=0,w=0,N=0;for(let C=0;C=g&&(v=0),b>=x&&(b=0),w>=y&&(w=0),N>=A&&(N=0);return n.makeTensorInfo(r.shape,r.dtype,f)}var JO={kernelName:Ds,backendName:"cpu",kernelFunc:YO};function QO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;we([r],"batchToSpaceND");let o=s.reduce((y,A)=>y*A),l=F.getReshaped(r.shape,s,o),u=F.getPermuted(l.length,s.length),d=F.getReshapedPermuted(r.shape,s,o),p=F.getSliceBeginCoords(i,s.length),c=F.getSliceSize(d,i,s.length),h=gt({inputs:{x:r},backend:n,attrs:{shape:l}}),m=ua({inputs:{x:h},backend:n,attrs:{perm:u}}),f=gt({inputs:{x:m},backend:n,attrs:{shape:d}}),g=Di({inputs:{x:f},backend:n,attrs:{begin:p,size:c}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),g}var ez={kernelName:Du,backendName:"cpu",kernelFunc:QO};function tz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,u=xg(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,u)}var nz={kernelName:Zp,backendName:"cpu",kernelFunc:tz},az=rt(zr,(e,t)=>{let n=t;return e>n.clipValueMax?n.clipValueMax:e{let{x:t}=e.inputs,n=e.backend,a=new Float32Array(k.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=n.data.get(s.dataId).values,l=n.data.get(i.dataId).values;for(let u=0;uf.shape),s);if(k.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(f=>k.sizeFromShape(f.shape)>0);if(o.length===1)return Ya({inputs:{x:o[0]},backend:n});let l=o.map(f=>f.shape);if(F.assertParamsConsistent(l,s),o[0].dtype==="complex64"){let f=o.map(v=>$i({inputs:{input:v},backend:n})),g=o.map(v=>Wl({inputs:{input:v},backend:n})),y=Bl({inputs:f,backend:n,attrs:{axis:s}}),A=Bl({inputs:g,backend:n,attrs:{axis:s}}),x=qn({inputs:{real:y,imag:A},backend:n});return f.forEach(v=>n.disposeIntermediateTensorInfo(v)),g.forEach(v=>n.disposeIntermediateTensorInfo(v)),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(A),x}let u=o.map(f=>{let g=k.sizeFromShape(f.shape.slice(s));return gt({inputs:{x:f},backend:n,attrs:{shape:[-1,g]}})}),d=u.map(f=>({vals:n.data.get(f.dataId).values,shape:f.shape}));i=F.computeOutShape(u.map(f=>f.shape),1);let p=u[0].shape[0]===1,c=bg(d,i,t[0].dtype,p),h=F.computeOutShape(o.map(f=>f.shape),s),m=n.makeTensorInfo(h,t[0].dtype,c);return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var lz={kernelName:So,backendName:"cpu",kernelFunc:Bl};function rv(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:d}=a;we([r,s],"conv2d");let p=F.convertConv2DDataFormat(l),c=F.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!1,p),h=c.filterHeight,m=c.filterWidth,f=c.dilationHeight,g=c.dilationWidth,y=c.padInfo.left,A=c.padInfo.top,x=c.dataFormat==="channelsLast",v=new Lt(c.outShape,r.dtype),b=k.computeStrides(r.shape),w=k.computeStrides(s.shape),N=b[0],C=x?b[1]:b[2],E=x?b[2]:1,_=x?1:b[1],$=v.strides[0],S=x?v.strides[1]:v.strides[2],z=x?v.strides[2]:1,O=x?1:v.strides[1],W=n.data.get(r.dataId).values,G=n.data.get(s.dataId).values,H=v.values;for(let J=0;J=c.inHeight)continue;let xe=le*w[0],fe=K+oe*C;for(let Ne=0;Ne=c.inWidth)continue;let tt=xe+Pe*w[1],nt=fe+ze*E,it=tt;for(let Ye=0;Ye=u.inDepth)continue;let J=G*E[0],K=$+H*C[1];for(let ne=0;ne=u.inHeight)continue;let oe=J+Z*E[1],xe=K+le*C[2];for(let fe=0;fe=u.inWidth)continue;let ze=oe+Oe*E[2],tt=xe+Pe*u.inChannels,nt=ze;for(let it=0;itMath.cos(e)),vz={kernelName:Ts,backendName:"cpu",kernelFunc:bz},wz=rt(No,e=>Math.cosh(e)),kz={kernelName:No,backendName:"cpu",kernelFunc:wz};function Iz(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=a,[d,p,c,h]=r.shape,m=s.shape[0],[f,g]=o,y=Ve([m,f,g,h],"float32"),A=n.data.get(s.dataId).values,x=n.data.get(i.dataId).values,v=n.data.get(r.dataId).values,b=k.computeStrides(r.shape),w=k.computeStrides(y.shape);for(let N=0;N=d)continue;let O=f>1?($-E)*(p-1)/(f-1):0,W=g>1?(S-_)*(c-1)/(g-1):0;for(let G=0;G1?E*(p-1)+G*O:.5*(E+$)*(p-1);if(H<0||H>p-1){for(let J=0;J1?_*(c-1)+Q*W:.5*(_+S)*(c-1);if(se<0||se>c-1){for(let xe=0;xe1?_*(c-1)+J*W:.5*(_+S)*(c-1);if(K<0||K>c-1){for(let se=0;sey+m-A-1:(y,A)=>y+A;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`),k.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=r.shape[1],u=r.shape[2],d=r.shape[3],p=l*s,c=u*s,h=d/(s*s),m=n.data.get(r.dataId).values,f=new Float32Array(o*p*c*h),g=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let h=F.computeConv2DInfo(r.shape,s.shape,i,c,o,u,!0),{filterHeight:m,filterWidth:f,dilationHeight:g,dilationWidth:y,padInfo:A}=h,x=A.left,v=A.top,b=h.outChannels/h.inChannels,w=new Lt(h.outShape,r.dtype),N=n.data.get(r.dataId).values,C=n.data.get(s.dataId).values,E=w.values;for(let _=0;_=h.inHeight)continue;let J=G*p[0],K=$+H*d[1];for(let ne=0;ne=h.inWidth)continue;let oe=J+Z*p[1],xe=K+le*h.inChannels,fe=Q,Ne=oe;for(let Te=0;Te{let{x:a,filter:r}=e,{strides:s,pad:i,dilations:o}=n,l=t,u=l.data.get(a.dataId).values,d=a.shape.length,p=l.data.get(r.dataId).values,c=r.shape.length,{batchSize:h,inHeight:m,inWidth:f,inChannels:g,outHeight:y,outWidth:A,padInfo:x,strideHeight:v,strideWidth:b,filterHeight:w,filterWidth:N,dilationHeight:C,dilationWidth:E,outShape:_}=F.computeDilation2DInfo(a.shape,r.shape,s,i,"NHWC",o),$=k.sizeFromShape(_),S=_.length,z=k.getArrayFromDType(a.dtype,$);for(let O=0;O=0&&Z=0&&oene&&(ne=Ne)}}}let Q=k.locToIndex([O,W,H,K],S,k.computeStrides(_));z[Q]=ne}}}return{dataId:l.write(k.toTypedArray(z,a.dtype),_,a.dtype),shape:_,dtype:a.dtype}}},Wz={kernelName:ic,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=n,u=t,d=k.toNestedArray(a.shape,u.data.get(a.dataId).values),p=k.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:A,strideHeight:x,strideWidth:v,filterHeight:b,filterWidth:w,dilationHeight:N,dilationWidth:C,outShape:E}=F.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",l);k.assert(s.rank===E.length,()=>`Error in ${ic}, dy must have the same rank as output ${E.length}, but got ${s.rank}`);let _=k.toNestedArray(E,u.data.get(s.dataId).values),$=k.makeZerosNestedTypedArray(r.shape,r.dtype);for(let S=0;S=0&&se=0&&leJ&&(J=oe,K=Q,ne=Z)}}}$[K][ne][H]+=_[S][z][W][H]}}}return{dataId:u.write(k.toTypedArray($,a.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Bz={kernelName:sc,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=n,u=t,d=k.toNestedArray(a.shape,u.data.get(a.dataId).values),p=k.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:A,strideHeight:x,strideWidth:v,filterHeight:b,filterWidth:w,dilationHeight:N,dilationWidth:C,outShape:E}=F.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",l);k.assert(s.rank===E.length,()=>`Error in ${sc}, dy must have the same rank as output ${E.length}, but got ${s.rank}`);let _=k.toNestedArray(E,u.data.get(s.dataId).values),$=k.makeZerosNestedTypedArray(a.shape,a.dtype);for(let S=0;S=0&&se=0&&leJ&&(J=oe,K=se,ne=le)}}}$[S][K][ne][H]+=_[S][z][W][H]}}}return{dataId:u.write(k.toTypedArray($,a.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}};function Sd(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;we(r,"sum");let o;r.dtype==="bool"?o=Zr({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):o=Ya({inputs:{x:r},backend:n});let l=o.shape.length,u=k.parseAxisParam(s,o.shape),d=F.getAxesPermutation(u,l),p=u,c=o;d!=null&&(c=ua({inputs:{x:o},backend:n,attrs:{perm:d}}),p=F.getInnerMostAxes(p.length,l)),F.assertAxesAreInnerMostDims("sum",p,c.shape.length);let[h,m]=F.computeOutAndReduceShapes(c.shape,p),f=F.upcastType(c.dtype,"int32"),g=Rh(n,h,f),y=k.sizeFromShape(m),A=n.data.get(g.dataId).values,x=n.data.get(c.dataId).values;for(let v=0;v=0&&(c=Sd({inputs:{x:c},backend:n,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var Uz={kernelName:oc,backendName:"cpu",kernelFunc:jz};function Hz(e){let{inputs:t,backend:n}=e,{dy:a,y:r}=t;we([a,r],"eluGrad");let s=new Float32Array(k.sizeFromShape(r.shape)),i=n.data.get(r.dataId).values,o=n.data.get(a.dataId).values;for(let l=0;l=1?s[l]=o[l]:s[l]=o[l]*(u+1)}return n.makeTensorInfo(r.shape,"float32",s)}var Gz={kernelName:lc,backendName:"cpu",kernelFunc:Hz},qz=F.ERF_P,Xz=F.ERF_A1,Kz=F.ERF_A2,Zz=F.ERF_A3,Yz=F.ERF_A4,Jz=F.ERF_A5,Qz=rt(Ro,e=>{let t=Math.sign(e),n=Math.abs(e),a=1/(1+qz*n);return t*(1-((((Jz*a+Yz)*a+Zz)*a+Kz)*a+Xz)*a*Math.exp(-n*n))}),e_={kernelName:Ro,backendName:"cpu",kernelFunc:Qz};function $h(e){let{inputs:t,backend:n,attrs:a}=e,{input:r}=t,{dim:s}=a,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(k.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),gt({inputs:{x:r},backend:n,attrs:{shape:o}})}var t_={kernelName:Fo,backendName:"cpu",kernelFunc:$h},n_=Ot((e,t)=>e/t),Cg=Yt(Rs,n_),Eg={kernelName:Rs,backendName:"cpu",kernelFunc:Cg};function iv(e,t,n){let a=e.shape,r=a[0],s=a[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,u=[r,s],d=k.sizeFromShape(u),p=k.getTypedArrayFromDType("float32",d),c=k.getTypedArrayFromDType("float32",d);for(let g=0;g{let{image:a}=e,r=n,s=k.getTypedArrayFromDType(a.dtype,k.sizeFromShape(a.shape)),[i,o,l,u]=a.shape,d=r.data.get(a.dataId).values;for(let p=0;p=0&&xMath.floor(e/t)),c_=Yt($s,p_,null,"int32"),h_={kernelName:$s,backendName:"cpu",kernelFunc:c_};function f_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:d,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=rv({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:u,dataFormat:d,dilations:p,dimRoundingMode:c}});if(i){let g=f;f=Id({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(g)}if(h){let g=f;f=Ng(n,f,h,o,m),n.disposeIntermediateTensorInfo(g)}return f}var m_={kernelName:fi,backendName:"cpu",kernelFunc:f_};function g_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:d,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=sv({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:u,dataFormat:d,dilations:p,dimRoundingMode:c}});if(i){let g=f;f=Id({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(g)}if(h){let g=f;f=Ng(n,f,h,o,m),n.disposeIntermediateTensorInfo(g)}return f}var y_={kernelName:mi,backendName:"cpu",kernelFunc:g_};function A_(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=k.sizeFromShape(a.shape),i=r.shape,o=i[i.length-1],[l,u,d,p]=F.prepareAndValidate(a,r);if(u===0)return n.makeTensorInfo(l,a.dtype,[]);let c=n.data.get(r.dataId).values,h=n.bufferSync(a),m=w7(c,h,a.dtype,u,o,d,p,a.shape,s);return n.makeTensorInfo(l,a.dtype,m.values)}var x_={kernelName:zo,backendName:"cpu",kernelFunc:A_};function b_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,indices:s}=t,{axis:i,batchDims:o}=a;we([r,s],"gatherV2");let l=o;o==null&&(l=0);let u=k.sizeFromShape(s.shape),d=k.parseAxisParam(i,r.shape)[0],p=F.segment_util.collectGatherOpShapeInfo(r,s,d,l),c=gt({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),h=gt({inputs:{x:s},backend:n,attrs:{shape:[p.batchSize,u/p.batchSize]}}),m=[p.batchSize,p.outerSize,u/p.batchSize,p.sliceSize],f=n.bufferSync(h),g=n.bufferSync(c),y=k7(g,f,m);return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.makeTensorInfo(p.outputShape,y.dtype,y.values)}var v_={kernelName:Oo,backendName:"cpu",kernelFunc:b_};function w_(e){let{inputs:t,backend:n}=e,{input:a}=t,r=k.sizeFromShape(a.shape),s=a.shape[a.shape.length-1],i=r/s,o=gt({inputs:{x:a},backend:n,attrs:{shape:[i,s]}}),l=iv(o,!0,n),u=gt({inputs:{x:l},backend:n,attrs:{shape:a.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),u}var k_={kernelName:dc,backendName:"cpu",kernelFunc:w_},I_=rt(Po,e=>Number.isFinite(e)?1:0,"bool"),S_={kernelName:Po,backendName:"cpu",kernelFunc:I_},N_=rt(Lo,e=>Math.abs(e)===Infinity?1:0,"bool"),T_={kernelName:Lo,backendName:"cpu",kernelFunc:N_},C_=rt(Wo,e=>Number.isNaN(e)?1:0,"bool"),E_={kernelName:Wo,backendName:"cpu",kernelFunc:C_};function R_(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=C7(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var M_={kernelName:cc,backendName:"cpu",kernelFunc:R_},F_=rt(jo,e=>Math.log1p(e)),$_={kernelName:jo,backendName:"cpu",kernelFunc:F_},D_=Ot((e,t)=>e&&t),O_=Yt(Uo,D_,null,"bool"),z_={kernelName:Uo,backendName:"cpu",kernelFunc:O_},__=rt(Lu,e=>e?0:1,"bool"),P_={kernelName:Lu,backendName:"cpu",kernelFunc:__},L_=Ot((e,t)=>e||t),W_=Yt(Wu,L_,null,"bool"),B_={kernelName:Wu,backendName:"cpu",kernelFunc:W_};function V_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=a;we(r,"LRN");let u=r.shape[3],d=u-1,p=n.data.get(r.dataId).values,c=k.sizeFromShape(r.shape),h=new Float32Array(c);function m(f){let g=f%u,y=f-g+Math.max(0,g-s),A=f-g+Math.min(g+s,d),x=0;for(;y<=A;y++){let v=p[y];x+=v*v}return x}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=F.computePool2DInfo(r.shape,s,i,u,o,l),p;if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))p=Ya({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=k.computeStrides(r.shape),m=Tg(c,r.shape,r.dtype,h,d,"max");p=n.makeTensorInfo(d.outShape,r.dtype,m.values)}return p}var X_={kernelName:Bs,backendName:"cpu",kernelFunc:q_};function K_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=a;we(r,"maxPool3d");let d=F.computePool3DInfo(r.shape,s,i,1,o,l,u),p=n.data.get(r.dataId).values,c=av(p,r.shape,r.dtype,k.computeStrides(r.shape),d,"max");return n.makeTensorInfo(c.shape,"float32",c.values)}var Z_={kernelName:Vu,backendName:"cpu",kernelFunc:K_};function Y_(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=a;we([r,s],"maxPool3DGrad");let d=F.computePool3DInfo(s.shape,i,o,1,l,u),p=n.bufferSync(s),c=VO(p,d),h=d.strideDepth,m=d.strideHeight,f=d.strideWidth,g=d.dilationDepth,y=d.dilationHeight,A=d.dilationWidth,x=d.effectiveFilterDepth,v=d.effectiveFilterHeight,b=d.effectiveFilterWidth,w=x-1-d.padInfo.front,N=b-1-d.padInfo.left,C=v-1-d.padInfo.top,E=Ve(s.shape,"float32"),_=n.bufferSync(r);for(let $=0;$=d.outDepth||Math.floor(Q)!==Q))for(let se=0;se=d.outHeight||Math.floor(Z)!==Z))for(let le=0;le=d.outWidth||Math.floor(oe)!==oe)continue;let xe=x*v*b-1-c.get($,Q,Z,oe,S),fe=ne*v*b+se*b+le,Ne=xe===fe?1:0;Ne!==0&&(K+=_.get($,Q,Z,oe,S)*Ne)}}}E.set(K,$,z,O,W,S)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}var J_={kernelName:mc,backendName:"cpu",kernelFunc:Y_};function Q_(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s,output:i}=t,o=s;we([s,i],"maxPoolGrad");let{filterSize:l,strides:u,pad:d,dimRoundingMode:p}=a,c=F.computePool2DInfo(o.shape,l,u,1,d,p),h=n.data.get(o.dataId).values,m=Ve(c.outShape,o.dtype,nv(h,o.shape,o.dtype,c).values),f=c.strideHeight,g=c.strideWidth,y=c.dilationHeight,A=c.dilationWidth,x=c.effectiveFilterHeight,v=c.effectiveFilterWidth,b=v-1-c.padInfo.left,w=x-1-c.padInfo.top,N=Ve(o.shape,"float32"),C=n.data.get(r.dataId).values,E=Ve(r.shape,"float32",C);for(let _=0;_=c.outHeight||Math.floor(J)!==J))for(let K=0;K=c.outWidth||Math.floor(ne)!==ne)continue;let Q=x*v-1-m.get(_,J,ne,$),se=H*v+K,Z=Q===se?1:0;Z!==0&&(G+=E.get(_,J,ne,$)*Z)}}N.set(G,_,S,z,$)}return n.makeTensorInfo(N.shape,N.dtype,N.values)}var eP={kernelName:fc,backendName:"cpu",kernelFunc:Q_};function tP(e,t,n,a,r){let s=k.computeStrides(t),i=Tg(e,t,n,s,r,"max"),o=nv(e,t,n,r,!0,a);return[i.values,o.values]}var nP={kernelName:gc,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;we(a,"MaxPoolWithArgmax");let u=l.data.get(a.dataId).values,d=F.computePool2DInfo(a.shape,r,s,[1,1],i),[p,c]=tP(u,a.shape,a.dtype,o,d),h=l.write(p,d.outShape,a.dtype),m=l.write(c,d.outShape,a.dtype);return[{dataId:h,shape:d.outShape,dtype:a.dtype},{dataId:m,shape:d.outShape,dtype:"int32"}]}};function aP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=k.parseAxisParam(s,r.shape),l=F.computeOutAndReduceShapes(r.shape,o)[1],u=k.sizeFromShape(l),d=[],p=n.makeTensorInfo([],"float32",new Float32Array([u]));d.push(p);let c=Zr({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});d.push(c);let h=Cg({inputs:{a:c,b:p},backend:n});d.push(h);let m=Sd({inputs:{x:h},backend:n,attrs:{axis:s,keepDims:i}});return d.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var rP={kernelName:Vs,backendName:"cpu",kernelFunc:aP};function sP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;we(r,"min");let o=k.parseAxisParam(s,r.shape),l=o,u=F.getAxesPermutation(l,r.shape.length),d=r;u!=null&&(d=ua({inputs:{x:r},backend:n,attrs:{perm:u}}),l=F.getInnerMostAxes(l.length,r.shape.length)),F.assertAxesAreInnerMostDims("min",l,d.shape.length);let[p,c]=F.computeOutAndReduceShapes(d.shape,l),h=k.sizeFromShape(c),m=k.makeZerosTypedArray(k.sizeFromShape(p),d.dtype),f=n.data.get(d.dataId).values;for(let y=0;yA[0]+r.shape[x]+A[1]),l=s.map(A=>A[0]),u=s.map((A,x)=>A[0]+r.shape[x]),d=i==="reflect"?0:1,p=n.data.get(r.dataId).values,c=r.shape.length,h=k.computeStrides(r.shape),m=k.sizeFromShape(o),f=o.length,g=k.computeStrides(o),y=k.getTypedArrayFromDType(r.dtype,m);for(let A=0;A=u[b]&&(x[b]=(u[b]-1)*2-x[b]+d);x=x.map((b,w)=>b-l[w]);let v=k.locToIndex(x,c,h);y[A]=p[v]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}var lP={kernelName:Hs,backendName:"cpu",kernelFunc:oP},uP=Ot((e,t)=>{let n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),dP=Yt(Ho,uP),pP={kernelName:Ho,backendName:"cpu",kernelFunc:dP},cP=gs(N5());function lv(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=r.shape.length,o=s;if(o===-1&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);let l=k.parseAxisParam([o],r.shape),u=ov({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),d=F.expandShapeToKeepDim(u.shape,l),p=gt({inputs:{x:u},backend:n,attrs:{shape:d}}),c=Sg({inputs:{a:r,b:p},backend:n}),h=x7({inputs:{x:c},backend:n}),m=Sd({inputs:{x:h},backend:n,attrs:{axis:l,keepDims:!1}}),f=gt({inputs:{x:m},backend:n,attrs:{shape:d}}),g=Cg({inputs:{a:h,b:f},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),g}var hP={kernelName:oi,backendName:"cpu",kernelFunc:lv};function fP(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a;we(r,"multinomial");let l=o?r:lv({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],d=l.shape[1],p=n.data.get(l.dataId).values,c=[u,s],h=k.makeZerosTypedArray(k.sizeFromShape(c),"int32");for(let m=0;m=0&&d[p]{k.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),k.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let p=$h({inputs:{input:d},backend:n,attrs:{dim:r}});return o.push(p),p}),u=Bl({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(d=>n.disposeIntermediateTensorInfo(d)),u}var EP={kernelName:Jo,backendName:"cpu",kernelFunc:dv};function RP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a;we(r,"pad");let o=s.map((y,A)=>y[0]+r.shape[A]+y[1]),l=s.map(y=>y[0]),u=n.data.get(r.dataId).values,d=k.sizeFromShape(r.shape),p=r.shape.length,c=k.computeStrides(r.shape),h=k.sizeFromShape(o),m=o.length,f=k.computeStrides(o),g=k.getTypedArrayFromDType(r.dtype,h);i!==0&&g.fill(i);for(let y=0;yv+l[b]),x=k.locToIndex(A,m,f);g[x]=u[y]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}var pv={kernelName:Xs,backendName:"cpu",kernelFunc:RP},MP=Ot((e,t)=>Math.pow(e,t)),FP=Yt(Ks,MP),$P={kernelName:Ks,backendName:"cpu",kernelFunc:FP};function DP(e){let{backend:t,attrs:n}=e,{start:a,stop:r,dtype:s,step:i}=n,o=kg(a,r,i,s);return t.makeTensorInfo([o.length],s,o)}var OP={kernelName:ju,backendName:"cpu",kernelFunc:DP},zP=rt(el,e=>1/e),_P={kernelName:el,backendName:"cpu",kernelFunc:zP};function PP(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a;we(r,"resizeBilinear");let l=k.computeStrides(r.shape),[u,d]=o,[p,c,h,m]=r.shape,f=n.data.get(r.dataId).values,g=new Float32Array(k.sizeFromShape([p,u,d,m])),y=[s&&u>1?c-1:c,s&&d>1?h-1:h],A=[s&&u>1?u-1:u,s&&d>1?d-1:d],x=0,v=y[0]/A[0],b=y[1]/A[1];for(let w=0;w1?u-1:u,i&&h>1?d-1:d],g=[i&&c>1?c-1:c,i&&h>1?h-1:h],y=f[0]/g[0],A=f[1]/g[1],x=n.data.get(s.dataId).values,v=0;for(let b=0;b1?c-1:c,s&&d>1?h-1:h],A=[s&&u>1?u-1:u,s&&d>1?d-1:d],x=y[0]/A[0],v=y[1]/A[1],b=0;for(let w=0;w1?d-1:d,i&&m>1?p-1:p],A=[i&&h>1?h-1:h,i&&m>1?m-1:m],x=y[0]/A[0],v=y[1]/A[1],b=1/x,w=1/v,N=Math.ceil(b)*2+2,C=Math.ceil(w)*2+2;for(let E=0;E=h)continue;let Z=_+se*l[1],le=se*x,oe=Math.min(d-1,i?Math.round(le):Math.floor(le));if($===oe)for(let xe=0;xe=m)continue;let Ne=Z+fe*l[2],Te=fe*v,Oe=Math.min(p-1,i?Math.round(Te):Math.floor(Te));W===Oe&&(ne+=g[Ne+K])}}f[G+K]=ne}}}}return n.makeTensorInfo(r.shape,r.dtype,f)}var HP={kernelName:xc,backendName:"cpu",kernelFunc:UP};function GP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a;we(r,"reverse");let i=r.shape.length,o=k.parseAxisParam(s,r.shape);if(i===0)return Ya({inputs:{x:r},backend:n});let l=new Lt(r.shape,r.dtype),u=n.bufferSync(r);for(let d=0;dc[h]=r.shape[h]-1-c[h]),l.set(u.get(...c),...p)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}var qP={kernelName:ei,backendName:"cpu",kernelFunc:GP},XP={kernelName:ml,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,l=k.getTypedArrayFromDType(a.dtype,k.sizeFromShape(a.shape)),[u,d,p,c]=a.shape,[h,m]=F.getImageCenter(i,d,p),f=255,g=Math.sin(r),y=Math.cos(r),A=o.data.get(a.dataId).values;for(let x=0;x=0&&z=0&&O{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),ZP={kernelName:ti,backendName:"cpu",kernelFunc:KP};function cv(e,t,n,a,r,s,i,o,l,u){let d=[a/r,r],p=e.values,c=t.values;if(a===0)return Ve(n,t.dtype);let h=Ve(d,t.dtype);h.values.fill(l);for(let m=0;m=a/r)throw new Error(`Invalid indices: ${f} does not index into ${n}`);for(let y=0;y1||r.shape.length===1?1:k.sizeFromShape(r.shape.slice(1));for(let m=0;me>=0?nL*e:tL*(Math.exp(e)-1)),rL={kernelName:rl,backendName:"cpu",kernelFunc:aL},sL=rt(ol,e=>e<0?-1:e>0?1:0),iL={kernelName:ol,backendName:"cpu",kernelFunc:sL},oL=rt(ai,e=>Math.sin(e)),lL={kernelName:ai,backendName:"cpu",kernelFunc:oL},uL=rt(il,e=>Math.sinh(e)),dL={kernelName:il,backendName:"cpu",kernelFunc:uL},pL=11920928955078125e-23,hv=Math.log(pL)+2,cL=rt(ll,e=>{let t=e>-hv,n=eNumber(g)))),n.makeTensorInfo([f.length],a.dtype,new Int32Array(f))]}var gL={kernelName:vc,backendName:"cpu",kernelFunc:mL};function yL(e){let{inputs:t,backend:n}=e,{inputIndices:a,inputShape:r,newShape:s}=t;if(a.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape + ${i.shape}`);let o=n.data.get(a.dataId).values,l=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,d=n.data.get(i.dataId).values[0],[p,c,h,m,f]=_7(o,a.shape,a.dtype,l,r.dtype,u,d);return[n.makeTensorInfo(c,a.dtype,p),n.makeTensorInfo([c[0]],r.dtype,h),n.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(g=>Number(g)))),n.makeTensorInfo([f.length],a.dtype,new Int32Array(f))]}var yL={kernelName:vc,backendName:"cpu",kernelFunc:gL};function AL(e){let{inputs:t,backend:n}=e,{inputIndices:a,inputShape:r,newShape:s}=t;if(a.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${a.shape}`);if(r.shape.length!==1)throw new Error(`Input shape should be a vector but received shape - ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.data.get(r.dataId).values),o=n.data.get(a.dataId).values,u=Array.from(n.data.get(s.dataId).values),[l,d,p]=_7(o,a.shape,a.dtype,i,u);return[n.makeTensorInfo(d,a.dtype,l),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}var AL={kernelName:wc,backendName:"cpu",kernelFunc:yL};function xL(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.data.get(r.dataId).values),o=n.data.get(a.dataId).values,l=Array.from(n.data.get(s.dataId).values),[u,d,p]=P7(o,a.shape,a.dtype,i,l);return[n.makeTensorInfo(d,a.dtype,u),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}var xL={kernelName:wc,backendName:"cpu",kernelFunc:AL};function bL(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let i=n.data.get(a.dataId).values,o=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,[l,d]=Ig(i,a.shape,a.dtype,o,u,!0);return n.makeTensorInfo(d,a.dtype,l)}var bL={kernelName:kc,backendName:"cpu",kernelFunc:xL};function vL(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${s.shape}`);let i=n.data.get(a.dataId).values,o=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,d]=Ig(i,a.shape,a.dtype,o,l,!0);return n.makeTensorInfo(d,a.dtype,u)}var vL={kernelName:kc,backendName:"cpu",kernelFunc:bL};function wL(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let i=n.data.get(a.dataId).values,o=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,[l,d]=Ig(i,a.shape,a.dtype,o,u);return n.makeTensorInfo(d,a.dtype,l)}var wL={kernelName:Ic,backendName:"cpu",kernelFunc:vL};function kL(e){let{inputs:t,backend:n,attrs:a}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=a,{sliceRank:u,numUpdates:l,sliceSize:d,strides:p,outputSize:c}=F.calculateShapes(s,r,o),h=!1,m=n.bufferSync(r),f=n.bufferSync(s),g=n.data.get(i.dataId).values[0],y=pv(m,f,o,c,d,l,u,p,g,h);return n.makeTensorInfo(o,y.dtype,y.values)}var IL={kernelName:Sc,backendName:"cpu",kernelFunc:kL};function SL(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=k.parseAxisParam(i,r.shape)[0],u=F.prepareSplitSize(r,s,o),l=new Array(r.shape.length).fill(0),d=r.shape.slice();return u.map(p=>{let c=[...d];c[o]=p;let h=Di({inputs:{x:r},backend:n,attrs:{begin:l,size:c}});return l[o]+=p,h})}var NL={kernelName:ll,backendName:"cpu",kernelFunc:SL},TL=rt(si,e=>Math.sqrt(e)),CL={kernelName:si,backendName:"cpu",kernelFunc:TL},EL={kernelName:Gu,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:n}=e,a=t;we(n,"square");let r=a.data.get(n.dataId).values,s=new Float32Array(r.length);for(let i=0;i{let n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),ML={kernelName:Pr,backendName:"cpu",kernelFunc:RL};function FL(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:u,endMask:l,ellipsisMask:d,newAxisMask:p,shrinkAxisMask:c}=a;we(r,"stridedSlice");let{nonStrided:h,$begin:m,$strides:f,size:g,newShape:y,outShape:A}=fn.sliceInfo(r.shape,s,i,o,u,l,d,p,c),x=gt({inputs:{x:r},backend:n,attrs:{shape:y}}),v;if(h){let w=Di({inputs:{x},backend:n,attrs:{begin:m,size:g}});v=gt({inputs:{x:w},backend:n,attrs:{shape:A}}),n.disposeIntermediateTensorInfo(w)}else if(A.some(w=>w===0))v=n.makeTensorInfo(A,r.dtype,[]);else{let w=n.bufferSync(x),N=L7(A,w,f,m);v=n.makeTensorInfo(N.shape,N.dtype,N.values)}let b=gt({inputs:{x:v},backend:n,attrs:{shape:A}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),b}var $L={kernelName:ul,backendName:"cpu",kernelFunc:FL};function DL(e){let{inputs:t,backend:n,attrs:a}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:u,preserveShortSequences:l}=a,{data:d,dataSplits:p}=t,c=n.data.get(d.dataId).values,h=n.data.get(p.dataId).values,[m,f]=W7(c,h,r,s,i,o,u,l);return[n.makeTensorInfo([m.length],"string",m),n.makeTensorInfo(p.shape,"int32",f)]}var OL={kernelName:Nc,backendName:"cpu",kernelFunc:DL};function zL(e){let{inputs:t,backend:n,attrs:a}=e,{skipEmpty:r}=a,{input:s,delimiter:i}=t;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(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=n.data.get(s.dataId).values,u=n.data.get(i.dataId).values[0],[l,d,p]=B7(o,u,r),c=d.length;return[n.makeTensorInfo([c,2],"int32",l),n.makeTensorInfo([c],"string",d),n.makeTensorInfo([2],"int32",new Int32Array(p))]}var _L={kernelName:Tc,backendName:"cpu",kernelFunc:zL};function PL(e){let{inputs:t,backend:n,attrs:a}=e,{numBuckets:r}=a,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=n.data.get(s.dataId).values,o=V7(i,r);return n.makeTensorInfo(s.shape,"int32",o)}var LL={kernelName:Cc,backendName:"cpu",kernelFunc:PL},WL=rt(di,e=>Math.tan(e)),BL={kernelName:di,backendName:"cpu",kernelFunc:WL},VL=rt(pi,e=>Math.tanh(e)),jL={kernelName:pi,backendName:"cpu",kernelFunc:VL};function UL(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reps:s}=a;we(r,"tile");let i=U7(n.bufferSync(r),s);return n.makeTensorInfo(i.shape,i.dtype,i.values)}var HL={kernelName:_r,backendName:"cpu",kernelFunc:UL};function GL(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a;we(r,"topk");let o=n.data.get(r.dataId).values,[u,l]=H7(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(u.shape,u.dtype,u.values),n.makeTensorInfo(l.shape,l.dtype,l.values)]}var qL={kernelName:dl,backendName:"cpu",kernelFunc:GL};function XL(e){let{inputs:t,attrs:n,backend:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:u,outputShape:l}=n,[d,p,c,h]=r.shape,[m,f]=l!=null?l:[p,c],g=[d,m,f,h],y=k.computeStrides(r.shape),A=y[0],x=y[1],v=y[2],b=k.getTypedArrayFromDType(r.dtype,k.sizeFromShape(g));b.fill(u);let w=a.data.get(r.dataId).values,N=a.data.get(s.dataId).values;for(let C=0;Ct-1)if(t<=1)n=0;else{let a=2*t;n-=a*Math.trunc(n/a),n>=t&&(n=a-n-1)}return k.clamp(0,n,t-1)}function YL(e,t){let n=e;if(n<0)if(t<=1)n=0;else{let a=t-1;n+=t*(Math.trunc(-n/a)+1)}else if(n>t-1)if(t<=1)n=0;else{let a=t-1;n-=t*Math.trunc(n/a)}return k.clamp(0,n,t-1)}function JL(e,t){return e}function QL(e,t){return k.clamp(0,e,t-1)}function Nd(e,t,n,a,r,s,i,o,u,l,d){let p=i*a+o*r+u*s+l;return 0<=o&&on.disposeIntermediateTensorInfo(m)),h}var oW={kernelName:qu,backendName:"cpu",kernelFunc:iW},lW=[mO,cD,yO,xO,AD,vO,kO,SO,TO,EO,MO,$O,OO,PO,WO,jO,HO,qO,KO,hO,YO,QO,tz,gD,bD,az,hD,sz,oz,dz,cz,lz,gz,Az,fz,bz,wz,Iz,Nz,Cz,Rz,Mz,$z,Oz,_z,Pz,Wz,Lz,Eg,jz,sO,Hz,vD,Qz,wD,e_,ID,i_,o_,u_,ND,c_,f_,g_,A_,b_,CD,RD,fD,w_,iz,I_,N_,C_,iO,FD,DD,R_,zD,F_,O_,__,W_,V_,U_,PD,q_,K_,Y_,Q_,tP,H_,aP,sP,WD,oP,dP,fP,VD,UD,yP,bP,kP,GD,SP,TP,CP,dv,FP,lO,KD,DP,mD,zP,uO,dO,cO,PP,WP,VP,UP,GP,qP,KP,YD,YP,QP,aL,pO,sL,oL,uL,JD,cP,cL,fL,gL,AL,bL,wL,IL,NL,CL,EL,eO,ML,$L,OL,_L,LL,rO,Bz,BL,jL,HL,qL,qD,KL,aW,sW,oW,NP];for(let e of lW)gi(e);var fv={};Fe(fv,{assertNotComplex:()=>Vl,bindCanvasToFramebuffer:()=>bW,bindColorTextureToFramebuffer:()=>_h,bindTextureToProgramUniformSampler:()=>Ev,bindTextureUnit:()=>Nv,bindVertexBufferToProgramAttribute:()=>Dg,callAndCheck:()=>be,canBeRepresented:()=>mv,createFragmentShader:()=>Av,createFramebuffer:()=>Sv,createProgram:()=>xv,createStaticIndexBuffer:()=>wv,createStaticVertexBuffer:()=>vv,createTexture:()=>kv,createVertexShader:()=>yv,getBatchDim:()=>zi,getExtensionOrThrow:()=>Rd,getFramebufferErrorMessage:()=>Rv,getMaxTexturesInShader:()=>Dv,getNumChannels:()=>AW,getProgramUniformLocation:()=>Cv,getProgramUniformLocationOrThrow:()=>Tv,getRowsCols:()=>_i,getShapeAs3D:()=>Ph,getTextureShapeFromLogicalShape:()=>Fv,getWebGLDisjointQueryTimerVersion:()=>Ov,getWebGLErrorMessage:()=>gv,getWebGLMaxTextureSize:()=>$v,hasExtension:()=>pa,isCapableOfRenderingToFloatTexture:()=>zv,isDownloadFloatTextureEnabled:()=>_v,isReshapeFree:()=>Fd,isWebGLFenceEnabled:()=>Pv,isWebGLVersionEnabled:()=>zg,linkProgram:()=>bv,resetMaxTextureSize:()=>vW,resetMaxTexturesInShader:()=>wW,unbindColorTextureFromFramebuffer:()=>Og,unbindTextureUnit:()=>xW,validateFramebuffer:()=>Md,validateProgram:()=>zh,validateTextureSize:()=>Iv});var Oi={},Fg={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function Oh(e,t){Oi[e]=t}function Ja(e){if(!(e in Oi)){let n=dW(e);if(n!==null)Oi[e]=n;else return console.log("Could not get context for WebGL version",e),null}let t=Oi[e];return t.isContextLost()?(delete Oi[e],Ja(e)):(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),Oi[e])}function uW(e){if(typeof OffscreenCanvas!="undefined"&&e===2)return new OffscreenCanvas(300,150);if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function dW(e){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=uW(e);return t.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete Oi[e]},!1),e===1?t.getContext("webgl",Fg)||t.getContext("experimental-webgl",Fg):t.getContext("webgl2",Fg)}var Td;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(Td||(Td={}));var da;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(da||(da={}));var rn;(function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(rn||(rn={}));function Cd(e,t){return[t,e]}function pW(e,t){return e*t}function Ed(e){let t=k.sizeFromShape(e),n=Math.ceil(t/4);return k.sizeToSquarishShape(n)}function Bl(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function cW(e,t){let[n,a]=Bl(e,t);return n*a*4}function $g(e,t){let n=e,a,r,s,i,o,u,l,d,p,c;return te().getNumber("WEBGL_VERSION")===2?(a=n.R32F,r=n.R16F,s=n.RGBA16F,i=n.RGBA32F,o=n.RED,l=4,d=1,p=n.HALF_FLOAT,c=n.FLOAT):(a=e.RGBA,r=e.RGBA,s=e.RGBA,i=n.RGBA,o=e.RGBA,l=4,d=4,p=t!=null?t.HALF_FLOAT_OES:null,c=e.FLOAT),u=e.RGBA,{internalFormatFloat:a,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:u,downloadUnpackNumChannels:l,defaultNumChannels:d,textureTypeHalfFloat:p,textureTypeFloat:c}}function be(e,t){let n=t();return te().getBool("DEBUG")&&hW(e),n}function hW(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+gv(e,t))}var fW=596e-10,mW=65504;function mv(e){return!!(te().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||fWe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function yv(e,t){let n=br(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(be(e,()=>e.shaderSource(n,t)),be(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function Av(e,t){let n=br(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(be(e,()=>e.shaderSource(n,t)),be(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw yW(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var gW=/ERROR: [0-9]+:([0-9]+):/g;function yW(e,t){let n=gW.exec(t);if(n==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let a=+n[1],r=e.split(` -`),s=r.length.toString().length+2,i=r.map((p,c)=>k.rightPad((c+1).toString(),s)+p),o=0;for(let p=0;p{let c=[...d];c[o]=p;let h=Di({inputs:{x:r},backend:n,attrs:{begin:u,size:c}});return u[o]+=p,h})}var TL={kernelName:ul,backendName:"cpu",kernelFunc:NL},CL=rt(si,e=>Math.sqrt(e)),EL={kernelName:si,backendName:"cpu",kernelFunc:CL},RL={kernelName:Gu,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:n}=e,a=t;we(n,"square");let r=a.data.get(n.dataId).values,s=new Float32Array(r.length);for(let i=0;i{let n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),FL={kernelName:Pr,backendName:"cpu",kernelFunc:ML};function $L(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:p,shrinkAxisMask:c}=a;we(r,"stridedSlice");let{nonStrided:h,$begin:m,$strides:f,size:g,newShape:y,outShape:A}=fn.sliceInfo(r.shape,s,i,o,l,u,d,p,c),x=gt({inputs:{x:r},backend:n,attrs:{shape:y}}),v;if(h){let w=Di({inputs:{x},backend:n,attrs:{begin:m,size:g}});v=gt({inputs:{x:w},backend:n,attrs:{shape:A}}),n.disposeIntermediateTensorInfo(w)}else if(A.some(w=>w===0))v=n.makeTensorInfo(A,r.dtype,[]);else{let w=n.bufferSync(x),N=W7(A,w,f,m);v=n.makeTensorInfo(N.shape,N.dtype,N.values)}let b=gt({inputs:{x:v},backend:n,attrs:{shape:A}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),b}var DL={kernelName:dl,backendName:"cpu",kernelFunc:$L};function OL(e){let{inputs:t,backend:n,attrs:a}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=a,{data:d,dataSplits:p}=t,c=n.data.get(d.dataId).values,h=n.data.get(p.dataId).values,[m,f]=B7(c,h,r,s,i,o,l,u);return[n.makeTensorInfo([m.length],"string",m),n.makeTensorInfo(p.shape,"int32",f)]}var zL={kernelName:Nc,backendName:"cpu",kernelFunc:OL};function _L(e){let{inputs:t,backend:n,attrs:a}=e,{skipEmpty:r}=a,{input:s,delimiter:i}=t;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(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=n.data.get(s.dataId).values,l=n.data.get(i.dataId).values[0],[u,d,p]=V7(o,l,r),c=d.length;return[n.makeTensorInfo([c,2],"int32",u),n.makeTensorInfo([c],"string",d),n.makeTensorInfo([2],"int32",new Int32Array(p))]}var PL={kernelName:Tc,backendName:"cpu",kernelFunc:_L};function LL(e){let{inputs:t,backend:n,attrs:a}=e,{numBuckets:r}=a,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=n.data.get(s.dataId).values,o=j7(i,r);return n.makeTensorInfo(s.shape,"int32",o)}var WL={kernelName:Cc,backendName:"cpu",kernelFunc:LL},BL=rt(di,e=>Math.tan(e)),VL={kernelName:di,backendName:"cpu",kernelFunc:BL},jL=rt(pi,e=>Math.tanh(e)),UL={kernelName:pi,backendName:"cpu",kernelFunc:jL};function HL(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reps:s}=a;we(r,"tile");let i=H7(n.bufferSync(r),s);return n.makeTensorInfo(i.shape,i.dtype,i.values)}var GL={kernelName:_r,backendName:"cpu",kernelFunc:HL};function qL(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a;we(r,"topk");let o=n.data.get(r.dataId).values,[l,u]=G7(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(u.shape,u.dtype,u.values)]}var XL={kernelName:pl,backendName:"cpu",kernelFunc:qL};function KL(e){let{inputs:t,attrs:n,backend:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[d,p,c,h]=r.shape,[m,f]=u!=null?u:[p,c],g=[d,m,f,h],y=k.computeStrides(r.shape),A=y[0],x=y[1],v=y[2],b=k.getTypedArrayFromDType(r.dtype,k.sizeFromShape(g));b.fill(l);let w=a.data.get(r.dataId).values,N=a.data.get(s.dataId).values;for(let C=0;Ct-1)if(t<=1)n=0;else{let a=2*t;n-=a*Math.trunc(n/a),n>=t&&(n=a-n-1)}return k.clamp(0,n,t-1)}function JL(e,t){let n=e;if(n<0)if(t<=1)n=0;else{let a=t-1;n+=t*(Math.trunc(-n/a)+1)}else if(n>t-1)if(t<=1)n=0;else{let a=t-1;n-=t*Math.trunc(n/a)}return k.clamp(0,n,t-1)}function QL(e,t){return e}function eW(e,t){return k.clamp(0,e,t-1)}function Nd(e,t,n,a,r,s,i,o,l,u,d){let p=i*a+o*r+l*s+u;return 0<=o&&on.disposeIntermediateTensorInfo(m)),h}var lW={kernelName:qu,backendName:"cpu",kernelFunc:oW},uW=[gO,hD,AO,bO,xD,wO,IO,NO,CO,RO,FO,DO,zO,LO,BO,UO,GO,XO,ZO,fO,JO,ez,nz,yD,vD,rz,fD,iz,lz,pz,hz,uz,yz,xz,mz,vz,kz,Sz,Tz,Ez,Mz,Fz,Dz,zz,Pz,Lz,Bz,Wz,Eg,Uz,iO,Gz,wD,e_,kD,t_,SD,o_,l_,d_,TD,h_,m_,y_,x_,v_,ED,MD,mD,k_,oz,S_,T_,E_,oO,$D,OD,M_,_D,$_,z_,P_,B_,j_,H_,LD,X_,Z_,J_,eP,nP,G_,rP,iP,BD,lP,pP,mP,jD,HD,AP,vP,IP,qD,NP,CP,EP,pv,$P,uO,ZD,OP,gD,_P,dO,pO,hO,LP,BP,jP,HP,qP,XP,ZP,JD,JP,eL,rL,cO,iL,lL,dL,QD,hP,hL,mL,yL,xL,vL,kL,SL,TL,EL,RL,tO,FL,DL,zL,PL,WL,sO,Vz,VL,UL,GL,XL,XD,ZL,rW,iW,lW,TP];for(let e of uW)gi(e);var mv={};Fe(mv,{assertNotComplex:()=>jl,bindCanvasToFramebuffer:()=>vW,bindColorTextureToFramebuffer:()=>_h,bindTextureToProgramUniformSampler:()=>Rv,bindTextureUnit:()=>Tv,bindVertexBufferToProgramAttribute:()=>Dg,callAndCheck:()=>be,canBeRepresented:()=>gv,createFragmentShader:()=>xv,createFramebuffer:()=>Nv,createProgram:()=>bv,createStaticIndexBuffer:()=>kv,createStaticVertexBuffer:()=>wv,createTexture:()=>Iv,createVertexShader:()=>Av,getBatchDim:()=>zi,getExtensionOrThrow:()=>Rd,getFramebufferErrorMessage:()=>Mv,getMaxTexturesInShader:()=>Ov,getNumChannels:()=>xW,getProgramUniformLocation:()=>Ev,getProgramUniformLocationOrThrow:()=>Cv,getRowsCols:()=>_i,getShapeAs3D:()=>Ph,getTextureShapeFromLogicalShape:()=>$v,getWebGLDisjointQueryTimerVersion:()=>zv,getWebGLErrorMessage:()=>yv,getWebGLMaxTextureSize:()=>Dv,hasExtension:()=>pa,isCapableOfRenderingToFloatTexture:()=>_v,isDownloadFloatTextureEnabled:()=>Pv,isReshapeFree:()=>Fd,isWebGLFenceEnabled:()=>Lv,isWebGLVersionEnabled:()=>zg,linkProgram:()=>vv,resetMaxTextureSize:()=>wW,resetMaxTexturesInShader:()=>kW,unbindColorTextureFromFramebuffer:()=>Og,unbindTextureUnit:()=>bW,validateFramebuffer:()=>Md,validateProgram:()=>zh,validateTextureSize:()=>Sv});var Oi={},Fg={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function Oh(e,t){Oi[e]=t}function Ja(e){if(!(e in Oi)){let n=pW(e);if(n!==null)Oi[e]=n;else return console.log("Could not get context for WebGL version",e),null}let t=Oi[e];return t.isContextLost()?(delete Oi[e],Ja(e)):(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),Oi[e])}function dW(e){if(typeof OffscreenCanvas!="undefined"&&e===2)return new OffscreenCanvas(300,150);if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function pW(e){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=dW(e);return t.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete Oi[e]},!1),e===1?t.getContext("webgl",Fg)||t.getContext("experimental-webgl",Fg):t.getContext("webgl2",Fg)}var Td;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(Td||(Td={}));var da;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(da||(da={}));var rn;(function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(rn||(rn={}));function Cd(e,t){return[t,e]}function cW(e,t){return e*t}function Ed(e){let t=k.sizeFromShape(e),n=Math.ceil(t/4);return k.sizeToSquarishShape(n)}function Vl(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function hW(e,t){let[n,a]=Vl(e,t);return n*a*4}function $g(e,t){let n=e,a,r,s,i,o,l,u,d,p,c;return te().getNumber("WEBGL_VERSION")===2?(a=n.R32F,r=n.R16F,s=n.RGBA16F,i=n.RGBA32F,o=n.RED,u=4,d=1,p=n.HALF_FLOAT,c=n.FLOAT):(a=e.RGBA,r=e.RGBA,s=e.RGBA,i=n.RGBA,o=e.RGBA,u=4,d=4,p=t!=null?t.HALF_FLOAT_OES:null,c=e.FLOAT),l=e.RGBA,{internalFormatFloat:a,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:d,textureTypeHalfFloat:p,textureTypeFloat:c}}function be(e,t){let n=t();return te().getBool("DEBUG")&&fW(e),n}function fW(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+yv(e,t))}var mW=596e-10,gW=65504;function gv(e){return!!(te().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||mWe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function Av(e,t){let n=br(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(be(e,()=>e.shaderSource(n,t)),be(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function xv(e,t){let n=br(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(be(e,()=>e.shaderSource(n,t)),be(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw AW(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var yW=/ERROR: [0-9]+:([0-9]+):/g;function AW(e,t){let n=yW.exec(t);if(n==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let a=+n[1],r=e.split(` +`),s=r.length.toString().length+2,i=r.map((p,c)=>k.rightPad((c+1).toString(),s)+p),o=0;for(let p=0;pe.createProgram(),"Unable to create WebGLProgram.")}function bv(e,t){if(be(e,()=>e.linkProgram(t)),e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function zh(e,t){if(be(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function vv(e,t){let n=br(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),be(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function wv(e,t){let n=br(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return be(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),be(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function AW(){return te().getNumber("WEBGL_VERSION")===2?1:4}function kv(e){return br(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Iv(e,t){let n=te().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let a=`[${e}x${t}]`;throw new Error("Requested texture size "+a+" is invalid.")}if(e>n||t>n){let a=`[${e}x${t}]`,r=`[${n}x${n}]`;throw new Error("Requested texture size "+a+" greater than WebGL maximum on this browser / GPU "+r+".")}}function Sv(e){return br(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function Dg(e,t,n,a,r,s,i){let o=e.getAttribLocation(t,n);return o===-1?!1:(be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),be(e,()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,s,i)),be(e,()=>e.enableVertexAttribArray(o)),!0)}function Nv(e,t,n){Mv(e,n),be(e,()=>e.activeTexture(e.TEXTURE0+n)),be(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function xW(e,t){Mv(e,t),be(e,()=>e.activeTexture(e.TEXTURE0+t)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Tv(e,t,n){return br(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function Cv(e,t,n){return e.getUniformLocation(t,n)}function Ev(e,t,n,a){be(e,()=>Nv(e,t,a)),be(e,()=>e.uniform1i(n,a))}function bW(e){be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),be(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),be(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function _h(e,t,n){be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),be(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function Og(e,t){be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),be(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function Md(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Rv(e,t))}function Rv(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function br(e,t,n){let a=be(e,()=>t());if(a==null)throw new Error(n);return a}function Mv(e,t){let n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,a=t+e.TEXTURE0;if(an){let r=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${r}.`)}}function zi(e,t=2){return k.sizeFromShape(e.slice(0,e.length-t))}function _i(e){if(e.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function Ph(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[zi(e),..._i(e)]),t}function Fv(e,t=!1){let n=te().getNumber("WEBGL_MAX_TEXTURE_SIZE");t&&(n=n*2,e=e.map((r,s)=>s>=e.length-2?k.nearestLargerEven(e[s]):e[s]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=k.squeezeShape(e).newShape);let a=k.sizeFromShape(e);if(e.length<=1&&a<=n)return[1,a];if(e.length===2&&e[0]<=n&&e[1]<=n)return e;if(e.length===3&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(e.length===3&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(e.length===4&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(e.length===4&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){let r=zi(e),s=2,i=2;return e.length&&([s,i]=_i(e)),a=r*(s/2)*(i/2),k.sizeToSquarishShape(a).map(o=>o*2)}return k.sizeToSquarishShape(a)}function Lh(e){return e%2==0}function Fd(e,t){if(e=e.slice(-2),t=t.slice(-2),k.arraysEqual(e,t)||!e.length||!t.length||e[0]===0||e[1]===0||t[0]===0||t[1]===0)return!0;if(e.length!==t.length){let n=e.slice(-1)[0],a=t.slice(-1)[0];if(n===a||Lh(n)&&Lh(a)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&Lh(e[0])&&Lh(t[0])}var Wh,Bh;function $v(e){if(Wh==null){let t=Ja(e);Wh=t.getParameter(t.MAX_TEXTURE_SIZE)}return Wh}function vW(){Wh=null}function wW(){Bh=null}function Dv(e){if(Bh==null){let t=Ja(e);Bh=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,Bh)}function Ov(e){if(e===0)return 0;let t,n=Ja(e);return pa(n,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:pa(n,"EXT_disjoint_timer_query")?t=1:t=0,t}function pa(e,t){return e.getExtension(t)!=null}function zg(e){try{if(Ja(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function zv(e){if(e===0)return!1;let t=Ja(e);if(e===1){if(!pa(t,"OES_texture_float"))return!1}else if(!pa(t,"EXT_color_buffer_float"))return!1;return _g(t)}function _v(e){if(e===0)return!1;let t=Ja(e);if(e===1){if(!pa(t,"OES_texture_float")||!pa(t,"WEBGL_color_buffer_float"))return!1}else{if(pa(t,"EXT_color_buffer_float"))return _g(t);let n="EXT_color_buffer_half_float";if(pa(t,n)){let a=t.getExtension(n);return kW(t,a)}return!1}return _g(t)}function _g(e){let t=$g(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let a=1,r=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,a,r,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),i}function kW(e,t){let n=$g(e,t),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);let r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(a),e.deleteFramebuffer(i),o}function Pv(e){return e!==2?!1:Ja(e).fenceSync!=null}function Vl(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&k.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Me=te();Me.registerFlag("HAS_WEBGL",()=>Me.getNumber("WEBGL_VERSION")>0);Me.registerFlag("WEBGL_VERSION",()=>zg(2)?2:zg(1)?1:0);Me.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Me.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Me.get("WEBGL_VERSION")===2);Me.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Me.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Me.registerFlag("WEBGL_PACK",()=>Me.getBool("HAS_WEBGL"));Me.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_CLIP",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_REDUCE",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_LAZILY_UNPACK",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_CONV_IM2COL",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>$v(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>Dv(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Me.getNumber("WEBGL_VERSION");return e===0?0:Ov(e)});Me.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Me.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!ad.isMobile());Me.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>zv(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Me.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Me.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Me.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>_v(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_FENCE_API_ENABLED",()=>Pv(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Me.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Me.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)});Me.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>ad.isMobile()&&Me.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)});Me.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);function An(){let e,t,n,a,r,s,i,o,u,l;return te().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",n="out",a="in",r="texture",s="outputColor",i="out vec4 outputColor;",o=` +`)[0]),console.log(`%c ${k.rightPad(u[0],o)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(d.join(` +`))}function bv(e){return br(e,()=>e.createProgram(),"Unable to create WebGLProgram.")}function vv(e,t){if(be(e,()=>e.linkProgram(t)),e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function zh(e,t){if(be(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function wv(e,t){let n=br(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),be(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function kv(e,t){let n=br(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return be(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),be(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function xW(){return te().getNumber("WEBGL_VERSION")===2?1:4}function Iv(e){return br(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Sv(e,t){let n=te().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let a=`[${e}x${t}]`;throw new Error("Requested texture size "+a+" is invalid.")}if(e>n||t>n){let a=`[${e}x${t}]`,r=`[${n}x${n}]`;throw new Error("Requested texture size "+a+" greater than WebGL maximum on this browser / GPU "+r+".")}}function Nv(e){return br(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function Dg(e,t,n,a,r,s,i){let o=e.getAttribLocation(t,n);return o===-1?!1:(be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),be(e,()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,s,i)),be(e,()=>e.enableVertexAttribArray(o)),!0)}function Tv(e,t,n){Fv(e,n),be(e,()=>e.activeTexture(e.TEXTURE0+n)),be(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function bW(e,t){Fv(e,t),be(e,()=>e.activeTexture(e.TEXTURE0+t)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Cv(e,t,n){return br(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function Ev(e,t,n){return e.getUniformLocation(t,n)}function Rv(e,t,n,a){be(e,()=>Tv(e,t,a)),be(e,()=>e.uniform1i(n,a))}function vW(e){be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),be(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),be(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function _h(e,t,n){be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),be(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function Og(e,t){be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),be(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function Md(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Mv(e,t))}function Mv(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function br(e,t,n){let a=be(e,()=>t());if(a==null)throw new Error(n);return a}function Fv(e,t){let n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,a=t+e.TEXTURE0;if(an){let r=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${r}.`)}}function zi(e,t=2){return k.sizeFromShape(e.slice(0,e.length-t))}function _i(e){if(e.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function Ph(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[zi(e),..._i(e)]),t}function $v(e,t=!1){let n=te().getNumber("WEBGL_MAX_TEXTURE_SIZE");t&&(n=n*2,e=e.map((r,s)=>s>=e.length-2?k.nearestLargerEven(e[s]):e[s]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=k.squeezeShape(e).newShape);let a=k.sizeFromShape(e);if(e.length<=1&&a<=n)return[1,a];if(e.length===2&&e[0]<=n&&e[1]<=n)return e;if(e.length===3&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(e.length===3&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(e.length===4&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(e.length===4&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){let r=zi(e),s=2,i=2;return e.length&&([s,i]=_i(e)),a=r*(s/2)*(i/2),k.sizeToSquarishShape(a).map(o=>o*2)}return k.sizeToSquarishShape(a)}function Lh(e){return e%2==0}function Fd(e,t){if(e=e.slice(-2),t=t.slice(-2),k.arraysEqual(e,t)||!e.length||!t.length||e[0]===0||e[1]===0||t[0]===0||t[1]===0)return!0;if(e.length!==t.length){let n=e.slice(-1)[0],a=t.slice(-1)[0];if(n===a||Lh(n)&&Lh(a)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&Lh(e[0])&&Lh(t[0])}var Wh,Bh;function Dv(e){if(Wh==null){let t=Ja(e);Wh=t.getParameter(t.MAX_TEXTURE_SIZE)}return Wh}function wW(){Wh=null}function kW(){Bh=null}function Ov(e){if(Bh==null){let t=Ja(e);Bh=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,Bh)}function zv(e){if(e===0)return 0;let t,n=Ja(e);return pa(n,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:pa(n,"EXT_disjoint_timer_query")?t=1:t=0,t}function pa(e,t){return e.getExtension(t)!=null}function zg(e){try{if(Ja(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function _v(e){if(e===0)return!1;let t=Ja(e);if(e===1){if(!pa(t,"OES_texture_float"))return!1}else if(!pa(t,"EXT_color_buffer_float"))return!1;return _g(t)}function Pv(e){if(e===0)return!1;let t=Ja(e);if(e===1){if(!pa(t,"OES_texture_float")||!pa(t,"WEBGL_color_buffer_float"))return!1}else{if(pa(t,"EXT_color_buffer_float"))return _g(t);let n="EXT_color_buffer_half_float";if(pa(t,n)){let a=t.getExtension(n);return IW(t,a)}return!1}return _g(t)}function _g(e){let t=$g(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let a=1,r=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,a,r,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),i}function IW(e,t){let n=$g(e,t),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);let r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(a),e.deleteFramebuffer(i),o}function Lv(e){return e!==2?!1:Ja(e).fenceSync!=null}function jl(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&k.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Me=te();Me.registerFlag("HAS_WEBGL",()=>Me.getNumber("WEBGL_VERSION")>0);Me.registerFlag("WEBGL_VERSION",()=>zg(2)?2:zg(1)?1:0);Me.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Me.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Me.get("WEBGL_VERSION")===2);Me.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Me.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Me.registerFlag("WEBGL_PACK",()=>Me.getBool("HAS_WEBGL"));Me.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_CLIP",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_PACK_REDUCE",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_LAZILY_UNPACK",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_CONV_IM2COL",()=>Me.getBool("WEBGL_PACK"));Me.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>Dv(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>Ov(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Me.getNumber("WEBGL_VERSION");return e===0?0:zv(e)});Me.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Me.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!ad.isMobile());Me.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>_v(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Me.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Me.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Me.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>Pv(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_FENCE_API_ENABLED",()=>Lv(Me.getNumber("WEBGL_VERSION")));Me.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Me.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Me.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)});Me.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>ad.isMobile()&&Me.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)});Me.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);function An(){let e,t,n,a,r,s,i,o,l,u;return te().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",n="out",a="in",r="texture",s="outputColor",i="out vec4 outputColor;",o=` bool isnan_custom(float val) { return (val > 0.0 || val < 0.0) ? false : val != 0.0; } @@ -58,7 +57,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee } #define isnan(value) isnan_custom(value) - `,u="",l=` + `,l="",u=` #define round(value) newRound(value) int newRound(float value) { return int(floor(value + 0.5)); @@ -75,7 +74,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee bvec4 isnan_custom(vec4 val) { return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w)); } - `,u=` + `,l=` uniform float INFINITY; bool isinf(float val) { @@ -84,7 +83,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee bvec4 isinf(vec4 val) { return equal(abs(val), vec4(INFINITY)); } - `,l=` + `,u=` int round(float value) { return int(floor(value + 0.5)); } @@ -92,11 +91,11 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `),{version:e,attribute:t,varyingVs:n,varyingFs:a,texture2D:r,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:u,defineRound:l}}function Pi(e,t,n="index"){let a=k.computeStrides(t);return a.map((r,s)=>{let i=`int ${e[s]} = ${n} / ${r}`,o=s===a.length-1?`int ${e[s+1]} = ${n} - ${e[s]} * ${r}`:`index -= ${e[s]} * ${r}`;return`${i}; ${o};`}).join("")}function Pg(e){let t=k.computeStrides(e).map(n=>n.toString());return` + `),{version:e,attribute:t,varyingVs:n,varyingFs:a,texture2D:r,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function Pi(e,t,n="index"){let a=k.computeStrides(t);return a.map((r,s)=>{let i=`int ${e[s]} = ${n} / ${r}`,o=s===a.length-1?`int ${e[s+1]} = ${n} - ${e[s]} * ${r}`:`index -= ${e[s]} * ${r}`;return`${i}; ${o};`}).join("")}function Pg(e){let t=k.computeStrides(e).map(n=>n.toString());return` int getFlatIndex(ivec3 coords) { return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z; } -`}var Lv=` +`}var Wv=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -135,7 +134,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee return c / 255.0; } -`,IW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=Td.DENSE;let t=Ed(e),n=An();this.outputShape=e,this.userCode=` +`,SW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=Td.DENSE;let t=Ed(e),n=An();this.outputShape=e,this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { ${Pi(["r","c","d"],e)} return ivec3(r, c, d); @@ -156,7 +155,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${n.output} = result; } - `}},SW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=Td.DENSE;let t=Ed(e),n=An();this.outputShape=e,this.userCode=` + `}},NW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=Td.DENSE;let t=Ed(e),n=An();this.outputShape=e,this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { ${Pi(["r","c","d"],e)} return ivec3(r, c, d); @@ -177,22 +176,22 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${n.output} = result; } - `}},NW=class{constructor(e){this.variableNames=["A"],this.outTexUsage=da.DOWNLOAD;let t=An();this.outputShape=e,this.userCode=` - ${Lv} + `}},TW=class{constructor(e){this.variableNames=["A"],this.outTexUsage=da.DOWNLOAD;let t=An();this.outputShape=e,this.userCode=` + ${Wv} void main() { float x = getAAtOutCoords(); ${t.output} = encode_float(x); } - `}},TW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=da.DOWNLOAD;let t=An();this.outputShape=e,this.userCode=` - ${Lv} + `}},CW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=da.DOWNLOAD;let t=An();this.outputShape=e,this.userCode=` + ${Wv} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); ${t.output} = encode_float(x); } - `}},CW=class{constructor(e,t,n=!1){this.variableNames=["A"];let a=An(),[r,s]=t;this.outputShape=e;let i="result";n&&(i="floor(result * 255. + 0.5)"),this.userCode=` + `}},EW=class{constructor(e,t,n=!1){this.variableNames=["A"];let a=An(),[r,s]=t;this.outputShape=e;let i="result";n&&(i="floor(result * 255. + 0.5)"),this.userCode=` ${Pg(e)} void main() { @@ -222,12 +221,12 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${a.output} = vec4(${i}, 0., 0., 0.); } - `}},EW=class{constructor(e,t,n=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let a=An(),[r,s]=t;this.outputShape=e;let i="",o="result";n&&(o="floor(result * 255. + 0.5)");for(let u=0;u<=1;u++)for(let l=0;l<=1;l++){let d=u*2+l;i+=` + `}},RW=class{constructor(e,t,n=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let a=An(),[r,s]=t;this.outputShape=e;let i="",o="result";n&&(o="floor(result * 255. + 0.5)");for(let l=0;l<=1;l++)for(let u=0;u<=1;u++){let d=l*2+u;i+=` localCoords = coords; - if(localCoords[2] + ${l} < ${e[2]}) { - localCoords[2] += ${l}; - if(localCoords[1] + ${u} < ${e[1]}) { - localCoords[1] += ${u}; + if(localCoords[2] + ${u} < ${e[2]}) { + localCoords[2] += ${u}; + if(localCoords[1] + ${l} < ${e[1]}) { + localCoords[1] += ${l}; flatIndex = getFlatIndex(localCoords); offset = imod(flatIndex, 4); @@ -266,7 +265,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${a.output} = ${o}; } - `}},Wv={};Fe(Wv,{bindVertexProgramAttributeStreams:()=>Kv,createBufferFromOutputTexture:()=>Jv,createFloat16MatrixTexture:()=>Hv,createFloat16PackedMatrixTexture:()=>Xv,createFloat32MatrixTexture:()=>Uv,createIndexBuffer:()=>jv,createPackedMatrixTexture:()=>qv,createUnsignedBytesMatrixTexture:()=>Gv,createVertexBuffer:()=>Vv,createVertexShader:()=>Bv,downloadByteEncodedFloatMatrixFromOutputTexture:()=>ew,downloadFloat32MatrixFromBuffer:()=>Qv,downloadMatrixFromPackedOutputTexture:()=>nw,downloadPackedMatrixFromBuffer:()=>tw,getInternalFormatForFloat16MatrixTexture:()=>Wg,getInternalFormatForFloat16PackedMatrixTexture:()=>jg,getInternalFormatForFloat32MatrixTexture:()=>Lg,getInternalFormatForPackedMatrixTexture:()=>Vg,getInternalFormatForUnsignedBytesMatrixTexture:()=>Bg,uploadDenseMatrixToTexture:()=>Zv,uploadPixelDataToTexture:()=>Yv});function Bv(e){let t=An(),n=`${t.version} + `}},Bv={};Fe(Bv,{bindVertexProgramAttributeStreams:()=>Zv,createBufferFromOutputTexture:()=>Qv,createFloat16MatrixTexture:()=>Gv,createFloat16PackedMatrixTexture:()=>Kv,createFloat32MatrixTexture:()=>Hv,createIndexBuffer:()=>Uv,createPackedMatrixTexture:()=>Xv,createUnsignedBytesMatrixTexture:()=>qv,createVertexBuffer:()=>jv,createVertexShader:()=>Vv,downloadByteEncodedFloatMatrixFromOutputTexture:()=>tw,downloadFloat32MatrixFromBuffer:()=>ew,downloadMatrixFromPackedOutputTexture:()=>aw,downloadPackedMatrixFromBuffer:()=>nw,getInternalFormatForFloat16MatrixTexture:()=>Wg,getInternalFormatForFloat16PackedMatrixTexture:()=>jg,getInternalFormatForFloat32MatrixTexture:()=>Lg,getInternalFormatForPackedMatrixTexture:()=>Vg,getInternalFormatForUnsignedBytesMatrixTexture:()=>Bg,uploadDenseMatrixToTexture:()=>Yv,uploadPixelDataToTexture:()=>Jv});function Vv(e){let t=An(),n=`${t.version} precision highp float; ${t.attribute} vec3 clipSpacePos; ${t.attribute} vec2 uv; @@ -275,22 +274,22 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; - }`;return yv(e,n)}function Vv(e){let t=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return vv(e,t)}function jv(e){let t=new Uint16Array([0,1,2,2,1,3]);return wv(e,t)}function $d(e,t,n,a,r,s){Iv(t,n);let i=kv(e),o=e.TEXTURE_2D;return be(e,()=>e.bindTexture(o,i)),be(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),be(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),be(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),be(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),be(e,()=>e.texImage2D(o,0,a,t,n,0,r,s,null)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null)),i}function Lg(e){return e.internalFormatFloat}function Uv(e,t,n,a){let[r,s]=Cd(t,n);return $d(e,r,s,Lg(a),a.textureFormatFloat,e.FLOAT)}function Wg(e){return e.internalFormatHalfFloat}function Hv(e,t,n,a){let[r,s]=Cd(t,n);return $d(e,r,s,Wg(a),a.textureFormatFloat,a.textureTypeHalfFloat)}function Bg(e){return e.downloadTextureFormat}function Gv(e,t,n,a){let[r,s]=Cd(t,n);return $d(e,r,s,Bg(a),e.RGBA,e.UNSIGNED_BYTE)}function Vg(e){return e.internalFormatPackedFloat}function qv(e,t,n,a){let[r,s]=Bl(t,n);return $d(e,r,s,Vg(a),e.RGBA,e.FLOAT)}function jg(e){return e.internalFormatPackedHalfFloat}function Xv(e,t,n,a){let[r,s]=Bl(t,n);return $d(e,r,s,jg(a),e.RGBA,a.textureTypeHalfFloat)}function Kv(e,t,n){let a=0,r=3*4,s=3*4+2*4;return be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),Dg(e,t,"clipSpacePos",n,3,s,a)&&Dg(e,t,"uv",n,2,s,r)}function Zv(e,t,n,a,r,s){be(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,u;r instanceof Uint8Array?(i=new Uint8Array(n*a*4),o=e.UNSIGNED_BYTE,u=e.RGBA):(i=new Float32Array(n*a*4),o=e.FLOAT,u=s.internalFormatPackedFloat),i.set(r),be(e,()=>e.texImage2D(e.TEXTURE_2D,0,u,n,a,0,e.RGBA,o,i)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Yv(e,t,n){be(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?be(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):be(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Jv(e,t,n,a){let r=e.createBuffer();be(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));let s=4*4*t*n;return be(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),be(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),be(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function Qv(e,t,n){let a=e,r=new Float32Array(n);return a.bindBuffer(a.PIXEL_PACK_BUFFER,t),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,r),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),r}function ew(e,t,n,a){let[r,s]=Cd(t,n),i=4,o=new Uint8Array(pW(t*n,i));return be(e,()=>e.readPixels(0,0,r,s,a.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function tw(e,t,n,a,r,s,i,o){let u=e,l=new Float32Array(cW(s,i));return u.bindBuffer(u.PIXEL_PACK_BUFFER,t),u.getBufferSubData(u.PIXEL_PACK_BUFFER,0,l),u.bindBuffer(u.PIXEL_PACK_BUFFER,null),l}function nw(e,t,n){let a=new Float32Array(t*n*4);return be(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,a)),a}var Vh=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];let t=te().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,Oh(t,e)):this.gl=Ja(t);let n="WEBGL_color_buffer_float",a="EXT_color_buffer_half_float";if(te().getNumber("WEBGL_VERSION")===1){let r="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=Rd(this.gl,r),pa(this.gl,s))this.textureHalfFloatExtension=Rd(this.gl,s);else if(te().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(n),pa(this.gl,a))this.colorBufferHalfFloatExtension=Rd(this.gl,a);else if(te().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(n="EXT_color_buffer_float",pa(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else if(pa(this.gl,a))this.colorBufferHalfFloatExtension=this.gl.getExtension(a);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=Vv(this.gl),this.indexBuffer=jv(this.gl),this.framebuffer=Sv(this.gl),this.textureConfig=$g(this.gl,this.textureHalfFloatExtension)}get debug(){return te().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.");let e=this.gl;be(e,()=>e.finish()),be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),be(e,()=>e.deleteFramebuffer(this.framebuffer)),be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),be(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),be(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),Uv(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),Hv(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),Gv(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),Yv(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,a){this.throwIfDisposed(),Zv(this.gl,e,t,n,a,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),Xv(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),qv(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(Og(this.gl,this.framebuffer),this.outputTexture=null),be(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>ew(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,a,r,s){return tw(this.gl,e,t,n,a,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return Qv(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);let a=Jv(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),a}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(te().getBool("WEBGL_FENCE_API_ENABLED")){let a=e,r=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{let s=a.clientWaitSync(r,0,0);return s===a.ALREADY_SIGNALED||s===a.CONDITION_SATISFIED},t=r}else te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>nw(this.gl,t,n))}createProgram(e){this.throwIfDisposed();let t=this.gl,n=Av(t,e);this.vertexShader==null&&(this.vertexShader=Bv(t));let a=xv(t);return be(t,()=>t.attachShader(a,this.vertexShader)),be(t,()=>t.attachShader(a,n)),bv(t,a),this.debug&&zh(t,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=Kv(t,this.program,this.vertexBuffer)),a}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&be(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&zh(this.gl,this.program),be(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?Tv(this.gl,e,t):Cv(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),be(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),Ev(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();let[a,r]=Bl(t,n);this.setOutputMatrixTextureDriver(e,a,r)}setOutputMatrixWriteRegion(e,t,n,a){this.setOutputMatrixWriteRegionDriver(n,e,a,t)}setOutputPackedMatrixWriteRegion(e,t,n,a){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&zh(this.gl,this.program),Md(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&this.debugValidate(),be(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),be(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=Rd(this.gl,te().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(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.createQuery();return n.beginQuery(a.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await k.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}else{let n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(a.GPU_DISJOINT_EXT)),r&&!this.disjoint}else{let n=this.getQueryTimerExtensionWebGL1(),a=n.getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),a&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=RW(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:n}=this.itemsToPoll[t];n()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),!(this.itemsToPoll.length>1)&&k.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),_h(this.gl,e,this.framebuffer),this.debug&&Md(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(_h(this.gl,this.outputTexture,this.framebuffer),this.debug&&Md(this.gl)):Og(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();let a=this.gl;_h(a,e,this.framebuffer),this.debug&&Md(a),this.outputTexture=e,be(a,()=>a.viewport(0,0,t,n)),be(a,()=>a.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,a){this.throwIfDisposed(),be(this.gl,()=>this.gl.scissor(e,t,n,a))}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 RW(e){let t=0;for(;t{let m=k.sizeFromShape(h.shapeInfo.logicalShape);h.shapeInfo.isUniform?r.push(`uniform float ${h.name}${m>1?`[${m}]`:""};`):(r.push(`uniform sampler2D ${h.name};`),r.push(`uniform int offset${h.name};`))});let s=r.join(` -`),i=e.map(h=>FW(h,t,a)).join(` -`),o=t.texShape,u=An(),l=OW(u),d,p,c=PW(u);return t.isPacked?(d=$W(t.logicalShape,o),p=_W(u)):(d=DW(t.logicalShape,o),p=zW(u)),a&&(c+=VW),[c,l,p,s,d,i,n].join(` -`)}function jl(e){let t=e.shapeInfo.logicalShape;switch(t.length){case 0:return eB(e);case 1:return nB(e);case 2:return rB(e);case 3:return iB(e);case 4:return lB(e);case 5:return uB(e);case 6:return dB(e);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function rw(e){switch(e.shapeInfo.logicalShape.length){case 0:return QW(e);case 1:return tB(e);case 2:return aB(e);case 3:return sB(e);default:return oB(e)}}function FW(e,t,n=!1){let a="";n?a+=rw(e):a+=jl(e);let r=e.shapeInfo.logicalShape,s=t.logicalShape;return r.length<=s.length&&(n?a+=pB(e,t):a+=cB(e,t)),a}function $W(e,t){switch(e.length){case 0:return sw();case 1:return jW(e,t);case 2:return YW(e,t);case 3:return HW(e,t);default:return qW(e,t)}}function DW(e,t){switch(e.length){case 0:return sw();case 1:return UW(e,t);case 2:return JW(e,t);case 3:return GW(e,t);case 4:return XW(e,t);case 5:return KW(e,t);case 6:return ZW(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function OW(e){return` + }`;return Av(e,n)}function jv(e){let t=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return wv(e,t)}function Uv(e){let t=new Uint16Array([0,1,2,2,1,3]);return kv(e,t)}function $d(e,t,n,a,r,s){Sv(t,n);let i=Iv(e),o=e.TEXTURE_2D;return be(e,()=>e.bindTexture(o,i)),be(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),be(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),be(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),be(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),be(e,()=>e.texImage2D(o,0,a,t,n,0,r,s,null)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null)),i}function Lg(e){return e.internalFormatFloat}function Hv(e,t,n,a){let[r,s]=Cd(t,n);return $d(e,r,s,Lg(a),a.textureFormatFloat,e.FLOAT)}function Wg(e){return e.internalFormatHalfFloat}function Gv(e,t,n,a){let[r,s]=Cd(t,n);return $d(e,r,s,Wg(a),a.textureFormatFloat,a.textureTypeHalfFloat)}function Bg(e){return e.downloadTextureFormat}function qv(e,t,n,a){let[r,s]=Cd(t,n);return $d(e,r,s,Bg(a),e.RGBA,e.UNSIGNED_BYTE)}function Vg(e){return e.internalFormatPackedFloat}function Xv(e,t,n,a){let[r,s]=Vl(t,n);return $d(e,r,s,Vg(a),e.RGBA,e.FLOAT)}function jg(e){return e.internalFormatPackedHalfFloat}function Kv(e,t,n,a){let[r,s]=Vl(t,n);return $d(e,r,s,jg(a),e.RGBA,a.textureTypeHalfFloat)}function Zv(e,t,n){let a=0,r=3*4,s=3*4+2*4;return be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),Dg(e,t,"clipSpacePos",n,3,s,a)&&Dg(e,t,"uv",n,2,s,r)}function Yv(e,t,n,a,r,s){be(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;r instanceof Uint8Array?(i=new Uint8Array(n*a*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*a*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(r),be(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,a,0,e.RGBA,o,i)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Jv(e,t,n){be(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?be(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):be(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),be(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Qv(e,t,n,a){let r=e.createBuffer();be(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));let s=4*4*t*n;return be(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),be(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),be(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function ew(e,t,n){let a=e,r=new Float32Array(n);return a.bindBuffer(a.PIXEL_PACK_BUFFER,t),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,r),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),r}function tw(e,t,n,a){let[r,s]=Cd(t,n),i=4,o=new Uint8Array(cW(t*n,i));return be(e,()=>e.readPixels(0,0,r,s,a.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function nw(e,t,n,a,r,s,i,o){let l=e,u=new Float32Array(hW(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function aw(e,t,n){let a=new Float32Array(t*n*4);return be(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,a)),a}var Vh=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];let t=te().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,Oh(t,e)):this.gl=Ja(t);let n="WEBGL_color_buffer_float",a="EXT_color_buffer_half_float";if(te().getNumber("WEBGL_VERSION")===1){let r="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=Rd(this.gl,r),pa(this.gl,s))this.textureHalfFloatExtension=Rd(this.gl,s);else if(te().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(n),pa(this.gl,a))this.colorBufferHalfFloatExtension=Rd(this.gl,a);else if(te().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(n="EXT_color_buffer_float",pa(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else if(pa(this.gl,a))this.colorBufferHalfFloatExtension=this.gl.getExtension(a);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=jv(this.gl),this.indexBuffer=Uv(this.gl),this.framebuffer=Nv(this.gl),this.textureConfig=$g(this.gl,this.textureHalfFloatExtension)}get debug(){return te().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.");let e=this.gl;be(e,()=>e.finish()),be(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),be(e,()=>e.deleteFramebuffer(this.framebuffer)),be(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),be(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),be(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),Hv(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),Gv(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),qv(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),Jv(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,a){this.throwIfDisposed(),Yv(this.gl,e,t,n,a,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),Kv(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),Xv(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(Og(this.gl,this.framebuffer),this.outputTexture=null),be(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>tw(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,a,r,s){return nw(this.gl,e,t,n,a,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return ew(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);let a=Qv(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),a}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(te().getBool("WEBGL_FENCE_API_ENABLED")){let a=e,r=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{let s=a.clientWaitSync(r,0,0);return s===a.ALREADY_SIGNALED||s===a.CONDITION_SATISFIED},t=r}else te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>aw(this.gl,t,n))}createProgram(e){this.throwIfDisposed();let t=this.gl,n=xv(t,e);this.vertexShader==null&&(this.vertexShader=Vv(t));let a=bv(t);return be(t,()=>t.attachShader(a,this.vertexShader)),be(t,()=>t.attachShader(a,n)),vv(t,a),this.debug&&zh(t,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=Zv(t,this.program,this.vertexBuffer)),a}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&be(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&zh(this.gl,this.program),be(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?Cv(this.gl,e,t):Ev(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),be(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),Rv(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();let[a,r]=Vl(t,n);this.setOutputMatrixTextureDriver(e,a,r)}setOutputMatrixWriteRegion(e,t,n,a){this.setOutputMatrixWriteRegionDriver(n,e,a,t)}setOutputPackedMatrixWriteRegion(e,t,n,a){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&zh(this.gl,this.program),Md(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&this.debugValidate(),be(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),be(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=Rd(this.gl,te().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(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.createQuery();return n.beginQuery(a.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await k.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}else{let n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(a.GPU_DISJOINT_EXT)),r&&!this.disjoint}else{let n=this.getQueryTimerExtensionWebGL1(),a=n.getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),a&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=MW(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:n}=this.itemsToPoll[t];n()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),!(this.itemsToPoll.length>1)&&k.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),_h(this.gl,e,this.framebuffer),this.debug&&Md(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(_h(this.gl,this.outputTexture,this.framebuffer),this.debug&&Md(this.gl)):Og(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();let a=this.gl;_h(a,e,this.framebuffer),this.debug&&Md(a),this.outputTexture=e,be(a,()=>a.viewport(0,0,t,n)),be(a,()=>a.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,a){this.throwIfDisposed(),be(this.gl,()=>this.gl.scissor(e,t,n,a))}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 MW(e){let t=0;for(;t{let m=k.sizeFromShape(h.shapeInfo.logicalShape);h.shapeInfo.isUniform?r.push(`uniform float ${h.name}${m>1?`[${m}]`:""};`):(r.push(`uniform sampler2D ${h.name};`),r.push(`uniform int offset${h.name};`))});let s=r.join(` +`),i=e.map(h=>$W(h,t,a)).join(` +`),o=t.texShape,l=An(),u=zW(l),d,p,c=LW(l);return t.isPacked?(d=DW(t.logicalShape,o),p=PW(l)):(d=OW(t.logicalShape,o),p=_W(l)),a&&(c+=jW),[c,u,p,s,d,i,n].join(` +`)}function Ul(e){let t=e.shapeInfo.logicalShape;switch(t.length){case 0:return tB(e);case 1:return aB(e);case 2:return sB(e);case 3:return oB(e);case 4:return uB(e);case 5:return dB(e);case 6:return pB(e);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function sw(e){switch(e.shapeInfo.logicalShape.length){case 0:return eB(e);case 1:return nB(e);case 2:return rB(e);case 3:return iB(e);default:return lB(e)}}function $W(e,t,n=!1){let a="";n?a+=sw(e):a+=Ul(e);let r=e.shapeInfo.logicalShape,s=t.logicalShape;return r.length<=s.length&&(n?a+=cB(e,t):a+=hB(e,t)),a}function DW(e,t){switch(e.length){case 0:return iw();case 1:return UW(e,t);case 2:return JW(e,t);case 3:return GW(e,t);default:return XW(e,t)}}function OW(e,t){switch(e.length){case 0:return iw();case 1:return HW(e,t);case 2:return QW(e,t);case 3:return qW(e,t);case 4:return KW(e,t);case 5:return ZW(e,t);case 6:return YW(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function zW(e){return` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${e.texture2D}(textureSampler, uv).r; } - `}function zW(e){return` + `}function _W(e){return` void setOutput(float val) { ${e.output} = vec4(val, 0, 0, 0); } - `}function _W(e){return` + `}function PW(e){return` void setOutput(vec4 val) { ${e.output} = val; } - `}function PW(e){return`${e.version} + `}function LW(e){return`${e.version} precision highp float; precision highp int; precision highp sampler2D; @@ -345,10 +344,10 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee return fract((p3.x + p3.y) * p3.z); } - ${LW} ${WW} ${BW} - `}var LW=` + ${VW} + `}var WW=` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texR = index / texNumC; int texC = index - texR * texNumC; @@ -360,7 +359,7 @@ vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,WW=` +`,BW=` vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texNumC, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); @@ -368,7 +367,7 @@ vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,BW=` +`,VW=` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { @@ -377,7 +376,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,VW=` +`,jW=` float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? @@ -388,11 +387,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float modCoord = mod(float(dim), 2.); return modCoord == 0. ? frag.r : frag.g; } -`;function sw(){return` +`;function iw(){return` int getOutputCoords() { return 0; } - `}function jW(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?` + `}function UW(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?` int getOutputCoords() { return 2 * int(resultUV.x * ${n[1]}.0); } @@ -406,7 +405,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${n[0]}, ${n[1]})); return 2 * (resTexRC.x * ${n[1]} + resTexRC.y); } - `}function UW(e,t){return t[0]===1?` + `}function HW(e,t){return t[0]===1?` int getOutputCoords() { return int(resultUV.x * ${t[1]}.0); } @@ -420,7 +419,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${t[0]}, ${t[1]})); return resTexRC.x * ${t[1]} + resTexRC.y; } - `}function HW(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[2]/2),r=a*Math.ceil(e[1]/2);return` + `}function GW(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[2]/2),r=a*Math.ceil(e[1]/2);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); @@ -434,7 +433,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec3(b, r, c); } - `}function GW(e,t){let n=Pi(["r","c","d"],e);return` + `}function qW(e,t){let n=Pi(["r","c","d"],e);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -442,10 +441,10 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${n} return ivec3(r, c, d); } - `}function qW(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[e.length-1]/2),r=a*Math.ceil(e[e.length-2]/2),s=r,i="",o="b, r, c";for(let u=2;u=1?d="coords = 0;":d=o.map(g=>`coords.${p[g+l]} = 0;`).join(` -`);let c="";i<2&&s>0?c="coords":c=e.shapeInfo.logicalShape.map((g,y)=>`coords.${p[y+l]}`).join(", ");let h="return outputValue;",m=k.sizeFromShape(e.shapeInfo.logicalShape)===1,f=k.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)h=` + `}function cB(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=e.shapeInfo.logicalShape.length,i=t.logicalShape.length,o=rw(e.shapeInfo.logicalShape,t.logicalShape),l=ut(i),u=i-s,d,p=["x","y","z","w","u","v"];s===0?d="":i<2&&o.length>=1?d="coords = 0;":d=o.map(g=>`coords.${p[g+u]} = 0;`).join(` +`);let c="";i<2&&s>0?c="coords":c=e.shapeInfo.logicalShape.map((g,y)=>`coords.${p[y+u]}`).join(", ");let h="return outputValue;",m=k.sizeFromShape(e.shapeInfo.logicalShape)===1,f=k.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)h=` return vec4(outputValue.xy, outputValue.xy); `;else if(m&&!f)i===1?h=` return vec4(outputValue.x, outputValue.x, 0., 0.); @@ -817,27 +816,27 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return vec4(outputValue.x); `;else if(o.length){let g=s-2,y=s-1;o.indexOf(g)>-1&&o.indexOf(y)>-1?h="return vec4(outputValue.x);":o.indexOf(g)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(y)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}return` vec4 ${r}() { - ${u} coords = getOutputCoords(); + ${l} coords = getOutputCoords(); ${d} vec4 outputValue = get${a}(${c}); ${h} } - `}function cB(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,u=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===u&&e.shapeInfo.flatOffset==null&&k.arraysEqual(i,s))return` + `}function hB(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&e.shapeInfo.flatOffset==null&&k.arraysEqual(i,s))return` float ${r}() { return sampleTexture(${n}, resultUV); } - `;let l=ut(u),d=aw(e.shapeInfo.logicalShape,t.logicalShape),p=u-o,c,h=["x","y","z","w","u","v"];o===0?c="":u<2&&d.length>=1?c="coords = 0;":c=d.map(f=>`coords.${h[f+p]} = 0;`).join(` -`);let m="";return u<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,g)=>`coords.${h[g+p]}`).join(", "),` + `;let u=ut(l),d=rw(e.shapeInfo.logicalShape,t.logicalShape),p=l-o,c,h=["x","y","z","w","u","v"];o===0?c="":l<2&&d.length>=1?c="coords = 0;":c=d.map(f=>`coords.${h[f+p]} = 0;`).join(` +`);let m="";return l<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,g)=>`coords.${h[g+p]}`).join(", "),` float ${r}() { - ${l} coords = getOutputCoords(); + ${u} coords = getOutputCoords(); ${c} return get${a}(${m}); } - `}function ut(e){if(e<=1)return"int";if(e===2)return"ivec2";if(e===3)return"ivec3";if(e===4)return"ivec4";if(e===5)return"ivec5";if(e===6)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function Hl(e,t){let n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Gl(e,t){return t.map(n=>e[n]).join(", ")}function hB(e,t,n,a){let r=t.userCode,s=n.map((h,m)=>{let f={logicalShape:h.shape,texShape:h.isUniform?null:h.texData.texShape,isUniform:h.isUniform,isPacked:h.isUniform?!1:h.texData.isPacked,flatOffset:null};return h.texData!=null&&h.texData.slice!=null&&h.texData.slice.flatOffset>0&&(f.flatOffset=h.texData.slice.flatOffset),{name:t.variableNames[m],shapeInfo:f}}),i=s.map(h=>h.shapeInfo),o={logicalShape:a.shape,texShape:a.texData.texShape,isUniform:!1,isPacked:a.texData.isPacked,flatOffset:null},u=MW(s,o,r,t.packedInputs),l=e.createProgram(u),d=null,p=e.getUniformLocation(l,"NAN",!1);te().getNumber("WEBGL_VERSION")===1&&(d=e.getUniformLocation(l,"INFINITY",!1));let c={};for(let h=0;h{let r=n.logicalShape,s=t[a],i=s.shape;if(!k.arraysEqual(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(n.isUniform&&s.isUniform)return;let o=n.texShape,u=s.isUniform?null:s.texData.texShape;if(!k.arraysEqual(o,u))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${u} must match`)})}function fB(e,t,n,a,r){iw(t.inShapeInfos,n),iw([t.outShapeInfo],[a]);let s=a.texData.texture,i=a.texData.texShape;a.texData.isPacked?e.setOutputPackedMatrixTexture(s,i[0],i[1]):e.setOutputMatrixTexture(s,i[0],i[1]),e.setProgram(t.webGLProgram),te().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,Infinity),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((o,u)=>{let l=t.program.variableNames[u],d=t.uniformLocations[l],p=t.uniformLocations[`offset${l}`];if(d!=null){if(o.isUniform){if(k.sizeFromShape(o.shape)<2)e.gl.uniform1f(d,o.uniformValues[0]);else{let c=o.uniformValues;c instanceof Float32Array||(c=new Float32Array(c)),e.gl.uniform1fv(d,c)}return}o.texData.slice!=null&&p!=null&&e.gl.uniform1i(p,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture,d,u)}}),r!=null&&r(e,t.webGLProgram),e.executeProgram()}function mB(e,t,n){let a="";t.concat(n).forEach(i=>{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0,u=i.isUniform?"uniform":i.texData.texShape;a+=`${i.shape}_${u}_${o}`});let r=e.userCode,s=e.constructor.name;return s+="_"+a+"_"+r,s}var{addImpl:gB,bincountImpl:ow,bincountReduceImpl:yB,ceilImpl:AB,concatImpl:xB,equalImpl:bB,expImpl:vB,expm1Impl:wB,floorImpl:kB,gatherNdImpl:IB,gatherV2Impl:SB,greaterImpl:NB,greaterEqualImpl:TB,lessImpl:CB,lessEqualImpl:EB,linSpaceImpl:RB,logImpl:MB,maxImpl:FB,maximumImpl:$B,minimumImpl:DB,multiplyImpl:OB,negImpl:zB,notEqualImpl:_B,prodImpl:PB,rangeImpl:LB,rsqrtImpl:WB,simpleAbsImpl:lw,sliceImpl:BB,sparseFillEmptyRowsImpl:VB,sparseReshapeImpl:jB,sparseSegmentReductionImpl:uw,stridedSliceImpl:UB,stringNGramsImpl:HB,stringSplitImpl:GB,stringToHashBucketFastImpl:qB,subImpl:XB,tileImpl:KB,topKImpl:ZB,transposeImpl:Ug,uniqueImpl:YB}=yg;function dw(e,t){return["x","y","z","w","u","v"].slice(0,t).map(n=>`${e}.${n}`)}function xn(e,t){return t===1?[e]:dw(e,t)}function JB(e,t){if(e===1)return"rc";let n="";for(let a=0;ae[n]).join(", ")}function fB(e,t,n,a){let r=t.userCode,s=n.map((h,m)=>{let f={logicalShape:h.shape,texShape:h.isUniform?null:h.texData.texShape,isUniform:h.isUniform,isPacked:h.isUniform?!1:h.texData.isPacked,flatOffset:null};return h.texData!=null&&h.texData.slice!=null&&h.texData.slice.flatOffset>0&&(f.flatOffset=h.texData.slice.flatOffset),{name:t.variableNames[m],shapeInfo:f}}),i=s.map(h=>h.shapeInfo),o={logicalShape:a.shape,texShape:a.texData.texShape,isUniform:!1,isPacked:a.texData.isPacked,flatOffset:null},l=FW(s,o,r,t.packedInputs),u=e.createProgram(l),d=null,p=e.getUniformLocation(u,"NAN",!1);te().getNumber("WEBGL_VERSION")===1&&(d=e.getUniformLocation(u,"INFINITY",!1));let c={};for(let h=0;h{let r=n.logicalShape,s=t[a],i=s.shape;if(!k.arraysEqual(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(n.isUniform&&s.isUniform)return;let o=n.texShape,l=s.isUniform?null:s.texData.texShape;if(!k.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function mB(e,t,n,a,r){ow(t.inShapeInfos,n),ow([t.outShapeInfo],[a]);let s=a.texData.texture,i=a.texData.texShape;a.texData.isPacked?e.setOutputPackedMatrixTexture(s,i[0],i[1]):e.setOutputMatrixTexture(s,i[0],i[1]),e.setProgram(t.webGLProgram),te().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,Infinity),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((o,l)=>{let u=t.program.variableNames[l],d=t.uniformLocations[u],p=t.uniformLocations[`offset${u}`];if(d!=null){if(o.isUniform){if(k.sizeFromShape(o.shape)<2)e.gl.uniform1f(d,o.uniformValues[0]);else{let c=o.uniformValues;c instanceof Float32Array||(c=new Float32Array(c)),e.gl.uniform1fv(d,c)}return}o.texData.slice!=null&&p!=null&&e.gl.uniform1i(p,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture,d,l)}}),r!=null&&r(e,t.webGLProgram),e.executeProgram()}function gB(e,t,n){let a="";t.concat(n).forEach(i=>{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0,l=i.isUniform?"uniform":i.texData.texShape;a+=`${i.shape}_${l}_${o}`});let r=e.userCode,s=e.constructor.name;return s+="_"+a+"_"+r,s}var{addImpl:yB,bincountImpl:lw,bincountReduceImpl:AB,ceilImpl:xB,concatImpl:bB,equalImpl:vB,expImpl:wB,expm1Impl:kB,floorImpl:IB,gatherNdImpl:SB,gatherV2Impl:NB,greaterImpl:TB,greaterEqualImpl:CB,lessImpl:EB,lessEqualImpl:RB,linSpaceImpl:MB,logImpl:FB,maxImpl:$B,maximumImpl:DB,minimumImpl:OB,multiplyImpl:zB,negImpl:_B,notEqualImpl:PB,prodImpl:LB,rangeImpl:WB,rsqrtImpl:BB,simpleAbsImpl:uw,sliceImpl:VB,sparseFillEmptyRowsImpl:jB,sparseReshapeImpl:UB,sparseSegmentReductionImpl:dw,stridedSliceImpl:HB,stringNGramsImpl:GB,stringSplitImpl:qB,stringToHashBucketFastImpl:XB,subImpl:KB,tileImpl:ZB,topKImpl:YB,transposeImpl:Ug,uniqueImpl:JB}=yg;function pw(e,t){return["x","y","z","w","u","v"].slice(0,t).map(n=>`${e}.${n}`)}function xn(e,t){return t===1?[e]:pw(e,t)}function QB(e,t){if(e===1)return"rc";let n="";for(let a=0;a ${t[0]}`;let a="";for(let r=e-2;r= ${t[r]}`,r ${t[0]}`;let a="";for(let r=e-2;r= ${t[r]}`,r= ${t}; bool rEdge = rp1 >= ${n}; - `}function aV(e,t){let n=e.length,a=eV(n,t);return n===1?`getA(rc), + `}function rV(e,t){let n=e.length,a=tV(n,t);return n===1?`getA(rc), rc + 1 >= ${e[0]} ? 0. : getA(rc + 1), 0, 0`:`getA(${a[0]}), cEdge ? 0. : getA(${a[1]}), rEdge ? 0. : getA(${a[2]}), - rEdge || cEdge ? 0. : getA(${a[3]})`}var pw=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let n="";for(let a=0;a<4;a++){let r="thisRC = rc;";a%2==1&&(r+="thisRC.z += 1;"),a>1&&(r+="thisRC.y += 1;"),n+=` + rEdge || cEdge ? 0. : getA(${a[3]})`}var cw=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let n="";for(let a=0;a<4;a++){let r="thisRC = rc;";a%2==1&&(r+="thisRC.z += 1;"),a>1&&(r+="thisRC.y += 1;"),n+=` ${r} ${a>0?"if(thisRC.y < rows && thisRC.z < cols){":""} int flatIndex = getFlatIndex(thisRC); @@ -874,7 +873,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); ${a>0?"}":""} `}this.userCode=` - ${rV(t)} + ${sV(t)} ${Pg(e)} void main() { @@ -890,12 +889,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function rV(e){return` + `}};function sV(e){return` ivec3 inputCoordsFromReshapedOutCoords(int index) { ${Pi(["r","c","d"],e)} return ivec3(r, c, d); } - `}var sV=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,n){let a=hw(t,n),r=fw(e,a,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);let s=cw(e,a,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[r].shift();return this.usedTextures[r].push(o),o}let i;return a===rn.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):a===rn.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):a===rn.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):a===rn.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):a===rn.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(i),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),i}releaseTexture(e,t,n,a){if(this.freeTextures==null)return;let r=hw(n,a),s=fw(t,r,a);s in this.freeTextures||(this.freeTextures[s]=[]);let i=cw(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,a),o=te().get("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let u=this.usedTextures[s],l=u.indexOf(e);if(l<0)throw new Error("Cannot release a texture that was never provided by this texture manager");u.splice(l,1),this.log()}log(){if(!this.logEnabled)return;let e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);let 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(let e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function iV(e,t){let n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F||t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}function cw(e,t,n,a,r){let s=oV(t,a),i;if(r){let[u,l]=Bl(e[0],e[1]);i=u*l}else{let[u,l]=Cd(e[0],e[1]);i=u*l}let o=iV(n,s);return i*o}function oV(e,t){switch(e){case rn.PACKED_2X2_FLOAT32:return Vg(t);case rn.PACKED_2X2_FLOAT16:return jg(t);case rn.UNPACKED_FLOAT32:return Lg(t);case rn.UNPACKED_FLOAT16:return Wg(t);case rn.PACKED_4X1_UNSIGNED_BYTE:return Bg(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function lV(e){return te().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?rn.PACKED_2X2_FLOAT32:rn.UNPACKED_FLOAT32:e?rn.PACKED_2X2_FLOAT16:rn.UNPACKED_FLOAT16}function hw(e,t){if(e===da.UPLOAD)return rn.PACKED_2X2_FLOAT32;if(e===da.RENDER||e==null)return lV(t);if(e===da.DOWNLOAD||e===da.PIXELS)return rn.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function fw(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}var Yr=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode=` + `}var iV=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,n){let a=fw(t,n),r=mw(e,a,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);let s=hw(e,a,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[r].shift();return this.usedTextures[r].push(o),o}let i;return a===rn.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):a===rn.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):a===rn.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):a===rn.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):a===rn.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(i),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),i}releaseTexture(e,t,n,a){if(this.freeTextures==null)return;let r=fw(n,a),s=mw(t,r,a);s in this.freeTextures||(this.freeTextures[s]=[]);let i=hw(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,a),o=te().get("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],u=l.indexOf(e);if(u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(u,1),this.log()}log(){if(!this.logEnabled)return;let e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);let 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(let e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function oV(e,t){let n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F||t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}function hw(e,t,n,a,r){let s=lV(t,a),i;if(r){let[l,u]=Vl(e[0],e[1]);i=l*u}else{let[l,u]=Cd(e[0],e[1]);i=l*u}let o=oV(n,s);return i*o}function lV(e,t){switch(e){case rn.PACKED_2X2_FLOAT32:return Vg(t);case rn.PACKED_2X2_FLOAT16:return jg(t);case rn.UNPACKED_FLOAT32:return Lg(t);case rn.UNPACKED_FLOAT16:return Wg(t);case rn.PACKED_4X1_UNSIGNED_BYTE:return Bg(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function uV(e){return te().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?rn.PACKED_2X2_FLOAT32:rn.UNPACKED_FLOAT32:e?rn.PACKED_2X2_FLOAT16:rn.UNPACKED_FLOAT16}function fw(e,t){if(e===da.UPLOAD)return rn.PACKED_2X2_FLOAT32;if(e===da.RENDER||e==null)return uV(t);if(e===da.DOWNLOAD||e===da.PIXELS)return rn.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function mw(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}var Yr=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode=` float unaryOperation(float x) { ${t} } @@ -906,11 +905,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},Ca="if (isnan(x)) return x;",uV="return x;",mw="return abs(x);",dV="return (x >= 0.0) ? x : (exp(x) - 1.0);",pV=Ca+` + `}},Ca="if (isnan(x)) return x;",dV="return x;",gw="return abs(x);",pV="return (x >= 0.0) ? x : (exp(x) - 1.0);",cV=Ca+` return (x < 0.0) ? 0.0 : x; -`,cV=Ca+` +`,hV=Ca+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,jh="return x;",hV="return 1.0 / (1.0 + exp(-1.0 * x));",fV="return x;",mV=` +`,jh="return x;",fV="return 1.0 / (1.0 + exp(-1.0 * x));",mV="return x;",gV=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -919,7 +918,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,gV=` +`,yV=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -929,7 +928,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,yV=` +`,AV=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -939,7 +938,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,AV="return 1.0 / (1.0 + exp(-1.0 * x));",ql=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` +`,xV="return 1.0 / (1.0 + exp(-1.0 * x));",Xl=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` vec4 unaryOperation(vec4 x) { ${t} } @@ -950,17 +949,17 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},xV=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;let t=e.length,n=xn("rc",t),a=ut(t),r=JB(t,n),s=n.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` + `}},bV=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;let t=e.length,n=xn("rc",t),a=ut(t),r=QB(t,n),s=n.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` void main() { ${a} rc = getOutputCoords(); vec4 packedInput = getA(${r}); setOutput(getChannel(packedInput, ${i})); } - `}},bV=Za.whereImpl,vV=1e-7,wV=1e-4,Hg={};function kV(e){return e in Hg||(Hg[e]={}),Hg[e]}var IV=te().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),SV=600;function NV(){return te().global.screen==null?1024:te().global.screen.height*te().global.screen.width*window.devicePixelRatio*SV/1024/1024}var Xl=class extends Eu{constructor(e){super();if(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,!te().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){let t=Ja(te().getNumber("WEBGL_VERSION"));this.binaryCache=kV(te().getNumber("WEBGL_VERSION")),this.gpgpu=new Vh(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new sV(this.gpgpu),this.numMBBeforeWarning=NV(),this.texData=new Up(this,fr())}nextDataId(){return Xl.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((te().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||te().getBool("DEBUG"))&&this.checkNumericalProblems(e),n==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let a={id:this.nextDataId()};return this.texData.set(a,{shape:t,dtype:n,values:e,usage:da.UPLOAD,refCount:1}),a}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){let t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){let t=this.texData.get(e);t.refCount--}}move(e,t,n,a,r){if(te().getBool("DEBUG")&&this.checkNumericalProblems(t),a==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:a,values:t,usage:da.UPLOAD,refCount:r})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:n,dtype:a,complexTensorInfos:r,slice:s,shape:i,isPacked:o}=t;if(s!=null){let p;o?p=new ql(i,jh):p=new Yr(i,jh);let c=this.runWebGLProgram(p,[{dataId:e,shape:i,dtype:a}],a),h=this.readSync(c.dataId);return this.disposeIntermediateTensorInfo(c),h}if(n!=null)return this.convertAndCacheOnCPU(e);if(a==="string")return n;let u=this.activeTimers!=null,l;u&&(l=k.now());let d;if(a==="complex64"){let p=this.readSync(r.real.dataId),c=this.readSync(r.imag.dataId);d=F.mergeRealAndImagArrays(p,c)}else d=this.getValuesFromTexture(e);return u&&(this.downloadWaitMs+=k.now()-l),this.convertAndCacheOnCPU(e,d)}async read(e){if(this.pendingRead.has(e)){let h=this.pendingRead.get(e);return new Promise(m=>h.push(m))}let t=this.texData.get(e),{values:n,shape:a,slice:r,dtype:s,complexTensorInfos:i,isPacked:o}=t;if(r!=null){let h;o?h=new ql(a,jh):h=new Yr(a,jh);let m=this.runWebGLProgram(h,[{dataId:e,shape:a,dtype:s}],s),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(n!=null)return this.convertAndCacheOnCPU(e);if(!te().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&te().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let u=null,l;if(s!=="complex64"&&te().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);let h=this.texData.get(l.dataId);u=this.gpgpu.createBufferFromTexture(h.texture,...Ed(a))}this.pendingRead.set(e,[]),s!=="complex64"&&await this.gpgpu.createAndWaitForFence();let d;if(s==="complex64"){let h=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),m=h[0],f=h[1];d=F.mergeRealAndImagArrays(m,f)}else if(u==null)d=this.getValuesFromTexture(e);else{let h=k.sizeFromShape(a);d=this.gpgpu.downloadFloat32MatrixFromBuffer(u,h)}l!=null&&this.disposeIntermediateTensorInfo(l);let p=this.convertAndCacheOnCPU(e,d),c=this.pendingRead.get(e);return this.pendingRead.delete(e),c.forEach(h=>h(p)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&fr().removeDataId(e,this),this.pendingDeletes--),p}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>k.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return Ve(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}async time(e){let t=this.activeTimers,n=[],a=!1;this.programTimersStack==null?(this.programTimersStack=n,a=!0):this.activeTimers.push(n),this.activeTimers=n,e();let r=k.flatten(this.activeTimers.map(o=>o.query)).filter(o=>o!=null),s=k.flatten(this.activeTimers.map(o=>o.name)).filter(o=>o!=null);this.activeTimers=t,a&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let o=await Promise.all(r);i.kernelMs=k.sum(o),i.getExtraProfileInfo=()=>o.map((u,l)=>({name:s[l],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:k.now(),endMs:null}}endTimer(e){return te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=k.now(),e)}async getQueryTime(e){if(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);let 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);let{complexTensorInfos:n}=this.texData.get(e);return n!=null&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:n,texShape:a,usage:r,isPacked:s,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,u=this.dataRefCount.get(o);u>1?this.dataRefCount.set(o,u-1):(this.dataRefCount.delete(o),t!=null&&(this.numBytesInGPU-=this.computeBytes(a,n),this.textureManager.releaseTexture(t,a,r,s)));let l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=IV){return te().getBool("WEBGL_CPU_FORWARD")&&e.every(n=>this.texData.get(n.dataId).texture==null&&k.sizeFromShape(n.shape)0&&k.isString(n[0])){let r=n.map(s=>k.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return this.texData.get(a).usage=null,{dataId:a,shape:e,dtype:t}}makeOutput(e,t,n){let{dataId:a}=this.makeTensorInfo(e,t,n);return fr().makeTensorFromDataId(a,e,t,this)}unpackTensor(e){let t=new xV(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new QB(e.shape),n=!0;return this.runWebGLProgram(t,[e],e.dtype,null,n)}packedReshape(e,t){let n=[zi(e.shape),..._i(e.shape)],a={dtype:e.dtype,shape:n,dataId:e.dataId},r=[zi(t),..._i(t)],s=new pw(r,n),i=!0,o=this.runWebGLProgram(s,[a],e.dtype,null,i);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e){let t=this.texData.get(e),{isPacked:n,shape:a,dtype:r}=t,s=Ph(a),i;n?i=new SW(s):i=new IW(s);let o=!0,u=this.runWebGLProgram(i,[{shape:s,dtype:r,dataId:e}],r,null,o);return{dtype:r,shape:a,dataId:u.dataId}}runWebGLProgram(e,t,n,a,r=!1){let s=this.makeTensorInfo(e.outputShape,n),i=this.texData.get(s.dataId);if(e.packedOutput&&(i.isPacked=!0),e.outPackingScheme===Td.DENSE){let f=Ed(e.outputShape);i.texShape=f.map(g=>g*2)}if(e.outTexUsage!=null&&(i.usage=e.outTexUsage),k.sizeFromShape(s.shape)===0)return i.values=k.getTypedArrayFromDType(s.dtype,0),s;let o=[],u=t.map(f=>{if(f.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let g=this.texData.get(f.dataId);if(g.texture==null){if(!e.packedInputs&&k.sizeFromShape(f.shape)<=te().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:f.shape,texData:null,isUniform:!0,uniformValues:g.values};e.packedInputs&&(g.isPacked=!0,g.shape=f.shape)}else if(!!g.isPacked!=!!e.packedInputs)f=g.isPacked?this.unpackTensor(f):this.packTensor(f),o.push(f),g=this.texData.get(f.dataId);else if(g.isPacked&&!Fd(g.shape,f.shape)){let y=f,A=f.shape;f.shape=g.shape,f=this.packedReshape(f,A),o.push(f),g=this.texData.get(f.dataId),y.shape=A}return this.uploadToGPU(f.dataId),{shape:f.shape,texData:g,isUniform:!1}});this.uploadToGPU(s.dataId);let l={shape:s.shape,texData:i,isUniform:!1},d=mB(e,u,l),p=this.getAndSaveBinary(d,()=>hB(this.gpgpu,e,u,l)),c=this.activeTimers!=null,h;c&&(h=this.startTimer()),fB(this.gpgpu,p,u,l,a),o.forEach(f=>this.disposeIntermediateTensorInfo(f)),c&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));let m=te().get("WEBGL_FLUSH_THRESHOLD");if(m>0){let f=k.now();f-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=f)}if(!te().getBool("WEBGL_LAZILY_UNPACK")&&i.isPacked&&r===!1){let f=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),f}return s}compileAndRun(e,t,n,a,r=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,a,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(te().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement!="undefined"&&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=V(()=>{if(!te().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=te().getBool("DEBUG");te().set("DEBUG",!1);let t=this.abs(ke(1e-8)).dataSync()[0];if(te().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?vV:wV}uploadToGPU(e){let t=this.texData.get(e),{shape:n,dtype:a,values:r,texture:s,usage:i,isPacked:o}=t;if(s!=null)return;let u=this.activeTimers!=null,l;u&&(l=k.now());let d=t.texShape;if(d==null&&(d=Fv(n,o),t.texShape=d),r!=null){let p=Ph(n),c,h=d[1],m=d[0],f=r instanceof Uint8Array;o?([h,m]=Bl(d[0],d[1]),c=new EW(p,[m,h],f)):c=new CW(p,[m,h],f);let g=this.makeTensorInfo([m,h],a);f?this.texData.get(g.dataId).usage=da.PIXELS:this.texData.get(g.dataId).usage=da.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(g.dataId),h,m,r);let y=!0,A=this.runWebGLProgram(c,[g],a,null,y),x=this.texData.get(A.dataId);t.texture=x.texture,t.texShape=x.texShape,t.isPacked=x.isPacked,t.usage=x.usage,this.disposeIntermediateTensorInfo(g),this.texData.delete(A.dataId),t.values=null,u&&(this.uploadWaitMs+=k.now()-l)}else{let p=this.acquireTexture(d,i,a,o);t.texture=p}}convertAndCacheOnCPU(e,t){let n=this.texData.get(e),{dtype:a}=n;return this.releaseGPUData(e),t!=null&&(n.values=TV(t,a)),n.values}acquireTexture(e,t,n,a){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let r=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${r} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,a)}computeBytes(e,t){return e[0]*e[1]*k.bytesPerElement(t)}};Xl.nextDataId=0;function TV(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let n=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let a=0;anew Xl,2);var CV={forceHalfFloat:yw},Aw=` + `}},vV=Za.whereImpl,wV=1e-7,kV=1e-4,Hg={};function IV(e){return e in Hg||(Hg[e]={}),Hg[e]}var SV=te().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),NV=600;function TV(){return te().global.screen==null?1024:te().global.screen.height*te().global.screen.width*window.devicePixelRatio*NV/1024/1024}var Kl=class extends Eu{constructor(e){super();if(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,!te().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){let t=Ja(te().getNumber("WEBGL_VERSION"));this.binaryCache=IV(te().getNumber("WEBGL_VERSION")),this.gpgpu=new Vh(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new iV(this.gpgpu),this.numMBBeforeWarning=TV(),this.texData=new Up(this,fr())}nextDataId(){return Kl.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((te().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||te().getBool("DEBUG"))&&this.checkNumericalProblems(e),n==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let a={id:this.nextDataId()};return this.texData.set(a,{shape:t,dtype:n,values:e,usage:da.UPLOAD,refCount:1}),a}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){let t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){let t=this.texData.get(e);t.refCount--}}move(e,t,n,a,r){if(te().getBool("DEBUG")&&this.checkNumericalProblems(t),a==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:a,values:t,usage:da.UPLOAD,refCount:r})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:n,dtype:a,complexTensorInfos:r,slice:s,shape:i,isPacked:o}=t;if(s!=null){let p;o?p=new Xl(i,jh):p=new Yr(i,jh);let c=this.runWebGLProgram(p,[{dataId:e,shape:i,dtype:a}],a),h=this.readSync(c.dataId);return this.disposeIntermediateTensorInfo(c),h}if(n!=null)return this.convertAndCacheOnCPU(e);if(a==="string")return n;let l=this.activeTimers!=null,u;l&&(u=k.now());let d;if(a==="complex64"){let p=this.readSync(r.real.dataId),c=this.readSync(r.imag.dataId);d=F.mergeRealAndImagArrays(p,c)}else d=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=k.now()-u),this.convertAndCacheOnCPU(e,d)}async read(e){if(this.pendingRead.has(e)){let h=this.pendingRead.get(e);return new Promise(m=>h.push(m))}let t=this.texData.get(e),{values:n,shape:a,slice:r,dtype:s,complexTensorInfos:i,isPacked:o}=t;if(r!=null){let h;o?h=new Xl(a,jh):h=new Yr(a,jh);let m=this.runWebGLProgram(h,[{dataId:e,shape:a,dtype:s}],s),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(n!=null)return this.convertAndCacheOnCPU(e);if(!te().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&te().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,u;if(s!=="complex64"&&te().get("WEBGL_BUFFER_SUPPORTED")){u=this.decode(e);let h=this.texData.get(u.dataId);l=this.gpgpu.createBufferFromTexture(h.texture,...Ed(a))}this.pendingRead.set(e,[]),s!=="complex64"&&await this.gpgpu.createAndWaitForFence();let d;if(s==="complex64"){let h=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),m=h[0],f=h[1];d=F.mergeRealAndImagArrays(m,f)}else if(l==null)d=this.getValuesFromTexture(e);else{let h=k.sizeFromShape(a);d=this.gpgpu.downloadFloat32MatrixFromBuffer(l,h)}u!=null&&this.disposeIntermediateTensorInfo(u);let p=this.convertAndCacheOnCPU(e,d),c=this.pendingRead.get(e);return this.pendingRead.delete(e),c.forEach(h=>h(p)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&fr().removeDataId(e,this),this.pendingDeletes--),p}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>k.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return Ve(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}async time(e){let t=this.activeTimers,n=[],a=!1;this.programTimersStack==null?(this.programTimersStack=n,a=!0):this.activeTimers.push(n),this.activeTimers=n,e();let r=k.flatten(this.activeTimers.map(o=>o.query)).filter(o=>o!=null),s=k.flatten(this.activeTimers.map(o=>o.name)).filter(o=>o!=null);this.activeTimers=t,a&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let o=await Promise.all(r);i.kernelMs=k.sum(o),i.getExtraProfileInfo=()=>o.map((l,u)=>({name:s[u],ms:l})).map(l=>`${l.name}: ${l.ms}`).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:k.now(),endMs:null}}endTimer(e){return te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=k.now(),e)}async getQueryTime(e){if(te().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);let 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);let{complexTensorInfos:n}=this.texData.get(e);return n!=null&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:n,texShape:a,usage:r,isPacked:s,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),t!=null&&(this.numBytesInGPU-=this.computeBytes(a,n),this.textureManager.releaseTexture(t,a,r,s)));let u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=SV){return te().getBool("WEBGL_CPU_FORWARD")&&e.every(n=>this.texData.get(n.dataId).texture==null&&k.sizeFromShape(n.shape)0&&k.isString(n[0])){let r=n.map(s=>k.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return this.texData.get(a).usage=null,{dataId:a,shape:e,dtype:t}}makeOutput(e,t,n){let{dataId:a}=this.makeTensorInfo(e,t,n);return fr().makeTensorFromDataId(a,e,t,this)}unpackTensor(e){let t=new bV(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new eV(e.shape),n=!0;return this.runWebGLProgram(t,[e],e.dtype,null,n)}packedReshape(e,t){let n=[zi(e.shape),..._i(e.shape)],a={dtype:e.dtype,shape:n,dataId:e.dataId},r=[zi(t),..._i(t)],s=new cw(r,n),i=!0,o=this.runWebGLProgram(s,[a],e.dtype,null,i);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e){let t=this.texData.get(e),{isPacked:n,shape:a,dtype:r}=t,s=Ph(a),i;n?i=new NW(s):i=new SW(s);let o=!0,l=this.runWebGLProgram(i,[{shape:s,dtype:r,dataId:e}],r,null,o);return{dtype:r,shape:a,dataId:l.dataId}}runWebGLProgram(e,t,n,a,r=!1){let s=this.makeTensorInfo(e.outputShape,n),i=this.texData.get(s.dataId);if(e.packedOutput&&(i.isPacked=!0),e.outPackingScheme===Td.DENSE){let f=Ed(e.outputShape);i.texShape=f.map(g=>g*2)}if(e.outTexUsage!=null&&(i.usage=e.outTexUsage),k.sizeFromShape(s.shape)===0)return i.values=k.getTypedArrayFromDType(s.dtype,0),s;let o=[],l=t.map(f=>{if(f.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let g=this.texData.get(f.dataId);if(g.texture==null){if(!e.packedInputs&&k.sizeFromShape(f.shape)<=te().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:f.shape,texData:null,isUniform:!0,uniformValues:g.values};e.packedInputs&&(g.isPacked=!0,g.shape=f.shape)}else if(!!g.isPacked!=!!e.packedInputs)f=g.isPacked?this.unpackTensor(f):this.packTensor(f),o.push(f),g=this.texData.get(f.dataId);else if(g.isPacked&&!Fd(g.shape,f.shape)){let y=f,A=f.shape;f.shape=g.shape,f=this.packedReshape(f,A),o.push(f),g=this.texData.get(f.dataId),y.shape=A}return this.uploadToGPU(f.dataId),{shape:f.shape,texData:g,isUniform:!1}});this.uploadToGPU(s.dataId);let u={shape:s.shape,texData:i,isUniform:!1},d=gB(e,l,u),p=this.getAndSaveBinary(d,()=>fB(this.gpgpu,e,l,u)),c=this.activeTimers!=null,h;c&&(h=this.startTimer()),mB(this.gpgpu,p,l,u,a),o.forEach(f=>this.disposeIntermediateTensorInfo(f)),c&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));let m=te().get("WEBGL_FLUSH_THRESHOLD");if(m>0){let f=k.now();f-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=f)}if(!te().getBool("WEBGL_LAZILY_UNPACK")&&i.isPacked&&r===!1){let f=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),f}return s}compileAndRun(e,t,n,a,r=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,a,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(te().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement!="undefined"&&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=V(()=>{if(!te().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=te().getBool("DEBUG");te().set("DEBUG",!1);let t=this.abs(ke(1e-8)).dataSync()[0];if(te().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?wV:kV}uploadToGPU(e){let t=this.texData.get(e),{shape:n,dtype:a,values:r,texture:s,usage:i,isPacked:o}=t;if(s!=null)return;let l=this.activeTimers!=null,u;l&&(u=k.now());let d=t.texShape;if(d==null&&(d=$v(n,o),t.texShape=d),r!=null){let p=Ph(n),c,h=d[1],m=d[0],f=r instanceof Uint8Array;o?([h,m]=Vl(d[0],d[1]),c=new RW(p,[m,h],f)):c=new EW(p,[m,h],f);let g=this.makeTensorInfo([m,h],a);f?this.texData.get(g.dataId).usage=da.PIXELS:this.texData.get(g.dataId).usage=da.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(g.dataId),h,m,r);let y=!0,A=this.runWebGLProgram(c,[g],a,null,y),x=this.texData.get(A.dataId);t.texture=x.texture,t.texShape=x.texShape,t.isPacked=x.isPacked,t.usage=x.usage,this.disposeIntermediateTensorInfo(g),this.texData.delete(A.dataId),t.values=null,l&&(this.uploadWaitMs+=k.now()-u)}else{let p=this.acquireTexture(d,i,a,o);t.texture=p}}convertAndCacheOnCPU(e,t){let n=this.texData.get(e),{dtype:a}=n;return this.releaseGPUData(e),t!=null&&(n.values=CV(t,a)),n.values}acquireTexture(e,t,n,a){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let r=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${r} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,a)}computeBytes(e,t){return e[0]*e[1]*k.bytesPerElement(t)}};Kl.nextDataId=0;function CV(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let n=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let a=0;anew Kl,2);var EV={forceHalfFloat:Aw},xw=` if (isnan(a)) return a; if (isnan(b)) return b; -`,Kl=class{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=F.assertAndGetBroadcastShape(t,n),this.userCode=` +`,Zl=class{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=F.assertAndGetBroadcastShape(t,n),this.userCode=` float binaryOperation(float a, float b) { ${e} } @@ -1007,29 +1006,29 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function Xn(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var EV={kernelName:zs,backendName:"webgl",kernelFunc:Xn};function Jr(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.makeTensorInfo(a.shape,"complex64"),i=n.texData.get(s.dataId),o=Xn({inputs:{x:a},backend:n}),u=Xn({inputs:{x:r},backend:n});return i.complexTensorInfos={real:o,imag:u},s}var RV={kernelName:Yp,backendName:"webgl",kernelFunc:Jr},xw="return (a < 0.) ? b * a : a;",bw=` + `}};function Xn(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var RV={kernelName:zs,backendName:"webgl",kernelFunc:Xn};function Jr(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.makeTensorInfo(a.shape,"complex64"),i=n.texData.get(s.dataId),o=Xn({inputs:{x:a},backend:n}),l=Xn({inputs:{x:r},backend:n});return i.complexTensorInfos={real:o,imag:l},s}var MV={kernelName:Yp,backendName:"webgl",kernelFunc:Jr},bw="return (a < 0.) ? b * a : a;",vw=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function MV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a,i=n.makeTensorInfo([],"float32",k.createScalarValue(s,"float32")),o=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Dd(bw,r.shape,i.shape):new Kl(xw,r.shape,i.shape),u=n.runWebGLProgram(o,[r,i],r.dtype);return n.disposeIntermediateTensorInfo(i),u}var FV={kernelName:_s,backendName:"webgl",kernelFunc:MV},vw="return (a < 0.) ? b * a : a;",ww=` +`;function FV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a,i=n.makeTensorInfo([],"float32",k.createScalarValue(s,"float32")),o=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Dd(vw,r.shape,i.shape):new Zl(bw,r.shape,i.shape),l=n.runWebGLProgram(o,[r,i],r.dtype);return n.disposeIntermediateTensorInfo(i),l}var $V={kernelName:_s,backendName:"webgl",kernelFunc:FV},ww="return (a < 0.) ? b * a : a;",kw=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function $V(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Dd(ww,a.shape,r.shape):new Kl(vw,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)}var DV={kernelName:Zs,backendName:"webgl",kernelFunc:$V},kw="if (isnan(x)) return x;",OV=` +`;function DV(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Dd(kw,a.shape,r.shape):new Zl(ww,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)}var OV={kernelName:Zs,backendName:"webgl",kernelFunc:DV},Iw="if (isnan(x)) return x;",zV=` if (isnan(a)) return a; if (isnan(b)) return b; -`,zV=` +`,_V=` result.r = isNaN.r > 0. ? NAN : result.r; result.g = isNaN.g > 0. ? NAN : result.g; result.b = isNaN.b > 0. ? NAN : result.b; result.a = isNaN.a > 0. ? NAN : result.a; -`;function Ke({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:a}){return({inputs:r,backend:s})=>{let{x:i}=r,o=s,u=a||i.dtype;if(o.shouldExecuteOnCPU([i])&&n!=null){let p=o.texData.get(i.dataId),c=n(p.values,u);return o.makeTensorInfo(i.shape,u,c)}let l=te().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,d;return l?d=new ql(i.shape,t):d=new Yr(i.shape,e),o.runWebGLProgram(d,[i],u)}}function sn({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:a=!1,cpuKernelImpl:r,dtype:s}){return({inputs:i,backend:o})=>{let{a:u,b:l}=i,d=o;if(a&&u.dtype==="complex64"){let m=d.texData.get(u.dataId),f=d.texData.get(l.dataId),[g,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(x=>{let[v,b]=x,w={dataId:v.dataId,dtype:v.dtype,shape:u.shape},N={dataId:b.dataId,dtype:b.dtype,shape:l.shape},C=new Kl(e,u.shape,l.shape);return d.runWebGLProgram(C,[w,N],Aa(v.dtype,b.dtype))}),A=Jr({inputs:{real:g,imag:y},backend:d});return d.disposeIntermediateTensorInfo(g),d.disposeIntermediateTensorInfo(y),A}let p=s||Aa(u.dtype,l.dtype);if((u.dtype==="string"||l.dtype==="string"||d.shouldExecuteOnCPU([u,l]))&&r!=null){let m=d.texData.get(u.dataId).values,f=d.texData.get(l.dataId).values,g=u.dtype==="string"?F.fromUint8ToStringArray(m):m,y=u.dtype==="string"?F.fromUint8ToStringArray(f):f,[A,x]=r(u.shape,l.shape,g,y,p),v=d.makeTensorInfo(x,p),b=d.texData.get(v.dataId);return b.values=A,v}let c=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,h;return c?h=new Dd(t,u.shape,l.shape,n):h=new Kl(e,u.shape,l.shape),d.runWebGLProgram(h,[u,l],p)}}function Hh(e,t=!1){if(e==="linear")return t?fV:uV;if(e==="relu")return t?gV:pV;if(e==="elu")return t?mV:dV;if(e==="relu6")return t?yV:cV;if(e==="prelu")return t?ww:vw;if(e==="leakyrelu")return t?bw:xw;if(e==="sigmoid")return t?AV:hV;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var Iw=class{constructor(e,t,n,a=!1,r=!1,s=!1,i=null,o=!1,u=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;let l=a?e[1]:e[2],d=Math.ceil(l/2),p=a?"i * 2, rc.y":"rc.y, i * 2",c=r?"rc.z, i * 2":"i * 2, rc.z",h=a?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",g="";i&&(o?f=`vec4 activation(vec4 a) { +`;function Ze({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:a}){return({inputs:r,backend:s})=>{let{x:i}=r,o=s,l=a||i.dtype;if(o.shouldExecuteOnCPU([i])&&n!=null){let p=o.texData.get(i.dataId),c=n(p.values,l);return o.makeTensorInfo(i.shape,l,c)}let u=te().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,d;return u?d=new Xl(i.shape,t):d=new Yr(i.shape,e),o.runWebGLProgram(d,[i],l)}}function sn({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:a=!1,cpuKernelImpl:r,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:u}=i,d=o;if(a&&l.dtype==="complex64"){let m=d.texData.get(l.dataId),f=d.texData.get(u.dataId),[g,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(x=>{let[v,b]=x,w={dataId:v.dataId,dtype:v.dtype,shape:l.shape},N={dataId:b.dataId,dtype:b.dtype,shape:u.shape},C=new Zl(e,l.shape,u.shape);return d.runWebGLProgram(C,[w,N],Aa(v.dtype,b.dtype))}),A=Jr({inputs:{real:g,imag:y},backend:d});return d.disposeIntermediateTensorInfo(g),d.disposeIntermediateTensorInfo(y),A}let p=s||Aa(l.dtype,u.dtype);if((l.dtype==="string"||u.dtype==="string"||d.shouldExecuteOnCPU([l,u]))&&r!=null){let m=d.texData.get(l.dataId).values,f=d.texData.get(u.dataId).values,g=l.dtype==="string"?F.fromUint8ToStringArray(m):m,y=l.dtype==="string"?F.fromUint8ToStringArray(f):f,[A,x]=r(l.shape,u.shape,g,y,p),v=d.makeTensorInfo(x,p),b=d.texData.get(v.dataId);return b.values=A,v}let c=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,h;return c?h=new Dd(t,l.shape,u.shape,n):h=new Zl(e,l.shape,u.shape),d.runWebGLProgram(h,[l,u],p)}}function Hh(e,t=!1){if(e==="linear")return t?mV:dV;if(e==="relu")return t?yV:cV;if(e==="elu")return t?gV:pV;if(e==="relu6")return t?AV:hV;if(e==="prelu")return t?kw:ww;if(e==="leakyrelu")return t?vw:bw;if(e==="sigmoid")return t?xV:fV;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var Sw=class{constructor(e,t,n,a=!1,r=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;let u=a?e[1]:e[2],d=Math.ceil(u/2),p=a?"i * 2, rc.y":"rc.y, i * 2",c=r?"rc.z, i * 2":"i * 2, rc.z",h=a?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",g="";i&&(o?f=`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${i} - }`:u?f=`vec4 activation(vec4 a) { + }`:l?f=`vec4 activation(vec4 a) { vec4 b = getLeakyreluAlphaAtOutCoords(); ${i} }`:f=`vec4 activation(vec4 x) { ${i} - }`,g="result = activation(result);");let y=s?"result += getBiasAtOutCoords();":"";s&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),u&&this.variableNames.push("leakyreluAlpha");let A="rc.x",x="rc.x";e[0]`The new shape (${u}) has ${l} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let d=i.texData.get(r.dataId);return d.isPacked&&!Fd(r.shape,u)&&!(d.texture!==null&&Fd(d.shape,u))?PV(r,u,i):(i.incRef(r.dataId),{dataId:r.dataId,shape:u,dtype:r.dtype})}var LV={kernelName:el,backendName:"webgl",kernelFunc:Ae},Cw=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i=Math.floor(n/4)*4,o=n%4,u="sumValue += dot(values, ones);";if(t!=null){let d=1/t;u=`sumValue += dot(values * ${k.isInt(d)?d.toPrecision(2):d}, ones);`}let l="";r%n>0&&(l=` + `}},Cw="return a * b;";function Gg(e){let{inputs:t,backend:n}=e,{a,b:r}=t,s=F.upcastType(a.dtype,r.dtype);if(a.dtype==="complex64"){let o=n.texData.get(a.dataId),l=n.texData.get(r.dataId),u=new Tw(Nw.REAL,a.shape,r.shape),d=new Tw(Nw.IMAG,a.shape,r.shape),p=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:a.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:a.shape},{dataId:l.complexTensorInfos.real.dataId,dtype:l.complexTensorInfos.real.dtype,shape:r.shape},{dataId:l.complexTensorInfos.imag.dataId,dtype:l.complexTensorInfos.imag.dtype,shape:r.shape}],c=n.runWebGLProgram(u,p,"float32"),h=n.runWebGLProgram(d,p,"float32"),m=Jr({inputs:{real:c,imag:h},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}if(n.shouldExecuteOnCPU([a,r])){let o=n.texData.get(a.dataId),l=n.texData.get(r.dataId),[u,d]=zB(a.shape,r.shape,o.values,l.values,s),p=n.makeTensorInfo(d,s),c=n.texData.get(p.dataId);return c.values=u,p}let i;return te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?i=new Dd(Cw,a.shape,r.shape):i=new Zl(Cw,a.shape,r.shape),n.runWebGLProgram(i,[a,r],s)}var PV={kernelName:Gs,backendName:"webgl",kernelFunc:Gg};function LV(e,t,n){let a=[zi(e.shape),..._i(e.shape)],r={dtype:e.dtype,shape:a,dataId:e.dataId},s=[zi(t),..._i(t)],i=new cw(s,a),o=!0,l=n.runWebGLProgram(i,[r],e.dtype,null,o);return{dataId:l.dataId,shape:t,dtype:l.dtype}}function Ae(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=n,o=k.sizeFromShape(r.shape),l=k.inferFromImplicitShape(s,o),u=k.sizeFromShape(l);k.assert(o===u,()=>`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let d=i.texData.get(r.dataId);return d.isPacked&&!Fd(r.shape,l)&&!(d.texture!==null&&Fd(d.shape,l))?LV(r,l,i):(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype})}var WV={kernelName:tl,backendName:"webgl",kernelFunc:Ae},Ew=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i=Math.floor(n/4)*4,o=n%4,l="sumValue += dot(values, ones);";if(t!=null){let d=1/t;l=`sumValue += dot(values * ${k.isInt(d)?d.toPrecision(2):d}, ones);`}let u="";r%n>0&&(u=` if (inIdx < 0 || inIdx >= ${r}) { return 0.0; } @@ -1081,7 +1080,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { - ${l} + ${u} return getX(batch, inIdx); } @@ -1102,31 +1101,31 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, getValue(batch, inIdx + 3) ); - ${u} + ${l} } int inIdx = inOffset + ${i}; if (${o===1}) { vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0); - ${u} + ${l} } else if (${o===2}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), 0.0, 0.0); - ${u} + ${l} } else if (${o===3}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), 0.0); - ${u} + ${l} } setOutput(sumValue); } - `}},WV=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i="0.0",o="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",o="min"):t==="max"&&(i="-1.0 / 1e-20",o="max");let u=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?u="sumValue":t==="prod"?u="prodValue":t==="all"?u="allValue":t==="any"&&(u="anyValue");let l=Math.floor(n/4)*4,d=n%4,p=` + `}},BV=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i="0.0",o="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",o="min"):t==="max"&&(i="-1.0 / 1e-20",o="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");let u=Math.floor(n/4)*4,d=n%4,p=` if (${t==="sum"}) { sumValue += dot(values, ones); } else if (${t==="prod"}) { @@ -1175,7 +1174,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float allValue = 1.0; float anyValue = 0.0; - for (int i = 0; i < ${l}; i += 4) { + for (int i = 0; i < ${u}; i += 4) { int inIdx = inOffset + i; ${c} values = ${c}( getValue(batch, inIdx), @@ -1187,7 +1186,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${p} } - int inIdx = inOffset + ${l}; + int inIdx = inOffset + ${u}; if (${d===1}) { ${c} values = ${c}( getValue(batch, inIdx), @@ -1216,38 +1215,38 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${p} } - setOutput(${u}); + setOutput(${l}); } - `}};function BV(e){let t=[];for(;t.length===0||t[t.length-1].outSize!==1;){let n=t.length?t[t.length-1].outSize:e[1],a=F.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:a,outSize:Math.ceil(n/a)})}return t}function Wi(e,t,n,a){let r=BV(e.shape),s=e;for(let i=0;i6)throw Error(`Transpose for rank ${t} is not yet supported`);let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],a=new Array(t);for(let r=0;r6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let a=ut(this.rank),r=dw("rc",this.rank),s=new Array(this.rank);for(let l=0;l6)throw Error(`Transpose for rank ${t} is not yet supported`);let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],a=new Array(t);for(let r=0;r6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let a=ut(this.rank),r=pw("rc",this.rank),s=new Array(this.rank);for(let u=0;u=2&&d>=2&&x,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${f}) and (${g}).`);let v=(y>A?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([h,m]);k.assert(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${a} must match.`);let b=n?[y,p,h]:[y,h,p],w=a?[A,m,c]:[A,c,m],N=Ae({inputs:{x:e},backend:r,attrs:{shape:b}}),C=Ae({inputs:{x:t},backend:r,attrs:{shape:w}}),E=[N,C],_=Math.max(y,A),$=n?N.shape[1]:N.shape[2],S=s!=null,z=i!=null,O=u==="leakyrelu",W=u!=null?Hh(u,!0):null,G=S||z||O||W!=null,H;if((h===1||m===1)&&$>Ew&&G===!1){let K=N,ne=C;n&&(K=bn({inputs:{x:N},backend:r,attrs:{perm:[0,2,1]}}),E.push(K)),a&&(ne=bn({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),E.push(ne));let Q=m!==1,se=m===1,Z=K;Q&&(Z=Ae({inputs:{x:K},backend:r,attrs:{shape:[_,$,1]}}),E.push(Z));let le=m===1?2:1,oe=ne;se&&(oe=Ae({inputs:{x:ne},backend:r,attrs:{shape:[_,1,$]}}),E.push(oe));let xe=Gg({inputs:{a:Z,b:oe},backend:r});H=qh({inputs:{x:xe},backend:r,attrs:{axis:le,keepDims:!0}}),E.push(xe)}else{let K=Aa(e.dtype,t.dtype),ne=new Iw(b,w,[_,h,m],n,a,S,W,z,O),Q=[N,C];if(s!=null&&Q.push(s),z&&Q.push(i),O){let se=r.makeTensorInfo([],"float32",k.createScalarValue(o,"float32"));Q.push(se),E.push(se)}H=r.runWebGLProgram(ne,Q,K)}let J=Ae({inputs:{x:H},backend:r,attrs:{shape:v}});E.push(H);for(let K of E)r.disposeIntermediateTensorInfo(K);return J}function XV(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:u,transposeB:l,activation:d,leakyreluAlpha:p}=a;return Xh({a:r,b:s,transposeA:u,transposeB:l,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:p,activation:d})}var KV={kernelName:hi,backendName:"webgl",kernelFunc:XV},Rw="return abs(x);";function ZV(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])&&a.dtype!=="complex64"){let s=n.texData.get(a.dataId),i=lw(s.values);return n.makeTensorInfo(a.shape,a.dtype,i)}let r;return te().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new ql(a.shape,Rw):r=new Yr(a.shape,Rw),n.runWebGLProgram(r,[a],a.dtype)}var YV={kernelName:fo,backendName:"webgl",kernelFunc:ZV},JV=Ca+` + `}};function Gh(e,t,n){let a=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new HV(e.shape,t):new jV(e.shape,t);return n.runWebGLProgram(a,[e],e.dtype)}function GV(e,t,n,a){let r=t,s=e.shape.length,i=k.parseAxisParam(r,e.shape),o=i,l=F.getAxesPermutation(o,s),u=l!=null,d=e;u&&(d=Gh(e,l,a),o=F.getInnerMostAxes(o.length,s)),F.assertAxesAreInnerMostDims("sum",o,s);let[p,c]=F.computeOutAndReduceShapes(d.shape,o),h=p;n&&(h=F.expandShapeToKeepDim(p,i));let m=k.sizeFromShape(c),f=k.sizeFromShape(e.shape)/m,g=Ae({inputs:{x:d},attrs:{shape:[f,m]},backend:a}),y=zc(e.dtype),A=Wi(g,y,"sum",a),x=Ae({inputs:{x:A},attrs:{shape:h},backend:a});return a.disposeIntermediateTensorInfo(g),a.disposeIntermediateTensorInfo(A),u&&a.disposeIntermediateTensorInfo(d),x}function qh(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;return GV(r,s,i,n)}var qV={kernelName:ii,backendName:"webgl",kernelFunc:qh};function bn(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{perm:s}=a,i=n,o=r.shape.length,l=new Array(o);for(let d=0;d=2&&d>=2&&x,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${f}) and (${g}).`);let v=(y>A?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([h,m]);k.assert(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${a} must match.`);let b=n?[y,p,h]:[y,h,p],w=a?[A,m,c]:[A,c,m],N=Ae({inputs:{x:e},backend:r,attrs:{shape:b}}),C=Ae({inputs:{x:t},backend:r,attrs:{shape:w}}),E=[N,C],_=Math.max(y,A),$=n?N.shape[1]:N.shape[2],S=s!=null,z=i!=null,O=l==="leakyrelu",W=l!=null?Hh(l,!0):null,G=S||z||O||W!=null,H;if((h===1||m===1)&&$>Rw&&G===!1){let K=N,ne=C;n&&(K=bn({inputs:{x:N},backend:r,attrs:{perm:[0,2,1]}}),E.push(K)),a&&(ne=bn({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),E.push(ne));let Q=m!==1,se=m===1,Z=K;Q&&(Z=Ae({inputs:{x:K},backend:r,attrs:{shape:[_,$,1]}}),E.push(Z));let le=m===1?2:1,oe=ne;se&&(oe=Ae({inputs:{x:ne},backend:r,attrs:{shape:[_,1,$]}}),E.push(oe));let xe=Gg({inputs:{a:Z,b:oe},backend:r});H=qh({inputs:{x:xe},backend:r,attrs:{axis:le,keepDims:!0}}),E.push(xe)}else{let K=Aa(e.dtype,t.dtype),ne=new Sw(b,w,[_,h,m],n,a,S,W,z,O),Q=[N,C];if(s!=null&&Q.push(s),z&&Q.push(i),O){let se=r.makeTensorInfo([],"float32",k.createScalarValue(o,"float32"));Q.push(se),E.push(se)}H=r.runWebGLProgram(ne,Q,K)}let J=Ae({inputs:{x:H},backend:r,attrs:{shape:v}});E.push(H);for(let K of E)r.disposeIntermediateTensorInfo(K);return J}function KV(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:d,leakyreluAlpha:p}=a;return Xh({a:r,b:s,transposeA:l,transposeB:u,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:p,activation:d})}var ZV={kernelName:hi,backendName:"webgl",kernelFunc:KV},Mw="return abs(x);";function YV(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])&&a.dtype!=="complex64"){let s=n.texData.get(a.dataId),i=uw(s.values);return n.makeTensorInfo(a.shape,a.dtype,i)}let r;return te().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Xl(a.shape,Mw):r=new Yr(a.shape,Mw),n.runWebGLProgram(r,[a],a.dtype)}var JV={kernelName:mo,backendName:"webgl",kernelFunc:YV},QV=Ca+` if (abs(x) > 1.) { return NAN; } return acos(x); -`,QV=Ke({opSnippet:JV}),ej={kernelName:mo,backendName:"webgl",kernelFunc:QV},tj=Ca+` +`,ej=Ze({opSnippet:QV}),tj={kernelName:go,backendName:"webgl",kernelFunc:ej},nj=Ca+` if (x < 1.0) return NAN; -return log(x + sqrt(x * x - 1.0));`,nj=Ke({opSnippet:tj}),aj={kernelName:go,backendName:"webgl",kernelFunc:nj},Mw="return a + b;",rj=sn({opSnippet:Mw,packedOpSnippet:Mw,supportsComplex:!0,cpuKernelImpl:gB}),sj={kernelName:Or,backendName:"webgl",kernelFunc:rj},ij=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`float v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` +return log(x + sqrt(x * x - 1.0));`,aj=Ze({opSnippet:nj}),rj={kernelName:yo,backendName:"webgl",kernelFunc:aj},Fw="return a + b;",sj=sn({opSnippet:Fw,packedOpSnippet:Fw,supportsComplex:!0,cpuKernelImpl:yB}),ij={kernelName:Or,backendName:"webgl",kernelFunc:sj},oj=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`float v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${n.join(` `)} @@ -1255,7 +1254,7 @@ return log(x + sqrt(x * x - 1.0));`,nj=Ke({opSnippet:tj}),aj={kernelName:go,back float result = ${a}; setOutput(result); } - `}},oj=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`vec4 v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` + `}},lj=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`vec4 v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${n.join(` `)} @@ -1263,7 +1262,7 @@ return log(x + sqrt(x * x - 1.0));`,nj=Ke({opSnippet:tj}),aj={kernelName:go,back vec4 result = ${a}; setOutput(result); } - `}};function Kh(e){let{inputs:t,backend:n}=e,a=t;if(a.length===1)return Xn({inputs:{x:a[0]},backend:n});if(a.length>te().get("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(a.length/2),u=Kh({inputs:a.slice(0,o),backend:n}),l=Kh({inputs:a.slice(o),backend:n});return Kh({inputs:[u,l],backend:n})}let r=a.map(o=>o.dtype).reduce((o,u)=>Aa(o,u)),s=a.map(o=>o.shape),i=te().getBool("WEBGL_PACK")?new oj(a[0].shape,s):new ij(a[0].shape,s);return n.runWebGLProgram(i,a,r)}var lj={kernelName:xs,backendName:"webgl",kernelFunc:Kh};function uj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,u=k.parseAxisParam(s,r.shape),l=u,d=F.getAxesPermutation(l,o),p=r;d!=null&&(p=bn({inputs:{x:r},backend:n,attrs:{perm:d}}),l=F.getInnerMostAxes(l.length,o)),F.assertAxesAreInnerMostDims("all",l,o);let[c,h]=F.computeOutAndReduceShapes(p.shape,l),m=k.sizeFromShape(h),f=Ae({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),g=Wi(f,f.dtype,"all",n),y;if(i){let A=F.expandShapeToKeepDim(c,u);y=Ae({inputs:{x:g},backend:n,attrs:{shape:A}})}else y=Ae({inputs:{x:g},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),d!=null&&n.disposeIntermediateTensorInfo(p),y}var dj={kernelName:yo,backendName:"webgl",kernelFunc:uj};function pj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,u=k.parseAxisParam(s,r.shape),l=u,d=F.getAxesPermutation(l,o),p=r;d!=null&&(p=bn({inputs:{x:r},backend:n,attrs:{perm:d}}),l=F.getInnerMostAxes(l.length,o)),F.assertAxesAreInnerMostDims("any",l,o);let[c,h]=F.computeOutAndReduceShapes(p.shape,l),m=k.sizeFromShape(h),f=Ae({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),g=Wi(f,f.dtype,"any",n),y;if(i){let A=F.expandShapeToKeepDim(c,u);y=Ae({inputs:{x:g},backend:n,attrs:{shape:A}})}else y=Ae({inputs:{x:g},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),d!=null&&n.disposeIntermediateTensorInfo(p),y}var cj={kernelName:Ao,backendName:"webgl",kernelFunc:pj},hj=class{constructor(e,t,n){this.variableNames=["A"];let{windowSize:a,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];let i=t==="max"?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` + `}};function Kh(e){let{inputs:t,backend:n}=e,a=t;if(a.length===1)return Xn({inputs:{x:a[0]},backend:n});if(a.length>te().get("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(a.length/2),l=Kh({inputs:a.slice(0,o),backend:n}),u=Kh({inputs:a.slice(o),backend:n});return Kh({inputs:[l,u],backend:n})}let r=a.map(o=>o.dtype).reduce((o,l)=>Aa(o,l)),s=a.map(o=>o.shape),i=te().getBool("WEBGL_PACK")?new lj(a[0].shape,s):new oj(a[0].shape,s);return n.runWebGLProgram(i,a,r)}var uj={kernelName:xs,backendName:"webgl",kernelFunc:Kh};function dj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=k.parseAxisParam(s,r.shape),u=l,d=F.getAxesPermutation(u,o),p=r;d!=null&&(p=bn({inputs:{x:r},backend:n,attrs:{perm:d}}),u=F.getInnerMostAxes(u.length,o)),F.assertAxesAreInnerMostDims("all",u,o);let[c,h]=F.computeOutAndReduceShapes(p.shape,u),m=k.sizeFromShape(h),f=Ae({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),g=Wi(f,f.dtype,"all",n),y;if(i){let A=F.expandShapeToKeepDim(c,l);y=Ae({inputs:{x:g},backend:n,attrs:{shape:A}})}else y=Ae({inputs:{x:g},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),d!=null&&n.disposeIntermediateTensorInfo(p),y}var pj={kernelName:Ao,backendName:"webgl",kernelFunc:dj};function cj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=k.parseAxisParam(s,r.shape),u=l,d=F.getAxesPermutation(u,o),p=r;d!=null&&(p=bn({inputs:{x:r},backend:n,attrs:{perm:d}}),u=F.getInnerMostAxes(u.length,o)),F.assertAxesAreInnerMostDims("any",u,o);let[c,h]=F.computeOutAndReduceShapes(p.shape,u),m=k.sizeFromShape(h),f=Ae({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),g=Wi(f,f.dtype,"any",n),y;if(i){let A=F.expandShapeToKeepDim(c,l);y=Ae({inputs:{x:g},backend:n,attrs:{shape:A}})}else y=Ae({inputs:{x:g},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),d!=null&&n.disposeIntermediateTensorInfo(p),y}var hj={kernelName:xo,backendName:"webgl",kernelFunc:cj},fj=class{constructor(e,t,n){this.variableNames=["A"];let{windowSize:a,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];let i=t==="max"?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -1283,23 +1282,23 @@ return log(x + sqrt(x * x - 1.0));`,nj=Ke({opSnippet:tj}),aj={kernelName:go,back } setOutput(float(bestIndex)); } - `}},fj=class{constructor(e,t,n,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,k.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);let r=e[e.length-1],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),a||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,u=ut(o),l=xn("coords",o),d,p;if(s===1){p=o+1;let N=ut(p);d=` - ${N} sourceLocR = ${N}(${l.join()}, 0); - ++${l[o-1]}; - ${N} sourceLocG = ${N}(${l.join()}, 0); - ++${l[o-2]}; - ${N} sourceLocA = ${N}(${l.join()}, 0); - --${l[o-1]}; - ${N} sourceLocB = ${N}(${l.join()}, 0); - --${l[o-2]};`}else p=o,d=` - ${u} sourceLocR = coords; - ++${l[o-1]}; - ${u} sourceLocG = coords; - ++${l[o-2]}; - ${u} sourceLocA = coords; - --${l[o-1]}; - ${u} sourceLocB = coords; - --${l[o-2]};`;let c=["x","y","z","w","u","v"].slice(0,p),h="."+c[p-1],m=c.map(N=>"int "+N),f=xn("sourceLocR",p-1).concat("inIdx.r"),g=xn("sourceLocG",p-1).concat("inIdx.g"),y=xn("sourceLocB",p-1).concat("inIdx.b"),A=xn("sourceLocA",p-1).concat("inIdx.a"),x=n==="max"?"greaterThan":"lessThan",v=a?"":` + `}},mj=class{constructor(e,t,n,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,k.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);let r=e[e.length-1],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),a||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=ut(o),u=xn("coords",o),d,p;if(s===1){p=o+1;let N=ut(p);d=` + ${N} sourceLocR = ${N}(${u.join()}, 0); + ++${u[o-1]}; + ${N} sourceLocG = ${N}(${u.join()}, 0); + ++${u[o-2]}; + ${N} sourceLocA = ${N}(${u.join()}, 0); + --${u[o-1]}; + ${N} sourceLocB = ${N}(${u.join()}, 0); + --${u[o-2]};`}else p=o,d=` + ${l} sourceLocR = coords; + ++${u[o-1]}; + ${l} sourceLocG = coords; + ++${u[o-2]}; + ${l} sourceLocA = coords; + --${u[o-1]}; + ${l} sourceLocB = coords; + --${u[o-2]};`;let c=["x","y","z","w","u","v"].slice(0,p),h="."+c[p-1],m=c.map(N=>"int "+N),f=xn("sourceLocR",p-1).concat("inIdx.r"),g=xn("sourceLocG",p-1).concat("inIdx.g"),y=xn("sourceLocB",p-1).concat("inIdx.b"),A=xn("sourceLocA",p-1).concat("inIdx.a"),x=n==="max"?"greaterThan":"lessThan",v=a?"":` inIdx = round(vec4(getBestIndicesAChannel(${f.join()}), getBestIndicesAChannel(${g.join()}), getBestIndicesAChannel(${y.join()}), @@ -1318,9 +1317,9 @@ return log(x + sqrt(x * x - 1.0));`,nj=Ke({opSnippet:tj}),aj={kernelName:go,back } ${w} void main() { - ${u} coords = getOutputCoords(); - bool hasNextCol = ${l[o-1]} < ${i[o-1]-1}; - bool hasNextRow = ${l[o-2]} < ${i[o-2]-1}; + ${l} coords = getOutputCoords(); + bool hasNextCol = ${u[o-1]} < ${i[o-1]-1}; + bool hasNextRow = ${u[o-2]} < ${i[o-2]-1}; ${d} ivec4 srcIdx = ivec4(sourceLocR${h}, sourceLocG${h}, sourceLocB${h}, sourceLocA${h}) * ${t}; @@ -1345,23 +1344,23 @@ return log(x + sqrt(x * x - 1.0));`,nj=Ke({opSnippet:tj}),aj={kernelName:go,back } setOutput(bestIndex); } - `}};function Fw(e,t,n,a=null){let r=t.shape[0],s=t.shape[1];a!=null&&(r=a.shape[0],s=a.shape[1]);let i=F.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:r,outSize:Math.ceil(s/i)},u=new hj(o,n,a==null),l=[t];a!=null&&l.push(a);let d=e.runWebGLProgram(u,l,"int32");if(d.shape[1]===1)return d;let p=Fw(e,t,n,d);return e.disposeIntermediateTensorInfo(d),p}function $w(e,t,n,a=null){let r=a!=null?a.shape:t.shape,s=r[r.length-1],i=F.computeOptimalWindowSize(s),o=new fj(r,i,n,a==null),u=a==null?[t]:[t,a],l=e.runWebGLProgram(o,u,"int32");if(l.shape.length===t.shape.length){let d=$w(e,t,n,l);return e.disposeIntermediateTensorInfo(l),d}return l}function Dw(e,t,n,a){let r=[n];if(F.assertAxesAreInnerMostDims("arg"+a.charAt(0).toUpperCase()+a.slice(1),r,t.shape.length),!te().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],[i,o]=F.computeOutAndReduceShapes(t.shape,r),u=k.sizeFromShape(o),l=Ae({inputs:{x:t},backend:e,attrs:{shape:[-1,u]}});s.push(l);let d=Fw(e,l,a);s.push(d);let p=Ae({inputs:{x:d},backend:e,attrs:{shape:i}});return s.forEach(c=>e.disposeIntermediateTensorInfo(c)),p}return $w(e,t,a)}function mj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=k.parseAxisParam(s,r.shape),o=F.getAxesPermutation(i,r.shape.length),u=r,l=[];o!=null&&(u=bn({inputs:{x:r},backend:n,attrs:{perm:o}}),l.push(u),i=F.getInnerMostAxes(i.length,u.shape.length)),F.assertAxesAreInnerMostDims("argMax",[i[0]],u.shape.length);let d=Dw(n,u,i[0],"max");return l.forEach(p=>n.disposeIntermediateTensorInfo(p)),d}var gj={kernelName:bs,backendName:"webgl",kernelFunc:mj};function yj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=k.parseAxisParam(s,r.shape),o=F.getAxesPermutation(i,r.shape.length),u=r,l=[];o!=null&&(u=bn({inputs:{x:r},backend:n,attrs:{perm:o}}),l.push(u),i=F.getInnerMostAxes(i.length,u.shape.length)),F.assertAxesAreInnerMostDims("argMin",[i[0]],u.shape.length);let d=Dw(n,u,i[0],"min");return l.forEach(p=>n.disposeIntermediateTensorInfo(p)),d}var Aj={kernelName:Fu,backendName:"webgl",kernelFunc:yj},xj=Ca+` + `}};function $w(e,t,n,a=null){let r=t.shape[0],s=t.shape[1];a!=null&&(r=a.shape[0],s=a.shape[1]);let i=F.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:r,outSize:Math.ceil(s/i)},l=new fj(o,n,a==null),u=[t];a!=null&&u.push(a);let d=e.runWebGLProgram(l,u,"int32");if(d.shape[1]===1)return d;let p=$w(e,t,n,d);return e.disposeIntermediateTensorInfo(d),p}function Dw(e,t,n,a=null){let r=a!=null?a.shape:t.shape,s=r[r.length-1],i=F.computeOptimalWindowSize(s),o=new mj(r,i,n,a==null),l=a==null?[t]:[t,a],u=e.runWebGLProgram(o,l,"int32");if(u.shape.length===t.shape.length){let d=Dw(e,t,n,u);return e.disposeIntermediateTensorInfo(u),d}return u}function Ow(e,t,n,a){let r=[n];if(F.assertAxesAreInnerMostDims("arg"+a.charAt(0).toUpperCase()+a.slice(1),r,t.shape.length),!te().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],[i,o]=F.computeOutAndReduceShapes(t.shape,r),l=k.sizeFromShape(o),u=Ae({inputs:{x:t},backend:e,attrs:{shape:[-1,l]}});s.push(u);let d=$w(e,u,a);s.push(d);let p=Ae({inputs:{x:d},backend:e,attrs:{shape:i}});return s.forEach(c=>e.disposeIntermediateTensorInfo(c)),p}return Dw(e,t,a)}function gj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=k.parseAxisParam(s,r.shape),o=F.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=bn({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=F.getInnerMostAxes(i.length,l.shape.length)),F.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let d=Ow(n,l,i[0],"max");return u.forEach(p=>n.disposeIntermediateTensorInfo(p)),d}var yj={kernelName:bs,backendName:"webgl",kernelFunc:gj};function Aj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=k.parseAxisParam(s,r.shape),o=F.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=bn({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=F.getInnerMostAxes(i.length,l.shape.length)),F.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let d=Ow(n,l,i[0],"min");return u.forEach(p=>n.disposeIntermediateTensorInfo(p)),d}var xj={kernelName:Fu,backendName:"webgl",kernelFunc:Aj},bj=Ca+` if (abs(x) > 1.) { return NAN; } return asin(x); -`,bj=Ke({opSnippet:xj}),vj={kernelName:xo,backendName:"webgl",kernelFunc:bj},wj=Ca+"return log(x + sqrt(x * x + 1.0));",kj=Ke({opSnippet:wj}),Ij={kernelName:bo,backendName:"webgl",kernelFunc:kj},Sj=Ca+` +`,vj=Ze({opSnippet:bj}),wj={kernelName:bo,backendName:"webgl",kernelFunc:vj},kj=Ca+"return log(x + sqrt(x * x + 1.0));",Ij=Ze({opSnippet:kj}),Sj={kernelName:vo,backendName:"webgl",kernelFunc:Ij},Nj=Ca+` return atan(x); -`,Nj=Ke({opSnippet:Sj}),Tj={kernelName:vo,backendName:"webgl",kernelFunc:Nj},Cj=OV+` +`,Tj=Ze({opSnippet:Nj}),Cj={kernelName:wo,backendName:"webgl",kernelFunc:Tj},Ej=zV+` return atan(a, b); -`,Ej=` +`,Rj=` vec4 result = atan(a, b); vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); - `+zV+` + `+_V+` return result; -`,Rj=sn({opSnippet:Cj,packedOpSnippet:Ej}),Mj={kernelName:ko,backendName:"webgl",kernelFunc:Rj},Fj=Ca+` +`,Mj=sn({opSnippet:Ej,packedOpSnippet:Rj}),Fj={kernelName:Io,backendName:"webgl",kernelFunc:Mj},$j=Ca+` if ((x < -1.0) || (x > 1.0)) return NAN; -return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelName:wo,backendName:"webgl",kernelFunc:$j},Od=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,u=e.dilationHeight,l=e.dilationWidth,d=e.effectiveFilterHeight,p=e.effectiveFilterWidth,c=e.padInfo.top,h=e.padInfo.left;this.outputShape=e.outShape;let m=t==="avg",f=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),n){let N=">=";this.userCode=` +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,Dj=Ze({opSnippet:$j}),Oj={kernelName:ko,backendName:"webgl",kernelFunc:Dj},Od=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,d=e.effectiveFilterHeight,p=e.effectiveFilterWidth,c=e.padInfo.top,h=e.padInfo.left;this.outputShape=e.outShape;let m=t==="avg",f=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),n){let N=">=";this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); const ivec2 pads = ivec2(${c}, ${h}); @@ -1382,7 +1381,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam float avgValue = 0.0; for (int wR = 0; wR < ${d}; - wR += ${u}) { + wR += ${l}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { @@ -1390,7 +1389,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } for (int wC = 0; wC < ${p}; - wC += ${l}) { + wC += ${u}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { @@ -1450,7 +1449,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam count = 0.0; for (int wR = 0; wR < ${d}; - wR += ${u}) { + wR += ${l}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { @@ -1458,13 +1457,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } for (int wC = 0; wC < ${v}; wC += 4) { - int xC = xCCorner + wC * ${l}; + int xC = xCCorner + wC * ${u}; vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${l}, d), - getValue(batch, xR, xC + 2 * ${l}, d), - getValue(batch, xR, xC + 3 * ${l}, d) + getValue(batch, xR, xC + ${u}, d), + getValue(batch, xR, xC + 2 * ${u}, d), + getValue(batch, xR, xC + 3 * ${u}, d) ); ${w} @@ -1483,7 +1482,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } else if (${b===2}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${l}, d), + getValue(batch, xR, xC + ${u}, d), initializationValue, initializationValue ); @@ -1492,8 +1491,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } else if (${b===3}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${l}, d), - getValue(batch, xR, xC + 2 * ${l}, d), + getValue(batch, xR, xC + ${u}, d), + getValue(batch, xR, xC + 2 * ${u}, d), initializationValue ); @@ -1502,9 +1501,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(${x}); } - `}},qg=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,u=e.strideWidth,l=e.dilationDepth,d=e.dilationHeight,p=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let A=t==="avg",x="0.0";if(A||(x="-1.0 / 1e-20"),n){let E=">=";this.userCode=` + `}},qg=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,d=e.dilationHeight,p=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let A=t==="avg",x="0.0";if(A||(x="-1.0 / 1e-20"),n){let E=">=";this.userCode=` const ivec3 strides = - ivec3(${i}, ${o}, ${u}); + ivec3(${i}, ${o}, ${l}); const ivec3 pads = ivec3(${f}, ${g}, ${y}); void main() { @@ -1524,7 +1523,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam int minMaxPosition = 0; for (int wD = 0; wD < ${c}; - wD += ${l}) { + wD += ${u}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { @@ -1572,7 +1571,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } `;this.userCode=` const ivec3 strides = - ivec3(${i}, ${o}, ${u}); + ivec3(${i}, ${o}, ${l}); const ivec3 pads = ivec3(${f}, ${g}, ${y}); const float initializationValue = ${x}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); @@ -1604,7 +1603,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam count = 0.0; for (int wD = 0; wD < ${c}; - wD += ${l}) { + wD += ${u}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { @@ -1665,8 +1664,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam setOutput(${b}); } } - `}};function Oj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;Vl(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:u}=a,l=1;k.assert(F.eitherStridesOrDilationsAreOne(i,l),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${l}'`);let d=F.computePool2DInfo(r.shape,s,i,l,o,u);if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))return Xn({inputs:{x:r},backend:n});let p=new Od(d,"avg",!1);return n.runWebGLProgram(p,[r],"float32")}var zj={kernelName:vs,backendName:"webgl",kernelFunc:Oj};function _j(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:u,dataFormat:l}=a,d=[1,1,1],p=F.computePool3DInfo(r.shape,s,i,d,o,u,l),c=new qg(p,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}var Pj={kernelName:$u,backendName:"webgl",kernelFunc:_j},Lj=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,u=e.effectiveFilterWidth,l=o-1-e.padInfo.top,d=u-1-e.padInfo.left,p=1/(t*n);this.userCode=` - const ivec2 pads = ivec2(${l}, ${d}); + `}};function zj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;jl(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,u=1;k.assert(F.eitherStridesOrDilationsAreOne(i,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=F.computePool2DInfo(r.shape,s,i,u,o,l);if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))return Xn({inputs:{x:r},backend:n});let p=new Od(d,"avg",!1);return n.runWebGLProgram(p,[r],"float32")}var _j={kernelName:vs,backendName:"webgl",kernelFunc:zj};function Pj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=a,d=[1,1,1],p=F.computePool3DInfo(r.shape,s,i,d,o,l,u),c=new qg(p,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}var Lj={kernelName:$u,backendName:"webgl",kernelFunc:Pj},Wj=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,d=l-1-e.padInfo.left,p=1/(t*n);this.userCode=` + const ivec2 pads = ivec2(${u}, ${d}); const float avgMultiplier = float(${p}); void main() { @@ -1690,7 +1689,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${u}; + for (int wC = 0; wC < ${l}; wC+= ${i}) { float dyC = float(dyCCorner + wC) / ${r}.0; @@ -1707,7 +1706,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},Wj=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,u=e.dilationHeight,l=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,h=d-1-e.padInfo.front,m=p-1-e.padInfo.top,f=c-1-e.padInfo.left,g=1/(t*n*a);this.userCode=` + `}},Bj=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,h=d-1-e.padInfo.front,m=p-1-e.padInfo.top,f=c-1-e.padInfo.left,g=1/(t*n*a);this.userCode=` const ivec3 pads = ivec3(${h}, ${m}, ${f}); const float avgMultiplier = float(${g}); @@ -1736,7 +1735,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam int idyD = int(dyD); for (int wR = 0; wR < ${p}; - wR += ${u}) { + wR += ${l}) { float dyR = float(dyRCorner + wR) / ${s}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || @@ -1746,7 +1745,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam int idyR = int(dyR); for (int wC = 0; wC < ${c}; - wC += ${l}) { + wC += ${u}) { float dyC = float(dyCCorner + wC) / ${i}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || @@ -1763,7 +1762,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}};function Bj(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:u,pad:l,dimRoundingMode:d}=a,p=[1,1,1],c=F.computePool3DInfo(i.shape,o,u,p,l,d),h=new Wj(c);return n.runWebGLProgram(h,[r],i.dtype)}var Vj={kernelName:Kp,backendName:"webgl",kernelFunc:Bj};function jj(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;Vl([r,s],"avgPoolGrad");let{filterSize:o,strides:u,pad:l}=a,d=F.computePool2DInfo(i.shape,o,u,1,l),p=new Lj(d);return n.runWebGLProgram(p,[r],i.dtype)}var Uj={kernelName:Xp,backendName:"webgl",kernelFunc:jj};function Hj(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;return Xh({a:r,b:s,transposeA:i,transposeB:o,backend:n})}var Gj={kernelName:ws,backendName:"webgl",kernelFunc:Hj},qj=class{constructor(e,t,n,a,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],F.assertAndGetBroadcastShape(e,t),F.assertAndGetBroadcastShape(e,n);let i="0.0";a!=null&&(F.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";r!=null&&(F.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + `}};function Vj(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:d}=a,p=[1,1,1],c=F.computePool3DInfo(i.shape,o,l,p,u,d),h=new Bj(c);return n.runWebGLProgram(h,[r],i.dtype)}var jj={kernelName:Kp,backendName:"webgl",kernelFunc:Vj};function Uj(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;jl([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=a,d=F.computePool2DInfo(i.shape,o,l,1,u),p=new Wj(d);return n.runWebGLProgram(p,[r],i.dtype)}var Hj={kernelName:Xp,backendName:"webgl",kernelFunc:Uj};function Gj(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;return Xh({a:r,b:s,transposeA:i,transposeB:o,backend:n})}var qj={kernelName:ws,backendName:"webgl",kernelFunc:Gj},Xj=class{constructor(e,t,n,a,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],F.assertAndGetBroadcastShape(e,t),F.assertAndGetBroadcastShape(e,n);let i="0.0";a!=null&&(F.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";r!=null&&(F.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); @@ -1773,7 +1772,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam float inv = scale * inversesqrt(variance + float(${s})); setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); } - `}},Xj=class{constructor(e,t,n,a,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],F.assertAndGetBroadcastShape(e,t),F.assertAndGetBroadcastShape(e,n);let i="vec4(0.0)";a!=null&&(F.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";r!=null&&(F.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + `}},Kj=class{constructor(e,t,n,a,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],F.assertAndGetBroadcastShape(e,t),F.assertAndGetBroadcastShape(e,n);let i="vec4(0.0)";a!=null&&(F.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";r!=null&&(F.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { vec4 offset = ${i}; vec4 scale = ${o}; @@ -1786,7 +1785,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam setOutput((x - mean) * inv + offset); } - `}},Kj=({inputs:e,backend:t,attrs:n})=>{let{x:a,mean:r,variance:s,offset:i,scale:o}=e;k.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),k.assert(i==null||r.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),k.assert(o==null||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:u}=n;u==null&&(u=.001);let l=[a,r,s],d=null;i!=null&&(d=i.shape,l.push(i));let p=null;o!=null&&(p=o.shape,l.push(o));let c=te().getBool("WEBGL_PACK_NORMALIZATION")?new Xj(a.shape,r.shape,s.shape,d,p,u):new qj(a.shape,r.shape,s.shape,d,p,u);return t.runWebGLProgram(c,l,l[0].dtype)},Zj={kernelName:Ds,backendName:"webgl",kernelFunc:Kj},Yj=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=ut(this.rank),n=`uniform int start[${this.rank}];`,a=Jj(this.rank),r,s=e.map((i,o)=>`sourceLoc.${Xg[o]} = start[${o}] + coords.${Xg[o]};`);r=` + `}},Zj=({inputs:e,backend:t,attrs:n})=>{let{x:a,mean:r,variance:s,offset:i,scale:o}=e;k.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),k.assert(i==null||r.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),k.assert(o==null||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;l==null&&(l=.001);let u=[a,r,s],d=null;i!=null&&(d=i.shape,u.push(i));let p=null;o!=null&&(p=o.shape,u.push(o));let c=te().getBool("WEBGL_PACK_NORMALIZATION")?new Kj(a.shape,r.shape,s.shape,d,p,l):new Xj(a.shape,r.shape,s.shape,d,p,l);return t.runWebGLProgram(c,u,u[0].dtype)},Yj={kernelName:Ds,backendName:"webgl",kernelFunc:Zj},Jj=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=ut(this.rank),n=`uniform int start[${this.rank}];`,a=Qj(this.rank),r,s=e.map((i,o)=>`sourceLoc.${Xg[o]} = start[${o}] + coords.${Xg[o]};`);r=` ${t} sourceLoc; ${t} coords = getOutputCoords(); ${s.join(` @@ -1797,7 +1796,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${r} setOutput(getSource(${a})); } - `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}},Xg=["x","y","z","w","u","v"];function Jj(e){if(e===1)return"sourceLoc";if(e<=6)return Xg.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var Qj=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;let t=ut(this.rank),n=xn("coords",this.rank),a=xn("sourceLoc",this.rank),r=this.rank===1?"sourceLoc":`vec2(${a.slice(-2).join()})`,s=`getChannel(getSource(${a.join()}), ${r})`,i=` + `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}},Xg=["x","y","z","w","u","v"];function Qj(e){if(e===1)return"sourceLoc";if(e<=6)return Xg.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var eU=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;let t=ut(this.rank),n=xn("coords",this.rank),a=xn("sourceLoc",this.rank),r=this.rank===1?"sourceLoc":`vec2(${a.slice(-2).join()})`,s=`getChannel(getSource(${a.join()}), ${r})`,i=` result.x = ${s}; if (++${n[this.rank-1]} < ${e[this.rank-1]}) { ++${a[this.rank-1]}; @@ -1814,20 +1813,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam result.w = ${s}; } } - `,u=this.rank<=4?`sourceLoc = coords + - ${t}(${e.map((l,d)=>`start[${d}]`).join()});`:e.map((l,d)=>`${a[d]} = ${n[d]} + start[${d}];`).join(` + `,l=this.rank<=4?`sourceLoc = coords + + ${t}(${e.map((u,d)=>`start[${d}]`).join()});`:e.map((u,d)=>`${a[d]} = ${n[d]} + start[${d}];`).join(` `);this.userCode=` uniform int start[${this.rank}]; void main() { ${t} coords = getOutputCoords(); ${t} sourceLoc; - ${u} + ${l} vec4 result = vec4(0.); ${i} ${o} setOutput(result); } - `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}};function eU(e,t,n,a){let r=a.texData.get(e.dataId),s=a.makeTensorInfo(n,e.dtype),i=a.texData.get(s.dataId);Object.assign(i,r),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=fn.computeFlatOffset(t,k.computeStrides(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};let u=a.dataRefCount.get(i.slice.origDataId)||1;return a.dataRefCount.set(i.slice.origDataId,u+1),s}function zd(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a,[o,u]=fn.parseSliceParams(r,s,i);if(fn.assertParamsValid(r,o,u),k.sizeFromShape(u)===0)return n.makeTensorInfo(u,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||r.dtype==="string"){let p=n.texData.get(r.dataId),c=BB(p.values,o,u,r.shape,r.dtype);return n.makeTensorInfo(u,r.dtype,c)}let{isPacked:l}=n.texData.get(r.dataId),d=fn.isSliceContinous(r.shape,o,u);if(l||!d){let p=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Qj(u):new Yj(u),c=p.getCustomSetupFunc(o);return n.runWebGLProgram(p,[r],r.dtype,c)}return n.uploadToGPU(r.dataId),eU(r,o,u,n)}var tU={kernelName:rl,backendName:"webgl",kernelFunc:zd},nU=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;k.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((A,x)=>A*x),u=F.getReshaped(r.shape,s,o),l=F.getPermuted(u.length,s.length),d=F.getReshapedPermuted(r.shape,s,o),p=F.getSliceBeginCoords(i,s.length),c=F.getSliceSize(d,i,s.length),h=[],m=Ae({inputs:{x:r},backend:n,attrs:{shape:u}}),f=bn({inputs:{x:m},backend:n,attrs:{perm:l}}),g=Ae({inputs:{x:f},backend:n,attrs:{shape:d}}),y=zd({inputs:{x:g},backend:n,attrs:{begin:p,size:c}});return h.push(m),h.push(f),h.push(g),h.forEach(A=>n.disposeIntermediateTensorInfo(A)),y},aU={kernelName:Du,backendName:"webgl",kernelFunc:nU};function rU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.readSync(r.dataId),u=n.readSync(s.dataId),l=ow(o,u,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,l)}var sU={kernelName:Zp,backendName:"webgl",kernelFunc:rU},iU="return float(a != b);",Ow=sn({opSnippet:iU,cpuKernelImpl:_B,dtype:"bool"}),oU={kernelName:Go,backendName:"webgl",kernelFunc:Ow};function _d(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Xn({inputs:{x:r.complexTensorInfos.real},backend:n})}var lU={kernelName:Ac,backendName:"webgl",kernelFunc:_d},uU="return float(int(x));";function dU(e,t){let n=new Yr(e.shape,uU),a=t.runWebGLProgram(n,[e],"int32");return{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}function Kg(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Xn({inputs:{x:r},backend:n});let i=$t(r.shape),o=Kg({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),u=Jr({inputs:{real:o,imag:i},backend:n});return i.dispose(),n.disposeIntermediateTensorInfo(o),u}if(r.dtype==="complex64"){let i=_d({inputs:{input:r},backend:n}),o=Kg({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!k.hasEncodingLoss(r.dtype,s)){let i=Xn({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32")return dU(r,n);if(s==="bool"){let i=n.makeTensorInfo([],"bool",k.getTypedArrayFromDType("bool",1)),o=Ow({inputs:{a:r,b:i},backend:n});return n.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var pU={kernelName:ks,backendName:"webgl",kernelFunc:Kg},zw="return ceil(x);",cU=Ke({opSnippet:zw,packedOpSnippet:zw,cpuKernelImpl:AB}),hU={kernelName:Is,backendName:"webgl",kernelFunc:cU},fU=class{constructor(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}};function tU(e,t,n,a){let r=a.texData.get(e.dataId),s=a.makeTensorInfo(n,e.dtype),i=a.texData.get(s.dataId);Object.assign(i,r),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=fn.computeFlatOffset(t,k.computeStrides(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};let l=a.dataRefCount.get(i.slice.origDataId)||1;return a.dataRefCount.set(i.slice.origDataId,l+1),s}function zd(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a,[o,l]=fn.parseSliceParams(r,s,i);if(fn.assertParamsValid(r,o,l),k.sizeFromShape(l)===0)return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||r.dtype==="string"){let p=n.texData.get(r.dataId),c=VB(p.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,c)}let{isPacked:u}=n.texData.get(r.dataId),d=fn.isSliceContinous(r.shape,o,l);if(u||!d){let p=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new eU(l):new Jj(l),c=p.getCustomSetupFunc(o);return n.runWebGLProgram(p,[r],r.dtype,c)}return n.uploadToGPU(r.dataId),tU(r,o,l,n)}var nU={kernelName:sl,backendName:"webgl",kernelFunc:zd},aU=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;k.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((A,x)=>A*x),l=F.getReshaped(r.shape,s,o),u=F.getPermuted(l.length,s.length),d=F.getReshapedPermuted(r.shape,s,o),p=F.getSliceBeginCoords(i,s.length),c=F.getSliceSize(d,i,s.length),h=[],m=Ae({inputs:{x:r},backend:n,attrs:{shape:l}}),f=bn({inputs:{x:m},backend:n,attrs:{perm:u}}),g=Ae({inputs:{x:f},backend:n,attrs:{shape:d}}),y=zd({inputs:{x:g},backend:n,attrs:{begin:p,size:c}});return h.push(m),h.push(f),h.push(g),h.forEach(A=>n.disposeIntermediateTensorInfo(A)),y},rU={kernelName:Du,backendName:"webgl",kernelFunc:aU};function sU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.readSync(r.dataId),l=n.readSync(s.dataId),u=lw(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,u)}var iU={kernelName:Zp,backendName:"webgl",kernelFunc:sU},oU="return float(a != b);",zw=sn({opSnippet:oU,cpuKernelImpl:PB,dtype:"bool"}),lU={kernelName:qo,backendName:"webgl",kernelFunc:zw};function _d(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Xn({inputs:{x:r.complexTensorInfos.real},backend:n})}var uU={kernelName:Ac,backendName:"webgl",kernelFunc:_d},dU="return float(int(x));";function pU(e,t){let n=new Yr(e.shape,dU),a=t.runWebGLProgram(n,[e],"int32");return{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}function Kg(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Xn({inputs:{x:r},backend:n});let i=$t(r.shape),o=Kg({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),l=Jr({inputs:{real:o,imag:i},backend:n});return i.dispose(),n.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=_d({inputs:{input:r},backend:n}),o=Kg({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!k.hasEncodingLoss(r.dtype,s)){let i=Xn({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32")return pU(r,n);if(s==="bool"){let i=n.makeTensorInfo([],"bool",k.getTypedArrayFromDType("bool",1)),o=zw({inputs:{a:r,b:i},backend:n});return n.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var cU={kernelName:ks,backendName:"webgl",kernelFunc:Kg},_w="return ceil(x);",hU=Ze({opSnippet:_w,packedOpSnippet:_w,cpuKernelImpl:xB}),fU={kernelName:Is,backendName:"webgl",kernelFunc:hU},mU=class{constructor(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` uniform float minVal; uniform float maxVal; @@ -1840,7 +1839,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam setOutput(clamp(value, minVal, maxVal)); } - `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}},mU=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}},gU=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` uniform float minVal; uniform float maxVal; @@ -1854,7 +1853,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam setOutput(clamp(value, vec4(minVal), vec4(maxVal))); } - `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}};function gU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o;te().getBool("WEBGL_PACK_CLIP")?o=new mU(r.shape):o=new fU(r.shape);let u=o.getCustomSetupFunc(s,i);return n.runWebGLProgram(o,[r],r.dtype,u)}var yU={kernelName:zr,backendName:"webgl",kernelFunc:gU},AU=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}};function yU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o;te().getBool("WEBGL_PACK_CLIP")?o=new gU(r.shape):o=new mU(r.shape);let l=o.getCustomSetupFunc(s,i);return n.runWebGLProgram(o,[r],r.dtype,l)}var AU={kernelName:zr,backendName:"webgl",kernelFunc:yU},xU=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); @@ -1867,7 +1866,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) ); } - `}};function _w(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}function xU(e){let{inputs:t,backend:n}=e,{x:a}=t,r=n.texData.get(a.dataId),s=new AU(a.shape),i=[_w(a,r.complexTensorInfos.real),_w(a,r.complexTensorInfos.imag)];return n.runWebGLProgram(s,i,i[0].dtype)}var bU={kernelName:Ou,backendName:"webgl",kernelFunc:xU},vU=class{constructor(e){this.outputShape=[],this.outputShape=F.computeOutShape(e,1),this.variableNames=e.map((s,i)=>`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let s=1;s`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let s=1;s`T${f}`);let o=new Array(e.length-1);o[0]=e[0][t];for(let m=1;m`T${f}`);let o=new Array(e.length-1);o[0]=e[0][t];for(let m=1;m= ${o[m-1]}) { + if (${l} < ${o[m]} && ${l} >= ${o[m-1]}) { return getChannel( - getT${m}(${Zh(i,u,f)}), - vec2(${Zh(l,u,f)})); + getT${m}(${Zh(i,l,f)}), + vec2(${Zh(u,l,f)})); }`}let c=o.length,h=o[o.length-1];p+=` return getChannel( - getT${c}(${Zh(i,u,h)}), - vec2(${Zh(l,u,h)}));`,this.userCode=` + getT${c}(${Zh(i,l,h)}), + vec2(${Zh(u,l,h)}));`,this.userCode=` float getValue(${i.map(m=>"int "+m)}) { ${p} } @@ -1913,7 +1912,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(result); } - `}};function Zh(e,t,n){let a=e.indexOf(t);return e.map((r,s)=>s===a?`${r} - ${n}`:r).join()}function Yh(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Xn({inputs:{x:r.complexTensorInfos.imag},backend:n})}var kU={kernelName:pc,backendName:"webgl",kernelFunc:Yh};function Zl(e,t,n){let a=e[0].dtype;if(a==="complex64"){let d=e.map(f=>_d({inputs:{input:f},backend:n})),p=e.map(f=>Yh({inputs:{input:f},backend:n})),c=Zl(d,t,n),h=Zl(p,t,n),m=Jr({inputs:{real:c,imag:h},backend:n});return d.forEach(f=>n.disposeIntermediateTensorInfo(f)),p.forEach(f=>n.disposeIntermediateTensorInfo(f)),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}let r=n.shouldExecuteOnCPU(e);if(a==="string"&&(r=!0),r){let d=e.map(y=>{let A=k.sizeFromShape(y.shape.slice(t));return Ae({inputs:{x:y},backend:n,attrs:{shape:[-1,A]}})}),p=d.map(y=>({vals:n.readSync(y.dataId),shape:y.shape})),c=F.computeOutShape(d.map(y=>y.shape),1),h=d[0].shape[0]===1,m=xB(p,c,a,h),f=F.computeOutShape(e.map(y=>y.shape),t),g=n.makeTensorInfo(f,a,m);return d.forEach(y=>n.disposeIntermediateTensorInfo(y)),g}if(e.length>te().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let d=Math.floor(e.length/2),p=Zl(e.slice(0,d),t,n),c=Zl(e.slice(d),t,n),h=Zl([p,c],t,n);return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),h}if(te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){let d=new wU(e.map(p=>p.shape),t);return n.runWebGLProgram(d,e,a)}let{tensors2D:s,outShape:i}=IU(e,t,n),o=new vU(s.map(d=>d.shape)),u=n.runWebGLProgram(o,s,a);s.forEach(d=>n.disposeIntermediateTensorInfo(d));let l=Ae({inputs:{x:u},attrs:{shape:i},backend:n});return n.disposeIntermediateTensorInfo(u),l}function IU(e,t,n){let a=F.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>Ae({inputs:{x:r},attrs:{shape:[-1,k.sizeFromShape(r.shape.slice(t))]},backend:n})),outShape:a}}function Pw(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a,s=k.parseAxisParam(r,t[0].shape)[0],i=F.computeOutShape(t.map(l=>l.shape),s);if(k.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(l=>k.sizeFromShape(l.shape)>0);if(o.length===1)return Xn({inputs:{x:o[0]},backend:n});let u=o.map(l=>l.shape);return F.assertParamsConsistent(u,s),Zl(o,s,n)}var SU={kernelName:Io,backendName:"webgl",kernelFunc:Pw},Lw=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,u=e.strideWidth,l=e.dilationHeight,d=e.dilationWidth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",g=f?1:2,y=f?2:3,A=f?3:1,x="",v="";n&&(a?x=`float activation(float a) { + `}};function Zh(e,t,n){let a=e.indexOf(t);return e.map((r,s)=>s===a?`${r} - ${n}`:r).join()}function Yh(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Xn({inputs:{x:r.complexTensorInfos.imag},backend:n})}var IU={kernelName:pc,backendName:"webgl",kernelFunc:Yh};function Yl(e,t,n){let a=e[0].dtype;if(a==="complex64"){let d=e.map(f=>_d({inputs:{input:f},backend:n})),p=e.map(f=>Yh({inputs:{input:f},backend:n})),c=Yl(d,t,n),h=Yl(p,t,n),m=Jr({inputs:{real:c,imag:h},backend:n});return d.forEach(f=>n.disposeIntermediateTensorInfo(f)),p.forEach(f=>n.disposeIntermediateTensorInfo(f)),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}let r=n.shouldExecuteOnCPU(e);if(a==="string"&&(r=!0),r){let d=e.map(y=>{let A=k.sizeFromShape(y.shape.slice(t));return Ae({inputs:{x:y},backend:n,attrs:{shape:[-1,A]}})}),p=d.map(y=>({vals:n.readSync(y.dataId),shape:y.shape})),c=F.computeOutShape(d.map(y=>y.shape),1),h=d[0].shape[0]===1,m=bB(p,c,a,h),f=F.computeOutShape(e.map(y=>y.shape),t),g=n.makeTensorInfo(f,a,m);return d.forEach(y=>n.disposeIntermediateTensorInfo(y)),g}if(e.length>te().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let d=Math.floor(e.length/2),p=Yl(e.slice(0,d),t,n),c=Yl(e.slice(d),t,n),h=Yl([p,c],t,n);return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),h}if(te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){let d=new kU(e.map(p=>p.shape),t);return n.runWebGLProgram(d,e,a)}let{tensors2D:s,outShape:i}=SU(e,t,n),o=new wU(s.map(d=>d.shape)),l=n.runWebGLProgram(o,s,a);s.forEach(d=>n.disposeIntermediateTensorInfo(d));let u=Ae({inputs:{x:l},attrs:{shape:i},backend:n});return n.disposeIntermediateTensorInfo(l),u}function SU(e,t,n){let a=F.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>Ae({inputs:{x:r},attrs:{shape:[-1,k.sizeFromShape(r.shape.slice(t))]},backend:n})),outShape:a}}function Lw(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a,s=k.parseAxisParam(r,t[0].shape)[0],i=F.computeOutShape(t.map(u=>u.shape),s);if(k.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(u=>k.sizeFromShape(u.shape)>0);if(o.length===1)return Xn({inputs:{x:o[0]},backend:n});let l=o.map(u=>u.shape);return F.assertParamsConsistent(l,s),Yl(o,s,n)}var NU={kernelName:So,backendName:"webgl",kernelFunc:Lw},Ww=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,d=e.dilationWidth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",g=f?1:2,y=f?2:3,A=f?3:1,x="",v="";n&&(a?x=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${n} }`:r?x=`float activation(float a) { @@ -1926,7 +1925,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam `,v="result = activation(result);");let b=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${x} - const ivec2 strides = ivec2(${o}, ${u}); + const ivec2 strides = ivec2(${o}, ${l}); const ivec2 pads = ivec2(${s}, ${i}); void main() { @@ -1943,7 +1942,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR < ${p}; wR++) { - int xR = xRCorner + wR * ${l}; + int xR = xRCorner + wR * ${u}; if (xR < 0 || xR >= ${e.inHeight}) { continue; @@ -2047,7 +2046,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${v} setOutput(result); } - `}},NU=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,n=e.padInfo.top,a=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,u=e.dilationHeight,l=e.dilationWidth,d=e.filterDepth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` + `}},TU=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,n=e.padInfo.top,a=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,d=e.filterDepth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` const ivec3 strides = ivec3(${r}, ${s}, ${i}); const ivec3 pads = ivec3(${t}, ${n}, ${a}); @@ -2073,14 +2072,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } for (int wR = 0; wR < ${p}; wR++) { - int xR = xRCorner + wR * ${u}; + int xR = xRCorner + wR * ${l}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${c}; wC++) { - int xC = xCCorner + wC * ${l}; + int xC = xCCorner + wC * ${u}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2135,18 +2134,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},TU=class{constructor(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let{filterWidth:a,inChannels:r,strideWidth:s,strideHeight:i,padInfo:o,outWidth:u,dilationWidth:l,dilationHeight:d,dataFormat:p}=n,{left:c,top:h}=o,m=r*a,f=An(),g=p==="channelsLast",y=g?0:1,A=g?1:2,x="";for(let v=0;v<=1;v++)for(let b=0;b<=1;b++)x+=` + `}},CU=class{constructor(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let{filterWidth:a,inChannels:r,strideWidth:s,strideHeight:i,padInfo:o,outWidth:l,dilationWidth:u,dilationHeight:d,dataFormat:p}=n,{left:c,top:h}=o,m=r*a,f=An(),g=p==="channelsLast",y=g?0:1,A=g?1:2,x="";for(let v=0;v<=1;v++)for(let b=0;b<=1;b++)x+=` blockIndex = rc.y + ${b}; pos = rc.x + ${v}; if(blockIndex < ${e[1]} && pos < ${e[0]}) { - offsetY = int(blockIndex / (${u})) * ${i} - ${h}; + offsetY = int(blockIndex / (${l})) * ${i} - ${h}; d0 = offsetY + ${d} * (pos / ${m}); if(d0 < ${t[y]} && d0 >= 0) { - offsetX = int(mod(float(blockIndex), ${u}.) * ${s}. - ${c}.); - d1 = offsetX + ${l} * (int(mod(float(pos), ${m}.) / ${r}.)); + offsetX = int(mod(float(blockIndex), ${l}.) * ${s}. - ${c}.); + d1 = offsetX + ${u} * (int(mod(float(pos), ${m}.) / ${r}.)); if(d1 < ${t[A]} && d1 >= 0) { @@ -2179,7 +2178,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${f.output} = result; } - `}};function Ww({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let u=e.shape,l=a.texData.get(e.dataId),d=n.inChannels,p=u[0]*u[1]*u[2],c=n.outChannels,h=n.dataFormat==="channelsLast",m=!1,f=!1,g,y=[],A=(p===1||c===1)&&d>Ew,x=u[2]%2!=0&&!!l.isPacked;if(A||!te().getBool("WEBGL_LAZILY_UNPACK")||!te().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!x){let v=h?u[0]*u[1]*u[2]:u[0]*u[2]*u[3],b=Ae({inputs:{x:e},backend:a,attrs:{shape:[1,v,n.inChannels]}}),w=Ae({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}}),N=Xh({a:b,b:w,transposeA:m,transposeB:f,backend:a,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});g=Ae({inputs:{x:N},backend:a,attrs:{shape:n.outShape}}),y.push(b),y.push(w),y.push(N)}else{let v=h?u[0]*u[1]*(u[2]+1):u[0]*u[2]*(u[3]+1),b={dataId:e.dataId,shape:[1,v,n.inChannels],dtype:e.dtype},w=l.shape;l.shape=l.shape.slice(),l.shape[l.shape.length-2]++,k.assert(Fd(l.shape,b.shape),()=>`packed reshape ${l.shape} to ${b.shape} isn't free`);let N=Ae({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(N);let C=Xh({a:b,b:N,backend:a,transposeA:m,transposeB:f,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),E=a.texData.get(C.dataId);k.assert(E.isPacked,()=>"batchMatMul result is expected to be packed"),l.shape=w,E.shape=n.outShape,g=Xn({inputs:{x:C},backend:a}),g.shape=n.outShape,y.push(C)}for(let v of y)a.disposeIntermediateTensorInfo(v);return g}function Bw({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:u,filterHeight:l,inChannels:d,outWidth:p,outHeight:c,dataFormat:h}=n,m=h==="channelsLast",f=u*l*d,g=c*p,y=[f,g],A=!0,x=!1,v=[],b=Ae({inputs:{x:e},backend:a,attrs:{shape:e.shape.slice(1)}}),w=Ae({inputs:{x:t},backend:a,attrs:{shape:[1,f,k.sizeFromShape(t.shape)/f]}});v.push(b),v.push(w);let N=new TU(y,b.shape,n),C=a.runWebGLProgram(N,[b],"float32"),E=Ae({inputs:{x:C},backend:a,attrs:{shape:[1,y[0],y[1]]}});v.push(C),v.push(E);let _=r!=null,$=s!=null,S=o==="leakyrelu",z=o?Hh(o,!0):null,O=new Iw(E.shape,w.shape,[1,g,n.outChannels],A,x,_,z,$,S),W=[E,w];if(r&&W.push(r),$&&W.push(s),S){let K=a.makeTensorInfo([],"float32",k.createScalarValue(i,"float32"));W.push(K),v.push(K)}let G=a.runWebGLProgram(O,W,"float32"),H=m?[1,c,p,n.outChannels]:[1,n.outChannels,c,p],J=Ae({inputs:{x:G},backend:a,attrs:{shape:H}});v.push(G);for(let K of v)a.disposeIntermediateTensorInfo(K);return J}function CU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:u,dilations:l,dimRoundingMode:d}=a,p=F.convertConv2DDataFormat(u),c=F.computeConv2DInfo(r.shape,s.shape,i,l,o,d,!1,p),h;if(c.filterHeight===1&&c.filterWidth===1&&c.dilationHeight===1&&c.dilationWidth===1&&c.strideHeight===1&&c.strideWidth===1&&(c.padInfo.type==="SAME"||c.padInfo.type==="VALID"))h=Ww({x:r,filter:s,convInfo:c,backend:n});else if(te().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)h=Bw({x:r,filter:s,convInfo:c,backend:n});else{let f=new Lw(c);h=n.runWebGLProgram(f,[r,s],"float32")}let m=Ae({inputs:{x:h},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(h),m}var EU={kernelName:Ss,backendName:"webgl",kernelFunc:CU},RU=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` + `}};function Bw({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,u=a.texData.get(e.dataId),d=n.inChannels,p=l[0]*l[1]*l[2],c=n.outChannels,h=n.dataFormat==="channelsLast",m=!1,f=!1,g,y=[],A=(p===1||c===1)&&d>Rw,x=l[2]%2!=0&&!!u.isPacked;if(A||!te().getBool("WEBGL_LAZILY_UNPACK")||!te().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!x){let v=h?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],b=Ae({inputs:{x:e},backend:a,attrs:{shape:[1,v,n.inChannels]}}),w=Ae({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}}),N=Xh({a:b,b:w,transposeA:m,transposeB:f,backend:a,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});g=Ae({inputs:{x:N},backend:a,attrs:{shape:n.outShape}}),y.push(b),y.push(w),y.push(N)}else{let v=h?l[0]*l[1]*(l[2]+1):l[0]*l[2]*(l[3]+1),b={dataId:e.dataId,shape:[1,v,n.inChannels],dtype:e.dtype},w=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,k.assert(Fd(u.shape,b.shape),()=>`packed reshape ${u.shape} to ${b.shape} isn't free`);let N=Ae({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(N);let C=Xh({a:b,b:N,backend:a,transposeA:m,transposeB:f,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),E=a.texData.get(C.dataId);k.assert(E.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=w,E.shape=n.outShape,g=Xn({inputs:{x:C},backend:a}),g.shape=n.outShape,y.push(C)}for(let v of y)a.disposeIntermediateTensorInfo(v);return g}function Vw({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:u,inChannels:d,outWidth:p,outHeight:c,dataFormat:h}=n,m=h==="channelsLast",f=l*u*d,g=c*p,y=[f,g],A=!0,x=!1,v=[],b=Ae({inputs:{x:e},backend:a,attrs:{shape:e.shape.slice(1)}}),w=Ae({inputs:{x:t},backend:a,attrs:{shape:[1,f,k.sizeFromShape(t.shape)/f]}});v.push(b),v.push(w);let N=new CU(y,b.shape,n),C=a.runWebGLProgram(N,[b],"float32"),E=Ae({inputs:{x:C},backend:a,attrs:{shape:[1,y[0],y[1]]}});v.push(C),v.push(E);let _=r!=null,$=s!=null,S=o==="leakyrelu",z=o?Hh(o,!0):null,O=new Sw(E.shape,w.shape,[1,g,n.outChannels],A,x,_,z,$,S),W=[E,w];if(r&&W.push(r),$&&W.push(s),S){let K=a.makeTensorInfo([],"float32",k.createScalarValue(i,"float32"));W.push(K),v.push(K)}let G=a.runWebGLProgram(O,W,"float32"),H=m?[1,c,p,n.outChannels]:[1,n.outChannels,c,p],J=Ae({inputs:{x:G},backend:a,attrs:{shape:H}});v.push(G);for(let K of v)a.disposeIntermediateTensorInfo(K);return J}function EU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:d}=a,p=F.convertConv2DDataFormat(l),c=F.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!1,p),h;if(c.filterHeight===1&&c.filterWidth===1&&c.dilationHeight===1&&c.dilationWidth===1&&c.strideHeight===1&&c.strideWidth===1&&(c.padInfo.type==="SAME"||c.padInfo.type==="VALID"))h=Bw({x:r,filter:s,convInfo:c,backend:n});else if(te().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)h=Vw({x:r,filter:s,convInfo:c,backend:n});else{let f=new Ww(c);h=n.runWebGLProgram(f,[r,s],"float32")}let m=Ae({inputs:{x:h},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(h),m}var RU={kernelName:Ss,backendName:"webgl",kernelFunc:EU},MU=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2221,7 +2220,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},MU=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,u=s?1:2,l=s?2:3,d=s?3:1;this.userCode=` + `}},FU=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=s?1:2,u=s?2:3,d=s?3:1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { @@ -2229,7 +2228,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam int batch = coords[0]; int d1 = coords[${d}]; - ivec2 dyCorner = ivec2(coords[${u}], coords[${l}]) - pads; + ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; @@ -2274,7 +2273,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},FU=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` + `}},$U=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` void main() { ivec5 coords = getOutputCoords(); int wF = coords.x; @@ -2316,8 +2315,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},$U=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,u=n-1-e.padInfo.top,l=a-1-e.padInfo.left;this.userCode=` - const ivec3 pads = ivec3(${o}, ${u}, ${l}); + `}},DU=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=a-1-e.padInfo.left;this.userCode=` + const ivec3 pads = ivec3(${o}, ${l}, ${u}); void main() { ivec5 coords = getOutputCoords(); @@ -2373,12 +2372,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}};function DU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:u,dimRoundingMode:l,filterShape:d}=a,p=F.convertConv2DDataFormat(u),c=F.computeConv2DInfo(r.shape,d,i,1,o,l,!1,p),h=new RU(c);return n.runWebGLProgram(h,[r,s],"float32")}var OU={kernelName:Jp,backendName:"webgl",kernelFunc:DU};function zU(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:u,dataFormat:l,dimRoundingMode:d}=a,p=F.convertConv2DDataFormat(l),c=F.computeConv2DInfo(i,s.shape,o,1,u,d,!1,p),h=new MU(c);return n.runWebGLProgram(h,[r,s],"float32")}var _U={kernelName:Ns,backendName:"webgl",kernelFunc:zU};function PU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:u}=a,l=F.computeConv3DInfo(r.shape,s.shape,i,u,o),d=new NU(l);return n.runWebGLProgram(d,[r,s],"float32")}var LU={kernelName:zu,backendName:"webgl",kernelFunc:PU};function WU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:u}=a,l=F.computeConv3DInfo(r.shape,u,i,1,o),d=new FU(l);return n.runWebGLProgram(d,[r,s],"float32")}var BU={kernelName:Qp,backendName:"webgl",kernelFunc:WU};function VU(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{pad:i,strides:o,inputShape:u}=a,l=F.computeConv3DInfo(u,s.shape,o,1,i),d=new $U(l);return n.runWebGLProgram(d,[r,s],"float32")}var jU={kernelName:ec,backendName:"webgl",kernelFunc:VU},UU=kw+` + `}};function OU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:d}=a,p=F.convertConv2DDataFormat(l),c=F.computeConv2DInfo(r.shape,d,i,1,o,u,!1,p),h=new MU(c);return n.runWebGLProgram(h,[r,s],"float32")}var zU={kernelName:Jp,backendName:"webgl",kernelFunc:OU};function _U(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:d}=a,p=F.convertConv2DDataFormat(u),c=F.computeConv2DInfo(i,s.shape,o,1,l,d,!1,p),h=new FU(c);return n.runWebGLProgram(h,[r,s],"float32")}var PU={kernelName:Ns,backendName:"webgl",kernelFunc:_U};function LU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=a,u=F.computeConv3DInfo(r.shape,s.shape,i,l,o),d=new TU(u);return n.runWebGLProgram(d,[r,s],"float32")}var WU={kernelName:zu,backendName:"webgl",kernelFunc:LU};function BU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=a,u=F.computeConv3DInfo(r.shape,l,i,1,o),d=new $U(u);return n.runWebGLProgram(d,[r,s],"float32")}var VU={kernelName:Qp,backendName:"webgl",kernelFunc:BU};function jU(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{pad:i,strides:o,inputShape:l}=a,u=F.computeConv3DInfo(l,s.shape,o,1,i),d=new DU(u);return n.runWebGLProgram(d,[r,s],"float32")}var UU={kernelName:ec,backendName:"webgl",kernelFunc:jU},HU=Iw+` return cos(x); -`,HU=Ke({opSnippet:UU}),GU={kernelName:Ts,backendName:"webgl",kernelFunc:HU},qU=` +`,GU=Ze({opSnippet:HU}),qU={kernelName:Ts,backendName:"webgl",kernelFunc:GU},XU=` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; -`,XU=Ke({opSnippet:qU}),KU={kernelName:So,backendName:"webgl",kernelFunc:XU},ZU=class{constructor(e,t,n,a,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,u]=e,[l]=t,[d,p]=n;this.outputShape=[l,d,p,u];let c=a==="bilinear"?1:0,[h,m]=[`${i-1}.0`,`${o-1}.0`],[f,g,y]=d>1?[`${(i-1)/(d-1)}`,"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[A,x,v]=p>1?[`${(o-1)/(p-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` +`,KU=Ze({opSnippet:XU}),ZU={kernelName:No,backendName:"webgl",kernelFunc:KU},YU=class{constructor(e,t,n,a,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[u]=t,[d,p]=n;this.outputShape=[u,d,p,l];let c=a==="bilinear"?1:0,[h,m]=[`${i-1}.0`,`${o-1}.0`],[f,g,y]=d>1?[`${(i-1)/(d-1)}`,"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[A,x,v]=p>1?[`${(o-1)/(p-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` const float height_ratio = float(${f}); const float width_ratio = float(${A}); void main() { @@ -2439,21 +2438,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam setOutput(newValue); } } - `}},YU=e=>{let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:u,extrapolationValue:l}=a,d=new ZU(r.shape,s.shape,o,u,l);return n.runWebGLProgram(d,[r,s,i],"float32")},JU={kernelName:No,backendName:"webgl",kernelFunc:YU},Vw=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=e;let a=e.length,r=t?"0.0":`getX(${jw(a,"coords")})`,s=e[e.length-1],i="",o="";t?(i=n?`end != ${s-1}`:"end != 0",o=n?"end + 1":"end - 1"):(i=n?`end + pow2 < ${s}`:"end >= pow2",o=n?"end + pow2":"end - pow2"),this.userCode=` + `}},JU=e=>{let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=a,d=new YU(r.shape,s.shape,o,l,u);return n.runWebGLProgram(d,[r,s,i],"float32")},QU={kernelName:To,backendName:"webgl",kernelFunc:JU},jw=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=e;let a=e.length,r=t?"0.0":`getX(${Uw(a,"coords")})`,s=e[e.length-1],i="",o="";t?(i=n?`end != ${s-1}`:"end != 0",o=n?"end + 1":"end - 1"):(i=n?`end + pow2 < ${s}`:"end >= pow2",o=n?"end + pow2":"end - pow2"),this.userCode=` uniform float index; void main() { ${ut(a)} coords = getOutputCoords(); - int end = ${Uw(a,"coords")}; + int end = ${Hw(a,"coords")}; float val = ${r}; int pow2 = int(pow(2.0, index)); if (${i}) { int idx = ${o}; - ${Uw(a,"coords")} = idx; - val += getX(${jw(a,"coords")}); + ${Hw(a,"coords")} = idx; + val += getX(${Uw(a,"coords")}); } setOutput(val); } - `}getCustomSetupFunc(e){return(t,n)=>{this.index==null&&(this.index=t.getUniformLocation(n,"index")),t.gl.uniform1f(this.index,e)}}};function jw(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.x, ${t}.y`;if(e===3)return`${t}.x, ${t}.y, ${t}.z`;if(e===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function Uw(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function QU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=a,u=r.shape.length,l=F.getAxesPermutation([s],u),d=r;l!=null&&(d=bn({inputs:{x:r},backend:n,attrs:{perm:l}}));let p=F.getInnerMostAxes(1,u)[0];if(p!==u-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${r.shape.length-1} but got axis=${s}`);let c=d.shape[p],h=Xn({inputs:{x:d},backend:n});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let f=new Vw(d.shape,!1,o),g=f.getCustomSetupFunc(m),y=h;h=n.runWebGLProgram(f,[h],h.dtype,g),n.disposeIntermediateTensorInfo(y)}if(i){let m=new Vw(d.shape,i,o),f=h;h=n.runWebGLProgram(m,[h],h.dtype),n.disposeIntermediateTensorInfo(f)}if(l!=null){let m=F.getUndoAxesPermutation(l),f=bn({inputs:{x:h},backend:n,attrs:{perm:m}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),f}return h}var eH={kernelName:Cs,backendName:"webgl",kernelFunc:QU};function tH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=a;if(r.shape.length===1){let u=n.readSync(r.dataId),l=n.readSync(s.dataId),d=ow(u,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,d)}else if(r.shape.length===2){let u=n.bufferSync(r),l=n.bufferSync(s),d=yB(u,l,i,o);return n.makeTensorInfo(d.shape,s.dtype,d.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}var nH={kernelName:tc,backendName:"webgl",kernelFunc:tH},aH=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=` + `}getCustomSetupFunc(e){return(t,n)=>{this.index==null&&(this.index=t.getUniformLocation(n,"index")),t.gl.uniform1f(this.index,e)}}};function Uw(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.x, ${t}.y`;if(e===3)return`${t}.x, ${t}.y, ${t}.z`;if(e===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function Hw(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function eH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=a,l=r.shape.length,u=F.getAxesPermutation([s],l),d=r;u!=null&&(d=bn({inputs:{x:r},backend:n,attrs:{perm:u}}));let p=F.getInnerMostAxes(1,l)[0];if(p!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${r.shape.length-1} but got axis=${s}`);let c=d.shape[p],h=Xn({inputs:{x:d},backend:n});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let f=new jw(d.shape,!1,o),g=f.getCustomSetupFunc(m),y=h;h=n.runWebGLProgram(f,[h],h.dtype,g),n.disposeIntermediateTensorInfo(y)}if(i){let m=new jw(d.shape,i,o),f=h;h=n.runWebGLProgram(m,[h],h.dtype),n.disposeIntermediateTensorInfo(f)}if(u!=null){let m=F.getUndoAxesPermutation(u),f=bn({inputs:{x:h},backend:n,attrs:{perm:m}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),f}return h}var tH={kernelName:Cs,backendName:"webgl",kernelFunc:eH};function nH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=a;if(r.shape.length===1){let l=n.readSync(r.dataId),u=n.readSync(s.dataId),d=lw(l,u,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,d)}else if(r.shape.length===2){let l=n.bufferSync(r),u=n.bufferSync(s),d=AB(l,u,i,o);return n.makeTensorInfo(d.shape,s.dtype,d.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}var aH={kernelName:tc,backendName:"webgl",kernelFunc:nH},rH=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -2472,7 +2471,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam float result = ${this.getInputSamplingString()}; setOutput(result); } - `}getHeightCoordString(){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)"}};function rH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockSize:s,dataFormat:i}=a;k.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],u=i==="NHWC"?r.shape[1]:r.shape[2],l=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],p=u*s,c=l*s,h=d/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=new aH(m,s,i);return n.runWebGLProgram(f,[r],r.dtype)}var sH={kernelName:To,backendName:"webgl",kernelFunc:rH},Hw=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.inHeight,i=e.inWidth,o=e.padInfo.top,u=e.padInfo.left,l=e.strideHeight,d=e.strideWidth,p=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,m=e.filterWidth,f=e.outChannels/e.inChannels,g="",y="";n&&(a?g=`float activation(float a) { + `}getHeightCoordString(){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)"}};function sH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockSize:s,dataFormat:i}=a;k.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],p=l*s,c=u*s,h=d/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=new rH(m,s,i);return n.runWebGLProgram(f,[r],r.dtype)}var iH={kernelName:Co,backendName:"webgl",kernelFunc:sH},Gw=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.inHeight,i=e.inWidth,o=e.padInfo.top,l=e.padInfo.left,u=e.strideHeight,d=e.strideWidth,p=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,m=e.filterWidth,f=e.outChannels/e.inChannels,g="",y="";n&&(a?g=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${n} }`:r?g=`float activation(float a) { @@ -2485,8 +2484,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam `,y="result = activation(result);");let A=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${g} - const ivec2 strides = ivec2(${l}, ${d}); - const ivec2 pads = ivec2(${o}, ${u}); + const ivec2 strides = ivec2(${u}, ${d}); + const ivec2 pads = ivec2(${o}, ${l}); void main() { ivec4 coords = getOutputCoords(); @@ -2528,7 +2527,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${y} setOutput(result); } - `}},Gw=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;let s=e.outChannels/e.inChannels,i=e.inHeight,o=e.inWidth,u=e.padInfo.top,l=e.padInfo.left,d=e.strideHeight,p=e.strideWidth,c=e.dilationHeight,h=e.dilationWidth,m=e.filterHeight,f=e.filterWidth,g=f,y=` + `}},qw=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;let s=e.outChannels/e.inChannels,i=e.inHeight,o=e.inWidth,l=e.padInfo.top,u=e.padInfo.left,d=e.strideHeight,p=e.strideWidth,c=e.dilationHeight,h=e.dilationWidth,m=e.filterHeight,f=e.filterWidth,g=f,y=` int xR; int xC; int xCOffset; vec4 wTexel; vec4 previous; vec4 final;`;for(let b=0;b=0 && xR < ${i}) { `;for(let w=0;w<(g+1)/2;w++){let N=w*2,C=N*h;if(y+=` xC = xCCorner + ${C}; - `,p===1){if(N= 0 && xCOffset < ${o} && xTexelC${C}Ready == 0) { xTexelC${C} = getX(batch, xR, xCOffset, d1); @@ -2581,8 +2580,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } xC${N} = xTexelC${C}; - `,C+1= 0 && xCOffset < ${o} && xTexelC${C+2}Ready == 0) { xTexelC${C+2} = getX(batch, xR, xCOffset, d1); @@ -2616,7 +2615,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } xC${N+1} = xTexelC${C+2}; - `}}else C= 0 && xCOffset < ${o} && xTexelC${C}Ready == 0) { xTexelC${C} = getX(batch, xR, xCOffset, d1); @@ -2688,7 +2687,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${A} const ivec2 strides = ivec2(${d}, ${p}); - const ivec2 pads = ivec2(${u}, ${l}); + const ivec2 pads = ivec2(${l}, ${u}); void main() { @@ -2711,7 +2710,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${x} setOutput(result); } - `}};function iH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:u,dimRoundingMode:l}=a,d=u;d==null&&(d=[1,1]),k.assert(F.eitherStridesOrDilationsAreOne(i,d),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let p=F.computeConv2DInfo(r.shape,s.shape,i,d,o,l,!0),c;return te().getBool("WEBGL_PACK_DEPTHWISECONV")&&p.strideWidth<=2&&p.outChannels/p.inChannels==1?c=new Gw(p):c=new Hw(p),n.runWebGLProgram(c,[r,s],"float32")}var oH={kernelName:Es,backendName:"webgl",kernelFunc:iH},lH=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` + `}};function oH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l,dimRoundingMode:u}=a,d=l;d==null&&(d=[1,1]),k.assert(F.eitherStridesOrDilationsAreOne(i,d),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let p=F.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!0),c;return te().getBool("WEBGL_PACK_DEPTHWISECONV")&&p.strideWidth<=2&&p.outChannels/p.inChannels==1?c=new qw(p):c=new Gw(p),n.runWebGLProgram(c,[r,s],"float32")}var lH={kernelName:Es,backendName:"webgl",kernelFunc:oH},uH=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2746,7 +2745,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},uH=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` + `}},dH=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` const ivec2 pads = ivec2(${s}, ${i}); void main() { @@ -2791,13 +2790,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}};function dH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:u,dimRoundingMode:l,filterShape:d}=a,p=F.computeConv2DInfo(r.shape,d,i,o,u,l,!0),c=new lH(p);return n.runWebGLProgram(c,[r,s],"float32")}var pH={kernelName:nc,backendName:"webgl",kernelFunc:dH};function cH(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:u,dimRoundingMode:l,inputShape:d}=a,p=F.computeConv2DInfo(d,s.shape,i,o,u,l,!0),c=new uH(p);return n.runWebGLProgram(c,[r,s],"float32")}var hH={kernelName:ac,backendName:"webgl",kernelFunc:cH},fH=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` + `}};function pH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:d}=a,p=F.computeConv2DInfo(r.shape,d,i,o,l,u,!0),c=new uH(p);return n.runWebGLProgram(c,[r,s],"float32")}var cH={kernelName:nc,backendName:"webgl",kernelFunc:pH};function hH(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:d}=a,p=F.computeConv2DInfo(d,s.shape,i,o,l,u,!0),c=new dH(p);return n.runWebGLProgram(c,[r,s],"float32")}var fH={kernelName:ac,backendName:"webgl",kernelFunc:hH},mH=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` void main() { ivec2 coords = getOutputCoords(); float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; setOutput(val); } - `}};function mH(e){let{inputs:t,backend:n}=e,{x:a}=t,r=[...a.shape,...a.shape],s=k.sizeFromShape(a.shape),i=Ae({inputs:{x:a},backend:n,attrs:{shape:[s]}}),o=new fH(s),u=n.runWebGLProgram(o,[i],i.dtype),l=Ae({inputs:{x:u},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(u),l}var gH={kernelName:rc,backendName:"webgl",kernelFunc:mH},yH=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:n,padInfo:a,strideHeight:r,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:u,dilationWidth:l}=e,{top:d,left:p}=a;this.userCode=` + `}};function gH(e){let{inputs:t,backend:n}=e,{x:a}=t,r=[...a.shape,...a.shape],s=k.sizeFromShape(a.shape),i=Ae({inputs:{x:a},backend:n,attrs:{shape:[s]}}),o=new mH(s),l=n.runWebGLProgram(o,[i],i.dtype),u=Ae({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),u}var yH={kernelName:rc,backendName:"webgl",kernelFunc:gH},AH=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:n,padInfo:a,strideHeight:r,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:d,left:p}=a;this.userCode=` const ivec2 strides = ivec2(${r}, ${s}); const ivec2 pads = ivec2(${d}, ${p}); const float neg_infinity = -3.4e38; @@ -2813,11 +2812,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam float curVal = neg_infinity; for (int h = 0; h < ${i}; h++) { - int hIn = hBeg + h * ${u}; + int hIn = hBeg + h * ${l}; if (hIn >= 0 && hIn < ${t}) { for (int w = 0; w < ${o}; w++) { - int wIn = wBeg + w * ${l}; + int wIn = wBeg + w * ${u}; if (wIn >= 0 && wIn < ${n}) { float xVal = getX(batch, hIn, wIn, d1); @@ -2835,7 +2834,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam float result = curVal; setOutput(result); } - `}};function AH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:u}=a,l=F.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",u),d,p=new yH(l);d=n.runWebGLProgram(p,[r,s],"float32");let c=Ae({inputs:{x:d},backend:n,attrs:{shape:l.outShape}});return n.disposeIntermediateTensorInfo(d),c}var xH={kernelName:_u,backendName:"webgl",kernelFunc:AH};function bH(e){let{inputs:t,backend:n,attrs:a}=e,{equation:r}=a,s=t,{allDims:i,summedDims:o,idDims:u}=F.decodeEinsumEquation(r,s.length);F.checkEinsumDimSizes(i.length,u,s);let{path:l,steps:d}=F.getEinsumComputePath(o,u),p=d.length,c=null,h=i.length,m=[];for(let f=0;f=0&&(c=qh({inputs:{x:c},backend:n,attrs:{axis:l[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var vH={kernelName:oc,backendName:"webgl",kernelFunc:bH},wH="return (x >= 0.0) ? x : (exp(x) - 1.0);",kH=` + `}};function xH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=a,u=F.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),d,p=new AH(u);d=n.runWebGLProgram(p,[r,s],"float32");let c=Ae({inputs:{x:d},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(d),c}var bH={kernelName:_u,backendName:"webgl",kernelFunc:xH};function vH(e){let{inputs:t,backend:n,attrs:a}=e,{equation:r}=a,s=t,{allDims:i,summedDims:o,idDims:l}=F.decodeEinsumEquation(r,s.length);F.checkEinsumDimSizes(i.length,l,s);let{path:u,steps:d}=F.getEinsumComputePath(o,l),p=d.length,c=null,h=i.length,m=[];for(let f=0;f=0&&(c=qh({inputs:{x:c},backend:n,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var wH={kernelName:oc,backendName:"webgl",kernelFunc:vH},kH="return (x >= 0.0) ? x : (exp(x) - 1.0);",IH=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -2844,12 +2843,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,IH=Ke({opSnippet:wH,packedOpSnippet:kH}),SH={kernelName:Co,backendName:"webgl",kernelFunc:IH},NH="return (b >= 1.0) ? a : a * (b + 1.0);",TH=` +`,SH=Ze({opSnippet:kH,packedOpSnippet:IH}),NH={kernelName:Eo,backendName:"webgl",kernelFunc:SH},TH="return (b >= 1.0) ? a : a * (b + 1.0);",CH=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); -`,CH=e=>{let{inputs:t,backend:n}=e,{dy:a,y:r}=t,s=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Dd(TH,a.shape,r.shape):new Kl(NH,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)},EH={kernelName:lc,backendName:"webgl",kernelFunc:CH},RH=` +`,EH=e=>{let{inputs:t,backend:n}=e,{dy:a,y:r}=t,s=te().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Dd(CH,a.shape,r.shape):new Zl(TH,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)},RH={kernelName:lc,backendName:"webgl",kernelFunc:EH},MH=` return vec4(equal(a, b)); -`,MH="return float(a == b);",FH=sn({opSnippet:MH,packedOpSnippet:RH,dtype:"bool",cpuKernelImpl:bB}),$H={kernelName:Ro,backendName:"webgl",kernelFunc:FH},DH=` +`,FH="return float(a == b);",$H=sn({opSnippet:FH,packedOpSnippet:MH,dtype:"bool",cpuKernelImpl:vB}),DH={kernelName:Mo,backendName:"webgl",kernelFunc:$H},OH=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. @@ -2864,7 +2863,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam x = abs(x); float t = 1.0 / (1.0 + p * x); return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); -`,OH=Ke({opSnippet:DH}),zH={kernelName:Eo,backendName:"webgl",kernelFunc:OH},qw="return exp(x);",Xw=Ke({opSnippet:qw,packedOpSnippet:qw,cpuKernelImpl:vB}),_H={kernelName:Ms,backendName:"webgl",kernelFunc:Xw};function Zg(e){let{inputs:t,attrs:n,backend:a}=e,{dim:r}=n,{input:s}=t,i=s.shape.length,o=s.shape.slice(),u=r;return r<0&&(k.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),u=i+r+1),o.splice(u,0,1),Ae({inputs:{x:s},backend:a,attrs:{shape:o}})}var PH={kernelName:Mo,backendName:"webgl",kernelFunc:Zg},Kw="return exp(x) - 1.0;",LH=Ke({opSnippet:Kw,packedOpSnippet:Kw,cpuKernelImpl:wB}),WH={kernelName:Fo,backendName:"webgl",kernelFunc:LH},Zw=class{constructor(e,t,n){this.variableNames=["real","imag"];let a=t[1];this.outputShape=t;let r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${a}.0`:"1.0",i;if(e==="real")i="return real * expR - imag * expI;";else if(e==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` +`,zH=Ze({opSnippet:OH}),_H={kernelName:Ro,backendName:"webgl",kernelFunc:zH},Xw="return exp(x);",Kw=Ze({opSnippet:Xw,packedOpSnippet:Xw,cpuKernelImpl:wB}),PH={kernelName:Ms,backendName:"webgl",kernelFunc:Kw};function Zg(e){let{inputs:t,attrs:n,backend:a}=e,{dim:r}=n,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(k.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),Ae({inputs:{x:s},backend:a,attrs:{shape:o}})}var LH={kernelName:Fo,backendName:"webgl",kernelFunc:Zg},Zw="return exp(x) - 1.0;",WH=Ze({opSnippet:Zw,packedOpSnippet:Zw,cpuKernelImpl:kB}),BH={kernelName:$o,backendName:"webgl",kernelFunc:WH},Yw=class{constructor(e,t,n){this.variableNames=["real","imag"];let a=t[1];this.outputShape=t;let r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${a}.0`:"1.0",i;if(e==="real")i="return real * expR - imag * expI;";else if(e==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` const float exponentMultiplier = ${r}; float unaryOpComplex(float real, float expR, float imag, float expI) { @@ -2897,13 +2896,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ivec2 coords = getOutputCoords(); setOutput(mulMatDFT(coords[0], coords[1])); } - `}};function Yw(e,t,n){let a=n.texData.get(e.dataId),r=k.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=Ae({inputs:{x:e},backend:n,attrs:{shape:[i,s]}}),u=o.shape,l=new Zw("real",u,t),d=new Zw("imag",u,t),p=[{dataId:a.complexTensorInfos.real.dataId,dtype:a.complexTensorInfos.real.dtype,shape:u},{dataId:a.complexTensorInfos.imag.dataId,dtype:a.complexTensorInfos.imag.dtype,shape:u}],c=n.runWebGLProgram(l,p,"float32"),h=n.runWebGLProgram(d,p,"float32"),m=Jr({inputs:{real:c,imag:h},backend:n});n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h);let f=Ae({inputs:{x:m},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(m),f}function BH(e){let{inputs:t,backend:n}=e,{input:a}=t;return Yw(a,!1,n)}var VH={kernelName:uc,backendName:"webgl",kernelFunc:BH},jH=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` + `}};function Jw(e,t,n){let a=n.texData.get(e.dataId),r=k.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=Ae({inputs:{x:e},backend:n,attrs:{shape:[i,s]}}),l=o.shape,u=new Yw("real",l,t),d=new Yw("imag",l,t),p=[{dataId:a.complexTensorInfos.real.dataId,dtype:a.complexTensorInfos.real.dtype,shape:l},{dataId:a.complexTensorInfos.imag.dataId,dtype:a.complexTensorInfos.imag.dtype,shape:l}],c=n.runWebGLProgram(u,p,"float32"),h=n.runWebGLProgram(d,p,"float32"),m=Jr({inputs:{real:c,imag:h},backend:n});n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h);let f=Ae({inputs:{x:m},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(m),f}function VH(e){let{inputs:t,backend:n}=e,{input:a}=t;return Jw(a,!1,n)}var jH={kernelName:uc,backendName:"webgl",kernelFunc:VH},UH=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` uniform float value; void main() { // Input can be obtained from uniform value. setOutput(value); } - `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}};function Yg(e){let{backend:t,attrs:n}=e,{shape:a,value:r}=n,{dtype:s}=n;if(s=s||k.inferDtype(r),s==="string"){let i=k.getArrayFromDType(s,k.sizeFromShape(a));return i.fill(r),t.makeTensorInfo(a,s,i)}else{let i=new jH(a,r),o=i.getCustomSetupFunc(r);return t.runWebGLProgram(i,[],s,o)}}var UH={kernelName:Pu,backendName:"webgl",kernelFunc:Yg},HH=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}};function Yg(e){let{backend:t,attrs:n}=e,{shape:a,value:r}=n,{dtype:s}=n;if(s=s||k.inferDtype(r),s==="string"){let i=k.getArrayFromDType(s,k.sizeFromShape(a));return i.fill(r),t.makeTensorInfo(a,s,i)}else{let i=new UH(a,r),o=i.getCustomSetupFunc(r);return t.runWebGLProgram(i,[],s,o)}}var HH={kernelName:Pu,backendName:"webgl",kernelFunc:Yg},GH=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int x = coords[2]; @@ -2917,7 +2916,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(outputValue); } - `}},GH={kernelName:$o,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:n}=e,a=t,r=new HH(n.shape);return a.runWebGLProgram(r,[n],n.dtype)}},Jw="return floor(x);",qH=Ke({opSnippet:Jw,packedOpSnippet:Jw,cpuKernelImpl:kB}),XH={kernelName:Fs,backendName:"webgl",kernelFunc:qH},KH=` + `}},qH={kernelName:Do,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:n}=e,a=t,r=new GH(n.shape);return a.runWebGLProgram(r,[n],n.dtype)}},Qw="return floor(x);",XH=Ze({opSnippet:Qw,packedOpSnippet:Qw,cpuKernelImpl:IB}),KH={kernelName:Fs,backendName:"webgl",kernelFunc:XH},ZH=` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); @@ -2927,7 +2926,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } else { return NAN; } -`,ZH=` +`,YH=` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); @@ -2948,7 +2947,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam result[3] = idiv(ia[3], ib[3], s[3]); } return vec4(result); -`,YH=sn({opSnippet:KH,packedOpSnippet:ZH,dtype:"int32"}),JH={kernelName:$s,backendName:"webgl",kernelFunc:YH},QH=class{constructor(e){this.variableNames=["A"];let t=An(),[n,a]=e;this.outputShape=e,this.userCode=` +`,JH=sn({opSnippet:ZH,packedOpSnippet:YH,dtype:"int32"}),QH={kernelName:$s,backendName:"webgl",kernelFunc:JH},eG=class{constructor(e){this.variableNames=["A"];let t=An(),[n,a]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -2970,7 +2969,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam setOutput(floor(value * 255.0 + 0.5)); } - `}},eG=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=An(),[n,a]=e;this.outputShape=e,this.userCode=` + `}},tG=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=An(),[n,a]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -3004,7 +3003,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${t.output} = result; } - `}},tG={kernelName:Rc,backendName:"webgl",kernelFunc:nG},Yl;function nG(e){let{inputs:t,backend:n,attrs:a}=e,{pixels:r}=t,{numChannels:s}=a,i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,[u,l]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],d=[l,u],p=[l,u,s];(o||i)&&(Yl==null&&(Yl=document.createElement("canvas").getContext("2d")),Yl.canvas.width=u,Yl.canvas.height=l,Yl.drawImage(r,0,0,u,l),r=Yl.canvas);let c=n.makeTensorInfo(d,"int32");n.texData.get(c.dataId).usage=da.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(c.dataId),r);let h=te().getBool("WEBGL_PACK")?new eG(p):new QH(p),m=n.runWebGLProgram(h,[c],"int32");return n.disposeData(c.dataId),m}function aG(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:u,pad:l,dataFormat:d,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=F.convertConv2DDataFormat(d),g=F.computeConv2DInfo(r.shape,s.shape,u,p,l,c,!1,f),y,A=[];if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type==="SAME"||g.padInfo.type==="VALID"))y=Ww({x:r,filter:s,convInfo:g,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else if(te().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)y=Bw({x:r,filter:s,convInfo:g,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else{let v=i!=null,b=o!=null,w=h==="leakyrelu",N=h?Hh(h,!1):null,C=new Lw(g,v,N,b,w),E=[r,s];if(i&&E.push(i),o&&E.push(o),w){let _=n.makeTensorInfo([],"float32",k.createScalarValue(m,"float32"));E.push(_),A.push(_)}y=n.runWebGLProgram(C,E,"float32")}let x=Ae({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return A.push(y),A.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var rG={kernelName:fi,backendName:"webgl",kernelFunc:aG};function sG(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:u,pad:l,dilations:d,dimRoundingMode:p,activation:c,leakyreluAlpha:h}=a,m=[],f=d;f==null&&(f=[1,1]),k.assert(F.eitherStridesOrDilationsAreOne(u,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${u} and dilations '${f}'`);let g=F.computeConv2DInfo(r.shape,s.shape,u,f,l,p,!0),y=te().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,A=c?Hh(c,y):null,x=[r,s],v=i!=null,b=o!=null,w=c==="leakyrelu";if(v&&x.push(i),b&&x.push(o),w){let E=n.makeTensorInfo([],"float32",k.createScalarValue(h,"float32"));x.push(E),m.push(E)}let N;y?N=new Gw(g,v,A,b,w):N=new Hw(g,v,A,b,w);let C=n.runWebGLProgram(N,x,"float32");return m.forEach(E=>n.disposeIntermediateTensorInfo(E)),C}var iG={kernelName:mi,backendName:"webgl",kernelFunc:sG},oG=class{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;let a=ut(t.length),r=ut(n.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode=` + `}},nG={kernelName:Rc,backendName:"webgl",kernelFunc:aG},Jl;function aG(e){let{inputs:t,backend:n,attrs:a}=e,{pixels:r}=t,{numChannels:s}=a,i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,[l,u]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],d=[u,l],p=[u,l,s];(o||i)&&(Jl==null&&(Jl=document.createElement("canvas").getContext("2d")),Jl.canvas.width=l,Jl.canvas.height=u,Jl.drawImage(r,0,0,l,u),r=Jl.canvas);let c=n.makeTensorInfo(d,"int32");n.texData.get(c.dataId).usage=da.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(c.dataId),r);let h=te().getBool("WEBGL_PACK")?new tG(p):new eG(p),m=n.runWebGLProgram(h,[c],"int32");return n.disposeData(c.dataId),m}function rG(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:d,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=F.convertConv2DDataFormat(d),g=F.computeConv2DInfo(r.shape,s.shape,l,p,u,c,!1,f),y,A=[];if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type==="SAME"||g.padInfo.type==="VALID"))y=Bw({x:r,filter:s,convInfo:g,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else if(te().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)y=Vw({x:r,filter:s,convInfo:g,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else{let v=i!=null,b=o!=null,w=h==="leakyrelu",N=h?Hh(h,!1):null,C=new Ww(g,v,N,b,w),E=[r,s];if(i&&E.push(i),o&&E.push(o),w){let _=n.makeTensorInfo([],"float32",k.createScalarValue(m,"float32"));E.push(_),A.push(_)}y=n.runWebGLProgram(C,E,"float32")}let x=Ae({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return A.push(y),A.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var sG={kernelName:fi,backendName:"webgl",kernelFunc:rG};function iG(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dimRoundingMode:p,activation:c,leakyreluAlpha:h}=a,m=[],f=d;f==null&&(f=[1,1]),k.assert(F.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let g=F.computeConv2DInfo(r.shape,s.shape,l,f,u,p,!0),y=te().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,A=c?Hh(c,y):null,x=[r,s],v=i!=null,b=o!=null,w=c==="leakyrelu";if(v&&x.push(i),b&&x.push(o),w){let E=n.makeTensorInfo([],"float32",k.createScalarValue(h,"float32"));x.push(E),m.push(E)}let N;y?N=new qw(g,v,A,b,w):N=new Gw(g,v,A,b,w);let C=n.runWebGLProgram(N,x,"float32");return m.forEach(E=>n.disposeIntermediateTensorInfo(E)),C}var oG={kernelName:mi,backendName:"webgl",kernelFunc:iG},lG=class{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;let a=ut(t.length),r=ut(n.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode=` ${a} strides = ${a}(${this.strides}); void main() { ${r} coords = getOutputCoords(); @@ -3015,21 +3014,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(getX(flattenIndex, coords[1])); } - `}};function lG(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=r.shape,i=s[s.length-1],o=k.sizeFromShape(a.shape),[u,l,d,p]=F.prepareAndValidate(a,r),c=Ae({inputs:{x:r},backend:n,attrs:{shape:[l,i]}}),h=Ae({inputs:{x:a},backend:n,attrs:{shape:[k.sizeFromShape(a.shape)/d,d]}});if(n.shouldExecuteOnCPU([a,r])||a.dtype==="string"){let y=n.readSync(r.dataId),A=n.bufferSync(a),x=IB(y,A,a.dtype,l,i,d,p,a.shape,o);return n.makeTensorInfo(u,a.dtype,x.values)}let m=new oG(i,p,[l,d]),f=n.runWebGLProgram(m,[h,c],h.dtype),g=Ae({inputs:{x:f},backend:n,attrs:{shape:u}});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),g}var uG={kernelName:Oo,backendName:"webgl",kernelFunc:lG},dG=class{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let n=ut(this.rank),a=pG(e,2);this.userCode=` + `}};function uG(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=r.shape,i=s[s.length-1],o=k.sizeFromShape(a.shape),[l,u,d,p]=F.prepareAndValidate(a,r),c=Ae({inputs:{x:r},backend:n,attrs:{shape:[u,i]}}),h=Ae({inputs:{x:a},backend:n,attrs:{shape:[k.sizeFromShape(a.shape)/d,d]}});if(n.shouldExecuteOnCPU([a,r])||a.dtype==="string"){let y=n.readSync(r.dataId),A=n.bufferSync(a),x=SB(y,A,a.dtype,u,i,d,p,a.shape,o);return n.makeTensorInfo(l,a.dtype,x.values)}let m=new lG(i,p,[u,d]),f=n.runWebGLProgram(m,[h,c],h.dtype),g=Ae({inputs:{x:f},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(f),g}var dG={kernelName:zo,backendName:"webgl",kernelFunc:uG},pG=class{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let n=ut(this.rank),a=cG(e,2);this.userCode=` void main() { ${n} resRC = getOutputCoords(); setOutput(getA(${a})); } - `}};function pG(e,t){let n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[];for(let r=0;rn.disposeIntermediateTensorInfo(b)),n.makeTensorInfo(l.outputShape,v.dtype,v.values)}let f=new dG(c.shape,m),g=n.runWebGLProgram(f,[c,h],c.dtype);p.push(g);let y=Ae({inputs:{x:g},backend:n,attrs:{shape:l.outputShape}});return p.forEach(A=>n.disposeIntermediateTensorInfo(A)),y}var hG={kernelName:Do,backendName:"webgl",kernelFunc:cG},fG="return float(a > b);",mG=` + `}};function cG(e,t){let n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[];for(let r=0;rn.disposeIntermediateTensorInfo(b)),n.makeTensorInfo(u.outputShape,v.dtype,v.values)}let f=new pG(c.shape,m),g=n.runWebGLProgram(f,[c,h],c.dtype);p.push(g);let y=Ae({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return p.forEach(A=>n.disposeIntermediateTensorInfo(A)),y}var fG={kernelName:Oo,backendName:"webgl",kernelFunc:hG},mG="return float(a > b);",gG=` return vec4(greaterThan(a, b)); -`,gG=sn({opSnippet:fG,packedOpSnippet:mG,cpuKernelImpl:NB,dtype:"bool"}),yG={kernelName:zo,backendName:"webgl",kernelFunc:gG},AG="return float(a >= b);",xG=` +`,yG=sn({opSnippet:mG,packedOpSnippet:gG,cpuKernelImpl:TB,dtype:"bool"}),AG={kernelName:_o,backendName:"webgl",kernelFunc:yG},xG="return float(a >= b);",bG=` return vec4(greaterThanEqual(a, b)); -`,bG=sn({opSnippet:AG,packedOpSnippet:xG,dtype:"bool",cpuKernelImpl:TB}),vG={kernelName:Os,backendName:"webgl",kernelFunc:bG};function wG(e){let{inputs:t,backend:n}=e,{input:a}=t;return Yw(a,!0,n)}var kG={kernelName:dc,backendName:"webgl",kernelFunc:wG},IG="return float(!isnan(x) && !isinf(x));",SG=Ke({opSnippet:IG,dtype:"bool"}),NG={kernelName:_o,backendName:"webgl",kernelFunc:SG},TG="return float(isinf(x));",CG=Ke({opSnippet:TG,dtype:"bool"}),EG={kernelName:Po,backendName:"webgl",kernelFunc:CG},RG="return float(isnan(x));",MG=Ke({opSnippet:RG,dtype:"bool"}),FG={kernelName:Lo,backendName:"webgl",kernelFunc:MG},$G="return float(a < b);",DG=` +`,vG=sn({opSnippet:xG,packedOpSnippet:bG,dtype:"bool",cpuKernelImpl:CB}),wG={kernelName:Os,backendName:"webgl",kernelFunc:vG};function kG(e){let{inputs:t,backend:n}=e,{input:a}=t;return Jw(a,!0,n)}var IG={kernelName:dc,backendName:"webgl",kernelFunc:kG},SG="return float(!isnan(x) && !isinf(x));",NG=Ze({opSnippet:SG,dtype:"bool"}),TG={kernelName:Po,backendName:"webgl",kernelFunc:NG},CG="return float(isinf(x));",EG=Ze({opSnippet:CG,dtype:"bool"}),RG={kernelName:Lo,backendName:"webgl",kernelFunc:EG},MG="return float(isnan(x));",FG=Ze({opSnippet:MG,dtype:"bool"}),$G={kernelName:Wo,backendName:"webgl",kernelFunc:FG},DG="return float(a < b);",OG=` return vec4(lessThan(a, b)); -`,OG=sn({opSnippet:$G,packedOpSnippet:DG,cpuKernelImpl:CB,dtype:"bool"}),zG={kernelName:Wo,backendName:"webgl",kernelFunc:OG},_G="return float(a <= b);",PG=` +`,zG=sn({opSnippet:DG,packedOpSnippet:OG,cpuKernelImpl:EB,dtype:"bool"}),_G={kernelName:Bo,backendName:"webgl",kernelFunc:zG},PG="return float(a <= b);",LG=` return vec4(lessThanEqual(a, b)); -`,LG=sn({opSnippet:_G,packedOpSnippet:PG,cpuKernelImpl:EB,dtype:"bool"}),WG={kernelName:Bo,backendName:"webgl",kernelFunc:LG};function BG(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=RB(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var VG={kernelName:cc,backendName:"webgl",kernelFunc:BG},jG=`if (x < 0.0) return NAN; - return log(x);`,UG=` +`,WG=sn({opSnippet:PG,packedOpSnippet:LG,cpuKernelImpl:RB,dtype:"bool"}),BG={kernelName:Vo,backendName:"webgl",kernelFunc:WG};function VG(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=MB(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var jG={kernelName:cc,backendName:"webgl",kernelFunc:VG},UG=`if (x < 0.0) return NAN; + return log(x);`,HG=` vec4 result = log(x); vec4 isNaN = vec4(lessThan(x, vec4(0.0))); result.r = isNaN.r == 1.0 ? NAN : result.r; @@ -3038,16 +3037,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam result.a = isNaN.a == 1.0 ? NAN : result.a; return result; -`,HG=Ke({opSnippet:jG,packedOpSnippet:UG,cpuKernelImpl:MB}),GG={kernelName:Ps,backendName:"webgl",kernelFunc:HG},qG="return log(1.0 + x);",XG=Ke({opSnippet:qG}),KG={kernelName:Vo,backendName:"webgl",kernelFunc:XG},ZG="return float(a >= 1.0 && b >= 1.0);",YG=` +`,GG=Ze({opSnippet:UG,packedOpSnippet:HG,cpuKernelImpl:FB}),qG={kernelName:Ps,backendName:"webgl",kernelFunc:GG},XG="return log(1.0 + x);",KG=Ze({opSnippet:XG}),ZG={kernelName:jo,backendName:"webgl",kernelFunc:KG},YG="return float(a >= 1.0 && b >= 1.0);",JG=` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); -`,JG=sn({opSnippet:ZG,packedOpSnippet:YG,dtype:"bool"}),QG={kernelName:jo,backendName:"webgl",kernelFunc:JG},eq="return float(!(x >= 1.0));",tq=Ke({opSnippet:eq}),nq={kernelName:Lu,backendName:"webgl",kernelFunc:tq},aq="return float(a >= 1.0 || b >= 1.0);",rq=` +`,QG=sn({opSnippet:YG,packedOpSnippet:JG,dtype:"bool"}),eq={kernelName:Uo,backendName:"webgl",kernelFunc:QG},tq="return float(!(x >= 1.0));",nq=Ze({opSnippet:tq}),aq={kernelName:Lu,backendName:"webgl",kernelFunc:nq},rq="return float(a >= 1.0 || b >= 1.0);",sq=` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); -`,sq=sn({opSnippet:aq,packedOpSnippet:rq,dtype:"bool"}),iq={kernelName:Wu,backendName:"webgl",kernelFunc:sq},oq=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,u=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${u})`:r===1?o=`1.0/(${u})`:o=`exp(log(${u}) * float(-${r}));`,this.userCode=` +`,iq=sn({opSnippet:rq,packedOpSnippet:sq,dtype:"bool"}),oq={kernelName:Wu,backendName:"webgl",kernelFunc:iq},lq=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3066,7 +3065,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam float val = x * ${o}; setOutput(val); } - `}},lq=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let s=t,i=e[3]-1;this.outputShape=e;let o,u=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${u})`:r===1?o=`1.0/(${u})`:o=`exp(log(${u}) * float(-${r}));`,this.userCode=` + `}},uq=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords.x; @@ -3128,7 +3127,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam vec4 result = xAtOutputCoords * ${o}; setOutput(result); } - `}},uq=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:u}=a,l=te().getBool("WEBGL_PACK_NORMALIZATION")?new lq(r.shape,s,i,o,u):new oq(r.shape,s,i,o,u);return n.runWebGLProgram(l,[r],r.dtype)},dq={kernelName:Bu,backendName:"webgl",kernelFunc:uq},pq=class{constructor(e,t,n,a,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=a,this.beta=r,this.userCode=` + `}},dq=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=a,u=te().getBool("WEBGL_PACK_NORMALIZATION")?new uq(r.shape,s,i,o,l):new lq(r.shape,s,i,o,l);return n.runWebGLProgram(u,[r],r.dtype)},pq={kernelName:Bu,backendName:"webgl",kernelFunc:dq},cq=class{constructor(e,t,n,a,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=a,this.beta=r,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3183,14 +3182,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(result); } - `}},cq=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:u,alpha:l,beta:d}=a,p=new pq(r.shape,o,u,l,d);return n.runWebGLProgram(p,[r,s,i],r.dtype)},hq={kernelName:hc,backendName:"webgl",kernelFunc:cq};function fq(e,t,n,a){let r=k.sizeFromShape(t),s=k.sizeFromShape(e.shape)/r,i=Ae({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Wi(i,e.dtype,"max",a),u=Ae({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),u}function Qw(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=a,o=r.shape.length,u=k.parseAxisParam(s,r.shape),l=u,d=F.getAxesPermutation(l,o),p=d!=null,c=n.shouldExecuteOnCPU([r]),h=r;if(p){if(c){let A=n.texData.get(h.dataId).values,x=new Array(o);for(let w=0;w{let{inputs:t,backend:n,attrs:a}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:d}=a,p=new cq(r.shape,o,l,u,d);return n.runWebGLProgram(p,[r,s,i],r.dtype)},fq={kernelName:hc,backendName:"webgl",kernelFunc:hq};function mq(e,t,n,a){let r=k.sizeFromShape(t),s=k.sizeFromShape(e.shape)/r,i=Ae({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Wi(i,e.dtype,"max",a),l=Ae({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}function e6(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=a,o=r.shape.length,l=k.parseAxisParam(s,r.shape),u=l,d=F.getAxesPermutation(u,o),p=d!=null,c=n.shouldExecuteOnCPU([r]),h=r;if(p){if(c){let A=n.texData.get(h.dataId).values,x=new Array(o);for(let w=0;w`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${l}'`);let d=F.computePool2DInfo(r.shape,s,i,l,o,u);if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))return Xn({inputs:{x:r},backend:n});let p=new Od(d,"max",!1);return n.runWebGLProgram(p,[r],r.dtype)}var vq={kernelName:Bs,backendName:"webgl",kernelFunc:bq};function wq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:u,dimRoundingMode:l}=a,d=[1,1,1],p=F.computePool3DInfo(r.shape,s,i,d,o,l,u),c=new qg(p,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}var kq={kernelName:Vu,backendName:"webgl",kernelFunc:wq},Iq=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,n=e.strideWidth,a=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,i=r-1-e.padInfo.top,o=s-1-e.padInfo.left,u=r*s-1;this.userCode=` +`,xq=sn({opSnippet:yq,packedOpSnippet:Aq,cpuKernelImpl:DB}),bq={kernelName:Ws,backendName:"webgl",kernelFunc:xq};function vq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;jl(r,"maxPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,u=1;k.assert(F.eitherStridesOrDilationsAreOne(i,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=F.computePool2DInfo(r.shape,s,i,u,o,l);if(d.filterWidth===1&&d.filterHeight===1&&k.arraysEqual(d.inShape,d.outShape))return Xn({inputs:{x:r},backend:n});let p=new Od(d,"max",!1);return n.runWebGLProgram(p,[r],r.dtype)}var wq={kernelName:Bs,backendName:"webgl",kernelFunc:vq};function kq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=a,d=[1,1,1],p=F.computePool3DInfo(r.shape,s,i,d,o,u,l),c=new qg(p,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}var Iq={kernelName:Vu,backendName:"webgl",kernelFunc:kq},Sq=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,n=e.strideWidth,a=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,i=r-1-e.padInfo.top,o=s-1-e.padInfo.left,l=r*s-1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { @@ -3224,7 +3223,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam int idyC = int(dyC); float dyValue = getDy(b, idyR, idyC, d); - int maxPosValue = ${u} - int(getMaxPos(b, idyR, idyC, d)); + int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d)); // Get the current value, check it against the value from the // position matrix. @@ -3236,7 +3235,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}},Sq=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,u=e.effectiveFilterHeight,l=e.effectiveFilterWidth,d=o-1-e.padInfo.front,p=u-1-e.padInfo.top,c=l-1-e.padInfo.left,h=o*u*l-1;this.userCode=` + `}},Nq=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,d=o-1-e.padInfo.front,p=l-1-e.padInfo.top,c=u-1-e.padInfo.left,h=o*l*u-1;this.userCode=` const ivec3 pads = ivec3(${d}, ${p}, ${c}); void main() { @@ -3263,7 +3262,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } int idyD = int(dyD); - for (int wR = 0; wR < ${u}; + for (int wR = 0; wR < ${l}; wR += ${s}) { float dyR = float(dyRCorner + wR) / ${n}.0; @@ -3273,7 +3272,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${l}; + for (int wC = 0; wC < ${u}; wC += ${i}) { float dyC = float(dyCCorner + wC) / ${a}.0; @@ -3290,8 +3289,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam // Get the current value, check it against the value from the // position matrix. int curPosValue = - wD * ${u} * ${l} + - wR * ${l} + wC; + wD * ${l} * ${u} + + wR * ${u} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; @@ -3300,23 +3299,23 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam } setOutput(dotProd); } - `}};function Nq(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:u,pad:l,dimRoundingMode:d}=a,p=[1,1,1],c=F.computePool3DInfo(i.shape,o,u,p,l,d),h=new qg(c,"max",!0),m=n.runWebGLProgram(h,[i],i.dtype),f=new Sq(c),g=n.runWebGLProgram(f,[r,m],i.dtype);return n.disposeIntermediateTensorInfo(m),g}var Tq={kernelName:mc,backendName:"webgl",kernelFunc:Nq};function Cq(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s,output:i}=t,o=s;Vl([s,i],"maxPoolGrad");let{filterSize:u,strides:l,pad:d,dimRoundingMode:p}=a,c=F.computePool2DInfo(o.shape,u,l,1,d,p),h=!0,m=new Od(c,"max",h),f=n.runWebGLProgram(m,[o],o.dtype),g=new Iq(c),y=n.runWebGLProgram(g,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),y}var Eq={kernelName:fc,backendName:"webgl",kernelFunc:Cq};function Rq(e,t,n,a){let r=new Od(n,"max",!1),s=a.runWebGLProgram(r,[e],"float32");r=new Od(n,"max",!0,!0,t);let i=a.runWebGLProgram(r,[e],"float32");return[s,i]}var Mq={kernelName:gc,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,u=n;k.assert(a.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${a.shape.length}.`);let l=[1,1];k.assert(F.eitherStridesOrDilationsAreOne(s,l),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${l}'`);let d=F.computePool2DInfo(a.shape,r,s,l,i),[p,c]=Rq(a,o,d,u);return[p,c]}};function Fq(e,t,n,a){let r=k.sizeFromShape(t),s=k.sizeFromShape(e.shape)/r,i=Ae({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Wi(i,"float32","mean",a),u=Ae({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),u}var $q={kernelName:Vs,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{keepDims:r,axis:s}=t,i=n,o=a.shape.length,u=k.parseAxisParam(s,a.shape),l=u,d=F.getAxesPermutation(l,o),p=d!=null,c=i.shouldExecuteOnCPU([a]),h=[],m=a;if(p){if(c){let x=i.texData.get(m.dataId).values,v=new Array(o);for(let N=0;N{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;k.assert(a.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${a.shape.length}.`);let u=[1,1];k.assert(F.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let d=F.computePool2DInfo(a.shape,r,s,u,i),[p,c]=Mq(a,o,d,l);return[p,c]}};function $q(e,t,n,a){let r=k.sizeFromShape(t),s=k.sizeFromShape(e.shape)/r,i=Ae({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Wi(i,"float32","mean",a),l=Ae({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}var Dq={kernelName:Vs,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{keepDims:r,axis:s}=t,i=n,o=a.shape.length,l=k.parseAxisParam(s,a.shape),u=l,d=F.getAxesPermutation(u,o),p=d!=null,c=i.shouldExecuteOnCPU([a]),h=[],m=a;if(p){if(c){let x=i.texData.get(m.dataId).values,v=new Array(o);for(let N=0;Nl[0]+e[d]+l[1]);let a=e.length,r=ut(a),s=t.map(l=>l[0]).join(","),i=t.map((l,d)=>l[0]+e[d]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a),u=n==="reflect"?0:1;if(a===1){this.userCode=` +`,Lq=sn({opSnippet:_q,packedOpSnippet:Pq,cpuKernelImpl:OB}),Wq={kernelName:Us,backendName:"webgl",kernelFunc:Lq},Bq=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((u,d)=>u[0]+e[d]+u[1]);let a=e.length,r=ut(a),s=t.map(u=>u[0]).join(","),i=t.map((u,d)=>u[0]+e[d]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a),l=n==="reflect"?0:1;if(a===1){this.userCode=` int start = ${s}; int end = ${i}; void main() { int outC = getOutputCoords(); if (outC < start) { - outC = start * 2 - outC - ${u}; + outC = start * 2 - outC - ${l}; } else if(outC >= end) { - outC = (end - 1) * 2 - outC + ${u}; + outC = (end - 1) * 2 - outC + ${l}; } setOutput(getX(outC - start)); } @@ -3328,15 +3327,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${r} outC = getOutputCoords(); for (int i = 0; i < ${a}; i++) { if (outC[i] < start[i]) { - outC[i] = start[i] * 2 - outC[i] - ${u}; + outC[i] = start[i] * 2 - outC[i] - ${l}; } else if(outC[i] >= end[i]) { - outC[i] = (end[i] - 1) * 2 - outC[i] + ${u}; + outC[i] = (end[i] - 1) * 2 - outC[i] + ${l}; } } ${r} coords = outC - start; setOutput(getX(${o})); } - `}},Bq=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((h,m)=>h[0]+e[m]+h[1]);let a=e.length,r=ut(a),s=t.map(h=>h[0]).join(","),i=t.map((h,m)=>h[0]+e[m]).join(","),o=xn("rc",a),u=xn("source",a),l=`${o[a-1]} < ${this.outputShape[a-1]}`,d=a===1?"source":`vec2(${u.slice(-2).join()})`,p=n==="reflect"?0:1,c="";if(a===1){let h=` + `}},Vq=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((h,m)=>h[0]+e[m]+h[1]);let a=e.length,r=ut(a),s=t.map(h=>h[0]).join(","),i=t.map((h,m)=>h[0]+e[m]).join(","),o=xn("rc",a),l=xn("source",a),u=`${o[a-1]} < ${this.outputShape[a-1]}`,d=a===1?"source":`vec2(${l.slice(-2).join()})`,p=n==="reflect"?0:1,c="";if(a===1){let h=` ${r} source = rc; if (source < start) { source = start * 2 - source - ${p}; @@ -3347,11 +3346,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam `;c=` ${r} rc = outputLoc; ${h} - result[0] = getChannel(getX(${u.join()}), ${d}); + result[0] = getChannel(getX(${l.join()}), ${d}); ${o[a-1]} += 1; - if(${l}) { + if(${u}) { ${h} - result[1] = getChannel(getX(${u.join()}), ${d}); + result[1] = getChannel(getX(${l.join()}), ${d}); } `}else{let h=` ${r} source = rc; @@ -3365,21 +3364,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam `;c=` ${r} rc = outputLoc; ${h} - result[0] = getChannel(getX(${u.join()}), ${d}); + result[0] = getChannel(getX(${l.join()}), ${d}); ${o[a-1]} += 1; - if(${l}) { + if(${u}) { ${h} - result[1] = getChannel(getX(${u.join()}), ${d}); + result[1] = getChannel(getX(${l.join()}), ${d}); } rc = outputLoc; ${o[a-2]} += 1; if(${o[a-2]} < ${this.outputShape[a-2]}) { ${h} - result[2] = getChannel(getX(${u.join()}), ${d}); + result[2] = getChannel(getX(${l.join()}), ${d}); ${o[a-1]} += 1; - if(${l}) { + if(${u}) { ${h} - result[3] = getChannel(getX(${u.join()}), ${d}); + result[3] = getChannel(getX(${l.join()}), ${d}); } } `}this.userCode=` @@ -3392,13 +3391,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam ${c} setOutput(result); } - `}},Vq=({inputs:e,backend:t,attrs:n})=>{let{x:a}=e,{paddings:r,mode:s}=n,i=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Bq(a.shape,r,s):new Wq(a.shape,r,s);return t.runWebGLProgram(i,[a],a.dtype)},jq={kernelName:Hs,backendName:"webgl",kernelFunc:Vq},Uq=`if (b == 0.0) return NAN; - return mod(a, b);`,Hq=` + `}},jq=({inputs:e,backend:t,attrs:n})=>{let{x:a}=e,{paddings:r,mode:s}=n,i=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Vq(a.shape,r,s):new Bq(a.shape,r,s);return t.runWebGLProgram(i,[a],a.dtype)},Uq={kernelName:Hs,backendName:"webgl",kernelFunc:jq},Hq=`if (b == 0.0) return NAN; + return mod(a, b);`,Gq=` vec4 result = mod(a, b); vec4 isNaN = vec4(equal(b, vec4(0.0))); `+Uh+` return result; -`,Gq=sn({opSnippet:Uq,packedOpSnippet:Hq}),qq={kernelName:Uo,backendName:"webgl",kernelFunc:Gq},Xq=class{constructor(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode=` +`,qq=sn({opSnippet:Hq,packedOpSnippet:Gq}),Xq={kernelName:Ho,backendName:"webgl",kernelFunc:qq},Kq=class{constructor(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode=` uniform float seed; void main() { @@ -3420,11 +3419,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$j=Ke({opSnippet:Fj}),Dj={kernelNam // If no other event happened, last event happened. setOutput(float(${t-1})); } - `}getCustomSetupFunc(e){return(t,n)=>{this.seedLoc==null&&(this.seedLoc=t.getUniformLocation(n,"seed")),t.gl.uniform1f(this.seedLoc,e)}}},Kq=` + `}getCustomSetupFunc(e){return(t,n)=>{this.seedLoc==null&&(this.seedLoc=t.getUniformLocation(n,"seed")),t.gl.uniform1f(this.seedLoc,e)}}},Zq=` if (a == b) { return 1.0; }; -return a / b;`,Zq=` +return a / b;`,Yq=` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; @@ -3442,14 +3441,14 @@ return a / b;`,Zq=` } return result; -`,e6=sn({opSnippet:Kq,packedOpSnippet:Zq,checkOutOfBounds:!0}),Yq={kernelName:Rs,backendName:"webgl",kernelFunc:e6},t6="return a - b;",n6=sn({opSnippet:t6,packedOpSnippet:t6,supportsComplex:!0,cpuKernelImpl:XB}),Jq={kernelName:ui,backendName:"webgl",kernelFunc:n6};function a6(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=k.parseAxisParam([s],r.shape),o=Qw({inputs:{x:r},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),u=F.expandShapeToKeepDim(o.shape,i),l=Ae({inputs:{x:o},backend:n,attrs:{shape:u}}),d=n6({inputs:{a:r,b:l},backend:n}),p=Xw({inputs:{x:d},backend:n}),c=qh({inputs:{x:p},backend:n,attrs:{axis:i,keepDims:!1}}),h=Ae({inputs:{x:c},backend:n,attrs:{shape:u}}),m=e6({inputs:{a:p,b:h},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}var Qq={kernelName:oi,backendName:"webgl",kernelFunc:a6};function eX(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a,u=o?r:a6({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),l=u.shape[0],d=u.shape[1],p=new Xq(l,d,s),c=p.getCustomSetupFunc(i),h=n.runWebGLProgram(p,[u],"int32",c);return o||n.disposeIntermediateTensorInfo(u),h}var tX={kernelName:yc,backendName:"webgl",kernelFunc:eX},r6="return -x;";function nX(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])){let s=n.texData.get(a.dataId),[i,o]=zB(s.values,a.shape,a.dtype);return n.makeTensorInfo(o,a.dtype,i)}let r;return te().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new ql(a.shape,r6):r=new Yr(a.shape,r6),n.runWebGLProgram(r,[a],a.dtype)}var aX={kernelName:Ho,backendName:"webgl",kernelFunc:nX},rX=Za.nonMaxSuppressionV3Impl;function sX(e){F.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:u}=a,l=n.readSync(r.dataId),d=n.readSync(s.dataId),{selectedIndices:p}=rX(l,d,i,o,u);return n.makeTensorInfo([p.length],"int32",new Int32Array(p))}var iX={kernelName:qo,backendName:"webgl",kernelFunc:sX},oX=Za.nonMaxSuppressionV4Impl;function lX(e){F.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:u,padToMaxOutputSize:l}=a,d=n.readSync(r.dataId),p=n.readSync(s.dataId),{selectedIndices:c,validOutputs:h}=oX(d,p,i,o,u,l);return[n.makeTensorInfo([c.length],"int32",new Int32Array(c)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}var uX={kernelName:Xo,backendName:"webgl",kernelFunc:lX},dX=Za.nonMaxSuppressionV5Impl;function pX(e){F.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:u,softNmsSigma:l}=a,d=n.readSync(r.dataId),p=n.readSync(s.dataId),c=i,h=o,m=u,f=l,{selectedIndices:g,selectedScores:y}=dX(d,p,c,h,m,f);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var cX={kernelName:Ko,backendName:"webgl",kernelFunc:pX},hX=class{constructor(e,t,n,a){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` +`,t6=sn({opSnippet:Zq,packedOpSnippet:Yq,checkOutOfBounds:!0}),Jq={kernelName:Rs,backendName:"webgl",kernelFunc:t6},n6="return a - b;",a6=sn({opSnippet:n6,packedOpSnippet:n6,supportsComplex:!0,cpuKernelImpl:KB}),Qq={kernelName:ui,backendName:"webgl",kernelFunc:a6};function r6(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=k.parseAxisParam([s],r.shape),o=e6({inputs:{x:r},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=F.expandShapeToKeepDim(o.shape,i),u=Ae({inputs:{x:o},backend:n,attrs:{shape:l}}),d=a6({inputs:{a:r,b:u},backend:n}),p=Kw({inputs:{x:d},backend:n}),c=qh({inputs:{x:p},backend:n,attrs:{axis:i,keepDims:!1}}),h=Ae({inputs:{x:c},backend:n,attrs:{shape:l}}),m=t6({inputs:{a:p,b:h},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}var eX={kernelName:oi,backendName:"webgl",kernelFunc:r6};function tX(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a,l=o?r:r6({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],d=l.shape[1],p=new Kq(u,d,s),c=p.getCustomSetupFunc(i),h=n.runWebGLProgram(p,[l],"int32",c);return o||n.disposeIntermediateTensorInfo(l),h}var nX={kernelName:yc,backendName:"webgl",kernelFunc:tX},s6="return -x;";function aX(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])){let s=n.texData.get(a.dataId),[i,o]=_B(s.values,a.shape,a.dtype);return n.makeTensorInfo(o,a.dtype,i)}let r;return te().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Xl(a.shape,s6):r=new Yr(a.shape,s6),n.runWebGLProgram(r,[a],a.dtype)}var rX={kernelName:Go,backendName:"webgl",kernelFunc:aX},sX=Za.nonMaxSuppressionV3Impl;function iX(e){F.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=a,u=n.readSync(r.dataId),d=n.readSync(s.dataId),{selectedIndices:p}=sX(u,d,i,o,l);return n.makeTensorInfo([p.length],"int32",new Int32Array(p))}var oX={kernelName:Xo,backendName:"webgl",kernelFunc:iX},lX=Za.nonMaxSuppressionV4Impl;function uX(e){F.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=a,d=n.readSync(r.dataId),p=n.readSync(s.dataId),{selectedIndices:c,validOutputs:h}=lX(d,p,i,o,l,u);return[n.makeTensorInfo([c.length],"int32",new Int32Array(c)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}var dX={kernelName:Ko,backendName:"webgl",kernelFunc:uX},pX=Za.nonMaxSuppressionV5Impl;function cX(e){F.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=a,d=n.readSync(r.dataId),p=n.readSync(s.dataId),c=i,h=o,m=l,f=u,{selectedIndices:g,selectedScores:y}=pX(d,p,c,h,m,f);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var hX={kernelName:Zo,backendName:"webgl",kernelFunc:cX},fX=class{constructor(e,t,n,a){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int index = round(getIndices(coords.x)); setOutput(mix(float(${a}), float(${n}), float(index == coords.y))); } - `}},fX=e=>{let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,u=k.sizeFromShape(r.shape),l=new hX(u,s,i,o),d=Ae({inputs:{x:r},backend:n,attrs:{shape:[u]}}),p=n.runWebGLProgram(l,[d],r.dtype);n.disposeIntermediateTensorInfo(d);let c=[...r.shape,s],h=Ae({inputs:{x:p},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(p),h},mX={kernelName:qs,backendName:"webgl",kernelFunc:fX};function Jh(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="complex64"){let r=_d({inputs:{input:a},backend:n}),s=Jh({inputs:{x:r},backend:n}),i=Yh({inputs:{input:a},backend:n}),o=Jh({inputs:{x:i},backend:n}),u=Jr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),u}else return Yg({attrs:{shape:a.shape,dtype:a.dtype,value:a.dtype==="string"?"":0},backend:n})}var gX={kernelName:hl,backendName:"webgl",kernelFunc:Jh};function s6(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(a.dtype==="complex64"){let r=_d({inputs:{input:a},backend:n}),s=s6({inputs:{x:r},backend:n}),i=Yh({inputs:{input:a},backend:n}),o=Jh({inputs:{x:i},backend:n}),u=Jr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),u}else return Yg({attrs:{shape:a.shape,dtype:a.dtype,value:1},backend:n})}var yX={kernelName:Zo,backendName:"webgl",kernelFunc:s6};function AX(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return Zg({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{k.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),k.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],u=t.map(d=>{let p=Zg({inputs:{input:d},backend:n,attrs:{dim:r}});return o.push(p),p}),l=Pw({inputs:u,backend:n,attrs:{axis:r}});return o.forEach(d=>n.disposeIntermediateTensorInfo(d)),l}var xX={kernelName:Yo,backendName:"webgl",kernelFunc:AX},bX=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((u,l)=>u[0]+e[l]+u[1]);let a=e.length,r=ut(a),s=t.map(u=>u[0]).join(","),i=t.map((u,l)=>u[0]+e[l]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a);if(a===1){this.userCode=` + `}},mX=e=>{let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,l=k.sizeFromShape(r.shape),u=new fX(l,s,i,o),d=Ae({inputs:{x:r},backend:n,attrs:{shape:[l]}}),p=n.runWebGLProgram(u,[d],r.dtype);n.disposeIntermediateTensorInfo(d);let c=[...r.shape,s],h=Ae({inputs:{x:p},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(p),h},gX={kernelName:qs,backendName:"webgl",kernelFunc:mX};function Jh(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="complex64"){let r=_d({inputs:{input:a},backend:n}),s=Jh({inputs:{x:r},backend:n}),i=Yh({inputs:{input:a},backend:n}),o=Jh({inputs:{x:i},backend:n}),l=Jr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return Yg({attrs:{shape:a.shape,dtype:a.dtype,value:a.dtype==="string"?"":0},backend:n})}var yX={kernelName:fl,backendName:"webgl",kernelFunc:Jh};function i6(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(a.dtype==="complex64"){let r=_d({inputs:{input:a},backend:n}),s=i6({inputs:{x:r},backend:n}),i=Yh({inputs:{input:a},backend:n}),o=Jh({inputs:{x:i},backend:n}),l=Jr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return Yg({attrs:{shape:a.shape,dtype:a.dtype,value:1},backend:n})}var AX={kernelName:Yo,backendName:"webgl",kernelFunc:i6};function xX(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return Zg({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{k.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),k.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let p=Zg({inputs:{input:d},backend:n,attrs:{dim:r}});return o.push(p),p}),u=Lw({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(d=>n.disposeIntermediateTensorInfo(d)),u}var bX={kernelName:Jo,backendName:"webgl",kernelFunc:xX},vX=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((l,u)=>l[0]+e[u]+l[1]);let a=e.length,r=ut(a),s=t.map(l=>l[0]).join(","),i=t.map((l,u)=>l[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a);if(a===1){this.userCode=` int start = ${s}; int end = ${i}; uniform float value; @@ -3476,19 +3475,19 @@ return a / b;`,Zq=` setOutput(getX(${o})); } } - `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},vX=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let a=e.length,r=ut(a),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=xn("rc",a),u=xn("source",a),l=`${o[a-1]} < ${this.outputShape[a-1]}`,d=a===1?"source":`vec2(${u.slice(-2).join()})`,p=[`${r} rc = outputLoc;`,`${o[a-1]} += 1; - if(${l}) { + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},wX=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let a=e.length,r=ut(a),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=xn("rc",a),l=xn("source",a),u=`${o[a-1]} < ${this.outputShape[a-1]}`,d=a===1?"source":`vec2(${l.slice(-2).join()})`,p=[`${r} rc = outputLoc;`,`${o[a-1]} += 1; + if(${u}) { `,a===1?"":`} rc = outputLoc; ${o[a-2]} += 1; if(${o[a-2]} < ${this.outputShape[a-2]}) {`,a===1?"":` ${o[a-1]} += 1; - if(${l}) {`],c=a===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="";for(let m=0,f=a===1?2:4;m= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="";for(let m=0,f=a===1?2:4;m{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},i6=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a,o=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new vX(r.shape,s,i):new bX(r.shape,s,i),u=o.getCustomSetupFunc(i);return n.runWebGLProgram(o,[r],r.dtype,u)},wX={kernelName:Xs,backendName:"webgl",kernelFunc:i6},kX=` + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},o6=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a,o=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new wX(r.shape,s,i):new vX(r.shape,s,i),l=o.getCustomSetupFunc(i);return n.runWebGLProgram(o,[r],r.dtype,l)},kX={kernelName:Xs,backendName:"webgl",kernelFunc:o6},IX=` if(a < 0.0 && floor(b) < b){ return NAN; } @@ -3510,7 +3509,7 @@ return a / b;`,Zq=` } return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); -`,IX=` +`,SX=` // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); @@ -3526,9 +3525,9 @@ return a / b;`,Zq=` vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b)); `+Uh+` return result; -`,SX=sn({opSnippet:kX,packedOpSnippet:IX}),NX={kernelName:Ks,backendName:"webgl",kernelFunc:SX};function TX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,u=[],l=k.parseAxisParam(s,r.shape),d=l,p=F.getAxesPermutation(d,o),c=r;p!=null&&(c=bn({inputs:{x:r},backend:n,attrs:{perm:p}}),d=F.getInnerMostAxes(d.length,o),u.push(c)),F.assertAxesAreInnerMostDims("prod",d,o);let h;if(n.shouldExecuteOnCPU([c])){let m=n.texData.get(c.dataId).values,{outVals:f,outShape:g,outDtype:y}=PB(c.shape,c.dtype,m,d);h=n.makeTensorInfo(g,y,f)}else{let[m,f]=F.computeOutAndReduceShapes(c.shape,d),g=k.sizeFromShape(f),y=Ae({inputs:{x:c},backend:n,attrs:{shape:[-1,g]}}),A=zc(r.dtype),x=Wi(y,A,"prod",n);h=Ae({inputs:{x},backend:n,attrs:{shape:m}}),u.push(y),u.push(x)}if(i){u.push(h);let m=F.expandShapeToKeepDim(h.shape,l);h=Ae({inputs:{x:h},backend:n,attrs:{shape:m}})}return u.forEach(m=>n.disposeIntermediateTensorInfo(m)),h}var CX={kernelName:Jo,backendName:"webgl",kernelFunc:TX},o6=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=LB(a,r,s,i);return t.makeTensorInfo([o.length],i,o)},EX={kernelName:ju,backendName:"webgl",kernelFunc:o6},RX="return 1.0 / x;",MX=Ke({opSnippet:RX}),FX={kernelName:Qo,backendName:"webgl",kernelFunc:MX},$X=Ca+` +`,NX=sn({opSnippet:IX,packedOpSnippet:SX}),TX={kernelName:Ks,backendName:"webgl",kernelFunc:NX};function CX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=[],u=k.parseAxisParam(s,r.shape),d=u,p=F.getAxesPermutation(d,o),c=r;p!=null&&(c=bn({inputs:{x:r},backend:n,attrs:{perm:p}}),d=F.getInnerMostAxes(d.length,o),l.push(c)),F.assertAxesAreInnerMostDims("prod",d,o);let h;if(n.shouldExecuteOnCPU([c])){let m=n.texData.get(c.dataId).values,{outVals:f,outShape:g,outDtype:y}=LB(c.shape,c.dtype,m,d);h=n.makeTensorInfo(g,y,f)}else{let[m,f]=F.computeOutAndReduceShapes(c.shape,d),g=k.sizeFromShape(f),y=Ae({inputs:{x:c},backend:n,attrs:{shape:[-1,g]}}),A=zc(r.dtype),x=Wi(y,A,"prod",n);h=Ae({inputs:{x},backend:n,attrs:{shape:m}}),l.push(y),l.push(x)}if(i){l.push(h);let m=F.expandShapeToKeepDim(h.shape,u);h=Ae({inputs:{x:h},backend:n,attrs:{shape:m}})}return l.forEach(m=>n.disposeIntermediateTensorInfo(m)),h}var EX={kernelName:Qo,backendName:"webgl",kernelFunc:CX},l6=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=WB(a,r,s,i);return t.makeTensorInfo([o.length],i,o)},RX={kernelName:ju,backendName:"webgl",kernelFunc:l6},MX="return 1.0 / x;",FX=Ze({opSnippet:MX}),$X={kernelName:el,backendName:"webgl",kernelFunc:FX},DX=Ca+` return (x < 0.0) ? 0.0 : x; -`,DX=` +`,OX=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -3538,9 +3537,9 @@ return a / b;`,Zq=` result.a = isNaN.a ? x.a : result.a; return result; -`,OX=Ke({opSnippet:$X,packedOpSnippet:DX}),zX={kernelName:Ys,backendName:"webgl",kernelFunc:OX},_X=Ca+` +`,zX=Ze({opSnippet:DX,packedOpSnippet:OX}),_X={kernelName:Ys,backendName:"webgl",kernelFunc:zX},PX=Ca+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,PX=` +`,LX=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -3550,10 +3549,10 @@ return a / b;`,Zq=` result.a = isNaN.a ? x.a : result.a; return result; -`,LX=Ke({opSnippet:_X,packedOpSnippet:PX}),WX={kernelName:Qs,backendName:"webgl",kernelFunc:LX},BX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,u]=e;this.outputShape=[s,t,n,u];let l=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":p="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` +`,WX=Ze({opSnippet:PX,packedOpSnippet:LX}),BX={kernelName:Qs,backendName:"webgl",kernelFunc:WX},VX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let u=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":p="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${l[0]/d[0]}, - ${l[1]/d[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -3583,11 +3582,11 @@ return a / b;`,Zq=` setOutput(newValue); } - `}},VX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,u]=e;this.outputShape=[s,t,n,u];let l=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":p="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}},jX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let u=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":p="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${l[0]/d[0]}, - ${l[1]/d[1]}, - ${l[1]/d[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}, + ${u[1]/d[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${o}.0, ${o}.0); @@ -3611,7 +3610,7 @@ return a / b;`,Zq=` min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); // Should we calculate next column and row elements in 2x2 packed cell. - bool hasNextCol = d < ${u-1}; + bool hasNextCol = d < ${l-1}; bool hasNextRow = coords.z < ${n-1}; // In parallel, construct four corners for all four components in @@ -3660,7 +3659,7 @@ return a / b;`,Zq=` setOutput(newValue); } - `}};function jX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[u,l]=o,d=te().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new VX(r.shape,u,l,s,i):new BX(r.shape,u,l,s,i);return n.runWebGLProgram(d,[r],"float32")}var UX={kernelName:Js,backendName:"webgl",kernelFunc:jX},HX=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],u=[n&&s>1?s-1:s,n&&i>1?i-1:i],l=o[0]/u[0],d=o[1]/u[1],p=1/l,c=1/d,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` + `}};function UX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,u]=o,d=te().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new jX(r.shape,l,u,s,i):new VX(r.shape,l,u,s,i);return n.runWebGLProgram(d,[r],"float32")}var HX={kernelName:Js,backendName:"webgl",kernelFunc:UX},GX=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],u=o[0]/l[0],d=o[1]/l[1],p=1/u,c=1/d,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3670,7 +3669,7 @@ return a / b;`,Zq=` float accumulator = 0.0; - const float heightScale = float(${l}); + const float heightScale = float(${u}); const float widthScale = float(${d}); const float invHeightScale = float(${p}); @@ -3741,10 +3740,10 @@ return a / b;`,Zq=` setOutput(accumulator); } - `}};function GX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new HX(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var qX={kernelName:bc,backendName:"webgl",kernelFunc:GX},XX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,u]=e;this.outputShape=[s,t,n,u];let l=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p=a?"0.5":"0.0",c;r?c="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":c="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};function qX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new GX(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var XX={kernelName:bc,backendName:"webgl",kernelFunc:qX},KX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let u=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p=a?"0.5":"0.0",c;r?c="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":c="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${l[0]/d[0]}, - ${l[1]/d[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -3763,11 +3762,11 @@ return a / b;`,Zq=` setOutput(newValue); } - `}},KX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,u]=e;this.outputShape=[s,t,n,u];let l=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p=a?"0.5":"0.0",c;r?c="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":c="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}},ZX=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let u=[a&&t>1?i-1:i,a&&n>1?o-1:o],d=[a&&t>1?t-1:t,a&&n>1?n-1:n],p=a?"0.5":"0.0",c;r?c="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":c="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${l[0]/d[0]}, - ${l[1]/d[1]}, - ${l[1]/d[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}, + ${u[1]/d[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${o}.0, ${o}.0); @@ -3790,7 +3789,7 @@ return a / b;`,Zq=` min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${p}))); // Should we calculate next column and row elements in 2x2 packed cell. - bool hasNextCol = d < ${u-1}; + bool hasNextCol = d < ${l-1}; bool hasNextRow = coords.z < ${n-1}; vec4 newValue = vec4( @@ -3804,7 +3803,7 @@ return a / b;`,Zq=` setOutput(newValue); } - `}};function ZX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[u,l]=o,d=te().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new KX(r.shape,u,l,s,i):new XX(r.shape,u,l,s,i);return n.runWebGLProgram(d,[r],r.dtype)}var YX={kernelName:Uu,backendName:"webgl",kernelFunc:ZX},JX=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],u=[n&&s>1?s-1:s,n&&i>1?i-1:i],l=o[0]/u[0],d=o[1]/u[1],p=1/l,c=1/d,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` + `}};function YX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,u]=o,d=te().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new ZX(r.shape,l,u,s,i):new KX(r.shape,l,u,s,i);return n.runWebGLProgram(d,[r],r.dtype)}var JX={kernelName:Uu,backendName:"webgl",kernelFunc:YX},QX=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],u=o[0]/l[0],d=o[1]/l[1],p=1/u,c=1/d,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3814,7 +3813,7 @@ return a / b;`,Zq=` float accumulator = 0.0; - const float heightScale = float(${l}); + const float heightScale = float(${u}); const float widthScale = float(${d}); const float invHeightScale = float(${p}); @@ -3849,11 +3848,11 @@ return a / b;`,Zq=` float sourceFracRow = float(${o[0]}) * - (float(dyR) / float(${u[0]})); + (float(dyR) / float(${l[0]})); float sourceFracCol = float(${o[1]}) * - (float(dyC) / float(${u[1]})); + (float(dyC) / float(${l[1]})); int sourceNearestRow = int(min( float(int(${a}) - 1), @@ -3874,7 +3873,7 @@ return a / b;`,Zq=` setOutput(accumulator); } - `}};function QX(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new JX(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var eK={kernelName:xc,backendName:"webgl",kernelFunc:QX},tK=class{constructor(e,t){this.variableNames=["x"];let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,n===1){this.userCode=` + `}};function eK(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new QX(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var tK={kernelName:xc,backendName:"webgl",kernelFunc:eK},nK=class{constructor(e,t){this.variableNames=["x"];let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,n===1){this.userCode=` void main() { int coord = getOutputCoords(); setOutput(getX(${e[0]} - coord - 1)); @@ -3884,7 +3883,7 @@ return a / b;`,Zq=` ${s} coords = getOutputCoords(); setOutput(getX(${r})); } - `}},nK=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;let a=xn("rc",n),r=`${a[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${a[n-2]} + 1 < ${this.outputShape[n-2]}`,i=ut(n);n===1?this.userCode=` + `}},aK=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;let a=xn("rc",n),r=`${a[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${a[n-2]} + 1 < ${this.outputShape[n-2]}`,i=ut(n);n===1?this.userCode=` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); @@ -3902,17 +3901,17 @@ return a / b;`,Zq=` vec4 result = vec4(0.); result.r = ${o(a.slice())}; if(${r}){ - result.g = ${u(a.slice())}; + result.g = ${l(a.slice())}; } if(${s}) { - result.b = ${l(a.slice())}; + result.b = ${u(a.slice())}; if(${r}) { result.a = ${d(a.slice())}; } } setOutput(result); } - `;function o(h){return p(h)}function u(h){return h[n-1]="("+h[n-1]+" + 1)",p(h)}function l(h){return h[n-2]="("+h[n-2]+" + 1)",p(h)}function d(h){return h[n-1]="("+h[n-1]+" + 1)",h[n-2]="("+h[n-2]+" + 1)",p(h)}function p(h){let m=e.map((y,A)=>c(A,h)),f=m.join(","),g=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${g}))`}function c(h,m){return t.indexOf(h)!==-1&&e[h]!==1?`${e[h]} - ${m[h]} - 1`:`${m[h]}`}}};function aK(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=r.shape.length,o=k.parseAxisParam(s,r.shape);if(i===0)return Xn({inputs:{x:r},backend:n});let u=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new nK(r.shape,o):new tK(r.shape,o);return n.runWebGLProgram(u,[r],r.dtype)}var rK={kernelName:ei,backendName:"webgl",kernelFunc:aK},sK=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[];let n=e[1],a=e[2];this.outputShape=e;let r="";typeof t=="number"?r=`float outputValue = ${t.toFixed(2)};`:r=` + `;function o(h){return p(h)}function l(h){return h[n-1]="("+h[n-1]+" + 1)",p(h)}function u(h){return h[n-2]="("+h[n-2]+" + 1)",p(h)}function d(h){return h[n-1]="("+h[n-1]+" + 1)",h[n-2]="("+h[n-2]+" + 1)",p(h)}function p(h){let m=e.map((y,A)=>c(A,h)),f=m.join(","),g=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${g}))`}function c(h,m){return t.indexOf(h)!==-1&&e[h]!==1?`${e[h]} - ${m[h]} - 1`:`${m[h]}`}}};function rK(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=r.shape.length,o=k.parseAxisParam(s,r.shape);if(i===0)return Xn({inputs:{x:r},backend:n});let l=te().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new aK(r.shape,o):new nK(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}var sK={kernelName:ei,backendName:"webgl",kernelFunc:rK},iK=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[];let n=e[1],a=e[2];this.outputShape=e;let r="";typeof t=="number"?r=`float outputValue = ${t.toFixed(2)};`:r=` vec3 fill = vec3(${t.join(",")}); float outputValue = fill[coords[3]];`,this.userCode=` uniform vec4 params; @@ -3932,7 +3931,7 @@ return a / b;`,Zq=` } setOutput(outputValue); } - `}getCustomSetupFunc(e,t,n,a){return(r,s)=>{this.paramsLoc==null&&(this.paramsLoc=r.getUniformLocationNoThrow(s,"params")),r.gl.uniform4f(this.paramsLoc,e,t,n,a)}}},iK={kernelName:fl,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,u=new sK(a.shape,s),[l,d]=F.getImageCenter(i,a.shape[1],a.shape[2]),p=u.getCustomSetupFunc(l,d,Math.sin(r),Math.cos(r));return o.runWebGLProgram(u,[a],a.dtype,p)}},oK=` + `}getCustomSetupFunc(e,t,n,a){return(r,s)=>{this.paramsLoc==null&&(this.paramsLoc=r.getUniformLocationNoThrow(s,"params")),r.gl.uniform4f(this.paramsLoc,e,t,n,a)}}},oK={kernelName:ml,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,l=new iK(a.shape,s),[u,d]=F.getImageCenter(i,a.shape[1],a.shape[2]),p=l.getCustomSetupFunc(u,d,Math.sin(r),Math.cos(r));return o.runWebGLProgram(l,[a],a.dtype,p)}},lK=` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); @@ -3947,11 +3946,11 @@ return a / b;`,Zq=` return base + 1.0; } } -`,lK=Ke({opSnippet:oK}),uK={kernelName:ti,backendName:"webgl",kernelFunc:lK},dK="return inversesqrt(x);",pK=Ke({opSnippet:dK,cpuKernelImpl:WB}),cK={kernelName:ni,backendName:"webgl",kernelFunc:pK},l6=class{constructor(e,t,n,a,r,s,i=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let o=ut(r.length),u=ut(s.length),l="";n===1?l="i":n===2&&(l="i, j");let d=`getIndices(${l})`,p="";a===1?p="i":a===2&&(p="i, coords[1]");let c=`getUpdates(${p})`,h=t>1?"strides[j]":"strides";this.userCode=` +`,uK=Ze({opSnippet:lK}),dK={kernelName:ti,backendName:"webgl",kernelFunc:uK},pK="return inversesqrt(x);",cK=Ze({opSnippet:pK,cpuKernelImpl:BB}),hK={kernelName:ni,backendName:"webgl",kernelFunc:cK},u6=class{constructor(e,t,n,a,r,s,i=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let o=ut(r.length),l=ut(s.length),u="";n===1?u="i":n===2&&(u="i, j");let d=`getIndices(${u})`,p="";a===1?p="i":a===2&&(p="i, coords[1]");let c=`getUpdates(${p})`,h=t>1?"strides[j]":"strides";this.userCode=` ${o} strides = ${o}(${r}); void main() { - ${u} coords = getOutputCoords(); + ${l} coords = getOutputCoords(); float sum = 0.0; bool found = false; for (int i = 0; i < ${e}; i++) { @@ -3967,7 +3966,7 @@ return a / b;`,Zq=` } setOutput(mix(getDefaultValue(), sum, float(found))); } - `}};function hK(e){let{inputs:t,backend:n,attrs:a}=e,{indices:r,updates:s}=t,{shape:i}=a,{sliceRank:o,numUpdates:u,sliceSize:l,strides:d,outputSize:p}=F.calculateShapes(s,r,i),c=[p/l,l];if(p===0)return n.makeTensorInfo(i,r.dtype);let h=Ae({inputs:{x:r},backend:n,attrs:{shape:[u,o]}}),m=Ae({inputs:{x:s},backend:n,attrs:{shape:[u,l]}}),f=n.makeTensorInfo([],"float32",new Float32Array([0])),g=new l6(u,o,h.shape.length,m.shape.length,d,c),y=n.runWebGLProgram(g,[m,h,f],m.dtype),A=Ae({inputs:{x:y},backend:n,attrs:{shape:i}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(f),A}var fK={kernelName:tl,backendName:"webgl",kernelFunc:hK},mK=class{constructor(e,t,n){this.variableNames=["c","a","b"],this.outputShape=t;let a,r;if(n>4)throw Error(`Where for rank ${n} is not yet supported`);if(n===1)r="resRC",a="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],u=[];for(let l=0;l4)throw Error(`Where for rank ${n} is not yet supported`);if(n===1)r="resRC",a="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let u=0;u= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); -`,xK=Ke({opSnippet:AK}),bK={kernelName:al,backendName:"webgl",kernelFunc:xK},vK="return 1.0 / (1.0 + exp(-1.0 * x));",wK=Ke({opSnippet:vK}),kK={kernelName:ri,backendName:"webgl",kernelFunc:wK},IK=` +`,bK=Ze({opSnippet:xK}),vK={kernelName:rl,backendName:"webgl",kernelFunc:bK},wK="return 1.0 / (1.0 + exp(-1.0 * x));",kK=Ze({opSnippet:wK}),IK={kernelName:ri,backendName:"webgl",kernelFunc:kK},SK=` if (isnan(x)) { return 0.0; } return sign(x); -`,SK=Ke({opSnippet:IK}),NK={kernelName:il,backendName:"webgl",kernelFunc:SK},TK=kw+` +`,NK=Ze({opSnippet:SK}),TK={kernelName:ol,backendName:"webgl",kernelFunc:NK},CK=Iw+` return sin(x); -`,CK=Ke({opSnippet:TK}),EK={kernelName:ai,backendName:"webgl",kernelFunc:CK},RK=` +`,EK=Ze({opSnippet:CK}),RK={kernelName:ai,backendName:"webgl",kernelFunc:EK},MK=` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; -`,MK=Ke({opSnippet:RK}),FK={kernelName:sl,backendName:"webgl",kernelFunc:MK},$K=` +`,FK=Ze({opSnippet:MK}),$K={kernelName:il,backendName:"webgl",kernelFunc:FK},DK=` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; @@ -4011,17 +4010,17 @@ return a / b;`,Zq=` result = log(exp_x + 1.0); } return result; -`,DK=Ke({opSnippet:$K}),OK={kernelName:ol,backendName:"webgl",kernelFunc:DK},zK=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,paddings:i}=a;k.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,A)=>y*A),u=[[0,0]];u.push(...i);for(let y=1+s.length;yn.disposeIntermediateTensorInfo(y)),g},_K={kernelName:Hu,backendName:"webgl",kernelFunc:zK};function PK(e){let{inputs:t,backend:n}=e,{indices:a,values:r,denseShape:s,defaultValue:i}=t;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: +`,OK=Ze({opSnippet:DK}),zK={kernelName:ll,backendName:"webgl",kernelFunc:OK},_K=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,paddings:i}=a;k.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,A)=>y*A),l=[[0,0]];l.push(...i);for(let y=1+s.length;yn.disposeIntermediateTensorInfo(y)),g},PK={kernelName:Hu,backendName:"webgl",kernelFunc:_K};function LK(e){let{inputs:t,backend:n}=e,{indices:a,values:r,denseShape:s,defaultValue:i}=t;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: ${s.shape}`);if(a.shape.length!==2)throw new Error(`Indices must be a matrix, saw: ${a.shape}`);if(r.shape.length!==1)throw new Error(`Values must be a vector, saw: ${r.shape}`);if(i.shape.length!==0)throw new Error(`Default value must be a scalar, saw: - ${i.shape}`);let o=n.readSync(a.dataId),u=n.readSync(r.dataId),l=n.readSync(s.dataId),d=n.readSync(i.dataId)[0],[p,c,h,m,f]=VB(o,a.shape,a.dtype,u,r.dtype,l,d);return[n.makeTensorInfo(c,a.dtype,p),n.makeTensorInfo([c[0]],r.dtype,h),n.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(g=>Number(g)))),n.makeTensorInfo([f.length],a.dtype,new Int32Array(f))]}var LK={kernelName:vc,backendName:"webgl",kernelFunc:PK};function WK(e){let{inputs:t,backend:n}=e,{inputIndices:a,inputShape:r,newShape:s}=t;if(a.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${a.shape}`);if(r.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.readSync(r.dataId)),o=n.readSync(a.dataId),u=Array.from(n.readSync(s.dataId)),[l,d,p]=jB(o,a.shape,a.dtype,i,u);return[n.makeTensorInfo(d,a.dtype,l),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}var BK={kernelName:wc,backendName:"webgl",kernelFunc:WK};function VK(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${i.shape}`);let o=n.readSync(a.dataId),l=n.readSync(r.dataId),u=n.readSync(s.dataId),d=n.readSync(i.dataId)[0],[p,c,h,m,f]=jB(o,a.shape,a.dtype,l,r.dtype,u,d);return[n.makeTensorInfo(c,a.dtype,p),n.makeTensorInfo([c[0]],r.dtype,h),n.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(g=>Number(g)))),n.makeTensorInfo([f.length],a.dtype,new Int32Array(f))]}var WK={kernelName:vc,backendName:"webgl",kernelFunc:LK};function BK(e){let{inputs:t,backend:n}=e,{inputIndices:a,inputShape:r,newShape:s}=t;if(a.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${a.shape}`);if(r.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.readSync(r.dataId)),o=n.readSync(a.dataId),l=Array.from(n.readSync(s.dataId)),[u,d,p]=UB(o,a.shape,a.dtype,i,l);return[n.makeTensorInfo(d,a.dtype,u),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}var VK={kernelName:wc,backendName:"webgl",kernelFunc:BK};function jK(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let i=n.readSync(a.dataId),o=n.readSync(r.dataId),u=n.readSync(s.dataId),[l,d]=uw(i,a.shape,a.dtype,o,u,!0);return n.makeTensorInfo(d,a.dtype,l)}var jK={kernelName:kc,backendName:"webgl",kernelFunc:VK};function UK(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${s.shape}`);let i=n.readSync(a.dataId),o=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,d]=dw(i,a.shape,a.dtype,o,l,!0);return n.makeTensorInfo(d,a.dtype,u)}var UK={kernelName:kc,backendName:"webgl",kernelFunc:jK};function HK(e){let{inputs:t,backend:n}=e,{data:a,indices:r,segmentIds:s}=t;if(a.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let i=n.readSync(a.dataId),o=n.readSync(r.dataId),u=n.readSync(s.dataId),[l,d]=uw(i,a.shape,a.dtype,o,u);return n.makeTensorInfo(d,a.dtype,l)}var HK={kernelName:Ic,backendName:"webgl",kernelFunc:UK};function GK(e){let{inputs:t,backend:n,attrs:a}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=a,{sliceRank:u,numUpdates:l,strides:d,outputSize:p}=F.calculateShapes(s,r,o),c=!1,h=new l6(l,u,r.shape.length,s.shape.length,d,[p,1],c),m=n.runWebGLProgram(h,[s,r,i],s.dtype),f=Ae({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),f}var qK={kernelName:Sc,backendName:"webgl",kernelFunc:GK};function XK(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=k.parseAxisParam(i,r.shape)[0],u=F.prepareSplitSize(r,s,o),l=r.shape.length,d=new Array(l).fill(0),p=r.shape.slice();return u.map(c=>{let h=[...p];h[o]=c;let m=zd({inputs:{x:r},backend:n,attrs:{begin:d,size:h}});return d[o]+=c,m})}var KK={kernelName:ll,backendName:"webgl",kernelFunc:XK},ZK="return sqrt(x);",YK=Ke({opSnippet:ZK}),JK={kernelName:si,backendName:"webgl",kernelFunc:YK},QK="return x * x;",eZ=Ke({opSnippet:QK}),tZ={kernelName:Gu,backendName:"webgl",kernelFunc:eZ},u6="return (a - b) * (a - b);",nZ=sn({opSnippet:u6,packedOpSnippet:u6}),aZ={kernelName:li,backendName:"webgl",kernelFunc:nZ};function rZ({inputs:e,attrs:t,backend:n}){let{x:a}=e,r=Ca+` + ${s.shape}`);let i=n.readSync(a.dataId),o=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,d]=dw(i,a.shape,a.dtype,o,l);return n.makeTensorInfo(d,a.dtype,u)}var GK={kernelName:Ic,backendName:"webgl",kernelFunc:HK};function qK(e){let{inputs:t,backend:n,attrs:a}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=a,{sliceRank:l,numUpdates:u,strides:d,outputSize:p}=F.calculateShapes(s,r,o),c=!1,h=new u6(u,l,r.shape.length,s.shape.length,d,[p,1],c),m=n.runWebGLProgram(h,[s,r,i],s.dtype),f=Ae({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),f}var XK={kernelName:Sc,backendName:"webgl",kernelFunc:qK};function KK(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=k.parseAxisParam(i,r.shape)[0],l=F.prepareSplitSize(r,s,o),u=r.shape.length,d=new Array(u).fill(0),p=r.shape.slice();return l.map(c=>{let h=[...p];h[o]=c;let m=zd({inputs:{x:r},backend:n,attrs:{begin:d,size:h}});return d[o]+=c,m})}var ZK={kernelName:ul,backendName:"webgl",kernelFunc:KK},YK="return sqrt(x);",JK=Ze({opSnippet:YK}),QK={kernelName:si,backendName:"webgl",kernelFunc:JK},eZ="return x * x;",tZ=Ze({opSnippet:eZ}),nZ={kernelName:Gu,backendName:"webgl",kernelFunc:tZ},d6="return (a - b) * (a - b);",aZ=sn({opSnippet:d6,packedOpSnippet:d6}),rZ={kernelName:li,backendName:"webgl",kernelFunc:aZ};function sZ({inputs:e,attrs:t,backend:n}){let{x:a}=e,r=Ca+` return x > 0.0 ? 1.0 : float(${t.alpha}); - `,s=new Yr(a.shape,r);return n.runWebGLProgram(s,[a],a.dtype)}var sZ={kernelName:Pr,backendName:"webgl",kernelFunc:rZ},iZ=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;let a=n.length,r=ut(n.length),s=ut(n.length),i="";if(a===1)i="coords * strides + begin";else{let o=0;i=n.map((u,l)=>(o++,n.length===1?`coords * strides[${l}] + begin[${l}]`:`coords[${o-1}] * strides[${l}] + begin[${l}]`)).join(",")}this.userCode=` + `,s=new Yr(a.shape,r);return n.runWebGLProgram(s,[a],a.dtype)}var iZ={kernelName:Pr,backendName:"webgl",kernelFunc:sZ},oZ=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;let a=n.length,r=ut(n.length),s=ut(n.length),i="";if(a===1)i="coords * strides + begin";else{let o=0;i=n.map((l,u)=>(o++,n.length===1?`coords * strides[${u}] + begin[${u}]`:`coords[${o-1}] * strides[${u}] + begin[${u}]`)).join(",")}this.userCode=` ${r} begin = ${r}(${e}); ${r} strides = ${r}(${t}); @@ -4029,15 +4028,15 @@ return a / b;`,Zq=` ${s} coords = getOutputCoords(); setOutput(getX(${i})); } - `}};function oZ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:u,endMask:l,ellipsisMask:d,newAxisMask:p,shrinkAxisMask:c}=a,{nonStrided:h,$begin:m,$strides:f,size:g,newShape:y,outShape:A}=fn.sliceInfo(r.shape,s,i,o,u,l,d,p,c),x=Ae({inputs:{x:r},backend:n,attrs:{shape:y}}),v;if(h){let w=zd({inputs:{x},backend:n,attrs:{begin:m,size:g}});v=Ae({inputs:{x:w},backend:n,attrs:{shape:A}}),n.disposeIntermediateTensorInfo(w)}else if(A.some(w=>w===0))v=n.makeTensorInfo(A,r.dtype,[]);else if(n.shouldExecuteOnCPU([x])){let w=n.texData.get(x.dataId).values,N=Ve(x.shape,x.dtype,w),C=UB(A,N,f,m);v=n.makeTensorInfo(A,x.dtype,C.values)}else{let w=new iZ(m,f,A);v=n.runWebGLProgram(w,[x],x.dtype)}let b=Ae({inputs:{x:v},backend:n,attrs:{shape:A}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),b}var lZ={kernelName:ul,backendName:"webgl",kernelFunc:oZ};function uZ(e){let{inputs:t,backend:n,attrs:a}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:u,preserveShortSequences:l}=a,{data:d,dataSplits:p}=t,c=n.readSync(d.dataId),h=n.readSync(p.dataId),[m,f]=HB(c,h,r,s,i,o,u,l);return[n.makeTensorInfo([m.length],"string",m),n.makeTensorInfo(p.shape,"int32",f)]}var dZ={kernelName:Nc,backendName:"webgl",kernelFunc:uZ};function pZ(e){let{inputs:t,backend:n,attrs:a}=e,{skipEmpty:r}=a,{input:s,delimiter:i}=t;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(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=n.readSync(s.dataId),u=n.readSync(i.dataId)[0],[l,d,p]=GB(o,u,r),c=d.length;return[n.makeTensorInfo([c,2],"int32",l),n.makeTensorInfo([c],"string",d),n.makeTensorInfo([2],"int32",new Int32Array(p))]}var cZ={kernelName:Tc,backendName:"webgl",kernelFunc:pZ};function hZ(e){let{inputs:t,backend:n,attrs:a}=e,{numBuckets:r}=a,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=n.readSync(s.dataId),o=qB(i,r);return n.makeTensorInfo(s.shape,"int32",o)}var fZ={kernelName:Cc,backendName:"webgl",kernelFunc:hZ},mZ="return tan(x);",gZ=Ke({opSnippet:mZ}),yZ={kernelName:di,backendName:"webgl",kernelFunc:gZ},AZ=` + `}};function lZ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:p,shrinkAxisMask:c}=a,{nonStrided:h,$begin:m,$strides:f,size:g,newShape:y,outShape:A}=fn.sliceInfo(r.shape,s,i,o,l,u,d,p,c),x=Ae({inputs:{x:r},backend:n,attrs:{shape:y}}),v;if(h){let w=zd({inputs:{x},backend:n,attrs:{begin:m,size:g}});v=Ae({inputs:{x:w},backend:n,attrs:{shape:A}}),n.disposeIntermediateTensorInfo(w)}else if(A.some(w=>w===0))v=n.makeTensorInfo(A,r.dtype,[]);else if(n.shouldExecuteOnCPU([x])){let w=n.texData.get(x.dataId).values,N=Ve(x.shape,x.dtype,w),C=HB(A,N,f,m);v=n.makeTensorInfo(A,x.dtype,C.values)}else{let w=new oZ(m,f,A);v=n.runWebGLProgram(w,[x],x.dtype)}let b=Ae({inputs:{x:v},backend:n,attrs:{shape:A}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),b}var uZ={kernelName:dl,backendName:"webgl",kernelFunc:lZ};function dZ(e){let{inputs:t,backend:n,attrs:a}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=a,{data:d,dataSplits:p}=t,c=n.readSync(d.dataId),h=n.readSync(p.dataId),[m,f]=GB(c,h,r,s,i,o,l,u);return[n.makeTensorInfo([m.length],"string",m),n.makeTensorInfo(p.shape,"int32",f)]}var pZ={kernelName:Nc,backendName:"webgl",kernelFunc:dZ};function cZ(e){let{inputs:t,backend:n,attrs:a}=e,{skipEmpty:r}=a,{input:s,delimiter:i}=t;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(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=n.readSync(s.dataId),l=n.readSync(i.dataId)[0],[u,d,p]=qB(o,l,r),c=d.length;return[n.makeTensorInfo([c,2],"int32",u),n.makeTensorInfo([c],"string",d),n.makeTensorInfo([2],"int32",new Int32Array(p))]}var hZ={kernelName:Tc,backendName:"webgl",kernelFunc:cZ};function fZ(e){let{inputs:t,backend:n,attrs:a}=e,{numBuckets:r}=a,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=n.readSync(s.dataId),o=XB(i,r);return n.makeTensorInfo(s.shape,"int32",o)}var mZ={kernelName:Cc,backendName:"webgl",kernelFunc:fZ},gZ="return tan(x);",yZ=Ze({opSnippet:gZ}),AZ={kernelName:di,backendName:"webgl",kernelFunc:yZ},xZ=` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); -`,xZ=Ke({opSnippet:AZ}),bZ={kernelName:pi,backendName:"webgl",kernelFunc:xZ},vZ=class{constructor(e,t){this.variableNames=["A"];let n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${e[0]})`;let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],a=[];for(let r=0;r5){let o=n.readSync(r.dataId),u=r.dtype==="string"?o.map(p=>k.decodeString(p)):o,l=Ve(r.shape,r.dtype,u),d=KB(l,s);return n.makeTensorInfo(d.shape,d.dtype,d.values)}let i=new vZ(r.shape,s);return n.runWebGLProgram(i,[r],r.dtype)}var kZ={kernelName:_r,backendName:"webgl",kernelFunc:d6};function IZ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a,o=n.readSync(r.dataId),[u,l]=ZB(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(u.shape,u.dtype,u.values),n.makeTensorInfo(l.shape,l.dtype,l.values)]}var SZ={kernelName:dl,backendName:"webgl",kernelFunc:IZ},NZ=class{constructor(e,t,n,a,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=n==="nearest"?1:2,o;switch(a){case"constant":o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4;break;default:o=1;break}this.userCode=` + `}};function kZ(e){let t=e.length;if(t>5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${e[0]})`;let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],a=[];for(let r=0;r5){let o=n.readSync(r.dataId),l=r.dtype==="string"?o.map(p=>k.decodeString(p)):o,u=Ve(r.shape,r.dtype,l),d=ZB(u,s);return n.makeTensorInfo(d.shape,d.dtype,d.values)}let i=new wZ(r.shape,s);return n.runWebGLProgram(i,[r],r.dtype)}var IZ={kernelName:_r,backendName:"webgl",kernelFunc:p6};function SZ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a,o=n.readSync(r.dataId),[l,u]=YB(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(u.shape,u.dtype,u.values)]}var NZ={kernelName:pl,backendName:"webgl",kernelFunc:SZ},TZ=class{constructor(e,t,n,a,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=n==="nearest"?1:2,o;switch(a){case"constant":o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4;break;default:o=1;break}this.userCode=` float mapCoord(float outCoord, float len) { float inCoord = outCoord; if(${o} == 2) { @@ -4149,7 +4148,7 @@ return a / b;`,Zq=` } setOutput(outputValue); } - `}};function TZ(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:u,outputShape:l}=a,[d,p,c,h]=r.shape,[m,f]=l!=null?l:[p,c],g=[d,m,f,h],y=new NZ(p,c,i,o,u,g);return n.runWebGLProgram(y,[r,s],"float32")}var CZ={kernelName:pl,backendName:"webgl",kernelFunc:TZ};function EZ(e){let{inputs:t,attrs:n,backend:a}=e,{axis:r}=n,{x:s}=t;Vl(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=a.readSync(s.dataId),{outputValues:o,outputShape:u,indices:l}=YB(i,r,s.shape,s.dtype);return[a.makeTensorInfo(u,s.dtype,o),a.makeTensorInfo([l.length],"int32",l)]}var RZ={kernelName:Ec,backendName:"webgl",kernelFunc:EZ};function MZ(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,u=r.shape[s],l=new Array(o-1),d=0;for(let f=0;fn.disposeIntermediateTensorInfo(f)),m}var FZ={kernelName:cl,backendName:"webgl",kernelFunc:MZ},$Z=class{constructor(e,t){this.variableNames=["x","segmentIds"];let n=e.windowSize,a=e.batchSize,r=e.inSize,s=e.numSegments,i=s*Math.ceil(r/n);this.outputShape=[a,i];let o="0.0",u="sumValue",l=Math.floor(n/4)*4,d=n%4,p=` + `}};function CZ(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=a,[d,p,c,h]=r.shape,[m,f]=u!=null?u:[p,c],g=[d,m,f,h],y=new TZ(p,c,i,o,l,g);return n.runWebGLProgram(y,[r,s],"float32")}var EZ={kernelName:cl,backendName:"webgl",kernelFunc:CZ};function RZ(e){let{inputs:t,attrs:n,backend:a}=e,{axis:r}=n,{x:s}=t;jl(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=a.readSync(s.dataId),{outputValues:o,outputShape:l,indices:u}=JB(i,r,s.shape,s.dtype);return[a.makeTensorInfo(l,s.dtype,o),a.makeTensorInfo([u.length],"int32",u)]}var MZ={kernelName:Ec,backendName:"webgl",kernelFunc:RZ};function FZ(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],u=new Array(o-1),d=0;for(let f=0;fn.disposeIntermediateTensorInfo(f)),m}var $Z={kernelName:hl,backendName:"webgl",kernelFunc:FZ},DZ=class{constructor(e,t){this.variableNames=["x","segmentIds"];let n=e.windowSize,a=e.batchSize,r=e.inSize,s=e.numSegments,i=s*Math.ceil(r/n);this.outputShape=[a,i];let o="0.0",l="sumValue",u=Math.floor(n/4)*4,d=n%4,p=` sumValue += dot(values, segFilter); `,c="";r%n>0&&(c=` if (inIdx < 0 || inIdx >= ${r}) { @@ -4182,7 +4181,7 @@ return a / b;`,Zq=` float sumValue = 0.0; - for (int i = 0; i < ${l}; i += 4) { + for (int i = 0; i < ${u}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), @@ -4201,7 +4200,7 @@ return a / b;`,Zq=` ${p} } - int inIdx = inOffset + ${l}; + int inIdx = inOffset + ${u}; if (${d===1}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4253,28 +4252,28 @@ return a / b;`,Zq=` ${p} } - setOutput(${u}); + setOutput(${l}); } - `}};function DZ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,segmentIds:s}=t,{numSegments:i}=a,o=r.shape.length,u=[],l=0,d=F.getAxesPermutation([l],o),p=r;d!=null&&(p=bn({inputs:{x:r},backend:n,attrs:{perm:d}}),u.push(p),l=F.getInnerMostAxes(1,o)[0]);let c=F.segment_util.computeOutShape(p.shape,l,i),h=k.sizeFromShape([p.shape[l]]),m=Ae({inputs:{x:p},backend:n,attrs:{shape:[-1,h]}});u.push(m);let f=zc(r.dtype),g=(v,b,w,N,C)=>{let E=v.shape[0],_=v.shape[1],$=F.segment_util.segOpComputeOptimalWindowSize(_,C),S={windowSize:$,inSize:_,batchSize:E,numSegments:C},z=new $Z(S,b),O=n.compileAndRun(z,[v,w],N);if(u.push(O),O.shape[1]===C)return O;let W=o6({backend:n,attrs:{start:0,stop:C,step:1,dtype:"float32"}}),G=d6({inputs:{x:W},backend:n,attrs:{reps:[_/$]}});return u.push(W),u.push(G),g(O,b,G,N,C)},y=g(m,"unsortedSegmentSum",s,f,i),A=Ae({inputs:{x:y},backend:n,attrs:{shape:c}}),x=A;if(d!=null){u.push(A);let v=F.getUndoAxesPermutation(d);x=bn({inputs:{x},backend:n,attrs:{perm:v}})}return u.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var OZ={kernelName:qu,backendName:"webgl",kernelFunc:DZ},zZ=[dq,hq,KV,YV,ej,aj,sj,lj,dj,cj,gj,Aj,vj,Ij,Mj,Tj,Dj,Pj,zj,Vj,Uj,Gj,Zj,aU,sU,pU,hU,yU,bU,RV,SU,OU,_U,EU,BU,jU,LU,GU,KU,JU,eH,nH,sH,pH,hH,oH,gH,xH,vH,SH,EH,$H,zH,_H,PH,WH,VH,UH,GH,XH,JH,tG,rG,iG,uG,hG,yG,vG,EV,kG,kU,NG,EG,FG,FV,zG,WG,VG,KG,GG,QG,nq,iq,mq,kq,vq,Tq,Eq,Mq,xq,$q,Oq,Lq,jq,qq,tX,_V,aX,iX,uX,cX,oU,mX,yX,xX,wX,NX,DV,CX,EX,lU,Yq,FX,WX,zX,LV,UX,qX,YX,eK,rK,iK,uK,cK,fK,yK,bK,kK,NK,EK,FK,tU,Qq,OK,_K,LK,BK,jK,HK,qK,KK,JK,tZ,aZ,sZ,lZ,dZ,cZ,fZ,Jq,GV,yZ,bZ,kZ,SZ,CZ,qV,RZ,FZ,OZ,gX];for(let e of zZ)gi(e);var Fn;(function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"})(Fn||(Fn={}));var Pd;(function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid"})(Pd||(Pd={}));var p6;function _Z(e){p6=e.wasm.cwrap(hi,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function PZ(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:u,transposeB:l,activation:d,leakyreluAlpha:p}=a,c=n.dataIdMap.get(r.dataId).id,h=n.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let C=n.dataIdMap.get(i.dataId);if(C.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${C.shape.length}.`);m=C.id}let f=o==null?0:n.dataIdMap.get(o.dataId).id,g=Pd[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let y=u?r.shape[2]:r.shape[1],A=l?s.shape[1]:s.shape[2],x=r.shape[0],v=n.makeOutput([x,y,A],r.dtype),b=n.dataIdMap.get(v.dataId).id,w=new Uint8Array(new Int32Array(r.shape).buffer),N=new Uint8Array(new Int32Array(s.shape).buffer);return p6(c,w,r.shape.length,h,N,s.shape.length,u,l,g,m,f,p||0,b),v}var LZ={kernelName:hi,backendName:"wasm",setupFunc:_Z,kernelFunc:PZ};function vn(e){let t;function n(r){t=r.wasm.cwrap(e,null,["number","number"])}function a(r){let{backend:s,inputs:{x:i}}=r,o=s.dataIdMap.get(i.dataId).id,u=s.makeOutput(i.shape,i.dtype),l=s.dataIdMap.get(u.dataId).id;return k.sizeFromShape(u.shape)===0||t(o,l),u}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:a}}var WZ=vn(fo);function wn(e,t,n){let a;function r(i){a=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:u}=i,{a:l,b:d}=u,p=o.dataIdMap.get(l.dataId).id,c=o.dataIdMap.get(d.dataId).id,h=n!=null?n:l.dtype,m=F.assertAndGetBroadcastShape(l.shape,d.shape),f=o.makeOutput(m,h);if(k.sizeFromShape(m)===0)return f;let g=new Uint8Array(new Int32Array(l.shape).buffer),y=new Uint8Array(new Int32Array(d.shape).buffer),A=o.dataIdMap.get(f.dataId).id,x=()=>a(p,g,l.shape.length,c,y,d.shape.length,Fn[l.dtype],A);if(t&&l.dtype==="float32")return x(),f;let v=F.getBroadcastDims(l.shape,m),b=F.getBroadcastDims(d.shape,m),w=v.every((C,E)=>C===E),N=b.every((C,E)=>C===E);if(w&&N)return x(),f;throw new Error(`Broadcasting along outer dims is not yet supported for ${l.dtype} ${e}.`)}return{kernelName:e,backendName:"wasm",setupFunc:r,kernelFunc:s}}var BZ=!0,VZ=wn(Or,BZ),c6;function jZ(e){c6=e.wasm.cwrap(xs,null,["array","number","number","number"])}function UZ(e){let{inputs:t,backend:n}=e,a=n.makeOutput(t[0].shape,t[0].dtype);if(k.sizeFromShape(a.shape)===0)return a;let r=t.map(o=>n.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(r).buffer),i=n.dataIdMap.get(a.dataId).id;return c6(s,r.length,Fn[a.dtype],i),a}var HZ={kernelName:xs,backendName:"wasm",setupFunc:jZ,kernelFunc:UZ};function Qh(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype),r=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(a).set(r),a}var GZ={kernelName:zs,backendName:"wasm",kernelFunc:Qh},h6;function qZ(e){h6=e.wasm.cwrap(ci,null,["number","array","number","number","number","array","number"])}function e0(e){let{inputs:t,backend:n,attrs:a}=e,[r,s]=KZ(t.x.shape,a.perm),i=!0;for(let m=0;m=r&&(s===-1||a[s]>a[i])&&(s=i);a[s]=r}return[n,a]}var ZZ={kernelName:ci,backendName:"wasm",kernelFunc:e0,setupFunc:qZ};function Qr(e,t,n){let a=e.shape,r=e.shape.length,s=k.parseAxisParam(t,a),i=s,o=F.getAxesPermutation(i,r),u=null,l=!1;if(o!=null){let d=new Array(r);for(let c=0;c`new shape: ${i}, old shape: ${a.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}var uY={kernelName:el,backendName:"wasm",kernelFunc:Ea},A6;function dY(e){A6=e.wasm.cwrap(ws,null,["number","array","number","number","array","number","number","number","number"])}function pY(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let u=r.shape.length,l=s.shape.length,d=i?r.shape[u-2]:r.shape[u-1],p=o?s.shape[l-1]:s.shape[l-2],c=i?r.shape[u-1]:r.shape[u-2],h=o?s.shape[l-2]:s.shape[l-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=k.sizeFromShape(m),y=k.sizeFromShape(f),A=g===y||g===1||y===1;k.assert(u>=2&&l>=2&&A,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(g>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);k.assert(d===p,()=>`Error in matMul: inner shapes (${d}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[g,d,c]:[g,c,d],b=o?[y,h,p]:[y,p,h],w=Ea({inputs:{x:r},backend:n,attrs:{shape:v}}),N=Ea({inputs:{x:s},backend:n,attrs:{shape:b}}),C=n.dataIdMap.get(w.dataId).id,E=n.dataIdMap.get(N.dataId).id,_=i?w.shape[2]:w.shape[1],$=o?N.shape[1]:N.shape[2],S=Math.max(g,y),z=n.makeOutput([S,_,$],w.dtype),O=n.dataIdMap.get(z.dataId).id,W=new Uint8Array(new Int32Array(w.shape).buffer),G=new Uint8Array(new Int32Array(N.shape).buffer);return A6(C,W,w.shape.length,E,G,N.shape.length,i,o,O),n.disposeData(w.dataId),n.disposeData(N.dataId),z.shape=x,z}var cY={kernelName:ws,backendName:"wasm",setupFunc:dY,kernelFunc:pY};function t0(e){let{inputs:{x:t},attrs:{dtype:n},backend:a}=e,r=a.makeOutput(t.shape,n),s=a.typedArrayFromHeap(t);return a.typedArrayFromHeap(r).set(s),r}var hY={kernelName:ks,backendName:"wasm",kernelFunc:t0},fY=vn(Is),x6;function mY(e){x6=e.wasm.cwrap(zr,null,["number","number","number","number"])}function gY(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o=n.dataIdMap.get(r.dataId).id,u=n.makeOutput(r.shape,r.dtype),l=n.dataIdMap.get(u.dataId).id;return x6(o,s,i,l),u}var yY={kernelName:zr,backendName:"wasm",setupFunc:mY,kernelFunc:gY};function b6(e){let{inputs:t,backend:n}=e,a=k.parseAxisParam(e.attrs.axis,t[0].shape)[0],r=F.computeOutShape(t.map(h=>h.shape),a),s=t.filter(h=>k.sizeFromShape(h.shape)>0);if(s.length===1)return Qh({inputs:{x:s[0]},backend:n});let i=n.makeOutput(r,t[0].dtype);if(k.sizeFromShape(r)===0)return i;let o=s.map(h=>h.shape);if(F.assertParamsConsistent(o,a),s[0].dtype==="string"){let h=s.map(x=>{let v=k.sizeFromShape(x.shape.slice(a));return Ea({inputs:{x},backend:n,attrs:{shape:[-1,v]}})}),m=h.map(x=>({vals:n.readSync(x.dataId),shape:x.shape}));r=F.computeOutShape(h.map(x=>x.shape),1);let f=h[0].shape[0]===1,g=bg(m,r,t[0].dtype,f),y=F.computeOutShape(s.map(x=>x.shape),a);i.shape=y;let A=n.dataIdMap.get(i.dataId);return A.stringBytes=F.fromStringArrayToUint8(g),h.forEach(x=>n.disposeData(x.dataId)),i}let u=k.sizeFromShape(s[0].shape.slice(0,a)),l=0,d=s.map(h=>{let m=k.sizeFromShape(h.shape.slice(a));return l+=m,m}),p=s.map(h=>n.typedArrayFromHeap(h)),c=n.typedArrayFromHeap(i);for(let h=0;h`cumsum does not support ${r.dtype} tensors in the WASM backend`);let l=F.getAxesPermutation([s],u),d=r;l!==null&&(d=e0({inputs:{x:r},attrs:{perm:l},backend:n}));let p=F.getInnerMostAxes(1,u)[0];F.assertAxesAreInnerMostDims("cumsum",[p],u);let c=n.makeOutput(d.shape,d.dtype),h=d.shape[p],m=n.dataIdMap.get(d.dataId).id,f=n.dataIdMap.get(c.dataId).id;I6(m,i?1:0,o?1:0,h,f,Fn[r.dtype]);let g=c;if(l!==null){let y=F.getUndoAxesPermutation(l);g=e0({inputs:{x:c},attrs:{perm:y},backend:n}),n.disposeData(d.dataId),n.disposeData(c.dataId)}return g}var MY={kernelName:Cs,backendName:"wasm",setupFunc:EY,kernelFunc:RY},S6;function FY(e){S6=e.wasm.cwrap(To,null,["number","number","number","array","number","array","array","number","number"])}function $Y(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{blockSize:s,dataFormat:i}=a;k.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],u=i==="NHWC"?r.shape[1]:r.shape[2],l=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],p=u*s,c=l*s,h=d/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=t.makeOutput(m,"float32"),g=t.dataIdMap.get(r.dataId).id,y=new Uint8Array(new Int32Array(k.computeStrides(r.shape)).buffer),A=new Uint8Array(new Int32Array(m).buffer),x=new Uint8Array(new Int32Array(k.computeStrides(m)).buffer),v=t.dataIdMap.get(f.dataId).id;return S6(g,s,i==="NHWC"?1:0,y,r.shape.length-1,A,x,m.length,v),f}var DY={kernelName:To,backendName:"wasm",setupFunc:FY,kernelFunc:$Y},N6;function OY(e){N6=e.wasm.cwrap(Es,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function zY(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s}=t,i=a.dataIdMap.get(r.dataId).id,o=a.dataIdMap.get(s.dataId).id,{strides:u,dilations:l,pad:d,dimRoundingMode:p}=n,c=l==null?[1,1]:l,h=F.computeConv2DInfo(r.shape,s.shape,u,c,d,p,!0),m=h.filterHeight,f=h.filterWidth,g=h.padInfo.top,y=h.padInfo.right,A=h.padInfo.bottom,x=h.padInfo.left,v=h.dilationHeight,b=h.dilationWidth,w=h.strideHeight,N=h.strideWidth,C=h.inChannels,E=h.outChannels,_=h.padInfo.type==="SAME"?1:0;if(h.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${h.dataFormat}'. Please use 'channelsLast'.`);let $=a.makeOutput(h.outShape,"float32"),S=a.dataIdMap.get($.dataId).id;return N6(i,r.shape[0],r.shape[1],r.shape[2],o,m,f,g,y,A,x,_,v,b,w,N,C,E,S),$}var _Y={kernelName:Es,backendName:"wasm",setupFunc:OY,kernelFunc:zY},PY=!1,LY=wn(Ro,PY,"bool"),WY=vn(Ms);function Qg(e){let{inputs:t,attrs:n,backend:a}=e,{input:r}=t,{dim:s}=n,i=r.shape.length,o=r.shape.slice(),u=s;return s<0&&(k.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),u=i+s+1),o.splice(u,0,1),Ea({inputs:{x:r},backend:a,attrs:{shape:o}})}var BY={kernelName:Mo,backendName:"wasm",kernelFunc:Qg};function VY(e){let{attrs:{shape:t,value:n,dtype:a},backend:r}=e,s=r.makeOutput(t,a);return r.typedArrayFromHeap(s).fill(n),s}var jY={kernelName:Pu,backendName:"wasm",kernelFunc:VY},T6;function UY(e){T6=e.wasm.cwrap($o,null,["number","number","number","number","number","number"])}function HY(e){let{inputs:t,backend:n}=e,{image:a}=t,r=n.makeOutput(a.shape,a.dtype),s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,[o,u,l,d]=a.shape;return T6(s,o,u,l,d,i),r}var GY={kernelName:$o,backendName:"wasm",kernelFunc:HY,setupFunc:UY},qY=vn(Fs),XY=!1,KY=wn($s,XY),C6;function ZY(e){C6=e.wasm.cwrap(Ds,null,["number","number","number","number","number","number","number"])}function YY(e){let{backend:t,inputs:n,attrs:a}=e,{varianceEpsilon:r}=a,{x:s,mean:i,variance:o,offset:u,scale:l}=n,d=t.dataIdMap.get(s.dataId).id,p=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(o.dataId).id,h=u!=null?t.dataIdMap.get(u.dataId).id:0,m=l!=null?t.dataIdMap.get(l.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(k.sizeFromShape(s.shape)===0)return f;let g=t.dataIdMap.get(f.dataId).id;return C6(d,p,c,h,m,r,g),f}var JY={kernelName:Ds,backendName:"wasm",setupFunc:ZY,kernelFunc:YY},E6;function QY(e){E6=e.wasm.cwrap(fi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function eJ(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:u,pad:l,dilations:d,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=F.computeConv2DInfo(r.shape,s.shape,u,d,l,c),g=Pd[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,A=a.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Z=a.dataIdMap.get(i.dataId);if(Z.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${Z.shape.length}.`);if(Z.shape[0]!==x)throw new Error(`FusedConv2D bias shape (${Z.shape}) does not match the number of output channels (${x})`);v=Z.id}let b=f.filterHeight,w=f.filterWidth,N=f.padInfo.top,C=f.padInfo.right,E=f.padInfo.bottom,_=f.padInfo.left,$=f.dilationHeight,S=f.dilationWidth,z=f.strideHeight,O=f.strideWidth,W=f.inChannels,G=f.padInfo.type==="SAME"?1:0,H=f.batchSize,J=f.inHeight,K=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let ne=a.makeOutput(f.outShape,"float32"),Q=a.dataIdMap.get(ne.dataId).id,se=o==null?0:a.dataIdMap.get(o.dataId).id;return E6(y,H,J,K,A,b,w,v,N,C,E,_,G,$,S,z,O,W,x,g,se,m||0,Q),ne}var tJ={kernelName:fi,backendName:"wasm",setupFunc:QY,kernelFunc:eJ},R6;function nJ(e){R6=e.wasm.cwrap(mi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function aJ(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:u,pad:l,dilations:d,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=F.computeConv2DInfo(r.shape,s.shape,u,d,l,c,!0),g=Pd[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,A=a.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Z=a.dataIdMap.get(i.dataId);if(Z.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${Z.shape.length}.`);if(Z.shape[0]!==x)throw new Error(`FusedDepthwiseConv2D bias shape (${Z.shape}) does not match the number of output channels (${x})`);v=Z.id}let b=f.filterHeight,w=f.filterWidth,N=f.padInfo.top,C=f.padInfo.right,E=f.padInfo.bottom,_=f.padInfo.left,$=f.dilationHeight,S=f.dilationWidth,z=f.strideHeight,O=f.strideWidth,W=f.inChannels,G=f.padInfo.type==="SAME"?1:0,H=f.batchSize,J=f.inHeight,K=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let ne=a.makeOutput(f.outShape,"float32"),Q=a.dataIdMap.get(ne.dataId).id,se=o==null?0:a.dataIdMap.get(o.dataId).id;return R6(y,H,J,K,A,b,w,v,N,C,E,_,G,$,S,z,O,W,x,g,se,m||0,Q),ne}var rJ={kernelName:mi,backendName:"wasm",setupFunc:nJ,kernelFunc:aJ},M6;function sJ(e){M6=e.wasm.cwrap(Oo,null,["number","number","number","number","number","number","array","number"])}function iJ(e){let{backend:t,inputs:n}=e,{params:a,indices:r}=n,[s,i,o,u]=g1.prepareAndValidate(a,r),l=t.makeOutput(s,a.dtype);if(i===0)return l;let d=r.shape,p=d[d.length-1],c=t.dataIdMap.get(a.dataId).id,h=t.dataIdMap.get(r.dataId).id,m=new Uint8Array(new Int32Array(u).buffer),f=t.dataIdMap.get(l.dataId).id;return M6(c,Fn[a.dtype],h,i,p,o,m,f),l}var oJ={kernelName:Oo,backendName:"wasm",setupFunc:sJ,kernelFunc:iJ},F6;function lJ(e){F6=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function uJ(e){let{backend:t,inputs:n,attrs:a}=e,{x:r,indices:s}=n,{axis:i,batchDims:o}=a,u=k.parseAxisParam(i,r.shape)[0],l=F.segment_util.collectGatherOpShapeInfo(r,s,u,o),d=Ea({inputs:{x:r},attrs:{shape:[l.batchSize,l.outerSize,l.dimSize,l.sliceSize]},backend:t}),p=k.sizeFromShape(s.shape),c=Ea({inputs:{x:s},attrs:{shape:[l.batchSize,p/l.batchSize]},backend:t}),h=[l.batchSize,l.outerSize,p/l.batchSize,l.sliceSize],m=t.makeOutput(h,r.dtype);if(k.sizeFromShape(r.shape)===0)return m;let f=d.shape.length-1,g=t.dataIdMap.get(d.dataId).id,y=t.dataIdMap.get(c.dataId).id,A=t.dataIdMap.get(m.dataId).id,x=new Uint8Array(new Int32Array(k.computeStrides(d.shape)).buffer),v=new Uint8Array(new Int32Array(k.computeStrides(h)).buffer);return F6(g,Fn[r.dtype],x,f,y,l.batchSize,v,A),t.disposeData(d.dataId),t.disposeData(c.dataId),m.shape=l.outputShape,m}var dJ={kernelName:Do,backendName:"wasm",setupFunc:lJ,kernelFunc:uJ},pJ=!1,cJ=wn(zo,pJ,"bool"),hJ=!1,fJ=wn(Os,hJ,"bool"),$6;function mJ(e){$6=e.wasm.cwrap(_s,null,["number","number","number"])}function gJ(e){let{inputs:{x:t},attrs:{alpha:n},backend:a}=e,r=a.dataIdMap.get(t.dataId).id,s=a.makeOutput(t.shape,t.dtype);if(k.sizeFromShape(t.shape)!==0){let i=a.dataIdMap.get(s.dataId).id;$6(r,n,i)}return s}var yJ={kernelName:_s,backendName:"wasm",setupFunc:mJ,kernelFunc:gJ},AJ=!1,xJ=wn(Wo,AJ,"bool"),bJ=!1,vJ=wn(Bo,bJ,"bool"),wJ=vn(Ps),kJ=!1,IJ=wn(jo,kJ,"bool"),D6;function SJ(e){D6=e.wasm.cwrap(Ls,null,["number, number, number"])}function NJ(e){let{backend:t,inputs:n,attrs:a}=e,{reductionIndices:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,u=i,{transposed:l,axes:d,originalAxes:p,inputWasTransposed:c}=Qr(i,r,t);if(c){let A=t.dataIdMap.get(l.dataId).id;u=l,o=A}let h=u.shape.length;F.assertAxesAreInnerMostDims("max",d,h);let[m,f]=F.computeOutAndReduceShapes(u.shape,d),g=k.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(k.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(y.dataId).id;D6(o,g,A)}if(c&&t.disposeData(l.dataId),s){let A=F.expandShapeToKeepDim(y.shape,p);y.shape=A}return y}var TJ={kernelName:Ls,backendName:"wasm",setupFunc:SJ,kernelFunc:NJ},CJ=!1,EJ=wn(Ws,CJ),O6;function RJ(e){O6=e.wasm.cwrap(Bs,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function MJ(e){let{inputs:t,attrs:n,backend:a}=e,r=t.x,s=a.dataIdMap.get(r.dataId).id,{filterSize:i,strides:o,pad:u,dimRoundingMode:l}=n,d=F.computePool2DInfo(r.shape,i,o,1,u,l),p=d.filterHeight,c=d.filterWidth,h=d.padInfo.top,m=d.padInfo.right,f=d.padInfo.bottom,g=d.padInfo.left,y=d.dilationHeight,A=d.dilationWidth,x=d.strideHeight,v=d.strideWidth,b=d.inChannels,w=d.outChannels;if(d.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let N=a.makeOutput(d.outShape,"float32"),C=a.dataIdMap.get(N.dataId).id;return O6(s,r.shape[0],r.shape[1],r.shape[2],p,c,h,m,f,g,y,A,x,v,b,w,C),N}var FJ={kernelName:Bs,backendName:"wasm",setupFunc:RJ,kernelFunc:MJ},z6;function $J(e){z6=e.wasm.cwrap(Vs,null,["number, number, number"])}function DJ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,u=o,l=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t),m=p;if(h){let v=t.dataIdMap.get(d.dataId).id;v!==o&&(l=d,u=v,m=F.getInnerMostAxes(m.length,l.shape.length))}F.assertAxesAreInnerMostDims("mean",m,l.shape.length);let[f,g]=F.computeOutAndReduceShapes(l.shape,m),y=k.sizeFromShape(g),A=l;l.dtype!=="float32"&&(A=t0({backend:t,inputs:{x:l},attrs:{dtype:"float32"}}),u=t.dataIdMap.get(A.dataId).id);let x=t.makeOutput(f,"float32");if(k.sizeFromShape(l.shape)!==0){let v=t.dataIdMap.get(x.dataId).id;z6(u,y,v)}if(h&&t.disposeData(d.dataId),s){let v=F.expandShapeToKeepDim(x.shape,c);x.shape=v}return l.dtype!=="float32"&&t.disposeData(A.dataId),x}var OJ={kernelName:Vs,backendName:"wasm",setupFunc:$J,kernelFunc:DJ},_6;function zJ(e){_6=e.wasm.cwrap(js,null,["number, number, number"])}function _J(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,u=o,l=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t);if(h){let x=t.dataIdMap.get(d.dataId).id;x!==o&&(l=d,u=x)}let m=l.shape.length;F.assertAxesAreInnerMostDims("min",p,m);let[f,g]=F.computeOutAndReduceShapes(l.shape,p),y=k.sizeFromShape(g),A=t.makeOutput(f,l.dtype);if(k.sizeFromShape(l.shape)!==0){let x=t.dataIdMap.get(A.dataId).id;_6(u,y,x)}if(h&&t.disposeData(d.dataId),s){let x=F.expandShapeToKeepDim(A.shape,c);A.shape=x}return A}var PJ={kernelName:js,backendName:"wasm",setupFunc:zJ,kernelFunc:_J},LJ=!1,WJ=wn(Us,LJ),ey;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(ey||(ey={}));var P6;function BJ(e){P6=e.wasm.cwrap(Hs,null,["number","array","number","number","array","array","number","number"])}function VJ(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,mode:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),u=n.dataIdMap.get(o.dataId).id,l=new Uint8Array(new Int32Array(t.shape).buffer),d=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(d).buffer),h=new Uint8Array(new Int32Array(p).buffer);return P6(i,l,t.shape.length,Fn[t.dtype],c,h,ey[r],u),o}var jJ={kernelName:Hs,backendName:"wasm",kernelFunc:VJ,setupFunc:BJ},UJ=!0,HJ=wn(Gs,UJ),GJ=vn(Ho);function ty(e,t){let n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),a=n[0],r=n[1],s=n[2],i=n[3];return e.wasm._free(t),{pSelectedIndices:a,selectedSize:r,pSelectedScores:s,pValidOutputs:i}}var L6;function qJ(e){L6=e.wasm.cwrap(qo,"number",["number","number","number","number","number"])}function XJ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i}=a,{boxes:o,scores:u}=n,l=t.dataIdMap.get(o.dataId).id,d=t.dataIdMap.get(u.dataId).id,p=L6(l,d,s,r,i),{pSelectedIndices:c,selectedSize:h,pSelectedScores:m,pValidOutputs:f}=ty(t,p);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([h],"int32",c)}var KJ={kernelName:qo,backendName:"wasm",setupFunc:qJ,kernelFunc:XJ},W6;function ZJ(e){W6=e.wasm.cwrap(Xo,"number",["number","number","number","number","number","bool"])}function YJ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=a,{boxes:u,scores:l}=n,d=t.dataIdMap.get(u.dataId).id,p=t.dataIdMap.get(l.dataId).id,c=W6(d,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=ty(t,c);t.wasm._free(f);let y=t.makeOutput([m],"int32",h),A=t.makeOutput([],"int32",g);return[y,A]}var JJ={kernelName:Xo,backendName:"wasm",setupFunc:ZJ,kernelFunc:YJ},B6;function QJ(e){B6=e.wasm.cwrap(Ko,"number",["number","number","number","number","number","number"])}function eQ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=a,{boxes:u,scores:l}=n,d=t.dataIdMap.get(u.dataId).id,p=t.dataIdMap.get(l.dataId).id,c=B6(d,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=ty(t,c);t.wasm._free(g);let y=t.makeOutput([m],"int32",h),A=t.makeOutput([m],"float32",f);return[y,A]}var tQ={kernelName:Ko,backendName:"wasm",setupFunc:QJ,kernelFunc:eQ},nQ=!1,aQ=wn(Go,nQ,"bool"),V6;function rQ(e){V6=e.wasm.cwrap(qs,null,["number","number","number","number","number"])}function sQ(e){let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,u=n.makeOutput([...r.shape,s],"int32"),l=n.dataIdMap.get(u.dataId).id,d=n.dataIdMap.get(r.dataId).id;return V6(d,s,i,o,l),u}var iQ={kernelName:qs,backendName:"wasm",setupFunc:rQ,kernelFunc:sQ};function oQ(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(1),a}var lQ={kernelName:Zo,backendName:"wasm",kernelFunc:oQ};function uQ(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return Qg({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{k.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),k.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],u=t.map(d=>{let p=Qg({inputs:{input:d},backend:n,attrs:{dim:r}});return o.push(p),p}),l=b6({inputs:u,backend:n,attrs:{axis:r}});return o.forEach(d=>n.disposeData(d.dataId)),l}var dQ={kernelName:Yo,backendName:"wasm",kernelFunc:uQ},j6;function pQ(e){j6=e.wasm.cwrap(Xs,null,["number","array","number","number","array","array","number","number"])}function cQ(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,constantValue:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),u=n.dataIdMap.get(o.dataId).id,l=new Uint8Array(new Int32Array(t.shape).buffer),d=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(d).buffer),h=new Uint8Array(new Int32Array(p).buffer);return j6(i,l,t.shape.length,Fn[t.dtype],c,h,r,u),o}var hQ={kernelName:Xs,backendName:"wasm",kernelFunc:cQ,setupFunc:pQ},fQ=!1,mQ=wn(Ks,fQ),U6;function gQ(e){U6=e.wasm.cwrap(Zs,null,["number","number","number"])}function yQ(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,o=n.makeOutput(a.shape,"float32"),u=n.dataIdMap.get(o.dataId).id;return U6(s,i,u),o}var AQ={kernelName:Zs,backendName:"wasm",setupFunc:gQ,kernelFunc:yQ},H6;function xQ(e){H6=e.wasm.cwrap(Jo,null,["number","number","number","number"])}function bQ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,u=o,l=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(d.dataId).id;x!==o&&(l=d,u=x,m=F.getInnerMostAxes(m.length,l.shape.length))}F.assertAxesAreInnerMostDims("prod",m,l.shape.length);let[f,g]=F.computeOutAndReduceShapes(l.shape,m),y=k.sizeFromShape(g),A=t.makeOutput(f,l.dtype);if(k.sizeFromShape(l.shape)!==0){let x=t.dataIdMap.get(A.dataId).id;H6(u,y,Fn[A.dtype],x)}if(h&&t.disposeData(d.dataId),s){let x=F.expandShapeToKeepDim(A.shape,c);A.shape=x}return A}var vQ={kernelName:Jo,backendName:"wasm",setupFunc:xQ,kernelFunc:bQ},wQ=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=kg(a,r,s,i),u=t.makeOutput([o.length],i);return t.typedArrayFromHeap(u).set(o),u},kQ={kernelName:ju,backendName:"wasm",kernelFunc:wQ},IQ=!0,SQ=wn(Rs,IQ),NQ=vn(Ys),TQ=vn(Qs),G6;function CQ(e){G6=e.wasm.cwrap(Js,null,["number","number","number","number","number","number","number","number","number","number"])}function EQ(e){let{backend:t,inputs:n,attrs:a}=e,{images:r}=n,{alignCorners:s,halfPixelCenters:i,size:o}=a,[u,l]=o,[d,p,c,h]=r.shape,m=[d,u,l,h],f=t.dataIdMap.get(r.dataId),g;f.dtype!=="float32"&&(g=t0({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(g.dataId));let y=f.id,A=t.makeOutput(m,"float32");if(k.sizeFromShape(r.shape)===0)return A;let x=t.dataIdMap.get(A.dataId).id;return G6(y,d,p,c,h,u,l,s?1:0,i?1:0,x),g!=null&&t.disposeData(g.dataId),A}var RQ={kernelName:Js,backendName:"wasm",setupFunc:CQ,kernelFunc:EQ},q6;function MQ(e){q6=e.wasm.cwrap(ei,null,["number","array","number","array","number","number"])}function FQ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=k.parseAxisParam(s,r.shape);if(r.shape.length===0)return Qh({inputs:{x:r},backend:n});let o=n.makeOutput(r.shape,r.dtype),u=n.dataIdMap.get(r.dataId).id,l=n.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(i).buffer),p=new Uint8Array(new Int32Array(r.shape).buffer);q6(u,d,i.length,p,r.shape.length,l);let c=Ea({inputs:{x:o},attrs:{shape:r.shape},backend:n});return n.disposeData(o.dataId),c}var $Q={kernelName:ei,backendName:"wasm",kernelFunc:FQ,setupFunc:MQ},X6;function DQ(e){X6=e.wasm.cwrap(fl,null,["number","number","number","number","number","number","number","number","array","number","number"])}function OQ(e){let{inputs:t,backend:n,attrs:a}=e,{image:r}=t,{radians:s,fillValue:i,center:o}=a,u=n.makeOutput(r.shape,r.dtype),l=n.dataIdMap.get(r.dataId).id,d=n.dataIdMap.get(u.dataId).id,[p,c,h,m]=r.shape,[f,g]=F.getImageCenter(o,c,h),y=i===0,A=255,x=typeof i=="number"?[i,i,i,y?0:A]:[...i,A],v=new Uint8Array(new Int32Array(x).buffer);return X6(l,p,c,h,m,s,f,g,v,x.length,d),u}var zQ={kernelName:fl,backendName:"wasm",kernelFunc:OQ,setupFunc:DQ},_Q=vn(ti),PQ=vn(ni),K6;function LQ(e){K6=e.wasm.cwrap(tl,null,["number","number","number","number","number","number","array","number","number"])}function WQ(e){let{backend:t,inputs:n,attrs:a}=e,{indices:r,updates:s}=n,{shape:i}=a,o=t.makeOutput(i,s.dtype);if(k.sizeFromShape(i)===0)return o;let{sliceRank:u,numUpdates:l,sliceSize:d,strides:p,outputSize:c}=y1.calculateShapes(s,r,i),h=t.dataIdMap.get(r.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(p).buffer),g=t.dataIdMap.get(o.dataId).id;return K6(h,m,Fn[s.dtype],u,l,d,f,c,g),o}var BQ={kernelName:tl,backendName:"wasm",setupFunc:LQ,kernelFunc:WQ},Z6;function VQ(e){Z6=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function jQ(e){let{inputs:t,backend:n}=e,{condition:a,t:r,e:s}=t,i=n.dataIdMap.get(a.dataId).id,o=n.dataIdMap.get(r.dataId).id,u=n.dataIdMap.get(s.dataId).id,l=n.makeOutput(r.shape,r.dtype),d=n.dataIdMap.get(l.dataId).id,p=a.shape.length,c=r.shape.length,h=p===0||p>1||c===1?1:k.sizeFromShape(r.shape.slice(1));return Z6(i,o,u,h,d),l}var UQ={kernelName:nl,backendName:"wasm",kernelFunc:jQ,setupFunc:VQ},Y6;function HQ(e){Y6=e.wasm.cwrap(ri,null,["number","number"])}function GQ(e){let{backend:t,inputs:{x:n}}=e,a=t.dataIdMap.get(n.dataId).id,r=t.makeOutput(n.shape,n.dtype),s=t.dataIdMap.get(r.dataId).id;return k.sizeFromShape(r.shape)===0||Y6(a,s),r}var qQ={kernelName:"Sigmoid",backendName:"wasm",setupFunc:HQ,kernelFunc:GQ},XQ=vn(ai);function n0(e){let{inputs:{x:t},attrs:{begin:n,size:a},backend:r}=e,[s,i]=fn.parseSliceParams(t,n,a),o=fn.isSliceContinous(t.shape,s,i),u=r.readSync(t.dataId),l=r.makeOutput(i,t.dtype),d=k.computeStrides(t.shape),p=r.dataIdMap.get(l.dataId);if(o){let m=fn.computeFlatOffset(s,d);return t.dtype==="string"?p.stringBytes=u.slice(m,m+k.sizeFromShape(i)):r.typedArrayFromHeap(l).set(u.subarray(m,m+k.sizeFromShape(i))),l}if(t.dtype==="string"){let m=Fh(u,s,i,t.shape,t.dtype);return p.stringBytes=m,l}let c=r.typedArrayFromHeap(l),h=t.shape.length;if(h===2)KQ(u,d[0],c,s,i);else if(h===3)ZQ(u,d[0],d[1],c,s,i);else if(h===4)YQ(u,d[0],d[1],d[2],c,s,i);else{let m=Fh(u,s,i,t.shape,t.dtype);c.set(m)}return l}function KQ(e,t,n,a,r){let s=0,i=a[0],o=a[1],u=i+r[0];for(let l=i;l{let c=[...d];c[o]=p;let h=n0({inputs:{x:r},attrs:{begin:l,size:c},backend:a});return l[o]+=p,h})}var aee={kernelName:ll,backendName:"wasm",kernelFunc:nee},ree=vn(si),see=vn(Gu),iee=!0,oee=wn(li,iee),Q6;function lee(e){Q6=e.wasm.cwrap(Pr,null,["number","number","number"])}function uee(e){let{backend:t,inputs:n,attrs:a}=e,{alpha:r}=a,{x:s}=n,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),u=t.dataIdMap.get(o.dataId).id;return Q6(i,r,u),o}var dee={kernelName:Pr,backendName:"wasm",setupFunc:lee,kernelFunc:uee},e4;function pee(e){e4=e.wasm.cwrap(ul,null,["number","array","number","array","array","array","array","array","number","number"])}function cee(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{begin:s,end:i,strides:o}=a;o==null&&(o=new Array(s.length));let{beginMask:u,endMask:l,ellipsisMask:d,newAxisMask:p,shrinkAxisMask:c}=a,h=F.slice_util.maskToAxes(d);if(h.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(d!==0&&p!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(d!==0&&c!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let m=r.shape.length-s.length,f=F.slice_util.maskToAxes(p),g=r.shape.slice();f.forEach(_=>{s[_]=0,i[_]=1,g.splice(_,0,1)});let y=Ea({inputs:{x:r},attrs:{shape:g},backend:t}),{begin:A,end:x,strides:v}=F.slice_util.getNormalizedAxes(y.shape,h,m,s,i,o,u,l,d);s=A,i=x,o=v;let b=F.slice_util.maskToAxes(c);b.forEach(_=>{i[_]=s[_]+1,o[_]=1});let w=F.slice_util.computeOutShape(s,i,o),N=w.filter((_,$)=>b.indexOf($)===-1);if(o.every(_=>_===1)){let _=n0({inputs:{x:y},attrs:{begin:s,size:w},backend:t});t.disposeData(y.dataId);let $=Ea({inputs:{x:_},attrs:{shape:N},backend:t});return t.disposeData(_.dataId),$}let C=t.makeOutput(N,"float32");if(!N.some(_=>_===0)){let _=t.dataIdMap.get(y.dataId).id,$=new Uint8Array(new Int32Array(k.computeStrides(y.shape)).buffer),S=new Uint8Array(new Int32Array(s).buffer),z=new Uint8Array(new Int32Array(i).buffer),O=new Uint8Array(new Int32Array(o).buffer),W=new Uint8Array(new Int32Array(N).buffer),G=new Uint8Array(new Int32Array(k.computeStrides(N)).buffer),H=t.dataIdMap.get(C.dataId).id;e4(_,$,y.shape.length,S,z,O,W,G,N.length,H)}t.disposeData(y.dataId);let E=Ea({inputs:{x:C},attrs:{shape:N},backend:t});return t.disposeData(C.dataId),E}var hee={kernelName:ul,backendName:"wasm",setupFunc:pee,kernelFunc:cee},fee=!0,mee=wn(ui,fee),t4;function gee(e){t4=e.wasm.cwrap(ii,null,["number, number, number"])}function yee(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,u=o,l=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(d.dataId).id;x!==o&&(l=d,u=x,m=F.getInnerMostAxes(m.length,l.shape.length))}F.assertAxesAreInnerMostDims("sum",m,l.shape.length);let[f,g]=F.computeOutAndReduceShapes(l.shape,m),y=k.sizeFromShape(g),A=t.makeOutput(f,l.dtype);if(k.sizeFromShape(l.shape)!==0){let x=t.dataIdMap.get(A.dataId).id;t4(u,y,x)}if(h&&t.disposeData(d.dataId),s){let x=F.expandShapeToKeepDim(A.shape,c);A.shape=x}return A}var Aee={kernelName:ii,backendName:"wasm",setupFunc:gee,kernelFunc:yee},xee=vn(di),bee=vn(pi),n4;function vee(e){n4=e.wasm.cwrap(_r,null,["number","array","number","array","number","number"])}function wee(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,s=n.dataIdMap.get(r.dataId).id,{reps:i}=a,o=new Array(r.shape.length);for(let c=0;c{let{x:a}=e,{k:r,sorted:s}=n,i=t.dataIdMap.get(a.dataId).id,o=new Uint8Array(new Int32Array(a.shape).buffer),u=a.shape.slice();u[u.length-1]=r;let l=t.makeOutput(u,a.dtype),d=t.dataIdMap.get(l.dataId).id,p=t.makeOutput(u,"int32"),c=t.dataIdMap.get(p.dataId).id;return a4(i,o,a.shape.length,Fn[a.dtype],r,s,d,c),[l,p]},Nee={kernelName:dl,backendName:"wasm",setupFunc:Iee,kernelFunc:See},r4;function Tee(e){r4=e.wasm.cwrap(pl,null,["number","number","bool","number","number","number","number","number","number","array","number","number","number","number","number"])}function Cee(e){let{backend:t,inputs:n,attrs:a}=e,{image:r,transforms:s}=n,{interpolation:i,fillMode:o,fillValue:u,outputShape:l}=a,[d,p,c,h]=r.shape,[m,f]=l!=null?l:[p,c],g=[d,m,f,h],y=new Uint8Array(new Int32Array(k.computeStrides(r.shape)).buffer),A=t.makeOutput(g,r.dtype),x=t.dataIdMap.get(A.dataId).id,v=t.dataIdMap.get(r.dataId).id,b=t.dataIdMap.get(s.dataId).id,w=i==="nearest"?1:2,N;switch(o){case"constant":N=1;break;case"reflect":N=2;break;case"wrap":N=3;break;case"nearest":N=4;break;default:N=1;break}return r4(v,b,s.shape[0]>1,d,m,f,h,c,p,y,r.shape.length-1,w,N,u,x),A}var Eee={kernelName:pl,backendName:"wasm",setupFunc:Tee,kernelFunc:Cee};function Ree(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r.shape[s],o=r.shape.length,u=new Array(o-1),l=0;for(let h=0;h({dataId:h,dtype:m,shape:u}))}var Mee={kernelName:cl,backendName:"wasm",kernelFunc:Ree};function Fee(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(0),a}var $ee={kernelName:hl,backendName:"wasm",kernelFunc:Fee},Dee=[WZ,VZ,HZ,QZ,nY,sY,lY,cY,hY,fY,yY,AY,vY,IY,SY,CY,MY,DY,_Y,LY,WY,BY,jY,GY,qY,KY,LZ,JY,tJ,rJ,oJ,dJ,cJ,fJ,GZ,yJ,xJ,vJ,wJ,IJ,TJ,EJ,FJ,OJ,PJ,WJ,jJ,HJ,GJ,KJ,JJ,tQ,aQ,iQ,lQ,dQ,hQ,mQ,AQ,vQ,kQ,SQ,NQ,TQ,uY,RQ,$Q,zQ,PQ,_Q,BQ,UQ,qQ,XQ,JQ,tee,aee,ree,see,oee,dee,hee,mee,Aee,xee,bee,kee,Nee,Eee,ZZ,Mee,$ee];for(let e of Dee)gi(e);var ny=te();ny.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>WebAssembly.validate(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])));ny.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(ny.get("IS_NODE"))return!1;try{return new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}});var s4=gs(iS()),Oee='var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}',zee=gs(oS()),i4=class extends Eu{constructor(e){super();this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.init(),this.dataIdMap=new Up(this,fr())}write(e,t,n){let a={id:this.dataIdNextNumber++};return this.move(a,e,t,n,1),a}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=k.now();return e(),{kernelMs:k.now()-t}}move(e,t,n,a,r){let s=this.dataIdNextNumber++;if(a==="string"){let l=t;this.dataIdMap.set(e,{id:s,stringBytes:l,shape:n,dtype:a,memoryOffset:null,refCount:r});return}let i=k.sizeFromShape(n),o=i*k.bytesPerElement(a),u=this.wasm._malloc(o);this.dataIdMap.set(e,{id:s,memoryOffset:u,shape:n,dtype:a,refCount:r}),this.wasm.tfjs.registerTensor(s,i,u),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,o),u)}async read(e){return this.readSync(e)}readSync(e){let{memoryOffset:t,dtype:n,shape:a,stringBytes:r}=this.dataIdMap.get(e);if(n==="string")return r;let s=this.wasm.HEAPU8.slice(t,t+k.sizeFromShape(a)*k.bytesPerElement(n));return Lee(s.buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){return this.dataIdMap.has(e)?this.dataIdMap.get(e).refCount:0}incRef(e){let t=this.dataIdMap.get(e);t!=null&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n){let a;if(n==null)a=this.write(null,e,t);else{let r=this.dataIdNextNumber++;a={id:r},this.dataIdMap.set(a,{id:r,memoryOffset:n,shape:e,dtype:t,refCount:1});let s=k.sizeFromShape(e);this.wasm.tfjs.registerTensor(r,s,n)}return{dataId:a,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){let a=this.wasm.HEAPU8.buffer,{memoryOffset:r}=this.dataIdMap.get(n),s=k.sizeFromShape(e);switch(t){case"float32":return new Float32Array(a,r,s);case"int32":return new Int32Array(a,r,s);case"bool":return new Uint8Array(a,r,s);default:throw new Error(`Unknown dtype ${t}`)}}};function _ee(e){return(t,n)=>(k.fetch(e,{credentials:"same-origin"}).then(a=>{a.ok||t.env.a(`failed to load wasm binary file at '${e}'`),a.arrayBuffer().then(r=>{WebAssembly.instantiate(r,t).then(s=>{n(s.instance,s.module)})})}),{})}function o4(e,t,n){if(a0!=null)return a0;let a="tfjs-backend-wasm.wasm";return e&&t?a="tfjs-backend-wasm-threaded-simd.wasm":e&&(a="tfjs-backend-wasm-simd.wasm"),Wd!=null&&Wd[a]!=null?Wd[a]:n+a}async function Pee(){let[e,t]=await Promise.all([te().getAsync("WASM_HAS_SIMD_SUPPORT"),te().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,a)=>{let r={};r.locateFile=(o,u)=>{if(o.endsWith(".worker.js")){let l=Oee,d=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(d)}return o.endsWith(".wasm")?o4(e,t,Ld!=null?Ld:u):u+o},ay&&(r.instantiateWasm=_ee(o4(e,t,Ld!=null?Ld:"")));let s=!1;r.onAbort=()=>{s||Bd||(Bd=!0,a({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"}))};let i;t&&e&&a0==null?(r.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+s4.default.toString()],{type:"text/javascript"}),i=(0,s4.default)(r)):i=(0,zee.default)(r),i.then(o=>{s=!0,Bd=!1;let u=null;o.tfjs={init:o.cwrap("init",null,[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",u,["number"]),dispose:o.cwrap("dispose",u,[])},n({wasm:o})})})}function Lee(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}var Wee=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],a0=null,Ld=null,Wd={},Bd=!1,ay=!1;function Bee(e,t=!1){if(k1("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),Bd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");a0=e,ay=t}function Vee(e,t=!1){if(Bd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof e=="string")Ld=e;else{Wd=e;let n=Wee.filter(a=>Wd[a]==null);if(n.length>0)throw new Error(`There were no entries found for the following binaries: ${n.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}ay=t}var l4="3.7.0",jee=2;kl("wasm",async()=>{let{wasm:e}=await Pee();return new i4(e)},jee);ee().prototype.abs=function(){return this.throwIfDisposed(),Wt(this)};ee().prototype.acos=function(){return this.throwIfDisposed(),S1(this)};ee().prototype.acosh=function(){return this.throwIfDisposed(),N1(this)};ee().prototype.add=function(e){return this.throwIfDisposed(),ie(this,e)};ee().prototype.all=function(e,t){return this.throwIfDisposed(),Uc(this,e,t)};ee().prototype.any=function(e,t){return this.throwIfDisposed(),id(this,e,t)};ee().prototype.argMax=function(e){return this.throwIfDisposed(),ki(this,e)};ee().prototype.argMin=function(e){return this.throwIfDisposed(),T1(this,e)};ee().prototype.asScalar=function(){return this.throwIfDisposed(),D(this.size===1,()=>"The array must have only 1 element."),q(this,[])};ee().prototype.asType=function(e){return this.throwIfDisposed(),ge(this,e)};ee().prototype.as1D=function(){return this.throwIfDisposed(),q(this,[this.size])};ee().prototype.as2D=function(e,t){return this.throwIfDisposed(),q(this,[e,t])};ee().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),q(this,[e,t,n])};ee().prototype.as4D=function(e,t,n,a){return this.throwIfDisposed(),q(this,[e,t,n,a])};ee().prototype.as5D=function(e,t,n,a,r){return this.throwIfDisposed(),q(this,[e,t,n,a,r])};ee().prototype.asin=function(){return this.throwIfDisposed(),C1(this)};ee().prototype.asinh=function(){return this.throwIfDisposed(),E1(this)};ee().prototype.atan=function(){return this.throwIfDisposed(),R1(this)};ee().prototype.atan2=function(e){return this.throwIfDisposed(),M1(this,e)};ee().prototype.atanh=function(){return this.throwIfDisposed(),F1(this)};ee().prototype.avgPool=function(e,t,n,a){return this.throwIfDisposed(),ld(this,e,t,n,a)};ee().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),ud(this,e,t)};ee().prototype.batchNorm=function(e,t,n,a,r){return this.throwIfDisposed(),Ni(this,e,t,n,a,r)};ee().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Sl(this,e)};ee().prototype.cast=function(e){return this.throwIfDisposed(),ge(this,e)};ee().prototype.ceil=function(){return this.throwIfDisposed(),_1(this)};ee().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Mn(this,e,t)};ee().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Be&&(e=[e]),lt([this,...e],t)};ee().prototype.conv1d=function(e,t,n,a,r,s){return this.throwIfDisposed(),Gc(this,e,t,n,a,r,s)};ee().prototype.conv2dTranspose=function(e,t,n,a,r){return this.throwIfDisposed(),qc(this,e,t,n,a,r)};ee().prototype.conv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),mr(this,e,t,n,a,r,s)};ee().prototype.cos=function(){return this.throwIfDisposed(),dd(this)};ee().prototype.cosh=function(){return this.throwIfDisposed(),Xc(this)};ee().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),Kc(this,e,t,n)};ee().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),W1(this,e,t)};ee().prototype.depthwiseConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),Tl(this,e,t,n,a,r,s)};ee().prototype.dilation2d=function(e,t,n,a,r){return this.throwIfDisposed(),B1(this,e,t,n,a,r)};ee().prototype.divNoNan=function(e){return this.throwIfDisposed(),V1(this,e)};ee().prototype.div=function(e){return this.throwIfDisposed(),me(this,e)};ee().prototype.dot=function(e){return this.throwIfDisposed(),S3(this,e)};ee().prototype.elu=function(){return this.throwIfDisposed(),Cl(this)};ee().prototype.equal=function(e){return this.throwIfDisposed(),Hr(this,e)};ee().prototype.erf=function(){return this.throwIfDisposed(),j1(this)};ee().prototype.exp=function(){return this.throwIfDisposed(),la(this)};ee().prototype.expandDims=function(e){return this.throwIfDisposed(),mn(this,e)};ee().prototype.expm1=function(){return this.throwIfDisposed(),U1(this)};ee().prototype.fft=function(){return this.throwIfDisposed(),bd(this)};ee().prototype.flatten=function(){return this.throwIfDisposed(),q(this,[this.size])};ee().prototype.floor=function(){return this.throwIfDisposed(),Rl(this)};ee().prototype.floorDiv=function(e){return this.throwIfDisposed(),Vc(this,e)};ee().prototype.gather=function(e,t){return this.throwIfDisposed(),Ti(this,e,t)};ee().prototype.greaterEqual=function(e){return this.throwIfDisposed(),qr(this,e)};ee().prototype.greater=function(e){return this.throwIfDisposed(),Wn(this,e)};ee().prototype.ifft=function(){return this.throwIfDisposed(),Dl(this)};ee().prototype.irfft=function(){return this.throwIfDisposed(),ch(this)};ee().prototype.isFinite=function(){return this.throwIfDisposed(),T3(this)};ee().prototype.isInf=function(){return this.throwIfDisposed(),C3(this)};ee().prototype.isNaN=function(){return this.throwIfDisposed(),G1(this)};ee().prototype.leakyRelu=function(e){return this.throwIfDisposed(),pd(this,e)};ee().prototype.lessEqual=function(e){return this.throwIfDisposed(),Xr(this,e)};ee().prototype.less=function(e){return this.throwIfDisposed(),Yc(this,e)};ee().prototype.localResponseNormalization=function(e,t,n,a){return this.throwIfDisposed(),q1(this,e,t,n,a)};ee().prototype.logSigmoid=function(){return this.throwIfDisposed(),M3(this)};ee().prototype.logSoftmax=function(e){return this.throwIfDisposed(),eh(this,e)};ee().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),Z1(this,e,t)};ee().prototype.log=function(){return this.throwIfDisposed(),Bn(this)};ee().prototype.log1p=function(){return this.throwIfDisposed(),Jc(this)};ee().prototype.logicalAnd=function(e){return this.throwIfDisposed(),xa(this,e)};ee().prototype.logicalNot=function(){return this.throwIfDisposed(),cd(this)};ee().prototype.logicalOr=function(e){return this.throwIfDisposed(),th(this,e)};ee().prototype.logicalXor=function(e){return this.throwIfDisposed(),O3(this,e)};ee().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),je(this,e,t,n)};ee().prototype.maxPool=function(e,t,n,a){return this.throwIfDisposed(),hd(this,e,t,n,a)};ee().prototype.max=function(e,t){return this.throwIfDisposed(),Vn(this,e,t)};ee().prototype.maximum=function(e){return this.throwIfDisposed(),Xa(this,e)};ee().prototype.mean=function(e,t){return this.throwIfDisposed(),Nt(this,e,t)};ee().prototype.min=function(e,t){return this.throwIfDisposed(),fd(this,e,t)};ee().prototype.minimum=function(e){return this.throwIfDisposed(),Ml(this,e)};ee().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),J1(this,e,t)};ee().prototype.mod=function(e){return this.throwIfDisposed(),Q1(this,e)};ee().prototype.mul=function(e){return this.throwIfDisposed(),B(this,e)};ee().prototype.neg=function(){return this.throwIfDisposed(),St(this)};ee().prototype.norm=function(e,t,n){return this.throwIfDisposed(),gh(this,e,t,n)};ee().prototype.notEqual=function(e){return this.throwIfDisposed(),Ri(this,e)};ee().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),vl(this,e,t,n)};ee().prototype.onesLike=function(){return this.throwIfDisposed(),Un(this)};ee().prototype.pad=function(e,t){return this.throwIfDisposed(),gr(this,e,t)};ee().prototype.pool=function(e,t,n,a,r){return this.throwIfDisposed(),P3(this,e,t,n,a,r)};ee().prototype.pow=function(e){return this.throwIfDisposed(),yr(this,e)};ee().prototype.prelu=function(e){return this.throwIfDisposed(),gd(this,e)};ee().prototype.prod=function(e,t){return this.throwIfDisposed(),ah(this,e,t)};ee().prototype.reciprocal=function(){return this.throwIfDisposed(),ng(this)};ee().prototype.relu=function(){return this.throwIfDisposed(),Ka(this)};ee().prototype.relu6=function(){return this.throwIfDisposed(),rh(this)};ee().prototype.reshapeAs=function(e){return this.throwIfDisposed(),q(this,e.shape)};ee().prototype.reshape=function(e){return this.throwIfDisposed(),q(this,e)};ee().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),n7(this,e,t,n)};ee().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),a7(this,e,t,n)};ee().prototype.reverse=function(e){return this.throwIfDisposed(),Hn(this,e)};ee().prototype.rfft=function(){return this.throwIfDisposed(),vd(this)};ee().prototype.round=function(){return this.throwIfDisposed(),sh(this)};ee().prototype.rsqrt=function(){return this.throwIfDisposed(),ih(this)};ee().prototype.selu=function(){return this.throwIfDisposed(),oh(this)};ee().prototype.separableConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),ag(this,e,t,n,a,r,s)};ee().prototype.sigmoid=function(){return this.throwIfDisposed(),Rn(this)};ee().prototype.sign=function(){return this.throwIfDisposed(),rg(this)};ee().prototype.sin=function(){return this.throwIfDisposed(),lh(this)};ee().prototype.sinh=function(){return this.throwIfDisposed(),uh(this)};ee().prototype.slice=function(e,t){return this.throwIfDisposed(),Re(this,e,t)};ee().prototype.softmax=function(e){return this.throwIfDisposed(),xd(this,e)};ee().prototype.softplus=function(){return this.throwIfDisposed(),Ci(this)};ee().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),md(this,e,t)};ee().prototype.split=function(e,t){return this.throwIfDisposed(),Zt(this,e,t)};ee().prototype.sqrt=function(){return this.throwIfDisposed(),an(this)};ee().prototype.square=function(){return this.throwIfDisposed(),ot(this)};ee().prototype.squaredDifference=function(e){return this.throwIfDisposed(),hh(this,e)};ee().prototype.squeeze=function(e){return this.throwIfDisposed(),Vt(this,e)};ee().prototype.stack=function(e,t){this.throwIfDisposed();let n=e instanceof Be?[this,e]:[this,...e];return gn(n,t)};ee().prototype.step=function(e){return this.throwIfDisposed(),Ol(this,e)};ee().prototype.stridedSlice=function(e,t,n,a,r,s,i,o){return this.throwIfDisposed(),ig(this,e,t,n,a,r,s,i,o)};ee().prototype.sub=function(e){return this.throwIfDisposed(),ye(this,e)};ee().prototype.sum=function(e,t){return this.throwIfDisposed(),Se(this,e,t)};ee().prototype.tan=function(){return this.throwIfDisposed(),og(this)};ee().prototype.tanh=function(){return this.throwIfDisposed(),Si(this)};ee().prototype.tile=function(e){return this.throwIfDisposed(),Gr(this,e)};ee().prototype.toBool=function(){return this.throwIfDisposed(),ge(this,"bool")};ee().prototype.toFloat=function(){return this.throwIfDisposed(),ge(this,"float32")};ee().prototype.toInt=function(){return this.throwIfDisposed(),ge(this,"int32")};ee().prototype.topk=function(e,t){return this.throwIfDisposed(),lg(this,e,t)};ee().prototype.transpose=function(e){return this.throwIfDisposed(),Qe(this,e)};ee().prototype.unique=function(e){return this.throwIfDisposed(),mh(this,e)};ee().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),ug(this,e,t)};ee().prototype.unstack=function(e){return this.throwIfDisposed(),Gn(this,e)};ee().prototype.where=function(e,t){return this.throwIfDisposed(),un(e,this,t)};ee().prototype.zerosLike=function(){return this.throwIfDisposed(),Ge(this)};var u4={kernelName:fo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Ol(ge(n,"float32"),-1))}}},Uee={kernelName:mo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=ot(ge(n,"float32")),r=an(ye(ke(1),a));return St(me(e,r))}}}},Hee={kernelName:go,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=an(ye(ot(ge(n,"float32")),1));return me(e,a)}}}},Gee={kernelName:Or,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=e,i=Bt(n.shape,r);return i.length>0&&(s=Se(s,i)),q(s,n.shape)},b:()=>{let s=e,i=Bt(a.shape,r);return i.length>0&&(s=Se(s,i)),q(s,a.shape)}}}},qee={kernelName:xs,saveAllInputs:!0,gradFunc:(e,t)=>{let n={};return t.forEach((a,r)=>{n[r]=()=>e.clone()}),n}},Xee={kernelName:bs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ge(n)}}},Kee={kernelName:Fu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ge(n)}}},Zee={kernelName:xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,an(ye(ke(1),ot(ge(n,"float32")))))}}},Yee={kernelName:bo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=an(ie(ke(1),ot(ge(n,"float32"))));return me(e,a)}}}},Jee={kernelName:ko,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=ie(ot(n),ot(a)),i=B(e,me(a,s)),o=Bt(n.shape,r);return o.length>0&&(i=Se(i,o)),q(i,n.shape)},b:()=>{let s=ie(ot(n),ot(a)),i=St(B(e,me(n,s))),o=Bt(a.shape,r);return o.length>0&&(i=Se(i,o)),q(i,a.shape)}}}},Qee={kernelName:vo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ie(ot(ge(n,"float32")),1))}}},ete={kernelName:wo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ye(ke(1),ot(ge(n,"float32"))))}}};function tte(e,t,n,a,r,s){let i=M(e,"dy","avgPool3dGrad"),o=M(t,"input","avgPool3dGrad"),u=i,l=o,d=!1;o.rank===4&&(d=!0,u=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),l=q(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),D(u.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`),D(l.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${l.rank}.`),s!=null&&D(qt(r),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${r}.`);let p={dy:u,input:l},c={filterSize:n,strides:a,pad:r,dimRoundingMode:s},h=P.runKernel(Kp,p,c);return d?q(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var nte=L({avgPool3dGrad_:tte}),ate={kernelName:$u,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i,dimRoundingMode:o}=n;return{x:()=>nte(e,a,r,s,i,o)}}};function rte(e,t,n,a,r){let s=M(e,"dy","avgPoolGrad"),i=M(t,"input","avgPoolGrad");D(i.rank===s.rank,()=>`Rank of input (${i.rank}) does not match rank of dy (${s.rank})`);let o=i,u=s,l=!1;i.rank===3&&(l=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2]]),u=q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),D(u.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${u.rank}.`),D(o.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`);let d={dy:u,input:o},p={filterSize:n,strides:a,pad:r},c=P.runKernel(Xp,d,p);return l?q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var ste=L({avgPoolGrad_:rte}),ite={kernelName:vs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i}=n;return{x:()=>ste(e,a,r,s,i)}}},ote={kernelName:ws,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{let[a,r]=t,{transposeA:s,transposeB:i}=n;return!s&&!i?{a:()=>je(e,r,!1,!0),b:()=>je(a,e,!0,!1)}:!s&&i?{a:()=>je(e,r,!1,!1),b:()=>je(e,a,!0,!1)}:s&&!i?{a:()=>je(r,e,!1,!0),b:()=>je(a,e,!1,!1)}:{a:()=>je(r,e,!0,!0),b:()=>je(e,a,!0,!0)}}},lte={kernelName:Du,gradFunc:(e,t,n)=>{let{blockShape:a,crops:r}=n;return{x:()=>md(e,a,r)}}},ute={kernelName:mb,gradFunc:(e,t,n)=>{let a=n,r=a.inputShape,s=a.shape,i=Array.from(s);for(let u=r.length-1;u>=0;u--)if(r[u]===s[u])i[u]=1;else if(r[u]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);let o=[];for(let u=0;u1&&o.push(u);return{x:()=>Se(e,o,!0)}}},dte={kernelName:ks,gradFunc:e=>({x:()=>e.clone()})},pte={kernelName:Is,gradFunc:e=>({x:()=>Ge(e)})},cte={kernelName:zr,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>un(xa(qr(a,r),Xr(a,s)),e,Ge(e))}}},hte={kernelName:Ou,inputsToSave:["x"],gradFunc:u4.gradFunc},fte={kernelName:Io,saveAllInputs:!0,gradFunc:(e,t,n)=>{let a=t.map(o=>o.shape),{axis:r}=n,s=ya(r,t[0].shape)[0],i=a.map(o=>o[s]);return Zt(e,i,s).map(o=>()=>o)}},mte={kernelName:Ss,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{dilations:s,strides:i,pad:o,dataFormat:u}=n;return D(Ur(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>P1(a.shape,e,r,i,o,u),filter:()=>hg(a,e,r.shape,i,o,u)}}},gte={kernelName:Ns,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{strides:s,pad:i,dataFormat:o,dimRoundingMode:u}=n;return{dy:()=>mr(e,r,s,i,o,1,u),filter:()=>hg(e,a,r.shape,s,i,o,u)}}};function yte(e,t,n,a,r){let s=e;e.rank===4&&(s=q(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;i.rank===4&&(i=q(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),D(s.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),D(i.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`),D(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),D(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),D(i.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`);let o={x:s,dy:i},u={strides:a,pad:r,filterShape:n};return P.runKernel(Qp,o,u)}var Ate=L({conv3DBackpropFilter_:yte}),xte={kernelName:zu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s}=n;D(Ur(a),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`);let[i,o]=t;return{x:()=>w3(i.shape,e,o,r,s),filter:()=>Ate(i,e,o.shape,r,s)}}},bte={kernelName:Ts,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(St(lh(ge(n,"float32"))),e)}}},vte={kernelName:So,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(uh(ge(n,"float32")),e)}}},wte={kernelName:Cs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r,exclusive:s,reverse:i}=n;return{x:()=>{let o=D3([r],a.rank),u=Kc(e,r,s,!i);return o!=null&&(u=Qe(u,o)),u}}}},kte={kernelName:Es,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s,dimRoundingMode:i}=n,o=a==null?[1,1]:a;D(Ur(o),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`);let[u,l]=t;return D(u.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${u.rank}.`),D(l.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${l.rank}.`),D(u.shape[3]===l.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${u.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`),D(Ga(r,o),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`),i!=null&&D(qt(s),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`),{x:()=>K3(u.shape,e,l,r,s,a,i),filter:()=>X3(u,e,l.shape,r,s,a,i)}}},Ite={kernelName:_u,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,s={x:a,filter:r,dy:e},i={x:a,filter:r,dy:e};return{x:()=>P.runKernel(sc,s,n),filter:()=>P.runKernel(ic,i,n)}}},Ste={kernelName:Co,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t,a={dy:e,y:n};return{x:()=>P.runKernel(lc,a)}}},Nte={kernelName:Eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(la(St(ot(n))),2/Math.sqrt(Math.PI));return{x:()=>B(e,a)}}},Tte={kernelName:Ms,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,n)}}},Cte={kernelName:Mo,inputsToSave:["input"],gradFunc:(e,t)=>{let[n]=t;return{input:()=>q(e,n.shape)}}},Ete={kernelName:Fo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,la(n))}}},Rte={kernelName:Fs,gradFunc:e=>({x:()=>Ge(e)})},Mte={kernelName:$s,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=me(e,ge(a,"float32")),i=Bt(n.shape,r);return i.length>0?q(Se(s,i),n.shape):s},b:()=>{let s=B(e,ge(n,"float32")),i=Bt(a.shape,r);i.length>0&&(s=q(Se(s,i),a.shape));let o=ot(a);return St(me(s,ge(o,"float32")))}}}},Fte={kernelName:Ds,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{let{varianceEpsilon:a}=n,[r,s,i,o]=t,u=o==null?ke(1):o,l=Bt(s.shape,r.shape),d=[];if(s.rank===1){for(let f=0;fs.rank===1?q(B(B(e,Gr(q(h,[1,1,1,s.shape[0]]),d)),u),r.shape):q(B(B(e,h),u),r.shape),mean:()=>{let f=B(B(h,ke(-1)),c);return s.rank===1&&(f=Se(f,l)),q(f,s.shape)},variance:()=>{let f=B(B(m,p),c);return s.rank===1&&(f=Se(f,l)),q(f,s.shape)},scale:()=>{let f=B(p,h),g=B(e,f);return s.rank===1&&(g=Se(g,l)),q(g,s.shape)},offset:()=>{let f=e;return s.rank===1&&(f=Se(f,l)),q(f,s.shape)}}}},$te={kernelName:Do,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{let[a,r]=t,{axis:s}=n,i=ya(s,a.shape)[0];return{x:()=>{let o=a.shape,u=r.size,l=o.slice(0,i),d=l.length,p=o.slice(s,o.length).slice(1),c=p.length,h=d4(0,d),m=d4(d+1,d+1+c),f=p4([l,[u],p]),g=q(e,f),y=q(r,[u]),A=p4([[d],h,m]),x=Qe(g,A),v=ug(x,y,a.shape[i]),b=K1(A);return v=Qe(v,b),v},indices:()=>r}}};function d4(e,t){let n=[];for(let a=e;a{let[n,a]=t;return{a:()=>Ge(n),b:()=>Ge(a)}}},Ote={kernelName:zs,gradFunc:e=>({x:()=>ge(e,"float32")})},zte={kernelName:_o,gradFunc:e=>({x:()=>Ge(e)})},_te={kernelName:Po,gradFunc:e=>({x:()=>Ge(e)})},Pte={kernelName:Lo,gradFunc:e=>({x:()=>Ge(e)})},Lte={kernelName:_s,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{alpha:r}=n,s=Wn(a,0);return{x:()=>un(s,e,B(e,r))}}},Wte={kernelName:Vo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ie(n,1))}}},Bte={kernelName:Ps,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ge(n,"float32"))}}},Vte={kernelName:gb,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n;return{logits:()=>{let s=!0,i=la(a);return ye(e,B(Se(e,r,s),i))}}}};function jte(e,t,n,a=5,r=1,s=1,i=.5){let o={x:e,y:t,dy:n},u={depthRadius:a,bias:r,alpha:s,beta:i};return P.runKernel(hc,o,u)}var Ute=L({localResponseNormalizationBackprop_:jte}),Hte={kernelName:Bu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{depthRadius:s,bias:i,alpha:o,beta:u}=n;return{x:()=>Ute(a,r,e,s,i,o,u)}}};function c4(e,t,n,a){return t.rankB(e,ge(Hr(n,t),e.dtype))}}var h4={kernelName:Ls,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{reductionIndices:r}=a,s=t[0],i=t[1],o=ya(r,s.shape),u=c4(e,i,s,o);return{x:()=>u.x()}}},Gte={kernelName:Ws,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,ge(qr(n,a),"float32")),b:()=>B(e,ge(Yc(n,a),"float32"))}}};function qte(e,t,n,a,r,s,i){let o=M(e,"dy","maxPool3dGrad"),u=M(t,"input","maxPool3dGrad"),l=M(n,"output","maxPool3dGrad"),d=o,p=u,c=l,h=!1;u.rank===4&&(h=!0,d=q(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),p=q(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]),c=q(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]])),D(d.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${d.rank}.`),D(p.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${p.rank}.`),D(c.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${c.rank}.`),i!=null&&D(qt(s),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let m={dy:d,input:p,output:c},f={filterSize:a,strides:r,pad:s,dimRoundingMode:i},g=P.runKernel(mc,m,f);return h?q(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}var Xte=L({maxPool3dGrad_:qte}),Kte={kernelName:Vu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:u}=n;return{x:()=>Xte(e,a,r,s,i,o,u)}}};function Zte(e,t,n,a,r,s,i){let o=M(e,"dy","maxPoolGrad"),u=M(t,"input","maxPoolGrad"),l=M(n,"output","maxPoolGrad");D(u.rank===o.rank,()=>`Rank of input (${u.rank}) does not match rank of dy (${o.rank})`),D(o.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`),D(u.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${u.rank}.`),i!=null&&D(qt(s),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let d={dy:o,input:u,output:l},p={filterSize:a,strides:r,pad:s,dimRoundingMode:i};return P.runKernel(fc,d,p)}var Yte=L({maxPoolGrad_:Zte}),Jte={kernelName:Bs,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o}=n;return{x:()=>Yte(e,a,r,s,i,o)}}},Qte={kernelName:Vs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n,s=ya(r,a.shape),i=$3(a.shape,s)[1],o=Mt(i);return{x:()=>{let u=a.shape.slice();s.forEach(d=>{u[d]=1});let l=q(e,u);return me(B(l,jn(a.shape,"float32")),o)}}}},ene={kernelName:js,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{axis:r}=a,[s,i]=t,o=ya(r,s.shape),u=c4(e,i,s,o);return{x:()=>u.x()}}},tne={kernelName:Us,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,ge(Xr(n,a),"float32")),b:()=>B(e,ge(Wn(n,a),"float32"))}}},nne={kernelName:Hs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Re(e,s,a.shape)}}},ane={kernelName:Uo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=Bt(n.shape,r);return s.length>0?q(Se(e,s),n.shape):e},b:()=>{let s=B(e,St(Rl(me(n,a)))),i=Bt(a.shape,r);return i.length>0?q(Se(s,i),a.shape):s}}}},rne={kernelName:Gs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=B(e,ge(a,"float32")),i=Bt(n.shape,r);return i.length>0?q(Se(s,i),n.shape):s},b:()=>{let s=B(e,ge(n,"float32")),i=Bt(a.shape,r);return i.length>0?q(Se(s,i),a.shape):s}}}},sne={kernelName:Ho,gradFunc:e=>({x:()=>St(e)})},ine={kernelName:qs,inputsToSave:["indices"],gradFunc:(e,t)=>{let n=t[0];return{indices:()=>$t(n.shape,"float32")}}},one={kernelName:Zo,gradFunc:e=>({x:()=>Ge(e)})},lne={kernelName:Yo,saveAllInputs:!0,gradFunc:(e,t,n)=>{let{axis:a}=n;return Gn(e,a).map(r=>()=>r)}},f4={kernelName:Xs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Re(e,s,a.shape)}}},une={kernelName:Ks,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{let[n,a,r]=t,s=n,i=a,o=mt(s.shape,i.shape);return{a:()=>{let u=ge(i,"float32"),l=B(e,B(u,yr(s,ye(u,ke(1))))),d=Bt(s.shape,o);return d.length>0&&(l=Se(l,d)),q(l,s.shape)},b:()=>{let u=Wn(s,0),l=un(u,Bn(s),Ge(s)),d=B(e,B(r,l)),p=Bt(i.shape,o);return p.length>0&&(d=Se(d,p)),q(d,i.shape)}}}},dne={kernelName:Zs,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{let[n,a]=t,r=Wn(n,0);return{x:()=>un(r,e,B(e,a)),alpha:()=>{let s=un(r,Ge(e),B(e,n)),i=Bt(a.shape,e.shape);return i.length>0&&(s=Se(s,i)),q(s,a.shape)}}}},pne={kernelName:Rs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=me(e,ge(a,"float32")),i=Bt(n.shape,r);return i.length>0?q(Se(s,i),n.shape):s},b:()=>{let s=B(e,ge(n,"float32")),i=Bt(a.shape,r);i.length>0&&(s=q(Se(s,i),a.shape));let o=ot(a);return St(me(s,ge(o,"float32")))}}}},cne={kernelName:Qo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,St(ot(n)))}}},hne={kernelName:Qs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(Xr(n,6),Ol(n));return{x:()=>B(e,ge(a,"float32"))}}},fne={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,ge(Ol(n),"float32"))}}},mne={kernelName:el,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>q(e,n.shape)}}},gne={kernelName:Js,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>P.runKernel(bc,r,n)}}},yne={kernelName:Uu,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>P.runKernel(xc,r,n)}}},Ane={kernelName:ei,gradFunc:(e,t,n)=>{let{dims:a}=n,r=ya(a,e.shape);return{x:()=>Hn(e,r)}}},xne={kernelName:ti,gradFunc:e=>({x:()=>Ge(e)})},bne={kernelName:ni,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>St(me(e,B(yr(n,1.5),2)))}}},vne={kernelName:nl,inputsToSave:["condition"],gradFunc:(e,t)=>{let[n]=t;return{condition:()=>ge(Ge(n),"float32"),t:()=>B(e,ge(n,e.dtype)),e:()=>B(e,ge(cd(n),e.dtype))}}},wne={kernelName:al,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=Wn(n,ke(0)),r=ke(i7),s=ke(o7),i=B(e,s),o=B(B(e,r),la(ge(n,"float32")));return un(a,i,o)}}}},kne={kernelName:ri,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(n,ye(ke(1),n)))}}},Ine={kernelName:il,gradFunc:e=>({x:()=>Ge(e)})},Sne={kernelName:ai,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(dd(ge(n,"float32")),e)}}},Nne={kernelName:sl,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Xc(ge(n,"float32")),e)}}},Tne={kernelName:rl,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{begin:r,size:s}=n,i=a.shape,[o,u]=o3(a,r,s),l=[];for(let d=0;dgr(e,l)}}},Cne={kernelName:oi,outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{dim:r}=n,s=!0,i=B(e,a);return{logits:()=>ye(i,B(Se(i,[r],s),a))}}},Ene={kernelName:ol,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Rn(n))}}},m4={kernelName:Hu,gradFunc:(e,t,n)=>{let{blockShape:a,paddings:r}=n;return{x:()=>ud(e,a,r)}}},g4={kernelName:ll,gradFunc:(e,t,n)=>{let{axis:a}=n;return{x:()=>lt(e,a)}}},Rne={kernelName:si,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,B(an(ge(n,"float32")),2))}}},Mne={kernelName:Gu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(ge(n,"float32"),2))}}},Fne={kernelName:li,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ke(2);return{a:()=>B(e,B(r,ye(n,a))),b:()=>B(e,B(r,ye(a,n)))}}},$ne={kernelName:Pr,gradFunc:e=>({x:()=>Ge(e)})},Dne={kernelName:ui,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=e,i=Bt(n.shape,r);return i.length>0&&(s=Se(s,i)),q(s,n.shape)},b:()=>{let s=e,i=Bt(a.shape,r);return i.length>0&&(s=Se(s,i)),q(St(s),a.shape)}}}},One={kernelName:ii,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,r=a.shape.slice(),{axis:s}=n;ya(s,a.shape).forEach(u=>{r[u]=1});let i=q(e,r),o=B(i,jn(a.shape,"float32"));return{x:()=>o}}},zne={kernelName:di,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ot(dd(n)))}}},_ne={kernelName:pi,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(ye(ke(1),ot(n)),e)}}},Pne={kernelName:_r,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{reps:r}=n;return{x:()=>{let s=Ge(a);if(a.rank===1)for(let i=0;i{let a=n,{perm:r}=a,s=K1(r);return{x:()=>Qe(e,s)}}},Wne={kernelName:cl,gradFunc:(e,t,n)=>{let a=n,{axis:r}=a;return{value:()=>gn(e,r)}}},Bne={kernelName:qu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Vne(e,n)}}};function Vne(e,t){let n=Xa(t,Ge(t)),a=Ti(e,n),r=qr(t,ke(0,"int32")),s=a.rank-r.rank;for(let o=0;o({x:()=>Ge(e)})},Une=[u4,Uee,Hee,Gee,qee,Xee,Kee,Zee,Yee,Jee,Qee,ete,ate,ite,ote,lte,ute,dte,pte,cte,hte,fte,gte,mte,xte,bte,vte,wte,kte,Ite,pne,Ste,Nte,Tte,Cte,Ete,Mte,Rte,Fte,$te,Dte,Ote,zte,_te,Pte,Lte,Wte,Bte,Vte,Hte,h4,h4,Gte,Kte,Jte,Qte,ene,tne,nne,ane,rne,sne,ine,one,lne,f4,f4,une,dne,cne,hne,fne,mne,gne,yne,Ane,xne,bne,vne,wne,kne,Ine,Sne,Nne,Tne,Cne,Ene,m4,m4,g4,g4,Rne,Fne,Mne,$ne,Dne,One,zne,_ne,Pne,Lne,Wne,Bne,jne];for(let e of Une)yb(e);var y4={};Fe(y4,{maxNorm:()=>Xne,minMaxNorm:()=>Yne,nonNeg:()=>Zne,unitNorm:()=>Kne});var ry;function jt(){return ry==null&&(ry=c3().epsilon()),ry}function Ra(){return"channelsLast"}var vr=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,vr.prototype)}},Ma=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,Ma.prototype)}},U=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,U.prototype)}},_e=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,_e.prototype)}},A4=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,A4.prototype)}};function Bi(e,t){if(Array.isArray(e)){let n=[];for(let a=0;an.toUpperCase())}var ba={};function sy(e){if(e==null)return null;let t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function iy(e){if(!(e==null||typeof e!="object"))if(Array.isArray(e))e.forEach(t=>iy(t));else{let t=Object.keys(e);for(let n of t){let a=e[n];a!=null&&typeof a=="object"&&(!Array.isArray(a)&&a.type==="ndarray"&&typeof a.value=="number"?e[n]=a.value:iy(a))}}}function Vd(e,t={},n={},a="object",r=!1){if(typeof e=="string"){let s=e,i;if(s in n)i=n[s];else if(s in ba)i=ba[s];else if(i=t[s],i==null)throw new U(`Unknown ${a}: ${e}. This may be due to one of the following reasons: + `}};function OZ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,segmentIds:s}=t,{numSegments:i}=a,o=r.shape.length,l=[],u=0,d=F.getAxesPermutation([u],o),p=r;d!=null&&(p=bn({inputs:{x:r},backend:n,attrs:{perm:d}}),l.push(p),u=F.getInnerMostAxes(1,o)[0]);let c=F.segment_util.computeOutShape(p.shape,u,i),h=k.sizeFromShape([p.shape[u]]),m=Ae({inputs:{x:p},backend:n,attrs:{shape:[-1,h]}});l.push(m);let f=zc(r.dtype),g=(v,b,w,N,C)=>{let E=v.shape[0],_=v.shape[1],$=F.segment_util.segOpComputeOptimalWindowSize(_,C),S={windowSize:$,inSize:_,batchSize:E,numSegments:C},z=new DZ(S,b),O=n.compileAndRun(z,[v,w],N);if(l.push(O),O.shape[1]===C)return O;let W=l6({backend:n,attrs:{start:0,stop:C,step:1,dtype:"float32"}}),G=p6({inputs:{x:W},backend:n,attrs:{reps:[_/$]}});return l.push(W),l.push(G),g(O,b,G,N,C)},y=g(m,"unsortedSegmentSum",s,f,i),A=Ae({inputs:{x:y},backend:n,attrs:{shape:c}}),x=A;if(d!=null){l.push(A);let v=F.getUndoAxesPermutation(d);x=bn({inputs:{x},backend:n,attrs:{perm:v}})}return l.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var zZ={kernelName:qu,backendName:"webgl",kernelFunc:OZ},_Z=[pq,fq,ZV,JV,tj,rj,ij,uj,pj,hj,yj,xj,wj,Sj,Fj,Cj,Oj,Lj,_j,jj,Hj,qj,Yj,rU,iU,cU,fU,AU,vU,MV,NU,zU,PU,RU,VU,UU,WU,qU,ZU,QU,tH,aH,iH,cH,fH,lH,yH,bH,wH,NH,RH,DH,_H,PH,LH,BH,jH,HH,qH,KH,QH,nG,sG,oG,dG,fG,AG,wG,RV,IG,IU,TG,RG,$G,$V,_G,BG,jG,ZG,qG,eq,aq,oq,gq,Iq,wq,Cq,Rq,Fq,bq,Dq,zq,Wq,Uq,Xq,nX,PV,rX,oX,dX,hX,lU,gX,AX,bX,kX,TX,OV,EX,RX,uU,Jq,$X,BX,_X,WV,HX,XX,JX,tK,sK,oK,dK,hK,mK,AK,vK,IK,TK,RK,$K,nU,eX,zK,PK,WK,VK,UK,GK,XK,ZK,QK,nZ,rZ,iZ,uZ,pZ,hZ,mZ,Qq,qV,AZ,vZ,IZ,NZ,EZ,XV,MZ,$Z,zZ,yX];for(let e of _Z)gi(e);var Fn;(function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"})(Fn||(Fn={}));var Pd;(function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid"})(Pd||(Pd={}));var c6;function PZ(e){c6=e.wasm.cwrap(hi,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function LZ(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:l,transposeB:u,activation:d,leakyreluAlpha:p}=a,c=n.dataIdMap.get(r.dataId).id,h=n.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let C=n.dataIdMap.get(i.dataId);if(C.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${C.shape.length}.`);m=C.id}let f=o==null?0:n.dataIdMap.get(o.dataId).id,g=Pd[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?r.shape[2]:r.shape[1],A=u?s.shape[1]:s.shape[2],x=r.shape[0],v=n.makeOutput([x,y,A],r.dtype),b=n.dataIdMap.get(v.dataId).id,w=new Uint8Array(new Int32Array(r.shape).buffer),N=new Uint8Array(new Int32Array(s.shape).buffer);return c6(c,w,r.shape.length,h,N,s.shape.length,l,u,g,m,f,p||0,b),v}var WZ={kernelName:hi,backendName:"wasm",setupFunc:PZ,kernelFunc:LZ};function vn(e){let t;function n(r){t=r.wasm.cwrap(e,null,["number","number"])}function a(r){let{backend:s,inputs:{x:i}}=r,o=s.dataIdMap.get(i.dataId).id,l=s.makeOutput(i.shape,i.dtype),u=s.dataIdMap.get(l.dataId).id;return k.sizeFromShape(l.shape)===0||t(o,u),l}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:a}}var BZ=vn(mo);function wn(e,t,n){let a;function r(i){a=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:u,b:d}=l,p=o.dataIdMap.get(u.dataId).id,c=o.dataIdMap.get(d.dataId).id,h=n!=null?n:u.dtype,m=F.assertAndGetBroadcastShape(u.shape,d.shape),f=o.makeOutput(m,h);if(k.sizeFromShape(m)===0)return f;let g=new Uint8Array(new Int32Array(u.shape).buffer),y=new Uint8Array(new Int32Array(d.shape).buffer),A=o.dataIdMap.get(f.dataId).id,x=()=>a(p,g,u.shape.length,c,y,d.shape.length,Fn[u.dtype],A);if(t&&u.dtype==="float32")return x(),f;let v=F.getBroadcastDims(u.shape,m),b=F.getBroadcastDims(d.shape,m),w=v.every((C,E)=>C===E),N=b.every((C,E)=>C===E);if(w&&N)return x(),f;throw new Error(`Broadcasting along outer dims is not yet supported for ${u.dtype} ${e}.`)}return{kernelName:e,backendName:"wasm",setupFunc:r,kernelFunc:s}}var VZ=!0,jZ=wn(Or,VZ),h6;function UZ(e){h6=e.wasm.cwrap(xs,null,["array","number","number","number"])}function HZ(e){let{inputs:t,backend:n}=e,a=n.makeOutput(t[0].shape,t[0].dtype);if(k.sizeFromShape(a.shape)===0)return a;let r=t.map(o=>n.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(r).buffer),i=n.dataIdMap.get(a.dataId).id;return h6(s,r.length,Fn[a.dtype],i),a}var GZ={kernelName:xs,backendName:"wasm",setupFunc:UZ,kernelFunc:HZ};function Qh(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype),r=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(a).set(r),a}var qZ={kernelName:zs,backendName:"wasm",kernelFunc:Qh},f6;function XZ(e){f6=e.wasm.cwrap(ci,null,["number","array","number","number","number","array","number"])}function e0(e){let{inputs:t,backend:n,attrs:a}=e,[r,s]=ZZ(t.x.shape,a.perm),i=!0;for(let m=0;m=r&&(s===-1||a[s]>a[i])&&(s=i);a[s]=r}return[n,a]}var YZ={kernelName:ci,backendName:"wasm",kernelFunc:e0,setupFunc:XZ};function Qr(e,t,n){let a=e.shape,r=e.shape.length,s=k.parseAxisParam(t,a),i=s,o=F.getAxesPermutation(i,r),l=null,u=!1;if(o!=null){let d=new Array(r);for(let c=0;c`new shape: ${i}, old shape: ${a.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}var dY={kernelName:tl,backendName:"wasm",kernelFunc:Ea},x6;function pY(e){x6=e.wasm.cwrap(ws,null,["number","array","number","number","array","number","number","number","number"])}function cY(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=r.shape.length,u=s.shape.length,d=i?r.shape[l-2]:r.shape[l-1],p=o?s.shape[u-1]:s.shape[u-2],c=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[u-2]:s.shape[u-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=k.sizeFromShape(m),y=k.sizeFromShape(f),A=g===y||g===1||y===1;k.assert(l>=2&&u>=2&&A,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(g>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);k.assert(d===p,()=>`Error in matMul: inner shapes (${d}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[g,d,c]:[g,c,d],b=o?[y,h,p]:[y,p,h],w=Ea({inputs:{x:r},backend:n,attrs:{shape:v}}),N=Ea({inputs:{x:s},backend:n,attrs:{shape:b}}),C=n.dataIdMap.get(w.dataId).id,E=n.dataIdMap.get(N.dataId).id,_=i?w.shape[2]:w.shape[1],$=o?N.shape[1]:N.shape[2],S=Math.max(g,y),z=n.makeOutput([S,_,$],w.dtype),O=n.dataIdMap.get(z.dataId).id,W=new Uint8Array(new Int32Array(w.shape).buffer),G=new Uint8Array(new Int32Array(N.shape).buffer);return x6(C,W,w.shape.length,E,G,N.shape.length,i,o,O),n.disposeData(w.dataId),n.disposeData(N.dataId),z.shape=x,z}var hY={kernelName:ws,backendName:"wasm",setupFunc:pY,kernelFunc:cY};function t0(e){let{inputs:{x:t},attrs:{dtype:n},backend:a}=e,r=a.makeOutput(t.shape,n),s=a.typedArrayFromHeap(t);return a.typedArrayFromHeap(r).set(s),r}var fY={kernelName:ks,backendName:"wasm",kernelFunc:t0},mY=vn(Is),b6;function gY(e){b6=e.wasm.cwrap(zr,null,["number","number","number","number"])}function yY(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o=n.dataIdMap.get(r.dataId).id,l=n.makeOutput(r.shape,r.dtype),u=n.dataIdMap.get(l.dataId).id;return b6(o,s,i,u),l}var AY={kernelName:zr,backendName:"wasm",setupFunc:gY,kernelFunc:yY};function v6(e){let{inputs:t,backend:n}=e,a=k.parseAxisParam(e.attrs.axis,t[0].shape)[0],r=F.computeOutShape(t.map(h=>h.shape),a),s=t.filter(h=>k.sizeFromShape(h.shape)>0);if(s.length===1)return Qh({inputs:{x:s[0]},backend:n});let i=n.makeOutput(r,t[0].dtype);if(k.sizeFromShape(r)===0)return i;let o=s.map(h=>h.shape);if(F.assertParamsConsistent(o,a),s[0].dtype==="string"){let h=s.map(x=>{let v=k.sizeFromShape(x.shape.slice(a));return Ea({inputs:{x},backend:n,attrs:{shape:[-1,v]}})}),m=h.map(x=>({vals:n.readSync(x.dataId),shape:x.shape}));r=F.computeOutShape(h.map(x=>x.shape),1);let f=h[0].shape[0]===1,g=bg(m,r,t[0].dtype,f),y=F.computeOutShape(s.map(x=>x.shape),a);i.shape=y;let A=n.dataIdMap.get(i.dataId);return A.stringBytes=F.fromStringArrayToUint8(g),h.forEach(x=>n.disposeData(x.dataId)),i}let l=k.sizeFromShape(s[0].shape.slice(0,a)),u=0,d=s.map(h=>{let m=k.sizeFromShape(h.shape.slice(a));return u+=m,m}),p=s.map(h=>n.typedArrayFromHeap(h)),c=n.typedArrayFromHeap(i);for(let h=0;h`cumsum does not support ${r.dtype} tensors in the WASM backend`);let u=F.getAxesPermutation([s],l),d=r;u!==null&&(d=e0({inputs:{x:r},attrs:{perm:u},backend:n}));let p=F.getInnerMostAxes(1,l)[0];F.assertAxesAreInnerMostDims("cumsum",[p],l);let c=n.makeOutput(d.shape,d.dtype),h=d.shape[p],m=n.dataIdMap.get(d.dataId).id,f=n.dataIdMap.get(c.dataId).id;S6(m,i?1:0,o?1:0,h,f,Fn[r.dtype]);let g=c;if(u!==null){let y=F.getUndoAxesPermutation(u);g=e0({inputs:{x:c},attrs:{perm:y},backend:n}),n.disposeData(d.dataId),n.disposeData(c.dataId)}return g}var FY={kernelName:Cs,backendName:"wasm",setupFunc:RY,kernelFunc:MY},N6;function $Y(e){N6=e.wasm.cwrap(Co,null,["number","number","number","array","number","array","array","number","number"])}function DY(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{blockSize:s,dataFormat:i}=a;k.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],p=l*s,c=u*s,h=d/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=t.makeOutput(m,"float32"),g=t.dataIdMap.get(r.dataId).id,y=new Uint8Array(new Int32Array(k.computeStrides(r.shape)).buffer),A=new Uint8Array(new Int32Array(m).buffer),x=new Uint8Array(new Int32Array(k.computeStrides(m)).buffer),v=t.dataIdMap.get(f.dataId).id;return N6(g,s,i==="NHWC"?1:0,y,r.shape.length-1,A,x,m.length,v),f}var OY={kernelName:Co,backendName:"wasm",setupFunc:$Y,kernelFunc:DY},T6;function zY(e){T6=e.wasm.cwrap(Es,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function _Y(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s}=t,i=a.dataIdMap.get(r.dataId).id,o=a.dataIdMap.get(s.dataId).id,{strides:l,dilations:u,pad:d,dimRoundingMode:p}=n,c=u==null?[1,1]:u,h=F.computeConv2DInfo(r.shape,s.shape,l,c,d,p,!0),m=h.filterHeight,f=h.filterWidth,g=h.padInfo.top,y=h.padInfo.right,A=h.padInfo.bottom,x=h.padInfo.left,v=h.dilationHeight,b=h.dilationWidth,w=h.strideHeight,N=h.strideWidth,C=h.inChannels,E=h.outChannels,_=h.padInfo.type==="SAME"?1:0;if(h.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${h.dataFormat}'. Please use 'channelsLast'.`);let $=a.makeOutput(h.outShape,"float32"),S=a.dataIdMap.get($.dataId).id;return T6(i,r.shape[0],r.shape[1],r.shape[2],o,m,f,g,y,A,x,_,v,b,w,N,C,E,S),$}var PY={kernelName:Es,backendName:"wasm",setupFunc:zY,kernelFunc:_Y},LY=!1,WY=wn(Mo,LY,"bool"),BY=vn(Ms);function Qg(e){let{inputs:t,attrs:n,backend:a}=e,{input:r}=t,{dim:s}=n,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(k.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),Ea({inputs:{x:r},backend:a,attrs:{shape:o}})}var VY={kernelName:Fo,backendName:"wasm",kernelFunc:Qg};function jY(e){let{attrs:{shape:t,value:n,dtype:a},backend:r}=e,s=r.makeOutput(t,a);return r.typedArrayFromHeap(s).fill(n),s}var UY={kernelName:Pu,backendName:"wasm",kernelFunc:jY},C6;function HY(e){C6=e.wasm.cwrap(Do,null,["number","number","number","number","number","number"])}function GY(e){let{inputs:t,backend:n}=e,{image:a}=t,r=n.makeOutput(a.shape,a.dtype),s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,[o,l,u,d]=a.shape;return C6(s,o,l,u,d,i),r}var qY={kernelName:Do,backendName:"wasm",kernelFunc:GY,setupFunc:HY},XY=vn(Fs),KY=!1,ZY=wn($s,KY),E6;function YY(e){E6=e.wasm.cwrap(Ds,null,["number","number","number","number","number","number","number"])}function JY(e){let{backend:t,inputs:n,attrs:a}=e,{varianceEpsilon:r}=a,{x:s,mean:i,variance:o,offset:l,scale:u}=n,d=t.dataIdMap.get(s.dataId).id,p=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(o.dataId).id,h=l!=null?t.dataIdMap.get(l.dataId).id:0,m=u!=null?t.dataIdMap.get(u.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(k.sizeFromShape(s.shape)===0)return f;let g=t.dataIdMap.get(f.dataId).id;return E6(d,p,c,h,m,r,g),f}var QY={kernelName:Ds,backendName:"wasm",setupFunc:YY,kernelFunc:JY},R6;function eJ(e){R6=e.wasm.cwrap(fi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function tJ(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=F.computeConv2DInfo(r.shape,s.shape,l,d,u,c),g=Pd[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,A=a.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Z=a.dataIdMap.get(i.dataId);if(Z.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${Z.shape.length}.`);if(Z.shape[0]!==x)throw new Error(`FusedConv2D bias shape (${Z.shape}) does not match the number of output channels (${x})`);v=Z.id}let b=f.filterHeight,w=f.filterWidth,N=f.padInfo.top,C=f.padInfo.right,E=f.padInfo.bottom,_=f.padInfo.left,$=f.dilationHeight,S=f.dilationWidth,z=f.strideHeight,O=f.strideWidth,W=f.inChannels,G=f.padInfo.type==="SAME"?1:0,H=f.batchSize,J=f.inHeight,K=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let ne=a.makeOutput(f.outShape,"float32"),Q=a.dataIdMap.get(ne.dataId).id,se=o==null?0:a.dataIdMap.get(o.dataId).id;return R6(y,H,J,K,A,b,w,v,N,C,E,_,G,$,S,z,O,W,x,g,se,m||0,Q),ne}var nJ={kernelName:fi,backendName:"wasm",setupFunc:eJ,kernelFunc:tJ},M6;function aJ(e){M6=e.wasm.cwrap(mi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function rJ(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=F.computeConv2DInfo(r.shape,s.shape,l,d,u,c,!0),g=Pd[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,A=a.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Z=a.dataIdMap.get(i.dataId);if(Z.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${Z.shape.length}.`);if(Z.shape[0]!==x)throw new Error(`FusedDepthwiseConv2D bias shape (${Z.shape}) does not match the number of output channels (${x})`);v=Z.id}let b=f.filterHeight,w=f.filterWidth,N=f.padInfo.top,C=f.padInfo.right,E=f.padInfo.bottom,_=f.padInfo.left,$=f.dilationHeight,S=f.dilationWidth,z=f.strideHeight,O=f.strideWidth,W=f.inChannels,G=f.padInfo.type==="SAME"?1:0,H=f.batchSize,J=f.inHeight,K=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let ne=a.makeOutput(f.outShape,"float32"),Q=a.dataIdMap.get(ne.dataId).id,se=o==null?0:a.dataIdMap.get(o.dataId).id;return M6(y,H,J,K,A,b,w,v,N,C,E,_,G,$,S,z,O,W,x,g,se,m||0,Q),ne}var sJ={kernelName:mi,backendName:"wasm",setupFunc:aJ,kernelFunc:rJ},F6;function iJ(e){F6=e.wasm.cwrap(zo,null,["number","number","number","number","number","number","array","number"])}function oJ(e){let{backend:t,inputs:n}=e,{params:a,indices:r}=n,[s,i,o,l]=g1.prepareAndValidate(a,r),u=t.makeOutput(s,a.dtype);if(i===0)return u;let d=r.shape,p=d[d.length-1],c=t.dataIdMap.get(a.dataId).id,h=t.dataIdMap.get(r.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(u.dataId).id;return F6(c,Fn[a.dtype],h,i,p,o,m,f),u}var lJ={kernelName:zo,backendName:"wasm",setupFunc:iJ,kernelFunc:oJ},$6;function uJ(e){$6=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function dJ(e){let{backend:t,inputs:n,attrs:a}=e,{x:r,indices:s}=n,{axis:i,batchDims:o}=a,l=k.parseAxisParam(i,r.shape)[0],u=F.segment_util.collectGatherOpShapeInfo(r,s,l,o),d=Ea({inputs:{x:r},attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]},backend:t}),p=k.sizeFromShape(s.shape),c=Ea({inputs:{x:s},attrs:{shape:[u.batchSize,p/u.batchSize]},backend:t}),h=[u.batchSize,u.outerSize,p/u.batchSize,u.sliceSize],m=t.makeOutput(h,r.dtype);if(k.sizeFromShape(r.shape)===0)return m;let f=d.shape.length-1,g=t.dataIdMap.get(d.dataId).id,y=t.dataIdMap.get(c.dataId).id,A=t.dataIdMap.get(m.dataId).id,x=new Uint8Array(new Int32Array(k.computeStrides(d.shape)).buffer),v=new Uint8Array(new Int32Array(k.computeStrides(h)).buffer);return $6(g,Fn[r.dtype],x,f,y,u.batchSize,v,A),t.disposeData(d.dataId),t.disposeData(c.dataId),m.shape=u.outputShape,m}var pJ={kernelName:Oo,backendName:"wasm",setupFunc:uJ,kernelFunc:dJ},cJ=!1,hJ=wn(_o,cJ,"bool"),fJ=!1,mJ=wn(Os,fJ,"bool"),D6;function gJ(e){D6=e.wasm.cwrap(_s,null,["number","number","number"])}function yJ(e){let{inputs:{x:t},attrs:{alpha:n},backend:a}=e,r=a.dataIdMap.get(t.dataId).id,s=a.makeOutput(t.shape,t.dtype);if(k.sizeFromShape(t.shape)!==0){let i=a.dataIdMap.get(s.dataId).id;D6(r,n,i)}return s}var AJ={kernelName:_s,backendName:"wasm",setupFunc:gJ,kernelFunc:yJ},xJ=!1,bJ=wn(Bo,xJ,"bool"),vJ=!1,wJ=wn(Vo,vJ,"bool"),kJ=vn(Ps),IJ=!1,SJ=wn(Uo,IJ,"bool"),O6;function NJ(e){O6=e.wasm.cwrap(Ls,null,["number, number, number"])}function TJ(e){let{backend:t,inputs:n,attrs:a}=e,{reductionIndices:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:u,axes:d,originalAxes:p,inputWasTransposed:c}=Qr(i,r,t);if(c){let A=t.dataIdMap.get(u.dataId).id;l=u,o=A}let h=l.shape.length;F.assertAxesAreInnerMostDims("max",d,h);let[m,f]=F.computeOutAndReduceShapes(l.shape,d),g=k.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(k.sizeFromShape(l.shape)!==0){let A=t.dataIdMap.get(y.dataId).id;O6(o,g,A)}if(c&&t.disposeData(u.dataId),s){let A=F.expandShapeToKeepDim(y.shape,p);y.shape=A}return y}var CJ={kernelName:Ls,backendName:"wasm",setupFunc:NJ,kernelFunc:TJ},EJ=!1,RJ=wn(Ws,EJ),z6;function MJ(e){z6=e.wasm.cwrap(Bs,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function FJ(e){let{inputs:t,attrs:n,backend:a}=e,r=t.x,s=a.dataIdMap.get(r.dataId).id,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n,d=F.computePool2DInfo(r.shape,i,o,1,l,u),p=d.filterHeight,c=d.filterWidth,h=d.padInfo.top,m=d.padInfo.right,f=d.padInfo.bottom,g=d.padInfo.left,y=d.dilationHeight,A=d.dilationWidth,x=d.strideHeight,v=d.strideWidth,b=d.inChannels,w=d.outChannels;if(d.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let N=a.makeOutput(d.outShape,"float32"),C=a.dataIdMap.get(N.dataId).id;return z6(s,r.shape[0],r.shape[1],r.shape[2],p,c,h,m,f,g,y,A,x,v,b,w,C),N}var $J={kernelName:Bs,backendName:"wasm",setupFunc:MJ,kernelFunc:FJ},_6;function DJ(e){_6=e.wasm.cwrap(Vs,null,["number, number, number"])}function OJ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t),m=p;if(h){let v=t.dataIdMap.get(d.dataId).id;v!==o&&(u=d,l=v,m=F.getInnerMostAxes(m.length,u.shape.length))}F.assertAxesAreInnerMostDims("mean",m,u.shape.length);let[f,g]=F.computeOutAndReduceShapes(u.shape,m),y=k.sizeFromShape(g),A=u;u.dtype!=="float32"&&(A=t0({backend:t,inputs:{x:u},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(A.dataId).id);let x=t.makeOutput(f,"float32");if(k.sizeFromShape(u.shape)!==0){let v=t.dataIdMap.get(x.dataId).id;_6(l,y,v)}if(h&&t.disposeData(d.dataId),s){let v=F.expandShapeToKeepDim(x.shape,c);x.shape=v}return u.dtype!=="float32"&&t.disposeData(A.dataId),x}var zJ={kernelName:Vs,backendName:"wasm",setupFunc:DJ,kernelFunc:OJ},P6;function _J(e){P6=e.wasm.cwrap(js,null,["number, number, number"])}function PJ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t);if(h){let x=t.dataIdMap.get(d.dataId).id;x!==o&&(u=d,l=x)}let m=u.shape.length;F.assertAxesAreInnerMostDims("min",p,m);let[f,g]=F.computeOutAndReduceShapes(u.shape,p),y=k.sizeFromShape(g),A=t.makeOutput(f,u.dtype);if(k.sizeFromShape(u.shape)!==0){let x=t.dataIdMap.get(A.dataId).id;P6(l,y,x)}if(h&&t.disposeData(d.dataId),s){let x=F.expandShapeToKeepDim(A.shape,c);A.shape=x}return A}var LJ={kernelName:js,backendName:"wasm",setupFunc:_J,kernelFunc:PJ},WJ=!1,BJ=wn(Us,WJ),ey;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(ey||(ey={}));var L6;function VJ(e){L6=e.wasm.cwrap(Hs,null,["number","array","number","number","array","array","number","number"])}function jJ(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,mode:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),d=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(d).buffer),h=new Uint8Array(new Int32Array(p).buffer);return L6(i,u,t.shape.length,Fn[t.dtype],c,h,ey[r],l),o}var UJ={kernelName:Hs,backendName:"wasm",kernelFunc:jJ,setupFunc:VJ},HJ=!0,GJ=wn(Gs,HJ),qJ=vn(Go);function ty(e,t){let n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),a=n[0],r=n[1],s=n[2],i=n[3];return e.wasm._free(t),{pSelectedIndices:a,selectedSize:r,pSelectedScores:s,pValidOutputs:i}}var W6;function XJ(e){W6=e.wasm.cwrap(Xo,"number",["number","number","number","number","number"])}function KJ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i}=a,{boxes:o,scores:l}=n,u=t.dataIdMap.get(o.dataId).id,d=t.dataIdMap.get(l.dataId).id,p=W6(u,d,s,r,i),{pSelectedIndices:c,selectedSize:h,pSelectedScores:m,pValidOutputs:f}=ty(t,p);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([h],"int32",c)}var ZJ={kernelName:Xo,backendName:"wasm",setupFunc:XJ,kernelFunc:KJ},B6;function YJ(e){B6=e.wasm.cwrap(Ko,"number",["number","number","number","number","number","bool"])}function JJ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=a,{boxes:l,scores:u}=n,d=t.dataIdMap.get(l.dataId).id,p=t.dataIdMap.get(u.dataId).id,c=B6(d,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=ty(t,c);t.wasm._free(f);let y=t.makeOutput([m],"int32",h),A=t.makeOutput([],"int32",g);return[y,A]}var QJ={kernelName:Ko,backendName:"wasm",setupFunc:YJ,kernelFunc:JJ},V6;function eQ(e){V6=e.wasm.cwrap(Zo,"number",["number","number","number","number","number","number"])}function tQ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=a,{boxes:l,scores:u}=n,d=t.dataIdMap.get(l.dataId).id,p=t.dataIdMap.get(u.dataId).id,c=V6(d,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=ty(t,c);t.wasm._free(g);let y=t.makeOutput([m],"int32",h),A=t.makeOutput([m],"float32",f);return[y,A]}var nQ={kernelName:Zo,backendName:"wasm",setupFunc:eQ,kernelFunc:tQ},aQ=!1,rQ=wn(qo,aQ,"bool"),j6;function sQ(e){j6=e.wasm.cwrap(qs,null,["number","number","number","number","number"])}function iQ(e){let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,l=n.makeOutput([...r.shape,s],"int32"),u=n.dataIdMap.get(l.dataId).id,d=n.dataIdMap.get(r.dataId).id;return j6(d,s,i,o,u),l}var oQ={kernelName:qs,backendName:"wasm",setupFunc:sQ,kernelFunc:iQ};function lQ(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(1),a}var uQ={kernelName:Yo,backendName:"wasm",kernelFunc:lQ};function dQ(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return Qg({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{k.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),k.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let p=Qg({inputs:{input:d},backend:n,attrs:{dim:r}});return o.push(p),p}),u=v6({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(d=>n.disposeData(d.dataId)),u}var pQ={kernelName:Jo,backendName:"wasm",kernelFunc:dQ},U6;function cQ(e){U6=e.wasm.cwrap(Xs,null,["number","array","number","number","array","array","number","number"])}function hQ(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,constantValue:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),d=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(d).buffer),h=new Uint8Array(new Int32Array(p).buffer);return U6(i,u,t.shape.length,Fn[t.dtype],c,h,r,l),o}var fQ={kernelName:Xs,backendName:"wasm",kernelFunc:hQ,setupFunc:cQ},mQ=!1,gQ=wn(Ks,mQ),H6;function yQ(e){H6=e.wasm.cwrap(Zs,null,["number","number","number"])}function AQ(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,o=n.makeOutput(a.shape,"float32"),l=n.dataIdMap.get(o.dataId).id;return H6(s,i,l),o}var xQ={kernelName:Zs,backendName:"wasm",setupFunc:yQ,kernelFunc:AQ},G6;function bQ(e){G6=e.wasm.cwrap(Qo,null,["number","number","number","number"])}function vQ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(d.dataId).id;x!==o&&(u=d,l=x,m=F.getInnerMostAxes(m.length,u.shape.length))}F.assertAxesAreInnerMostDims("prod",m,u.shape.length);let[f,g]=F.computeOutAndReduceShapes(u.shape,m),y=k.sizeFromShape(g),A=t.makeOutput(f,u.dtype);if(k.sizeFromShape(u.shape)!==0){let x=t.dataIdMap.get(A.dataId).id;G6(l,y,Fn[A.dtype],x)}if(h&&t.disposeData(d.dataId),s){let x=F.expandShapeToKeepDim(A.shape,c);A.shape=x}return A}var wQ={kernelName:Qo,backendName:"wasm",setupFunc:bQ,kernelFunc:vQ},kQ=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=kg(a,r,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},IQ={kernelName:ju,backendName:"wasm",kernelFunc:kQ},SQ=!0,NQ=wn(Rs,SQ),TQ=vn(Ys),CQ=vn(Qs),q6;function EQ(e){q6=e.wasm.cwrap(Js,null,["number","number","number","number","number","number","number","number","number","number"])}function RQ(e){let{backend:t,inputs:n,attrs:a}=e,{images:r}=n,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,u]=o,[d,p,c,h]=r.shape,m=[d,l,u,h],f=t.dataIdMap.get(r.dataId),g;f.dtype!=="float32"&&(g=t0({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(g.dataId));let y=f.id,A=t.makeOutput(m,"float32");if(k.sizeFromShape(r.shape)===0)return A;let x=t.dataIdMap.get(A.dataId).id;return q6(y,d,p,c,h,l,u,s?1:0,i?1:0,x),g!=null&&t.disposeData(g.dataId),A}var MQ={kernelName:Js,backendName:"wasm",setupFunc:EQ,kernelFunc:RQ},X6;function FQ(e){X6=e.wasm.cwrap(ei,null,["number","array","number","array","number","number"])}function $Q(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=k.parseAxisParam(s,r.shape);if(r.shape.length===0)return Qh({inputs:{x:r},backend:n});let o=n.makeOutput(r.shape,r.dtype),l=n.dataIdMap.get(r.dataId).id,u=n.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(i).buffer),p=new Uint8Array(new Int32Array(r.shape).buffer);X6(l,d,i.length,p,r.shape.length,u);let c=Ea({inputs:{x:o},attrs:{shape:r.shape},backend:n});return n.disposeData(o.dataId),c}var DQ={kernelName:ei,backendName:"wasm",kernelFunc:$Q,setupFunc:FQ},K6;function OQ(e){K6=e.wasm.cwrap(ml,null,["number","number","number","number","number","number","number","number","array","number","number"])}function zQ(e){let{inputs:t,backend:n,attrs:a}=e,{image:r}=t,{radians:s,fillValue:i,center:o}=a,l=n.makeOutput(r.shape,r.dtype),u=n.dataIdMap.get(r.dataId).id,d=n.dataIdMap.get(l.dataId).id,[p,c,h,m]=r.shape,[f,g]=F.getImageCenter(o,c,h),y=i===0,A=255,x=typeof i=="number"?[i,i,i,y?0:A]:[...i,A],v=new Uint8Array(new Int32Array(x).buffer);return K6(u,p,c,h,m,s,f,g,v,x.length,d),l}var _Q={kernelName:ml,backendName:"wasm",kernelFunc:zQ,setupFunc:OQ},PQ=vn(ti),LQ=vn(ni),Z6;function WQ(e){Z6=e.wasm.cwrap(nl,null,["number","number","number","number","number","number","array","number","number"])}function BQ(e){let{backend:t,inputs:n,attrs:a}=e,{indices:r,updates:s}=n,{shape:i}=a,o=t.makeOutput(i,s.dtype);if(k.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:u,sliceSize:d,strides:p,outputSize:c}=y1.calculateShapes(s,r,i),h=t.dataIdMap.get(r.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(p).buffer),g=t.dataIdMap.get(o.dataId).id;return Z6(h,m,Fn[s.dtype],l,u,d,f,c,g),o}var VQ={kernelName:nl,backendName:"wasm",setupFunc:WQ,kernelFunc:BQ},Y6;function jQ(e){Y6=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function UQ(e){let{inputs:t,backend:n}=e,{condition:a,t:r,e:s}=t,i=n.dataIdMap.get(a.dataId).id,o=n.dataIdMap.get(r.dataId).id,l=n.dataIdMap.get(s.dataId).id,u=n.makeOutput(r.shape,r.dtype),d=n.dataIdMap.get(u.dataId).id,p=a.shape.length,c=r.shape.length,h=p===0||p>1||c===1?1:k.sizeFromShape(r.shape.slice(1));return Y6(i,o,l,h,d),u}var HQ={kernelName:al,backendName:"wasm",kernelFunc:UQ,setupFunc:jQ},J6;function GQ(e){J6=e.wasm.cwrap(ri,null,["number","number"])}function qQ(e){let{backend:t,inputs:{x:n}}=e,a=t.dataIdMap.get(n.dataId).id,r=t.makeOutput(n.shape,n.dtype),s=t.dataIdMap.get(r.dataId).id;return k.sizeFromShape(r.shape)===0||J6(a,s),r}var XQ={kernelName:"Sigmoid",backendName:"wasm",setupFunc:GQ,kernelFunc:qQ},KQ=vn(ai);function n0(e){let{inputs:{x:t},attrs:{begin:n,size:a},backend:r}=e,[s,i]=fn.parseSliceParams(t,n,a),o=fn.isSliceContinous(t.shape,s,i),l=r.readSync(t.dataId),u=r.makeOutput(i,t.dtype),d=k.computeStrides(t.shape),p=r.dataIdMap.get(u.dataId);if(o){let m=fn.computeFlatOffset(s,d);return t.dtype==="string"?p.stringBytes=l.slice(m,m+k.sizeFromShape(i)):r.typedArrayFromHeap(u).set(l.subarray(m,m+k.sizeFromShape(i))),u}if(t.dtype==="string"){let m=Fh(l,s,i,t.shape,t.dtype);return p.stringBytes=m,u}let c=r.typedArrayFromHeap(u),h=t.shape.length;if(h===2)ZQ(l,d[0],c,s,i);else if(h===3)YQ(l,d[0],d[1],c,s,i);else if(h===4)JQ(l,d[0],d[1],d[2],c,s,i);else{let m=Fh(l,s,i,t.shape,t.dtype);c.set(m)}return u}function ZQ(e,t,n,a,r){let s=0,i=a[0],o=a[1],l=i+r[0];for(let u=i;u{let c=[...d];c[o]=p;let h=n0({inputs:{x:r},attrs:{begin:u,size:c},backend:a});return u[o]+=p,h})}var ree={kernelName:ul,backendName:"wasm",kernelFunc:aee},see=vn(si),iee=vn(Gu),oee=!0,lee=wn(li,oee),e4;function uee(e){e4=e.wasm.cwrap(Pr,null,["number","number","number"])}function dee(e){let{backend:t,inputs:n,attrs:a}=e,{alpha:r}=a,{x:s}=n,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return e4(i,r,l),o}var pee={kernelName:Pr,backendName:"wasm",setupFunc:uee,kernelFunc:dee},t4;function cee(e){t4=e.wasm.cwrap(dl,null,["number","array","number","array","array","array","array","array","number","number"])}function hee(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{begin:s,end:i,strides:o}=a;o==null&&(o=new Array(s.length));let{beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:p,shrinkAxisMask:c}=a,h=F.slice_util.maskToAxes(d);if(h.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(d!==0&&p!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(d!==0&&c!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let m=r.shape.length-s.length,f=F.slice_util.maskToAxes(p),g=r.shape.slice();f.forEach(_=>{s[_]=0,i[_]=1,g.splice(_,0,1)});let y=Ea({inputs:{x:r},attrs:{shape:g},backend:t}),{begin:A,end:x,strides:v}=F.slice_util.getNormalizedAxes(y.shape,h,m,s,i,o,l,u,d);s=A,i=x,o=v;let b=F.slice_util.maskToAxes(c);b.forEach(_=>{i[_]=s[_]+1,o[_]=1});let w=F.slice_util.computeOutShape(s,i,o),N=w.filter((_,$)=>b.indexOf($)===-1);if(o.every(_=>_===1)){let _=n0({inputs:{x:y},attrs:{begin:s,size:w},backend:t});t.disposeData(y.dataId);let $=Ea({inputs:{x:_},attrs:{shape:N},backend:t});return t.disposeData(_.dataId),$}let C=t.makeOutput(N,"float32");if(!N.some(_=>_===0)){let _=t.dataIdMap.get(y.dataId).id,$=new Uint8Array(new Int32Array(k.computeStrides(y.shape)).buffer),S=new Uint8Array(new Int32Array(s).buffer),z=new Uint8Array(new Int32Array(i).buffer),O=new Uint8Array(new Int32Array(o).buffer),W=new Uint8Array(new Int32Array(N).buffer),G=new Uint8Array(new Int32Array(k.computeStrides(N)).buffer),H=t.dataIdMap.get(C.dataId).id;t4(_,$,y.shape.length,S,z,O,W,G,N.length,H)}t.disposeData(y.dataId);let E=Ea({inputs:{x:C},attrs:{shape:N},backend:t});return t.disposeData(C.dataId),E}var fee={kernelName:dl,backendName:"wasm",setupFunc:cee,kernelFunc:hee},mee=!0,gee=wn(ui,mee),n4;function yee(e){n4=e.wasm.cwrap(ii,null,["number, number, number"])}function Aee(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:p,originalAxes:c,inputWasTransposed:h}=Qr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(d.dataId).id;x!==o&&(u=d,l=x,m=F.getInnerMostAxes(m.length,u.shape.length))}F.assertAxesAreInnerMostDims("sum",m,u.shape.length);let[f,g]=F.computeOutAndReduceShapes(u.shape,m),y=k.sizeFromShape(g),A=t.makeOutput(f,u.dtype);if(k.sizeFromShape(u.shape)!==0){let x=t.dataIdMap.get(A.dataId).id;n4(l,y,x)}if(h&&t.disposeData(d.dataId),s){let x=F.expandShapeToKeepDim(A.shape,c);A.shape=x}return A}var xee={kernelName:ii,backendName:"wasm",setupFunc:yee,kernelFunc:Aee},bee=vn(di),vee=vn(pi),a4;function wee(e){a4=e.wasm.cwrap(_r,null,["number","array","number","array","number","number"])}function kee(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,s=n.dataIdMap.get(r.dataId).id,{reps:i}=a,o=new Array(r.shape.length);for(let c=0;c{let{x:a}=e,{k:r,sorted:s}=n,i=t.dataIdMap.get(a.dataId).id,o=new Uint8Array(new Int32Array(a.shape).buffer),l=a.shape.slice();l[l.length-1]=r;let u=t.makeOutput(l,a.dtype),d=t.dataIdMap.get(u.dataId).id,p=t.makeOutput(l,"int32"),c=t.dataIdMap.get(p.dataId).id;return r4(i,o,a.shape.length,Fn[a.dtype],r,s,d,c),[u,p]},Tee={kernelName:pl,backendName:"wasm",setupFunc:See,kernelFunc:Nee},s4;function Cee(e){s4=e.wasm.cwrap(cl,null,["number","number","bool","number","number","number","number","number","number","array","number","number","number","number","number"])}function Eee(e){let{backend:t,inputs:n,attrs:a}=e,{image:r,transforms:s}=n,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=a,[d,p,c,h]=r.shape,[m,f]=u!=null?u:[p,c],g=[d,m,f,h],y=new Uint8Array(new Int32Array(k.computeStrides(r.shape)).buffer),A=t.makeOutput(g,r.dtype),x=t.dataIdMap.get(A.dataId).id,v=t.dataIdMap.get(r.dataId).id,b=t.dataIdMap.get(s.dataId).id,w=i==="nearest"?1:2,N;switch(o){case"constant":N=1;break;case"reflect":N=2;break;case"wrap":N=3;break;case"nearest":N=4;break;default:N=1;break}return s4(v,b,s.shape[0]>1,d,m,f,h,c,p,y,r.shape.length-1,w,N,l,x),A}var Ree={kernelName:cl,backendName:"wasm",setupFunc:Cee,kernelFunc:Eee};function Mee(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r.shape[s],o=r.shape.length,l=new Array(o-1),u=0;for(let h=0;h({dataId:h,dtype:m,shape:l}))}var Fee={kernelName:hl,backendName:"wasm",kernelFunc:Mee};function $ee(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(0),a}var Dee={kernelName:fl,backendName:"wasm",kernelFunc:$ee},Oee=[BZ,jZ,GZ,eY,aY,iY,uY,hY,fY,mY,AY,xY,wY,SY,NY,EY,FY,OY,PY,WY,BY,VY,UY,qY,XY,ZY,WZ,QY,nJ,sJ,lJ,pJ,hJ,mJ,qZ,AJ,bJ,wJ,kJ,SJ,CJ,RJ,$J,zJ,LJ,BJ,UJ,GJ,qJ,ZJ,QJ,nQ,rQ,oQ,uQ,pQ,fQ,gQ,xQ,wQ,IQ,NQ,TQ,CQ,dY,MQ,DQ,_Q,LQ,PQ,VQ,HQ,XQ,KQ,QQ,nee,ree,see,iee,lee,pee,fee,gee,xee,bee,vee,Iee,Tee,Ree,YZ,Fee,Dee];for(let e of Oee)gi(e);var ny=te();ny.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>WebAssembly.validate(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])));ny.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(ny.get("IS_NODE"))return!1;try{return new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}});var i4=gs(oS()),zee='var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}',_ee=gs(lS()),o4=class extends Eu{constructor(e){super();this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.init(),this.dataIdMap=new Up(this,fr())}write(e,t,n){let a={id:this.dataIdNextNumber++};return this.move(a,e,t,n,1),a}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=k.now();return e(),{kernelMs:k.now()-t}}move(e,t,n,a,r){let s=this.dataIdNextNumber++;if(a==="string"){let u=t;this.dataIdMap.set(e,{id:s,stringBytes:u,shape:n,dtype:a,memoryOffset:null,refCount:r});return}let i=k.sizeFromShape(n),o=i*k.bytesPerElement(a),l=this.wasm._malloc(o);this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:n,dtype:a,refCount:r}),this.wasm.tfjs.registerTensor(s,i,l),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,o),l)}async read(e){return this.readSync(e)}readSync(e){let{memoryOffset:t,dtype:n,shape:a,stringBytes:r}=this.dataIdMap.get(e);if(n==="string")return r;let s=this.wasm.HEAPU8.slice(t,t+k.sizeFromShape(a)*k.bytesPerElement(n));return Wee(s.buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){return this.dataIdMap.has(e)?this.dataIdMap.get(e).refCount:0}incRef(e){let t=this.dataIdMap.get(e);t!=null&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n){let a;if(n==null)a=this.write(null,e,t);else{let r=this.dataIdNextNumber++;a={id:r},this.dataIdMap.set(a,{id:r,memoryOffset:n,shape:e,dtype:t,refCount:1});let s=k.sizeFromShape(e);this.wasm.tfjs.registerTensor(r,s,n)}return{dataId:a,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){let a=this.wasm.HEAPU8.buffer,{memoryOffset:r}=this.dataIdMap.get(n),s=k.sizeFromShape(e);switch(t){case"float32":return new Float32Array(a,r,s);case"int32":return new Int32Array(a,r,s);case"bool":return new Uint8Array(a,r,s);default:throw new Error(`Unknown dtype ${t}`)}}};function Pee(e){return(t,n)=>(k.fetch(e,{credentials:"same-origin"}).then(a=>{a.ok||t.env.a(`failed to load wasm binary file at '${e}'`),a.arrayBuffer().then(r=>{WebAssembly.instantiate(r,t).then(s=>{n(s.instance,s.module)})})}),{})}function l4(e,t,n){if(a0!=null)return a0;let a="tfjs-backend-wasm.wasm";return e&&t?a="tfjs-backend-wasm-threaded-simd.wasm":e&&(a="tfjs-backend-wasm-simd.wasm"),Wd!=null&&Wd[a]!=null?Wd[a]:n+a}async function Lee(){let[e,t]=await Promise.all([te().getAsync("WASM_HAS_SIMD_SUPPORT"),te().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,a)=>{let r={};r.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let u=zee,d=new Blob([u],{type:"application/javascript"});return URL.createObjectURL(d)}return o.endsWith(".wasm")?l4(e,t,Ld!=null?Ld:l):l+o},ay&&(r.instantiateWasm=Pee(l4(e,t,Ld!=null?Ld:"")));let s=!1;r.onAbort=()=>{s||Bd||(Bd=!0,a({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"}))};let i;t&&e&&a0==null?(r.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+i4.default.toString()],{type:"text/javascript"}),i=(0,i4.default)(r)):i=(0,_ee.default)(r),i.then(o=>{s=!0,Bd=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},n({wasm:o})})})}function Wee(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}var Bee=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],a0=null,Ld=null,Wd={},Bd=!1,ay=!1;function Vee(e,t=!1){if(k1("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),Bd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");a0=e,ay=t}function jee(e,t=!1){if(Bd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof e=="string")Ld=e;else{Wd=e;let n=Bee.filter(a=>Wd[a]==null);if(n.length>0)throw new Error(`There were no entries found for the following binaries: ${n.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}ay=t}var u4="3.7.0",Uee=2;Il("wasm",async()=>{let{wasm:e}=await Lee();return new o4(e)},Uee);ee().prototype.abs=function(){return this.throwIfDisposed(),Wt(this)};ee().prototype.acos=function(){return this.throwIfDisposed(),S1(this)};ee().prototype.acosh=function(){return this.throwIfDisposed(),N1(this)};ee().prototype.add=function(e){return this.throwIfDisposed(),ie(this,e)};ee().prototype.all=function(e,t){return this.throwIfDisposed(),Uc(this,e,t)};ee().prototype.any=function(e,t){return this.throwIfDisposed(),id(this,e,t)};ee().prototype.argMax=function(e){return this.throwIfDisposed(),ki(this,e)};ee().prototype.argMin=function(e){return this.throwIfDisposed(),T1(this,e)};ee().prototype.asScalar=function(){return this.throwIfDisposed(),D(this.size===1,()=>"The array must have only 1 element."),q(this,[])};ee().prototype.asType=function(e){return this.throwIfDisposed(),ge(this,e)};ee().prototype.as1D=function(){return this.throwIfDisposed(),q(this,[this.size])};ee().prototype.as2D=function(e,t){return this.throwIfDisposed(),q(this,[e,t])};ee().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),q(this,[e,t,n])};ee().prototype.as4D=function(e,t,n,a){return this.throwIfDisposed(),q(this,[e,t,n,a])};ee().prototype.as5D=function(e,t,n,a,r){return this.throwIfDisposed(),q(this,[e,t,n,a,r])};ee().prototype.asin=function(){return this.throwIfDisposed(),C1(this)};ee().prototype.asinh=function(){return this.throwIfDisposed(),E1(this)};ee().prototype.atan=function(){return this.throwIfDisposed(),R1(this)};ee().prototype.atan2=function(e){return this.throwIfDisposed(),M1(this,e)};ee().prototype.atanh=function(){return this.throwIfDisposed(),F1(this)};ee().prototype.avgPool=function(e,t,n,a){return this.throwIfDisposed(),ld(this,e,t,n,a)};ee().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),ud(this,e,t)};ee().prototype.batchNorm=function(e,t,n,a,r){return this.throwIfDisposed(),Ni(this,e,t,n,a,r)};ee().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Nl(this,e)};ee().prototype.cast=function(e){return this.throwIfDisposed(),ge(this,e)};ee().prototype.ceil=function(){return this.throwIfDisposed(),_1(this)};ee().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Mn(this,e,t)};ee().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Be&&(e=[e]),lt([this,...e],t)};ee().prototype.conv1d=function(e,t,n,a,r,s){return this.throwIfDisposed(),Gc(this,e,t,n,a,r,s)};ee().prototype.conv2dTranspose=function(e,t,n,a,r){return this.throwIfDisposed(),qc(this,e,t,n,a,r)};ee().prototype.conv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),mr(this,e,t,n,a,r,s)};ee().prototype.cos=function(){return this.throwIfDisposed(),dd(this)};ee().prototype.cosh=function(){return this.throwIfDisposed(),Xc(this)};ee().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),Kc(this,e,t,n)};ee().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),W1(this,e,t)};ee().prototype.depthwiseConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),Cl(this,e,t,n,a,r,s)};ee().prototype.dilation2d=function(e,t,n,a,r){return this.throwIfDisposed(),B1(this,e,t,n,a,r)};ee().prototype.divNoNan=function(e){return this.throwIfDisposed(),V1(this,e)};ee().prototype.div=function(e){return this.throwIfDisposed(),me(this,e)};ee().prototype.dot=function(e){return this.throwIfDisposed(),N3(this,e)};ee().prototype.elu=function(){return this.throwIfDisposed(),El(this)};ee().prototype.equal=function(e){return this.throwIfDisposed(),Hr(this,e)};ee().prototype.erf=function(){return this.throwIfDisposed(),j1(this)};ee().prototype.exp=function(){return this.throwIfDisposed(),la(this)};ee().prototype.expandDims=function(e){return this.throwIfDisposed(),mn(this,e)};ee().prototype.expm1=function(){return this.throwIfDisposed(),U1(this)};ee().prototype.fft=function(){return this.throwIfDisposed(),bd(this)};ee().prototype.flatten=function(){return this.throwIfDisposed(),q(this,[this.size])};ee().prototype.floor=function(){return this.throwIfDisposed(),Ml(this)};ee().prototype.floorDiv=function(e){return this.throwIfDisposed(),Vc(this,e)};ee().prototype.gather=function(e,t){return this.throwIfDisposed(),Ti(this,e,t)};ee().prototype.greaterEqual=function(e){return this.throwIfDisposed(),qr(this,e)};ee().prototype.greater=function(e){return this.throwIfDisposed(),Wn(this,e)};ee().prototype.ifft=function(){return this.throwIfDisposed(),Ol(this)};ee().prototype.irfft=function(){return this.throwIfDisposed(),ch(this)};ee().prototype.isFinite=function(){return this.throwIfDisposed(),C3(this)};ee().prototype.isInf=function(){return this.throwIfDisposed(),E3(this)};ee().prototype.isNaN=function(){return this.throwIfDisposed(),G1(this)};ee().prototype.leakyRelu=function(e){return this.throwIfDisposed(),pd(this,e)};ee().prototype.lessEqual=function(e){return this.throwIfDisposed(),Xr(this,e)};ee().prototype.less=function(e){return this.throwIfDisposed(),Yc(this,e)};ee().prototype.localResponseNormalization=function(e,t,n,a){return this.throwIfDisposed(),q1(this,e,t,n,a)};ee().prototype.logSigmoid=function(){return this.throwIfDisposed(),F3(this)};ee().prototype.logSoftmax=function(e){return this.throwIfDisposed(),eh(this,e)};ee().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),Z1(this,e,t)};ee().prototype.log=function(){return this.throwIfDisposed(),Bn(this)};ee().prototype.log1p=function(){return this.throwIfDisposed(),Jc(this)};ee().prototype.logicalAnd=function(e){return this.throwIfDisposed(),xa(this,e)};ee().prototype.logicalNot=function(){return this.throwIfDisposed(),cd(this)};ee().prototype.logicalOr=function(e){return this.throwIfDisposed(),th(this,e)};ee().prototype.logicalXor=function(e){return this.throwIfDisposed(),z3(this,e)};ee().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),je(this,e,t,n)};ee().prototype.maxPool=function(e,t,n,a){return this.throwIfDisposed(),hd(this,e,t,n,a)};ee().prototype.max=function(e,t){return this.throwIfDisposed(),Vn(this,e,t)};ee().prototype.maximum=function(e){return this.throwIfDisposed(),Xa(this,e)};ee().prototype.mean=function(e,t){return this.throwIfDisposed(),Nt(this,e,t)};ee().prototype.min=function(e,t){return this.throwIfDisposed(),fd(this,e,t)};ee().prototype.minimum=function(e){return this.throwIfDisposed(),Fl(this,e)};ee().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),J1(this,e,t)};ee().prototype.mod=function(e){return this.throwIfDisposed(),Q1(this,e)};ee().prototype.mul=function(e){return this.throwIfDisposed(),B(this,e)};ee().prototype.neg=function(){return this.throwIfDisposed(),St(this)};ee().prototype.norm=function(e,t,n){return this.throwIfDisposed(),gh(this,e,t,n)};ee().prototype.notEqual=function(e){return this.throwIfDisposed(),Ri(this,e)};ee().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),wl(this,e,t,n)};ee().prototype.onesLike=function(){return this.throwIfDisposed(),Un(this)};ee().prototype.pad=function(e,t){return this.throwIfDisposed(),gr(this,e,t)};ee().prototype.pool=function(e,t,n,a,r){return this.throwIfDisposed(),L3(this,e,t,n,a,r)};ee().prototype.pow=function(e){return this.throwIfDisposed(),yr(this,e)};ee().prototype.prelu=function(e){return this.throwIfDisposed(),gd(this,e)};ee().prototype.prod=function(e,t){return this.throwIfDisposed(),ah(this,e,t)};ee().prototype.reciprocal=function(){return this.throwIfDisposed(),ng(this)};ee().prototype.relu=function(){return this.throwIfDisposed(),Ka(this)};ee().prototype.relu6=function(){return this.throwIfDisposed(),rh(this)};ee().prototype.reshapeAs=function(e){return this.throwIfDisposed(),q(this,e.shape)};ee().prototype.reshape=function(e){return this.throwIfDisposed(),q(this,e)};ee().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),a7(this,e,t,n)};ee().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),r7(this,e,t,n)};ee().prototype.reverse=function(e){return this.throwIfDisposed(),Hn(this,e)};ee().prototype.rfft=function(){return this.throwIfDisposed(),vd(this)};ee().prototype.round=function(){return this.throwIfDisposed(),sh(this)};ee().prototype.rsqrt=function(){return this.throwIfDisposed(),ih(this)};ee().prototype.selu=function(){return this.throwIfDisposed(),oh(this)};ee().prototype.separableConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),ag(this,e,t,n,a,r,s)};ee().prototype.sigmoid=function(){return this.throwIfDisposed(),Rn(this)};ee().prototype.sign=function(){return this.throwIfDisposed(),rg(this)};ee().prototype.sin=function(){return this.throwIfDisposed(),lh(this)};ee().prototype.sinh=function(){return this.throwIfDisposed(),uh(this)};ee().prototype.slice=function(e,t){return this.throwIfDisposed(),Re(this,e,t)};ee().prototype.softmax=function(e){return this.throwIfDisposed(),xd(this,e)};ee().prototype.softplus=function(){return this.throwIfDisposed(),Ci(this)};ee().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),md(this,e,t)};ee().prototype.split=function(e,t){return this.throwIfDisposed(),Zt(this,e,t)};ee().prototype.sqrt=function(){return this.throwIfDisposed(),an(this)};ee().prototype.square=function(){return this.throwIfDisposed(),ot(this)};ee().prototype.squaredDifference=function(e){return this.throwIfDisposed(),hh(this,e)};ee().prototype.squeeze=function(e){return this.throwIfDisposed(),Vt(this,e)};ee().prototype.stack=function(e,t){this.throwIfDisposed();let n=e instanceof Be?[this,e]:[this,...e];return gn(n,t)};ee().prototype.step=function(e){return this.throwIfDisposed(),zl(this,e)};ee().prototype.stridedSlice=function(e,t,n,a,r,s,i,o){return this.throwIfDisposed(),ig(this,e,t,n,a,r,s,i,o)};ee().prototype.sub=function(e){return this.throwIfDisposed(),ye(this,e)};ee().prototype.sum=function(e,t){return this.throwIfDisposed(),Se(this,e,t)};ee().prototype.tan=function(){return this.throwIfDisposed(),og(this)};ee().prototype.tanh=function(){return this.throwIfDisposed(),Si(this)};ee().prototype.tile=function(e){return this.throwIfDisposed(),Gr(this,e)};ee().prototype.toBool=function(){return this.throwIfDisposed(),ge(this,"bool")};ee().prototype.toFloat=function(){return this.throwIfDisposed(),ge(this,"float32")};ee().prototype.toInt=function(){return this.throwIfDisposed(),ge(this,"int32")};ee().prototype.topk=function(e,t){return this.throwIfDisposed(),lg(this,e,t)};ee().prototype.transpose=function(e){return this.throwIfDisposed(),Qe(this,e)};ee().prototype.unique=function(e){return this.throwIfDisposed(),mh(this,e)};ee().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),ug(this,e,t)};ee().prototype.unstack=function(e){return this.throwIfDisposed(),Gn(this,e)};ee().prototype.where=function(e,t){return this.throwIfDisposed(),un(e,this,t)};ee().prototype.zerosLike=function(){return this.throwIfDisposed(),Ge(this)};var d4={kernelName:mo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,zl(ge(n,"float32"),-1))}}},Hee={kernelName:go,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=ot(ge(n,"float32")),r=an(ye(ke(1),a));return St(me(e,r))}}}},Gee={kernelName:yo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=an(ye(ot(ge(n,"float32")),1));return me(e,a)}}}},qee={kernelName:Or,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=e,i=Bt(n.shape,r);return i.length>0&&(s=Se(s,i)),q(s,n.shape)},b:()=>{let s=e,i=Bt(a.shape,r);return i.length>0&&(s=Se(s,i)),q(s,a.shape)}}}},Xee={kernelName:xs,saveAllInputs:!0,gradFunc:(e,t)=>{let n={};return t.forEach((a,r)=>{n[r]=()=>e.clone()}),n}},Kee={kernelName:bs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ge(n)}}},Zee={kernelName:Fu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ge(n)}}},Yee={kernelName:bo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,an(ye(ke(1),ot(ge(n,"float32")))))}}},Jee={kernelName:vo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=an(ie(ke(1),ot(ge(n,"float32"))));return me(e,a)}}}},Qee={kernelName:Io,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=ie(ot(n),ot(a)),i=B(e,me(a,s)),o=Bt(n.shape,r);return o.length>0&&(i=Se(i,o)),q(i,n.shape)},b:()=>{let s=ie(ot(n),ot(a)),i=St(B(e,me(n,s))),o=Bt(a.shape,r);return o.length>0&&(i=Se(i,o)),q(i,a.shape)}}}},ete={kernelName:wo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ie(ot(ge(n,"float32")),1))}}},tte={kernelName:ko,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ye(ke(1),ot(ge(n,"float32"))))}}};function nte(e,t,n,a,r,s){let i=M(e,"dy","avgPool3dGrad"),o=M(t,"input","avgPool3dGrad"),l=i,u=o,d=!1;o.rank===4&&(d=!0,l=q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),u=q(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),D(l.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),D(u.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`),s!=null&&D(qt(r),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${r}.`);let p={dy:l,input:u},c={filterSize:n,strides:a,pad:r,dimRoundingMode:s},h=P.runKernel(Kp,p,c);return d?q(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var ate=L({avgPool3dGrad_:nte}),rte={kernelName:$u,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i,dimRoundingMode:o}=n;return{x:()=>ate(e,a,r,s,i,o)}}};function ste(e,t,n,a,r){let s=M(e,"dy","avgPoolGrad"),i=M(t,"input","avgPoolGrad");D(i.rank===s.rank,()=>`Rank of input (${i.rank}) does not match rank of dy (${s.rank})`);let o=i,l=s,u=!1;i.rank===3&&(u=!0,o=q(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),D(l.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),D(o.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`);let d={dy:l,input:o},p={filterSize:n,strides:a,pad:r},c=P.runKernel(Xp,d,p);return u?q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var ite=L({avgPoolGrad_:ste}),ote={kernelName:vs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i}=n;return{x:()=>ite(e,a,r,s,i)}}},lte={kernelName:ws,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{let[a,r]=t,{transposeA:s,transposeB:i}=n;return!s&&!i?{a:()=>je(e,r,!1,!0),b:()=>je(a,e,!0,!1)}:!s&&i?{a:()=>je(e,r,!1,!1),b:()=>je(e,a,!0,!1)}:s&&!i?{a:()=>je(r,e,!1,!0),b:()=>je(a,e,!1,!1)}:{a:()=>je(r,e,!0,!0),b:()=>je(e,a,!0,!0)}}},ute={kernelName:Du,gradFunc:(e,t,n)=>{let{blockShape:a,crops:r}=n;return{x:()=>md(e,a,r)}}},dte={kernelName:gb,gradFunc:(e,t,n)=>{let a=n,r=a.inputShape,s=a.shape,i=Array.from(s);for(let l=r.length-1;l>=0;l--)if(r[l]===s[l])i[l]=1;else if(r[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);let o=[];for(let l=0;l1&&o.push(l);return{x:()=>Se(e,o,!0)}}},pte={kernelName:ks,gradFunc:e=>({x:()=>e.clone()})},cte={kernelName:Is,gradFunc:e=>({x:()=>Ge(e)})},hte={kernelName:zr,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>un(xa(qr(a,r),Xr(a,s)),e,Ge(e))}}},fte={kernelName:Ou,inputsToSave:["x"],gradFunc:d4.gradFunc},mte={kernelName:So,saveAllInputs:!0,gradFunc:(e,t,n)=>{let a=t.map(o=>o.shape),{axis:r}=n,s=ya(r,t[0].shape)[0],i=a.map(o=>o[s]);return Zt(e,i,s).map(o=>()=>o)}},gte={kernelName:Ss,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{dilations:s,strides:i,pad:o,dataFormat:l}=n;return D(Ur(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>P1(a.shape,e,r,i,o,l),filter:()=>hg(a,e,r.shape,i,o,l)}}},yte={kernelName:Ns,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{strides:s,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>mr(e,r,s,i,o,1,l),filter:()=>hg(e,a,r.shape,s,i,o,l)}}};function Ate(e,t,n,a,r){let s=e;e.rank===4&&(s=q(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;i.rank===4&&(i=q(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),D(s.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),D(i.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`),D(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),D(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),D(i.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`);let o={x:s,dy:i},l={strides:a,pad:r,filterShape:n};return P.runKernel(Qp,o,l)}var xte=L({conv3DBackpropFilter_:Ate}),bte={kernelName:zu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s}=n;D(Ur(a),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`);let[i,o]=t;return{x:()=>k3(i.shape,e,o,r,s),filter:()=>xte(i,e,o.shape,r,s)}}},vte={kernelName:Ts,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(St(lh(ge(n,"float32"))),e)}}},wte={kernelName:No,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(uh(ge(n,"float32")),e)}}},kte={kernelName:Cs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r,exclusive:s,reverse:i}=n;return{x:()=>{let o=O3([r],a.rank),l=Kc(e,r,s,!i);return o!=null&&(l=Qe(l,o)),l}}}},Ite={kernelName:Es,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s,dimRoundingMode:i}=n,o=a==null?[1,1]:a;D(Ur(o),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`);let[l,u]=t;return D(l.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),D(u.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`),D(l.shape[3]===u.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`),D(Ga(r,o),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`),i!=null&&D(qt(s),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`),{x:()=>Z3(l.shape,e,u,r,s,a,i),filter:()=>K3(l,e,u.shape,r,s,a,i)}}},Ste={kernelName:_u,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,s={x:a,filter:r,dy:e},i={x:a,filter:r,dy:e};return{x:()=>P.runKernel(sc,s,n),filter:()=>P.runKernel(ic,i,n)}}},Nte={kernelName:Eo,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t,a={dy:e,y:n};return{x:()=>P.runKernel(lc,a)}}},Tte={kernelName:Ro,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(la(St(ot(n))),2/Math.sqrt(Math.PI));return{x:()=>B(e,a)}}},Cte={kernelName:Ms,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,n)}}},Ete={kernelName:Fo,inputsToSave:["input"],gradFunc:(e,t)=>{let[n]=t;return{input:()=>q(e,n.shape)}}},Rte={kernelName:$o,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,la(n))}}},Mte={kernelName:Fs,gradFunc:e=>({x:()=>Ge(e)})},Fte={kernelName:$s,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=me(e,ge(a,"float32")),i=Bt(n.shape,r);return i.length>0?q(Se(s,i),n.shape):s},b:()=>{let s=B(e,ge(n,"float32")),i=Bt(a.shape,r);i.length>0&&(s=q(Se(s,i),a.shape));let o=ot(a);return St(me(s,ge(o,"float32")))}}}},$te={kernelName:Ds,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{let{varianceEpsilon:a}=n,[r,s,i,o]=t,l=o==null?ke(1):o,u=Bt(s.shape,r.shape),d=[];if(s.rank===1){for(let f=0;fs.rank===1?q(B(B(e,Gr(q(h,[1,1,1,s.shape[0]]),d)),l),r.shape):q(B(B(e,h),l),r.shape),mean:()=>{let f=B(B(h,ke(-1)),c);return s.rank===1&&(f=Se(f,u)),q(f,s.shape)},variance:()=>{let f=B(B(m,p),c);return s.rank===1&&(f=Se(f,u)),q(f,s.shape)},scale:()=>{let f=B(p,h),g=B(e,f);return s.rank===1&&(g=Se(g,u)),q(g,s.shape)},offset:()=>{let f=e;return s.rank===1&&(f=Se(f,u)),q(f,s.shape)}}}},Dte={kernelName:Oo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{let[a,r]=t,{axis:s}=n,i=ya(s,a.shape)[0];return{x:()=>{let o=a.shape,l=r.size,u=o.slice(0,i),d=u.length,p=o.slice(s,o.length).slice(1),c=p.length,h=p4(0,d),m=p4(d+1,d+1+c),f=c4([u,[l],p]),g=q(e,f),y=q(r,[l]),A=c4([[d],h,m]),x=Qe(g,A),v=ug(x,y,a.shape[i]),b=K1(A);return v=Qe(v,b),v},indices:()=>r}}};function p4(e,t){let n=[];for(let a=e;a{let[n,a]=t;return{a:()=>Ge(n),b:()=>Ge(a)}}},zte={kernelName:zs,gradFunc:e=>({x:()=>ge(e,"float32")})},_te={kernelName:Po,gradFunc:e=>({x:()=>Ge(e)})},Pte={kernelName:Lo,gradFunc:e=>({x:()=>Ge(e)})},Lte={kernelName:Wo,gradFunc:e=>({x:()=>Ge(e)})},Wte={kernelName:_s,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{alpha:r}=n,s=Wn(a,0);return{x:()=>un(s,e,B(e,r))}}},Bte={kernelName:jo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ie(n,1))}}},Vte={kernelName:Ps,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ge(n,"float32"))}}},jte={kernelName:yb,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n;return{logits:()=>{let s=!0,i=la(a);return ye(e,B(Se(e,r,s),i))}}}};function Ute(e,t,n,a=5,r=1,s=1,i=.5){let o={x:e,y:t,dy:n},l={depthRadius:a,bias:r,alpha:s,beta:i};return P.runKernel(hc,o,l)}var Hte=L({localResponseNormalizationBackprop_:Ute}),Gte={kernelName:Bu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;return{x:()=>Hte(a,r,e,s,i,o,l)}}};function h4(e,t,n,a){return t.rankB(e,ge(Hr(n,t),e.dtype))}}var f4={kernelName:Ls,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{reductionIndices:r}=a,s=t[0],i=t[1],o=ya(r,s.shape),l=h4(e,i,s,o);return{x:()=>l.x()}}},qte={kernelName:Ws,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,ge(qr(n,a),"float32")),b:()=>B(e,ge(Yc(n,a),"float32"))}}};function Xte(e,t,n,a,r,s,i){let o=M(e,"dy","maxPool3dGrad"),l=M(t,"input","maxPool3dGrad"),u=M(n,"output","maxPool3dGrad"),d=o,p=l,c=u,h=!1;l.rank===4&&(h=!0,d=q(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),p=q(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),c=q(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),D(d.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${d.rank}.`),D(p.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${p.rank}.`),D(c.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${c.rank}.`),i!=null&&D(qt(s),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let m={dy:d,input:p,output:c},f={filterSize:a,strides:r,pad:s,dimRoundingMode:i},g=P.runKernel(mc,m,f);return h?q(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}var Kte=L({maxPool3dGrad_:Xte}),Zte={kernelName:Vu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>Kte(e,a,r,s,i,o,l)}}};function Yte(e,t,n,a,r,s,i){let o=M(e,"dy","maxPoolGrad"),l=M(t,"input","maxPoolGrad"),u=M(n,"output","maxPoolGrad");D(l.rank===o.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`),D(o.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`),D(l.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),i!=null&&D(qt(s),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let d={dy:o,input:l,output:u},p={filterSize:a,strides:r,pad:s,dimRoundingMode:i};return P.runKernel(fc,d,p)}var Jte=L({maxPoolGrad_:Yte}),Qte={kernelName:Bs,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o}=n;return{x:()=>Jte(e,a,r,s,i,o)}}},ene={kernelName:Vs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n,s=ya(r,a.shape),i=D3(a.shape,s)[1],o=Mt(i);return{x:()=>{let l=a.shape.slice();s.forEach(d=>{l[d]=1});let u=q(e,l);return me(B(u,jn(a.shape,"float32")),o)}}}},tne={kernelName:js,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{axis:r}=a,[s,i]=t,o=ya(r,s.shape),l=h4(e,i,s,o);return{x:()=>l.x()}}},nne={kernelName:Us,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,ge(Xr(n,a),"float32")),b:()=>B(e,ge(Wn(n,a),"float32"))}}},ane={kernelName:Hs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Re(e,s,a.shape)}}},rne={kernelName:Ho,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=Bt(n.shape,r);return s.length>0?q(Se(e,s),n.shape):e},b:()=>{let s=B(e,St(Ml(me(n,a)))),i=Bt(a.shape,r);return i.length>0?q(Se(s,i),a.shape):s}}}},sne={kernelName:Gs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=B(e,ge(a,"float32")),i=Bt(n.shape,r);return i.length>0?q(Se(s,i),n.shape):s},b:()=>{let s=B(e,ge(n,"float32")),i=Bt(a.shape,r);return i.length>0?q(Se(s,i),a.shape):s}}}},ine={kernelName:Go,gradFunc:e=>({x:()=>St(e)})},one={kernelName:qs,inputsToSave:["indices"],gradFunc:(e,t)=>{let n=t[0];return{indices:()=>$t(n.shape,"float32")}}},lne={kernelName:Yo,gradFunc:e=>({x:()=>Ge(e)})},une={kernelName:Jo,saveAllInputs:!0,gradFunc:(e,t,n)=>{let{axis:a}=n;return Gn(e,a).map(r=>()=>r)}},m4={kernelName:Xs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Re(e,s,a.shape)}}},dne={kernelName:Ks,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{let[n,a,r]=t,s=n,i=a,o=mt(s.shape,i.shape);return{a:()=>{let l=ge(i,"float32"),u=B(e,B(l,yr(s,ye(l,ke(1))))),d=Bt(s.shape,o);return d.length>0&&(u=Se(u,d)),q(u,s.shape)},b:()=>{let l=Wn(s,0),u=un(l,Bn(s),Ge(s)),d=B(e,B(r,u)),p=Bt(i.shape,o);return p.length>0&&(d=Se(d,p)),q(d,i.shape)}}}},pne={kernelName:Zs,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{let[n,a]=t,r=Wn(n,0);return{x:()=>un(r,e,B(e,a)),alpha:()=>{let s=un(r,Ge(e),B(e,n)),i=Bt(a.shape,e.shape);return i.length>0&&(s=Se(s,i)),q(s,a.shape)}}}},cne={kernelName:Rs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=me(e,ge(a,"float32")),i=Bt(n.shape,r);return i.length>0?q(Se(s,i),n.shape):s},b:()=>{let s=B(e,ge(n,"float32")),i=Bt(a.shape,r);i.length>0&&(s=q(Se(s,i),a.shape));let o=ot(a);return St(me(s,ge(o,"float32")))}}}},hne={kernelName:el,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,St(ot(n)))}}},fne={kernelName:Qs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(Xr(n,6),zl(n));return{x:()=>B(e,ge(a,"float32"))}}},mne={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,ge(zl(n),"float32"))}}},gne={kernelName:tl,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>q(e,n.shape)}}},yne={kernelName:Js,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>P.runKernel(bc,r,n)}}},Ane={kernelName:Uu,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>P.runKernel(xc,r,n)}}},xne={kernelName:ei,gradFunc:(e,t,n)=>{let{dims:a}=n,r=ya(a,e.shape);return{x:()=>Hn(e,r)}}},bne={kernelName:ti,gradFunc:e=>({x:()=>Ge(e)})},vne={kernelName:ni,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>St(me(e,B(yr(n,1.5),2)))}}},wne={kernelName:al,inputsToSave:["condition"],gradFunc:(e,t)=>{let[n]=t;return{condition:()=>ge(Ge(n),"float32"),t:()=>B(e,ge(n,e.dtype)),e:()=>B(e,ge(cd(n),e.dtype))}}},kne={kernelName:rl,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=Wn(n,ke(0)),r=ke(o7),s=ke(l7),i=B(e,s),o=B(B(e,r),la(ge(n,"float32")));return un(a,i,o)}}}},Ine={kernelName:ri,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(n,ye(ke(1),n)))}}},Sne={kernelName:ol,gradFunc:e=>({x:()=>Ge(e)})},Nne={kernelName:ai,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(dd(ge(n,"float32")),e)}}},Tne={kernelName:il,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Xc(ge(n,"float32")),e)}}},Cne={kernelName:sl,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{begin:r,size:s}=n,i=a.shape,[o,l]=l3(a,r,s),u=[];for(let d=0;dgr(e,u)}}},Ene={kernelName:oi,outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{dim:r}=n,s=!0,i=B(e,a);return{logits:()=>ye(i,B(Se(i,[r],s),a))}}},Rne={kernelName:ll,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Rn(n))}}},g4={kernelName:Hu,gradFunc:(e,t,n)=>{let{blockShape:a,paddings:r}=n;return{x:()=>ud(e,a,r)}}},y4={kernelName:ul,gradFunc:(e,t,n)=>{let{axis:a}=n;return{x:()=>lt(e,a)}}},Mne={kernelName:si,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,B(an(ge(n,"float32")),2))}}},Fne={kernelName:Gu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(ge(n,"float32"),2))}}},$ne={kernelName:li,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ke(2);return{a:()=>B(e,B(r,ye(n,a))),b:()=>B(e,B(r,ye(a,n)))}}},Dne={kernelName:Pr,gradFunc:e=>({x:()=>Ge(e)})},One={kernelName:ui,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=mt(n.shape,a.shape);return{a:()=>{let s=e,i=Bt(n.shape,r);return i.length>0&&(s=Se(s,i)),q(s,n.shape)},b:()=>{let s=e,i=Bt(a.shape,r);return i.length>0&&(s=Se(s,i)),q(St(s),a.shape)}}}},zne={kernelName:ii,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,r=a.shape.slice(),{axis:s}=n;ya(s,a.shape).forEach(l=>{r[l]=1});let i=q(e,r),o=B(i,jn(a.shape,"float32"));return{x:()=>o}}},_ne={kernelName:di,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>me(e,ot(dd(n)))}}},Pne={kernelName:pi,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(ye(ke(1),ot(n)),e)}}},Lne={kernelName:_r,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{reps:r}=n;return{x:()=>{let s=Ge(a);if(a.rank===1)for(let i=0;i{let a=n,{perm:r}=a,s=K1(r);return{x:()=>Qe(e,s)}}},Bne={kernelName:hl,gradFunc:(e,t,n)=>{let a=n,{axis:r}=a;return{value:()=>gn(e,r)}}},Vne={kernelName:qu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>jne(e,n)}}};function jne(e,t){let n=Xa(t,Ge(t)),a=Ti(e,n),r=qr(t,ke(0,"int32")),s=a.rank-r.rank;for(let o=0;o({x:()=>Ge(e)})},Hne=[d4,Hee,Gee,qee,Xee,Kee,Zee,Yee,Jee,Qee,ete,tte,rte,ote,lte,ute,dte,pte,cte,hte,fte,mte,yte,gte,bte,vte,wte,kte,Ite,Ste,cne,Nte,Tte,Cte,Ete,Rte,Fte,Mte,$te,Dte,Ote,zte,_te,Pte,Lte,Wte,Bte,Vte,jte,Gte,f4,f4,qte,Zte,Qte,ene,tne,nne,ane,rne,sne,ine,one,lne,une,m4,m4,dne,pne,hne,fne,mne,gne,yne,Ane,xne,bne,vne,wne,kne,Ine,Sne,Nne,Tne,Cne,Ene,Rne,g4,g4,y4,y4,Mne,$ne,Fne,Dne,One,zne,_ne,Pne,Lne,Wne,Bne,Vne,Une];for(let e of Hne)Ab(e);var A4={};Fe(A4,{maxNorm:()=>Kne,minMaxNorm:()=>Jne,nonNeg:()=>Yne,unitNorm:()=>Zne});var ry;function jt(){return ry==null&&(ry=h3().epsilon()),ry}function Ra(){return"channelsLast"}var vr=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,vr.prototype)}},Ma=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,Ma.prototype)}},U=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,U.prototype)}},_e=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,_e.prototype)}},x4=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,x4.prototype)}};function Bi(e,t){if(Array.isArray(e)){let n=[];for(let a=0;an.toUpperCase())}var ba={};function sy(e){if(e==null)return null;let t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function iy(e){if(!(e==null||typeof e!="object"))if(Array.isArray(e))e.forEach(t=>iy(t));else{let t=Object.keys(e);for(let n of t){let a=e[n];a!=null&&typeof a=="object"&&(!Array.isArray(a)&&a.type==="ndarray"&&typeof a.value=="number"?e[n]=a.value:iy(a))}}}function Vd(e,t={},n={},a="object",r=!1){if(typeof e=="string"){let s=e,i;if(s in n)i=n[s];else if(s in ba)i=ba[s];else if(i=t[s],i==null)throw new U(`Unknown ${a}: ${e}. This may be due to one of the following reasons: 1. The ${a} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. 2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}else{let s=e;if(s.className==null||s.config==null)throw new U(`${a}: Improper config format: ${JSON.stringify(s)}. -'className' and 'config' must set.`);let i=s.className,o,u;if(i in n?[o,u]=n[i]:i in ba?[o,u]=ba.className:i in t&&([o,u]=t[i]),o==null)throw new U(`Unknown ${a}: ${i}. This may be due to one of the following reasons: +'className' and 'config' must set.`);let i=s.className,o,l;if(i in n?[o,l]=n[i]:i in ba?[o,l]=ba.className:i in t&&([o,l]=t[i]),o==null)throw new U(`Unknown ${a}: ${i}. This may be due to one of the following reasons: 1. The ${a} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. -2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(u!=null){let l={};for(let h of Object.keys(ba))l[h]=ba[h];for(let h of Object.keys(n))l[h]=n[h];let d=s.config;d.customObjects=l;let p=Object.assign({},ba);for(let h of Object.keys(n))ba[h]=n[h];iy(s.config);let c=u(o,s.config,n,r);return ba=Object.assign({},p),c}else{let l=Object.assign({},ba);for(let p of Object.keys(n))ba[p]=n[p];let d=new o(s.config);return ba=Object.assign({},l),d}}}function Hne(e,t){return et?1:0}function r0(e,t){return-1*Hne(e,t)}function es(e){if(e==null)return e;let t=[];for(let n of e)t.indexOf(n)===-1&&t.push(n);return t}function Gne(e){if(e==null)throw new U(`Invalid value in obj: ${JSON.stringify(e)}`);for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function ji(e,t,n){if(n!=null&&e.indexOf(n)<0)throw new U(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function oy(e,t,n=0,a=Infinity){return Qa(n>=0),Qa(a>=n),Array.isArray(e)&&e.length>=n&&e.length<=a&&e.every(r=>typeof r===t)}function Jt(e,t){Array.isArray(e)?(k.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((n,a)=>Jt(n,`element ${a+1} of ${t}`))):k.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${b4(e)}.`)}function b4(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>b4(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function qne(e,t){let n=k.now(),a;return(...r)=>{let s=k.now();return s-nan(Se(B(e,e),t,!0)))}var jd=class extends re.Serializable{getConfig(){return{}}},uy=class extends jd{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return V(()=>{let t=ly(e,this.axis),n=Mn(t,0,this.maxValue);return B(e,me(n,ie(jt(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}};uy.className="MaxNorm";re.registerClass(uy);var dy=class extends jd{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return V(()=>me(e,ie(jt(),ly(e,this.axis))))}getConfig(){return{axis:this.axis}}};dy.className="UnitNorm";re.registerClass(dy);var py=class extends jd{apply(e){return Ka(e)}};py.className="NonNeg";re.registerClass(py);var cy=class extends jd{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return V(()=>{let t=ly(e,this.axis),n=ie(B(this.rate,Mn(t,this.minValue,this.maxValue)),B(1-this.rate,t));return B(e,me(n,ie(jt(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}};cy.className="MinMaxNorm";re.registerClass(cy);var w4={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Ut(e){return sy(e)}function k4(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"constraint")}function Ht(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in w4?w4[e]:e,config:{}};return k4(t)}else return e instanceof jd?e:k4(e)}function Xne(e){return new uy(e)}function Kne(e){return new dy(e)}function Zne(){return new py}function Yne(e){return new cy(e)}var I4={};Fe(I4,{constant:()=>bae,glorotNormal:()=>Tae,glorotUniform:()=>Nae,heNormal:()=>Cae,heUniform:()=>Eae,identity:()=>Iae,leCunNormal:()=>Rae,leCunUniform:()=>Mae,ones:()=>xae,orthogonal:()=>Fae,randomNormal:()=>wae,randomUniform:()=>vae,truncatedNormal:()=>kae,varianceScaling:()=>Sae,zeros:()=>Aae});var Jne=["channelsFirst","channelsLast"],Qne=["nearest","bilinear"],eae=["valid","same","causal"],tae=["max","avg"],nae=["sum","mul","concat","ave"],Jl=new Map;function Ft(e){ji(Jne,"DataFormat",e)}function aae(e){ji(Qne,"InterpolationFormat",e)}function ca(e){ji(eae,"PaddingMode",e)}function S4(e){ji(tae,"PoolMode",e)}var Ud=[],N4="/";function Ui(e,t){Ud.push(e);try{let n=t();return Ud.pop(),n}catch(n){throw Ud.pop(),n}}function rae(){return Ud.length===0?"":Ud.join(N4)+N4}function T4(e){if(!E4(e))throw new Error("Not a valid tensor name: '"+e+"'");return rae()+e}function C4(e){if(!E4(e))throw new Error("Not a valid tensor name: '"+e+"'");Jl.has(e)||Jl.set(e,0);let t=Jl.get(e);if(Jl.set(e,Jl.get(e)+1),t>0){let n=`${e}_${t}`;return Jl.set(n,1),n}else return e}var sae=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function E4(e){return!!e.match(sae)}function iae(e){return e===parseInt(e.toString(),10)}function ts(e,t,n){t==null&&(t=0),n==null&&(n=e.length);let a=1;for(let r=t;rt&&(t=a)}return t}function Fa(e,t){if(t{if(e.shape.length!==2)throw new U(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);let n=Gd(e,1);return my(n,[1,t,1])})}function lae(e){let t=[ts(e.shape)];return e.reshape(t)}function uae(e){if(e.rank<=1)throw new U(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);let t=[e.shape[0],ts(e.shape,1)];return e.reshape(t)}function Hi(e,t,n){return V(()=>{switch(e.rank){case 1:return dh(e,t,n);case 2:return sg(e,[t,0],[n,e.shape[1]]);case 3:return ph(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Ad(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Re(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Re(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new U(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function hy(e,t,n){return V(()=>{switch(e.rank){case 1:return dh(e,t,n);case 2:return sg(e,[0,t],[e.shape[0],n]);case 3:return ph(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Ad(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new U(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function s0(e,t,n,a){return V(()=>{switch(e.rank){case 1:return dh(e,t,n);case 2:switch(a){case 1:return Hi(e,t,n);case 2:return hy(e,t,n);default:throw new U(`The axis is not within the rank of the tensor ${a}`)}case 3:switch(a){case 1:return Hi(e,t,n);case 2:return ph(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return hy(e,t,n);default:throw new U(`The axis is not within the rank of the tensor ${a}`)}case 4:switch(a){case 1:return Hi(e,t,n);case 2:return Ad(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Ad(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return hy(e,t,n);default:throw new U(`The axis is not within the rank of the tensor ${a}`)}default:throw new U(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function fy(e,t=-1){let n;return t<0&&(n=e[0].rank,n!==0?t=n:t=0),t===e[0].rank&&(t=-1),lt(e,t)}function R4(e,t){switch(e.rank){case 1:return x3([e,t]);case 2:return Nl([e,t],0);case 3:return b3([e,t],0);case 4:return v3([e,t],0);default:throw new U(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function my(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new U(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Gr(e,t)}function i0(e,t=0,n=1,a,r){return L3(e,t,n,a,r)}function er(e,t,n,a){if(e.rank<2||t.rank<2)throw new _e(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){let r=e.shape.slice(-1)[0],s=t.shape.slice(-2)[0];if(r!==s)throw new _e(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(e.rank===2&&t.rank===2){let r=!1,s=!1;return Kr.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:a?gy(e.rank,a,Ra()):null,activation:n})}else{let r=e.shape.slice(),s=r.pop();e=e.reshape([-1,s]);let i=t.shape.slice(),o=i.pop(),u=i.pop(),l=[...i,o],d=Array.from({length:t.rank},(m,f)=>f===0?t.rank-2:f<=t.rank-2?f-1:f);t=t.transpose(d).reshape([u,-1]);let p=[...r,...l],c=!1,h=!1;return Kr.matMul({a:e,b:t,transposeA:c,transposeB:h,bias:a?gy(e.rank,a,Ra()):null,activation:n}).reshape(p)}}function M4(e,t,n){return V(()=>(Array.isArray(t)?t=Dt(t,"int32"):t=t.toInt(),Ti(e,t,n)))}function qd(e){return B(e,e)}function gy(e,t,n){let a=t.shape;if(t.rank!==1&&t.rank!==e)throw new U(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(e===5){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1,1]):t.reshape([1,a[3],a[0],a[1],a[2]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===4){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1]):t.reshape([1,a[2],a[0],a[1]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===3){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1]):t.reshape([1,a[1],a[0]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,a[0]]):t.reshape([1].concat(a))}else if(e<3)return t;throw new U(`Unsupported input rank by biasAdd: ${t.rank}`)}function $a(e,t,n){return V(()=>(n==null&&(n=Ra()),Ft(n),e.add(gy(e.rank,t,n))))}function dae(e,t=1){if(t!==1)throw new _e(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return Cl(e)}function pae(e){return V(()=>me(e,Wt(e).add(1)))}function F4(e,t,n,a){return V(()=>G3(e,t,n,a))}function cae(e){return V(()=>{let t=ie(.5,B(.2,e));return Mn(t,0,1)})}function Xd(e,t,n=!1){return n?e():t()}var hae=["fanIn","fanOut","fanAvg"],fae=["normal","uniform","truncatedNormal"];function mae(e){ji(hae,"FanMode",e)}function gae(e){ji(fae,"Distribution",e)}var va=class extends re.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}},yy=class extends va{apply(e,t){return $t(e,t)}};yy.className="Zeros";re.registerClass(yy);var o0=class extends va{apply(e,t){return jn(e,t)}};o0.className="Ones";re.registerClass(o0);var Ay=class extends va{constructor(e){super();if(typeof e!="object")throw new U(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new U(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return V(()=>B(ke(this.value),jn(e,t)))}getConfig(){return{value:this.value}}};Ay.className="Constant";re.registerClass(Ay);var xy=class extends va{constructor(e){super();this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return Fl(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}};xy.className="RandomUniform";re.registerClass(xy);var by=class extends va{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new _e(`randomNormal does not support dType ${t}.`);return i0(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};by.className="RandomNormal";re.registerClass(by);var vy=class extends va{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new _e(`truncatedNormal does not support dType ${t}.`);return fh(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};vy.className="TruncatedNormal";re.registerClass(vy);var wy=class extends va{constructor(e){super();this.gain=e.gain!=null?e.gain:1}apply(e,t){return V(()=>{if(e.length!==2||e[0]!==e[1])throw new U("Identity matrix initializer can only be used for 2D square matrices.");return B(this.gain,H1(e[0]))})}getConfig(){return{gain:this.gain}}};wy.className="Identity";re.registerClass(wy);function yae(e,t="channelsLast"){let n,a;if(Ft(t),e.length===2)n=e[0],a=e[1];else if([3,4,5].indexOf(e.length)!==-1){if(t==="channelsFirst"){let r=ts(e,2);n=e[1]*r,a=e[0]*r}else if(t==="channelsLast"){let r=ts(e,0,e.length-2);n=e[e.length-2]*r,a=e[e.length-1]*r}}else{let r=ts(e);n=Math.sqrt(r),a=Math.sqrt(r)}return[n,a]}var Dn=class extends va{constructor(e){super();if(e.scale<0)throw new U(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,mae(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,gae(this.distribution),this.seed=e.seed}apply(e,t){let n=yae(e),a=n[0],r=n[1],s=this.scale;if(this.mode==="fanIn"?s/=Math.max(1,a):this.mode==="fanOut"?s/=Math.max(1,r):s/=Math.max(1,(a+r)/2),this.distribution==="normal"){let i=Math.sqrt(s);if(t=t||"float32",t!=="float32"&&t!=="int32")throw new _e(`${this.getClassName()} does not support dType ${t}.`);return fh(e,0,i,t,this.seed)}else{let i=Math.sqrt(3*s);return Fl(e,-i,i,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}};Dn.className="VarianceScaling";re.registerClass(Dn);var l0=class extends Dn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};l0.className="GlorotUniform";re.registerClass(l0);var u0=class extends Dn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};u0.className="GlorotNormal";re.registerClass(u0);var d0=class extends Dn{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};d0.className="HeNormal";re.registerClass(d0);var p0=class extends Dn{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};p0.className="HeUniform";re.registerClass(p0);var c0=class extends Dn{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};c0.className="LeCunNormal";re.registerClass(c0);var h0=class extends Dn{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};h0.className="LeCunNormal";re.registerClass(h0);var ky=class extends va{constructor(e){super();if(this.DEFAULT_GAIN=1,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,this.seed!=null)throw new _e("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return V(()=>{if(e.length<2)throw new _e("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);let n=e[0]>e[1]?[e[1],e[0]]:e,a=i0(n,0,1,"float32"),r=s7.gramSchmidt(a);return e[0]>e[1]&&(r=r.transpose()),B(this.gain,r)})}getConfig(){return{gain:this.gain,seed:this.seed}}};ky.className="Orthogonal";re.registerClass(ky);var $4={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function D4(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"initializer")}function Tt(e){return sy(e)}function bt(e){if(typeof e=="string"){let t=e in $4?$4[e]:e;if(t==="GlorotNormal")return new u0;if(t==="GlorotUniform")return new l0;if(t==="HeNormal")return new d0;if(t==="HeUniform")return new p0;if(t==="LeCunNormal")return new c0;if(t==="LeCunUniform")return new h0;{let n={};return n.className=t,n.config={},D4(n)}}else return e instanceof va?e:D4(e)}function Aae(){return new yy}function xae(){return new o0}function bae(e){return new Ay(e)}function vae(e){return new xy(e)}function wae(e){return new by(e)}function kae(e){return new vy(e)}function Iae(e){return new wy(e)}function Sae(e){return new Dn(e)}function Nae(e){return new l0(e)}function Tae(e){return new u0(e)}function Cae(e){return new d0(e)}function Eae(e){return new p0(e)}function Rae(e){return new c0(e)}function Mae(e){return new h0(e)}function Fae(e){return new ky(e)}var O4={};Fe(O4,{Layer:()=>Xe,RNN:()=>ar,RNNCell:()=>ap,activation:()=>fse,add:()=>kse,alphaDropout:()=>iie,average:()=>Ise,averagePooling1d:()=>BA,averagePooling2d:()=>VA,averagePooling3d:()=>jA,avgPool1d:()=>$se,avgPool2d:()=>Ose,avgPool3d:()=>_se,avgPooling1d:()=>Dse,avgPooling2d:()=>zse,avgPooling3d:()=>Pse,batchNormalization:()=>Rse,bidirectional:()=>Jse,concatenate:()=>Sse,conv1d:()=>sse,conv2d:()=>ise,conv2dTranspose:()=>ose,conv3d:()=>lse,conv3dTranspose:()=>use,convLstm2d:()=>Xse,convLstm2dCell:()=>Kse,cropping2D:()=>pse,dense:()=>mse,depthwiseConv2d:()=>hse,dot:()=>Ese,dropout:()=>gse,elu:()=>Qre,embedding:()=>wse,flatten:()=>Ase,gaussianDropout:()=>sie,gaussianNoise:()=>rie,globalAveragePooling1d:()=>Lse,globalAveragePooling2d:()=>Wse,globalMaxPool1d:()=>eie,globalMaxPool2d:()=>tie,globalMaxPooling1d:()=>U8,globalMaxPooling2d:()=>H8,gru:()=>Vse,gruCell:()=>jse,input:()=>f8,inputLayer:()=>Jre,layerNormalization:()=>Mse,leakyReLU:()=>tse,lstm:()=>Use,lstmCell:()=>Hse,masking:()=>oie,maxPool1d:()=>nie,maxPool2d:()=>aie,maxPooling1d:()=>G8,maxPooling2d:()=>q8,maxPooling3d:()=>Bse,maximum:()=>Nse,minimum:()=>Tse,multiply:()=>Cse,permute:()=>vse,prelu:()=>nse,reLU:()=>ese,repeatVector:()=>xse,reshape:()=>bse,rnn:()=>Zse,separableConv2d:()=>dse,simpleRNN:()=>Gse,simpleRNNCell:()=>qse,softmax:()=>ase,spatialDropout1d:()=>yse,stackedRNNCells:()=>Yse,thresholdedReLU:()=>rse,timeDistributed:()=>Qse,upSampling2d:()=>cse,zeroPadding2d:()=>Fse});var $ae=0;function z4(){return $ae++}var f0={};function m0(e=""){return e in f0||(f0[e]=0),f0[e]+=1,e+f0[e].toString()}function Iy(e){return Array.isArray(e)&&Array.isArray(e[0])}function g0(e){return e.length===0?[]:Array.isArray(e[0])?e:[e]}function Le(e){let t;if(Array.isArray(e)){if(e.length!==1)throw new U(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function st(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(e.length===1)return e=e,e[0];throw new U(`Expected exactly 1 Shape; got ${e.length}`)}else return e}function y0(e){let t=0;for(let n of e)n.shape.length===0?t+=1:t+=n.shape.reduce((a,r)=>a*r);return t}var _4="Variable",P4=class{constructor(e,t="float32",n=_4,a=!0,r=null){this.dtype=t==null?"float32":t,this.shape=e.shape,this.id=z4(),n=n==null?_4:n,this.originalName=T4(n),this.name=C4(this.originalName),this.trainable_=a,this.constraint=r,this.val=B3(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),Dae(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}};function Dae(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}function Sy(e){return e.map(t=>t.read())}function Ny(e){e.forEach(t=>{t[0].write(t[1])})}var zt=class{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}},Da=class{constructor(e,t,n,a,r,s,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=a,this.callArgs=r,this.outputTensorIndex=i,this.id=z4(),s!=null&&(this.originalName=T4(s),this.name=C4(this.originalName)),this.rank=t.length}},Oae=0,A0=class{constructor(e,t){this.callArgs=t,this.id=Oae++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(let n of e.inboundLayers)n!=null&&n.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){let e=[];for(let t of this.inboundLayers)t!=null?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}},zae=0,Xe=class extends re.Serializable{constructor(e={}){super();this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=zae++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){let n=this.getClassName();t=wr(n)+"_"+m0(n)}if(this.name=t,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let n;if(e.batchInputShape!=null)n=e.batchInputShape;else if(e.inputShape!=null){let r=null;e.batchSize!=null&&(r=e.batchSize),n=[r].concat(e.inputShape)}this.batchInputShape=n;let a=e.dtype;a==null&&(a=e.inputDType),a==null&&(a="float32"),this.dtype=a}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(this.inboundNodes.length===0)throw new Ma(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new U(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return $n(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return $n(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new vr(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new vr(`Layer ${this.name} is not connected, no input to return.`);return $n(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new vr(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new vr(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return $n(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=yt(e),this.inputSpec==null||this.inputSpec.length===0)return;let t=yt(this.inputSpec);if(e.length!==t.length)throw new U(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;nr.maxNDim)throw new U(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(r.minNDim!=null&&s=0?i[u]:i[i.length+u];if(l!=null&&[l,null].indexOf(d)===-1)throw new U(`Input ${n} is incompatible with layer ${this.name}: expected axis ${u} of input shape to have value ${l} but got shape ${i}.`)}}if(r.shape!=null)for(let i=0;i{if(!this.built){this.assertInputCompatibility(e);let s=[];for(let i of yt(e))s.push(i.shape);this.build($n(s)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t),i=yt(s),o=[];for(let u of i)n.indexOf(u)!==-1&&(u=u.clone()),o.push(u);if(s=$n(o),this.activityRegularizer!=null)throw new _e("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}else{let s=_ae(e),i=this.computeOutputShape(s),o,u=Pae(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?s[0]:s),i!=null&&i.length>0&&Array.isArray(i[0])?o=i.map((l,d)=>new Da(u,l,this,yt(e),t,this.name,d)):o=new Da(u,i,this,yt(e),t,this.name),this.addInboundNode(e,o,null,null,s,i,t),this._refCount++,this.activityRegularizer!=null)throw new _e("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,a)=>{n!=null&&e[a]!=null&&e[a]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new vr(`The layer ${this.name} has never been called and thus has no defined output shape.`);let e=[];for(let t of this.inboundNodes){let n=JSON.stringify(t.outputShapes);e.indexOf(n)===-1&&e.push(n)}if(e.length===1){let t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&t.length===1?t[0]:t}else throw new vr(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new Ma(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return y0(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Sy(e?this.trainableWeights:this.weights)}setWeights(e){V(()=>{let t=this.weights;if(t.length!==e.length)throw new U(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(t.length===0)return;let n=[],a=Sy(t);for(let r=0;rr.apply(u.read())),s==null&&(s=!0),s?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=yt(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(t!=null)if(Array.isArray(t))t.forEach(n=>{if(n!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return t}addInboundNode(e,t,n,a,r,s,i=null){let o=yt(e);t=yt(t),n=yt(n),a=yt(a),r=g0(r),s=g0(s);let u=[],l=[],d=[];for(let p of o)u.push(p.sourceLayer),l.push(p.nodeIndex),d.push(p.tensorIndex);new A0({outboundLayer:this,inboundLayers:u,nodeIndices:l,tensorIndices:d,inputTensors:o,outputTensors:t,inputMasks:n,outputMasks:a,inputShapes:r,outputShapes:s},i);for(let p=0;pe.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount==0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}};function _ae(e){e=yt(e);let t=[];for(let n of e)t.push(n.shape);return $n(t)}function Pae(e){return"float32"}function L4(e,t,n){if((t==null||n!=null&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),t.inboundNodes.length===0)return[e];{let a=t.inboundNodes[n];if(a.inboundLayers.length===0)return a.inputTensors;{let r=[];for(let s=0;s0){let r=await Promise.all(t);for(let s=0;sie(this.totals[a],B(r,n)));this.totals[a]=i,s!=null&&s.dispose()}}}async onEpochEnd(e,t){if(t!=null)for(let n of this.params.metrics)this.totals[n]!=null&&(typeof this.totals[n]=="number"?t[n]=this.totals[n]/this.seen:V(()=>{let a=B(me(1,this.seen),this.totals[n]);t[n]=a,this.totals[n].dispose(),Kt(t[n])}))}},U4=class extends tu{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){t==null&&(t={}),this.epoch.push(e);for(let n in t)this.history[n]==null&&(this.history[n]=[]),this.history[n].push(t[n])}async syncData(){let e=[],t=[],n=[];for(let r in this.history){let s=this.history[r];for(let i=0;inew H4(n,t))}var wa=class{constructor(){}static registerCallbackConstructor(e,t){k.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),wa.checkForDuplicate(t),wa.constructors[e]==null&&(wa.constructors[e]=[]),wa.constructors[e].push(t)}static checkForDuplicate(e){for(let t in wa.constructors)wa.constructors[+t].forEach(n=>{if(n===e)throw new U("Duplicate callback constructor.")})}static clear(){wa.constructors={}}static createCallbacks(e){let t=[];for(let n in wa.constructors){let a=+n;e>=a&&t.push(...wa.constructors[a])}return t.map(n=>new n)}};wa.constructors={};function q4(e,t,n,a,r,s,i,o,u){let l=new U4,d=[new Wae,...wa.createCallbacks(t)];e!=null&&d.push(...e),d.push(l);let p=new j4(d);return p.setParams({epochs:n,initialEpoch:a,samples:r,steps:s,batchSize:i,verbose:t,doValidation:o,metrics:u}),{callbackList:p,history:l}}function Oa(e,t={},n=!1){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"layer",n)}function x0(e,t){return V(()=>{e.dtype!=="float32"&&(e=e.asType("float32"));let n=Se(qd(e),t,!0),a=El(n.shape,jt()),r=an(Xa(n,a));return me(e,r)})}function Gi(e,t){return V(()=>Nt(qd(ye(t,e)),-1))}function b0(e,t){return V(()=>Nt(Wt(ye(t,e)),-1))}function nu(e,t){return V(()=>{let n=ye(e,t),a=Mn(Wt(e),jt(),Number.MAX_VALUE),r=Wt(me(n,a));return B(100,Nt(r,-1))})}function Bae(e,t){return V(()=>{let n=Mn(t,jt(),Number.MAX_VALUE),a=Bn(ie(1,n)),r=Mn(e,jt(),Number.MAX_VALUE),s=Bn(ie(1,r));return Nt(qd(ye(a,s)),-1)})}function Vae(e,t){return V(()=>{let n=Xa(0,ye(1,B(e,t)));return Nt(qd(n),-1)})}function jae(e,t){return V(()=>{let n=Xa(0,ye(1,B(e,t)));return Nt(n,-1)})}function Uae(e,t){return V(()=>{let n=Se(B(e,t),-1),a=Vn(B(ye(1,e),t),-1);return Xa(0,ie(1,ye(a,n)))})}function Hae(e,t){return V(()=>{let n=Math.log(2),a=ye(t,e),r=ye(ie(a,Ci(B(-2,a))),n);return Nt(r,-1)})}function Kd(e,t,n=!1){return V(()=>{if(n)t=xd(t);else{let a=Se(t,t.shape.length-1,!0);t=me(t,a)}return t=Mn(t,jt(),1-jt()),St(Se(B(e.toFloat(),Bn(t)),t.shape.length-1))})}function v0(e,t,n=!1){return V(()=>{let a=Rl(lae(e)).toInt();t=Mn(t,jt(),1-jt());let r=t.shape,s=vl(a,r[r.length-1]).reshape(r);return Kd(s,t,n)})}function Gae(e,t){if(!k.arraysEqual(e.shape,t.shape))throw new U(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return V(()=>{let n=t.relu(),a=t.abs().neg();return n.sub(t.mul(e)).add(a.exp().log1p())})}function w0(e,t){return V(()=>{let n;return n=Mn(t,jt(),1-jt()),n=Bn(me(n,ye(1,n))),Nt(Gae(e,n),-1)})}function qae(e,t){return V(()=>{let n=Mn(e,jt(),1),a=Mn(t,jt(),1);return Se(B(e,Bn(me(n,a))),-1)})}function Xae(e,t){return V(()=>{let n=Bn(ie(jt(),t));return Nt(ye(t,B(e,n)),-1)})}function Ty(e,t){return V(()=>{let n=x0(e,-1),a=x0(t,-1),r=B(n,a);return St(Se(r,-1))})}var k0={meanSquaredError:Gi,meanAbsoluteError:b0,meanAbsolutePercentageError:nu,meanSquaredLogarithmicError:Bae,squaredHinge:Vae,hinge:jae,categoricalHinge:Uae,logcosh:Hae,categoricalCrossentropy:Kd,sparseCategoricalCrossentropy:v0,binaryCrossentropy:w0,kullbackLeiblerDivergence:qae,poisson:Xae,cosineProximity:Ty};function Cy(e){if(typeof e=="string"){if(e in k0)return k0[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new U(t)}else return e}function Ey(e,t){return V(()=>{let n=B(.5,Un(t)),a=Hd(Wn(t,n),e.dtype);return Nt(Hr(e,a),-1)})}function Ry(e,t){return V(()=>Hd(Hr(ki(e,-1),ki(t,-1)),"float32"))}function X4(e,t){return V(()=>xa(e.equal(1),t.equal(1)).sum().cast("float32"))}function Kae(e,t){return V(()=>xa(e.equal(1),t.equal(0)).sum().cast("float32"))}function Zae(e,t){return V(()=>xa(e.equal(0),t.equal(1)).sum().cast("float32"))}function K4(e,t){return V(()=>{let n=X4(e,t),a=Zae(e,t),r=n.add(a);return un(Wn(r,0),n.div(r),0).cast("float32")})}function Yae(e,t){return V(()=>{let n=X4(e,t),a=Kae(e,t),r=n.add(a);return un(Wn(r,0),n.div(r),0).cast("float32")})}function Z4(e,t){return w0(e,t)}function Y4(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),t=t.argMax(-1),t.dtype!==e.dtype&&(t=t.asType(e.dtype)),Hr(e,t).asType("float32")}var Jae=Gi,Qae=Gi,ere=b0,tre=b0,nre=nu,are=nu,My=Kd,rre=Ty,J4=v0,I0={binaryAccuracy:Ey,categoricalAccuracy:Ry,precision:K4,categoricalCrossentropy:My,sparseCategoricalCrossentropy:J4,mse:Jae,MSE:Qae,mae:ere,MAE:tre,mape:nre,MAPE:are,cosine:rre};function sre(e){if(typeof e=="string"&&e in I0)return I0[e];if(typeof e!="string"&&e!=null)return e;throw new U(`Unknown metric ${e}`)}function S0(e){if(Qa(e!==null,`Unknown LossOrMetricFn ${e}`),typeof e=="string")return e;{let t;for(let n of Object.keys(k0))if(k0[n]===e){t=n;break}if(t!==void 0)return t;for(let n of Object.keys(I0))if(I0[n]===e){t=n;break}return t!==void 0?t:e.name}}function ire(e){let t={Adagrad:()=>Fi.adagrad(.01),Adadelta:()=>Fi.adadelta(1,.95,jt()),Adam:()=>Fi.adam(.001,.9,.999,jt()),Adamax:()=>Fi.adamax(.002,.9,.999,jt(),0),RMSProp:()=>Fi.rmsprop(.001,.9,0,jt()),SGD:()=>Fi.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new U(`Unknown Optimizer ${e}`)}var Q4=1*1024*1024;function e8(e,t,n=!1){if(e==null||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype||!Fy(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){let a=JSON.stringify(e);a.length>Q4&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${a.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${Q4}.`)}}function Fy(e){if(e===null)return!0;if(typeof e=="object")if(Object.getPrototypeOf(e)===Object.prototype){let t=Object.keys(e);for(let n of t)if(typeof n!="string"||!Fy(e[n]))return!1;return!0}else if(Array.isArray(e)){for(let t of e)if(!Fy(t))return!1;return!0}else return!1;else{let t=typeof e;return t==="string"||t==="number"||t==="boolean"}}function ore(e,t,n,a=console.log){let r=ure(e),s=["Layer (type)","Output shape","Param #"];r?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(d=>Math.floor(t*d)));let i;if(!r){s.push("Receives inputs"),i=[];for(let d in e.nodesByDepth)i.push(...e.nodesByDepth[d])}a("_".repeat(t)),N0(s,n,a),a("=".repeat(t));let o=e.layers;for(let d=0;d1||r.length===1&&r[0].inboundLayers.length>1){t=!1;break}a.push(...r)}if(t)for(let r of e.layers){let s=!1;for(let i of r.inboundNodes)if(a.indexOf(i)!==-1)if(s){t=!1;break}else s=!0;if(!t)break}return t}function N0(e,t,n=console.log){let a="";for(let r=0;r0&&(a=a.slice(0,a.length-1)+" "),a+=e[r],a=a.slice(0,t[r]),a+=" ".repeat(t[r]-a.length);n(a)}function dre(e,t,n){let a;try{a=JSON.stringify(e.outputShape)}catch(o){a="multiple"}let r=e.name,s=e.getClassName(),i=[`${r} (${s})`,a,e.countParams().toString()];N0(i,t,n)}function pre(e,t,n,a){let r;try{r=JSON.stringify(e.outputShape)}catch(d){r="multiple"}let s=[];for(let d of e.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(d)===-1))for(let p=0;pm.name),u=[],l=t.names();for(let m of o)l.indexOf(m)!==-1?u.push(t.getValue(m)):u.push(null);a!=null&&(a.maxNumTensors=-Infinity,a.minNumTensors=Infinity);let d=o.join(",")+"|"+t.names().join(","),p,c;if(Oy[d]==null){let m=hre(i,t);p=m.sorted,c=m.recipientCounts,Oy[d]=p,n8[d]=c}p=Oy[d],c={},r||Object.assign(c,n8[d]);let h=new qi(t);for(let m=0;ma.maxNumTensors&&(a.maxNumTensors=E),E0,()=>"Expected at least one fetch, got none");let n=[],a={};if(e.length===1){let r=a8(e[0],t);n=r.sorted,a=r.recipientMap}else{let r=new Set;for(let s of e){let{sorted:i,recipientMap:o}=a8(s,t);for(let u of i)r.has(u.name)||(n.push(u),r.add(u.name));for(let u in o)a[u]==null&&(a[u]=new Set),o[u].forEach(l=>a[u].add(l))}}return{sorted:n,recipientCounts:fre(a)}}function fre(e){let t={};for(let n in e)t[n]=e[n].size;return t}function a8(e,t){let n=new Set,a=[],r={};for(let o of t.names())n.add(o);let s=[],i=[];for(s.push(e);s.length>0;){let o=s[s.length-1];if(n.has(o.name)){s.pop();continue}let u=i[i.length-1]===s.length-1;if(o.inputs.length===0||u)s.pop(),a.push(o),n.add(o.name),u&&i.pop();else{i.push(s.length-1);for(let l of o.inputs)r[l.name]==null&&(r[l.name]=new Set),r[l.name].add(o.name),!n.has(l.name)&&s.push(l)}}return{sorted:a,recipientMap:r}}function mre(e){let t;if(e.sourceLayer.inboundNodes.length===1)t=e.sourceLayer.output;else{let n=null;for(let a=0;ay.name)}`);es(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(y=>y.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(let y of this.outputs){let A=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;this.outputLayers.push(A),this.outputLayersNodeIndices.push(x),this.outputLayersTensorIndices.push(v)}for(let y of this.inputs){let A=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;Qa(x===0,"input layer has >1 nodes"),Qa(v===0,"input layer has >1 tensors"),this.inputLayers.push(A),this.inputLayersNodeIndices.push(x),this.inputLayersTensorIndices.push(v)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let y=0;yy.shape),this.internalOutputShapes=this.outputs.map(y=>y.shape);let t={},n={},a={},r={},s={},i=[],o=(y,A,x,v,b,w)=>{(v==null||b==null||w==null)&&(v=y.sourceLayer,b=y.nodeIndex,w=y.tensorIndex);let N=v.inboundNodes[b];if(x.indexOf(N)!==-1)throw new Ma(`The tensor ${y.name} at layer "${v.name}" is part of a cycle.`);if(A.indexOf(N)!==-1)return;this.containerNodes.add(tr.nodeKey(v,b)),v.id in s||(s[v.id]=Object.keys(s).length),x.indexOf(N)===-1&&x.push(N);let C=N.inboundLayers.length;for(let E=0;E=0;)x.splice(x.indexOf(N),1);i.push(N)},u=[],l=[];for(let y of this.outputs)o(y,u,l);let d=i.slice().reverse();for(let y of d){n[y.id]=y,y.id in t||(t[y.id]=0);let A=t[y.id],x=a[y.outboundLayer.id]==null?0:a[y.outboundLayer.id];A=Math.max(A,x),a[y.outboundLayer.id]=A,r[y.outboundLayer.id]=y.outboundLayer,t[y.id]=A;for(let v=0;vparseInt(y,10)).sort(r0);this.layers=[];for(let y of h){let A=c[y];A.sort((x,v)=>{let b=s[x.id],w=s[v.id];return bw?1:0});for(let x of A)x instanceof tr&&this.internalContainerRefs.push(x),this.layers.push(x)}this.layersByDepth=c,h=Object.keys(p).map(y=>parseInt(y,10)).sort(r0);let m=this.inputs.slice(),f=[];for(let y of h)for(let A of p[y]){let x=A.outboundLayer;if(x!=null){for(let v of A.inputTensors)if(m.indexOf(v)===-1)throw new Ma(`Graph disconnected: cannot obtain value for tensor ${v} at layer "${x.name}". The following previous layers were accessed without issue: ${f}`);for(let v of A.outputTensors)m.push(v);f.push(x.name)}}this.nodesByDepth=p;let g=this.layers.map(y=>y.name);for(let y of g){let A=g.filter(x=>x===y).length;if(A!==1)throw new Ma(`The name "${y}" is used ${A} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new A0({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(y=>null),outputMasks:this.outputs.map(y=>null),inputShapes:this.inputs.map(y=>y.shape),outputShapes:this.outputs.map(y=>y.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();let e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount==0){for(let t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(let t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(n=>n.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new U("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(let t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.layers)t.push(...n.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){let n={},a=0;for(let s of this.layers)for(let i of s.weights){if(n[i.originalName]!=null)throw new U(`Duplicate weight name: ${i.originalName}`);n[i.originalName]=i,a++}let r=[];for(let s in e){let i=s;if(n[s]==null){let o=s.split("/");i=o.slice(0,-2).concat([o[o.length-1]]).join("/")}if(n[i]!=null)r.push([n[i],e[s]]);else if(t)throw new U(`Provided weight data has no target variable: ${s}`);delete n[i]}if(t){let s=[];for(let i in n)s.push(i);if(s.length>0)throw new U(`${s.length} of ${a} weights are not set: ${s}`)}Ny(r)}updatedConfig(){let e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${Dy}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){let n=$y(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return V(()=>{e=yt(e);let n=new qi;for(let a=0;a{e=yt(e);let n;return t==null?n=Bi(null,e.length):n=yt(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){let t=g0(e);if(t.length!==this.inputLayers.length)throw new U(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);let n={};for(let i=0;iparseInt(i,10)).sort(r0);if(a.length>1)for(let i of a){let o=this.nodesByDepth[i];for(let u of o){let l=u.outboundLayer;if(this.inputLayers.map(m=>m.id).indexOf(l.id)!==-1)continue;let d=[];for(let m=0;mparseInt(o,10)).sort(r0);for(let o of a){let u=this.nodesByDepth[o];for(let l of u){let d=l.outboundLayer,p=l.inputTensors,c=l.outputTensors,h=new Array;for(let m of p)m.id in n&&h.push(n[m.id]);if(h.length===p.length){let m={},f,g,y,A;if(l.callArgs!=null&&(m=l.callArgs),h.length===1){let[x,v]=h[0];m.mask==null&&(m.mask=v),y=yt(d.call(x,m)),A=yt(d.computeMask(x,v)),f=[x],g=[v]}else f=h.map(x=>x[0]),g=h.map(x=>x[1]),m.mask==null&&(m.mask=g),y=yt(d.call(f,m)),A=yt(d.computeMask(f,g));if(d.activityRegularizer)throw new _e("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let x=0;x{let e=[];for(let t of this.layers)for(let n=0;n0){let m=[];for(let f=0;f0&&f.apply($n(y),A)}function u(f){let g=f.name,y=Oa(f,t.customObjects!=null?t.customObjects:{});y.setFastWeightInitDuringBuild(a),r[g]=y,f.inboundNodes.forEach(A=>{if(!(A instanceof Array))throw new U(`Corrupted configuration, expected array for nodeData: ${A}`);i(y,A)})}let l=t.name,d=t.layers;for(let f of d)u(f);for(;!Gne(s);)for(let f of d){let g=r[f.name];if(g.name in s){let y=s[g.name];delete s[g.name];for(let A of y)o(g,A)}}let p=[],c=[],h=t.inputLayers;for(let f of h){let g=f[0],y=f[1],A=f[2];Qa(g in r);let x=r[g].inboundNodes[y].outputTensors;p.push(x[A])}let m=t.outputLayers;for(let f of m){let g=f[0],y=f[1],A=f[2];Qa(g in r);let x=r[g].inboundNodes[y].outputTensors;c.push(x[A])}return new e({inputs:p,outputs:c,name:l})}get stateful(){if(this._stateful)throw new U("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(let e of this.layers)if(e.stateful)return!0;return!1}resetStates(){V(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}};function gre(e,t,n){let a=t.length;if(e==null||Array.isArray(e)&&e.length===0)return t.map(r=>null);if(a===1)return Array.isArray(e)&&e.length===1?e:typeof e=="object"&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==a)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${a} outputs. Make sure a set of weights is provided for each model output.`);return e}else if(typeof e=="object"&&Object.keys(e).length>0&&typeof e[Object.keys(e)[0]]=="object"){let r=[];return t.forEach(s=>{s in e?r.push(e[s]):r.push(null)}),r}else throw new Error(`The model has multiple (${a}) outputs, so ${n} must be either an array with ${a} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function r8(e,t){return gre(e,t,"classWeight")}async function s8(e,t,n,a){if(t!=null||a!=null)throw new Error("Support sampleWeight is not implemented yet");if(n!=null){let r=V(()=>{if(e.shape.length===1)return e.clone();if(e.shape.length===2)if(e.shape[1]>1){let o=1;return e.argMax(o)}else{if(e.shape[1]===1)return e.reshape([e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),s=Array.from(await r.data());he(r);let i=[];return s.forEach(o=>{if(n[o]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${o} exists in the data but not in classWeight`);i.push(n[o])}),Dt(i,"float32")}else return null}function yre(e,t){return B(e,t)}var Are=32;function i8(e,t){let n,a,r=t;n=r.xs,a=r.ys,k.assert(n!=null&&a!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);let s=o8("input",e.inputNames,n),i=o8("output",e.outputNames,a),o=s[0].shape[0];k.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),k.assert(i.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let u=0;u`Batch size mismatch: input ${e.inputNames[u]} has ${s[u].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);for(let u=0;u`Batch size mismatch: output ${e.outputNames[u]} has ${i[u].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);return{xs:s,ys:i}}function o8(e,t,n){if(n instanceof Be)return[n];if(Array.isArray(n))return k.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{let a=[];for(let r of t){if(n[r]==null)throw new U(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);a.push(n[r])}return a}}function xre(e){if(e.length===3)throw new _e("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}async function bre(e,t,n){let a=n.batchesPerEpoch!=null;if(k.assert(e.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),k.assert(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),k.assert(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),k.assert(!a||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),k.assert(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{let r=n.validationData!=null,s,i;if(r)if(l8(n.validationData))k.assert(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{let g=xre(n.validationData);s=g.xs,i=g.ys}let o=e.makeTrainFunction(),u=e.getDedupedMetricsNames(),l;r?l=u.slice().concat(u.map(g=>"val_"+g)):l=u.slice();let d=G4(n.callbacks,n.yieldEvery),p=n.verbose==null?1:n.verbose,{callbackList:c,history:h}=q4(d,p,n.epochs,null,null,vre(t,n),null,r,l);c.setModel(e),e.history=h,await c.onTrainBegin(),e.stopTraining_=!1;let m=n.initialEpoch==null?0:n.initialEpoch,f=await t.iterator();for(;m=n.batchesPerEpoch:x.done){if(r){let v;l8(n.validationData)?v=yt(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):v=yt(e.evaluate(s,i,{batchSize:n.validationBatchSize==null?Are:n.validationBatchSize,verbose:0}));for(let b=0;b0)throw new _e("Verbose mode is not implemented yet.");k.assert(!a||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);let i=wre(t)?t:await t.iterator(),o=0,u=0;for(;a?u{if(l.value){let{xs:d,ys:p}=i8(e,l.value),c=d.concat(p),h=V(()=>r(c));if(he(c),u===0)for(let f=0;fie(s[f],B(m,g))),u>0&&he(y)}he(h),o+=m,++u}return s}),l.done){a&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let l=0;l0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function Jd(e,t,n){return e==null?[null]:Array.isArray(e)?e.map(a=>Hi(a,t,n-t)):Hi(e,t,n-t)}function _y(e,t){return V(()=>e==null?null:Array.isArray(e)?e.map(n=>_y(n,t)):M4(e,t.dtype==="int32"?t:t.toInt()))}function Py(e,t){let n=[],a=0,r=null;for(;a=e&&(r=e),n.push([a,r]),a=r;return n}async function Ire(e,t,n,a,r,s,i,o,u,l,d,p,c,h,m){r==null&&(r=32),s==null&&(s=1),d==null&&(d=!0),c==null&&(c=0);let f=!1;if(u!=null&&l!=null&&(f=!0),m!=null&&(f=!0,h==null))throw new U("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");let g=e.checkNumSamples(n,r,h,"steps_per_epoch"),y;g!=null&&(y=Fa(0,g)),i==null&&(i=1);let{callbackList:A,history:x}=q4(o,i,s,c,g,h,r,f,p);A.setModel(e),e.history=x,await A.onTrainBegin(),e.stopTraining_=!1;for(let v=c;v{let _=N[C][0],$=N[C][1],S=Hi(w,_,$-_);E.batch=C,E.size=$-_;let z=_y(n,S),O=t(z);for(let W=0;W0){if(m=!0,a.validationData.length===2)i=a.validationData[0],o=a.validationData[1];else throw a.validationData.length===3?new _e("validationData including sample weights is not supported yet."):new U(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${a.validationData} is invalid.`);let w=!0,N=await e.standardizeUserData(i,o,null,null,w,p);u=N[0],l=N[1],f=u.concat(l)}else if(a.validationSplit!=null&&a.validationSplit>0&&a.validationSplit<1){m=!0;let w=Math.floor(r[0].shape[0]*(1-a.validationSplit)),N=r[0].shape[0];u=Jd(r,w,N),r=Jd(r,0,w),l=Jd(s,w,N),s=Jd(s,0,w),f=u.concat(l)}else a.validationSteps!=null&&(m=!0);let g=r.concat(s).concat(d);e.checkTrainableWeightsConsistency();let y=e.makeTrainFunction(),A=e.getDedupedMetricsNames(),x,v;m?(e.makeTestFunction(),x=e.testFunction,v=A.slice().concat(A.map(w=>"val_"+w))):(x=null,f=[],v=A.slice());let b=G4(a.callbacks,a.yieldEvery);return await Ire(e,y,g,A,p,a.epochs,a.verbose,b,x,f,a.shuffle,v,a.initialEpoch,null,null)}finally{e.isTraining=!1,Xi(r,t),Xi(s,n),Xi(u,i),Xi(l,o),d!=null&&he(d)}}function u8(e){let t=[];e instanceof Be&&(e=[e]);for(let n=0;nn.push(r.id));else if(t!=null)for(let r in t){let s=t[r];n.push(s.id)}let a=[];if(e instanceof Be)n.indexOf(e.id)===-1&&a.push(e);else if(Array.isArray(e))e.forEach(r=>{n.indexOf(r.id)===-1&&a.push(r)});else if(e!=null)for(let r in e){let s=e[r];n.indexOf(s.id)===-1&&a.push(s)}a.forEach(r=>{r.isDisposed||r.dispose()})}function Nre(e){return e instanceof Be}function Ly(e){return Array.isArray(e)}function d8(e){return!Nre(e)&&!Ly(e)}function p8(e,t,n,a=!0,r=""){if(t==null||t.length===0){if(e!=null){let i=!1;if(Ly(e)&&e.length>0)i=!0;else if(d8(e)){for(let o in e)if(e.hasOwnProperty(o)){i=!0;break}}else i=!0;if(i)throw new U(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(e==null)return t.map(i=>null);let s;if(d8(e)){e=e,s=[];for(let i of t){if(e[i]==null)throw new U(`No data provided for "${i}". Need data for each key in: ${t}`);s.push(e[i])}}else if(Ly(e)){if(e=e,e.length!==t.length)throw new U(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(e=e,t.length>1)throw new U(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=u8(s),n!=null)for(let i=0;i=0&&l!==d)throw new U(`Error when checking ${r}: expected ${t[i]} to have shape [${n[i]}], but got array with shape [${o.shape}].`)}}return s}function Tre(e,t,n){let a=es(e.map(s=>s.shape[0]));a.sort();let r=es(t.map(s=>s.shape[0]));if(r.sort(),a.length>1)throw new U(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(s=>s.shape))}`);if(r.length>1)throw new U(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(s=>s.shape))}`);if(a.length>0&&r.length>0&&!k.arraysEqual(a,r))throw new U(`Input Tensors should have the same number of samples as target Tensors. Found ${a[0]} input sample(s) and ${r[0]} target sample(s).`)}function Cre(e,t,n){let a=[Gi,w0,Kd];for(let r=0;r1)throw new U(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(n!=null)for(let i=0;i[]);let n;if(typeof e=="string"||typeof e=="function")n=[e];else if(Array.isArray(e)||typeof e=="object")n=e;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);if(Array.isArray(n))return t.map(a=>n);{let a=[];for(let r of t){let s=n.hasOwnProperty(r)?n[r]:[];Array.isArray(s)||(s=[s]),a.push(s)}return a}}var Rre="layers-model",kr=class extends tr{constructor(e){super(e);this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new U("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");ore(this,e,t,n)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=ire(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof xr))throw new U("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(let s in e.loss)if(this.outputNames.indexOf(s)===-1)throw new U(`Unknown entry in loss dictionary: "${s}". Only expected the following keys: ${this.outputNames}`);for(let s of this.outputNames)e.loss[s]==null&&console.warn(`Output "${s}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${s} during training`),t.push(Cy(e.loss[s]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new U(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);t=e.loss.map(s=>Cy(s))}else{let s=Cy(e.loss);this.outputs.forEach(i=>{t.push(s)})}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let s=0;s{for(let s=0;s1&&(this.metricsTensors.push([i,s]),this.metricsNames.push(this.outputNames[s]+"_loss"))}});let a=Ere(e.metrics,this.outputNames),r=(s,i,o)=>{this.outputNames.length>1&&(i=this.outputNames[s]+"_"+i),this.metricsNames.push(i),this.metricsTensors.push([o,s])};Ui("metric",()=>{for(let s=0;s{let u="",l,d,p;for(let c of o){if(typeof c=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(c)!==-1){let m=this.internalOutputShapes[s];m[m.length-1]===1||this.lossFunctions[s]===w0?["accuracy","acc"].indexOf(c)!==-1?d=Ey:["crossentropy","ce"].indexOf(c)!==-1&&(d=Z4):this.lossFunctions[s]===v0?["accuracy","acc"].indexOf(c)!==-1?d=Y4:["crossentropy","ce"].indexOf(c)!==-1&&(d=J4):["accuracy","acc"].indexOf(c)!==-1?d=Ry:["crossentropy","ce"].indexOf(c)!==-1&&(d=My);let f;["accuracy","acc"].indexOf(c)!==-1?f="acc":["crossentropy","ce"].indexOf(c)!==-1&&(f="ce"),p=d,l=u+f}else p=sre(c),l=u+S0(c);let h;Ui(l,()=>{h=p}),r(s,l,h)}})(i)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){let a=n.batchSize==null?32:n.batchSize;zy(a);let r=!0,s=this.standardizeUserDataXY(e,t,r,a);try{let i=s[0].concat(s[1]);this.makeTestFunction();let o=this.testFunction,u=this.testLoop(o,i,a,n.verbose,n.steps);return $n(u)}finally{Xi(s[0],e),Xi(s[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),kre(this,e,t)}checkNumSamples(e,t,n,a="steps"){let r;if(n!=null){if(r=null,t!=null)throw new U(`If ${a} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else if(e!=null)Array.isArray(e)?r=e[0].shape[0]:r=e.shape[0];else throw new U(`Either the input data should have a defined shape, or ${a} shoud be specified.`);return r}execute(e,t){if(Array.isArray(t)&&t.length===0)throw new U("`outputs` is an empty Array, which is not allowed.");let n=Array.isArray(t),a=n?t:[t],r=this.retrieveSymbolicTensors(a),s=new qi;if(e instanceof Be&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new U(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let o=0;oi.name);for(let i=0;i0){let a=[];throw t.forEach((r,s)=>{r==null&&a.push(e[s])}),new U(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(a)}`)}return t}predictLoop(e,t=32,n=!1){return V(()=>{let a=this.checkNumSamples(e);if(n)throw new _e("Verbose predictLoop() is not implemented yet.");let r=Py(a,t),s=this.outputs.map(i=>[]);for(let i=0;i{let o=r[i][0],u=r[i][1],l=Jd(e,o,u),d=[];if(Array.isArray(l))for(let c=0;cs[u].push(o));return $n(s.map(i=>lt(i,0)))})}predict(e,t={}){let n=u8(e);c8(n,this.inputNames,this.feedInputShapes,!1);try{let a=t.batchSize==null?32:t.batchSize;return zy(a),this.predictLoop(n,a)}finally{Xi(n,e)}}predictOnBatch(e){c8(e,this.inputNames,this.feedInputShapes,!0);let t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,a){if(this.optimizer_==null)throw new Ma("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");let r=[];for(let s=0;s0&&e[0].shape[0]%a!=0)throw new U(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${a}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,a,r=!0,s){let[i,o]=this.standardizeUserDataXY(e,t,r,s);if(n!=null)throw new Error("sample weight is not supported yet.");let u=null;if(a!=null){let l=r8(a,this.outputNames);u=[];for(let d=0;d{let s=this.checkNumSamples(t,n,r,"steps"),i=[];if(a>0)throw new _e("Verbose mode is not implemented yet.");if(r!=null)throw new _e("steps mode in testLoop() is not implemented yet");{let o=Py(s,n),u=Dt(Fa(0,s));for(let l=0;l1&&(r+=`_${x4(e.slice(0,n),a)}`),t.push(r)}return t}makeTrainFunction(){return e=>{let t=[],n=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),s=[],i=()=>{let l=[];for(let h=0;h1&&h{c=ie(c,h)}),c},o=this.collectedTrainableWeights.map(l=>l.read()),u=!0;return[this.optimizer_.minimize(i,u,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>V(()=>{let t=[],n,a=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let u=0;uwr(t))}else{let t=Object.keys(this.loss);e={};let n=this.loss;for(let a of t)if(typeof n[a]=="string")e[a]=wr(n[a]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[wr(S0(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>wr(S0(e)));{let e={};for(let t in this.metrics)e[t]=wr(S0(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");let t=Zd(e.optimizer_config),n=Oa(t),a;if(typeof e.loss=="string")a=Vi(e.loss);else if(Array.isArray(e.loss))a=e.loss.map(s=>Vi(s));else if(e.loss!=null){a={};for(let s in e.loss)a[s]=Vi(e.loss[s])}let r;if(Array.isArray(e.metrics))r=e.metrics.map(s=>Vi(s));else if(e.metrics!=null){r={};for(let s in e.metrics)r[s]=Vi(e.metrics[s])}this.compile({loss:a,metrics:r,optimizer:n})}async save(e,t){if(typeof e=="string"){let i=En.getSaveHandlers(e);if(i.length===0)throw new U(`Cannot find any save handlers for URL '${e}'`);if(i.length>1)throw new U(`Found more than one (${i.length}) save handlers for URL '${e}'`);e=i[0]}if(e.save==null)throw new U("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");let n=await En.encodeWeights(this.getNamedWeights(t)),a=!1,r=null,s={modelTopology:this.toJSON(r,a),format:Rre,generatedBy:`TensorFlow.js tfjs-layers v${Dy}`,convertedBy:null};if((t==null?!1:t.includeOptimizer)&&this.optimizer!=null){s.trainingConfig=this.getTrainingConfig();let i="optimizer",{data:o,specs:u}=await En.encodeWeights(await this.optimizer.getWeights(),i);n.specs.push(...u),n.data=En.concatenateArrayBuffers([n.data,o])}if(this.userDefinedMetadata!=null){let i=!0;e8(this.userDefinedMetadata,this.name,i),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){e8(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}};kr.className="Model";re.registerClass(kr);var h8=class extends kr{};h8.className="Functional";re.registerClass(h8);async function Mre(e,t){"modelTopology"in e||(e={modelTopology:e}),e=e;let n=e.modelTopology;n.model_config!=null&&(n=n.model_config);let a=Zd(n),r=Oa(a,t);if(e.weightsManifest!=null){let s=await En.loadWeights(e.weightsManifest,e.pathPrefix,r.weights.map(o=>o.originalName)),i={};for(let o of r.weights)i[o.originalName]=s[o.originalName];r.loadWeights(i),he(s)}return r}async function Fre(e,t){if(t==null&&(t={}),typeof e=="string"){let n=En.getLoadHandlers(e,t);if(n.length===0)n.push(En.browserHTTPRequest(e,t));else if(n.length>1)throw new U(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return $re(e,void 0,t)}async function $re(e,t,n){if(n==null&&(n={}),e.load==null)throw new U("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let a=await e.load(),r=a.modelTopology;r.model_config!=null&&(r=r.model_config);let s=n.strict==null?!0:n.strict,i=a.weightData!=null&&a.weightSpecs!=null&&s,o=Oa(Zd(r),t,i),u=a.trainingConfig;if(u!=null&&o.loadTrainingConfig(u),a.userDefinedMetadata!=null&&o.setUserDefinedMetadata(a.userDefinedMetadata),a.weightData!=null){if(a.weightSpecs==null)throw new U("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");let{modelWeights:l,optimizerWeights:d}=Dre(a.weightData,a.weightSpecs);o.loadWeights(l,s),o.optimizer!=null&&d.length>0&&await o.optimizer.setWeights(d),he(l),he(d.map(p=>p.tensor))}return o}function Dre(e,t){let n=En.decodeWeights(e,t),a={},r=[];return t.forEach(s=>{s.group==="optimizer"?r.push({name:s.name,tensor:n[s.name]}):a[s.name]=n[s.name]}),{modelWeights:a,optimizerWeights:r}}var au=class extends kr{constructor(e){super({inputs:[],outputs:[]});if(e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:m0("sequential_"),e.layers!=null)for(let t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(t=>t<0))throw new U(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){let t=e instanceof au||e instanceof kr,n;if(t){if(n=e,n.outputs.length!==1)throw new U("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(n.inputs.length!==1)throw new U("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new U("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");let a=W4({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(a)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(e.inboundNodes.length!==1)throw new U(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new U("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=L4(this.outputs[0])}this.inboundNodes=[],new A0({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Bi(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(a=>a.shape),outputShapes:this.outputs[0].shape})}else{let a=e.apply(this.outputs[0]);if(Array.isArray(a))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[a],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{let e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return this.model==null&&this.build(),this.model.call(e,t)}build(e){if(st(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new kr({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return this.model==null&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},a=!1){let r,s={};if(t instanceof Array){if(t[0].className==null||t[0].className==="Merge")throw new U("Legacy serialization format not supported yet.");r=t}else k.assert(t.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),r=t.layers,delete t.layers,s=t;let i=new e(s);if(!(i instanceof au))throw new _e(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(let o of r){let u=Oa(o,void 0,a);a&&u.setFastWeightInitDuringBuild(!0),i.add(u)}return i}set stopTraining(e){if(this.model==null)throw new U("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new U("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){let e=[];for(let t of this.layers){let n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}};au.className="Sequential";re.registerClass(au);function Ore(e){return new kr(e)}function zre(e){return new au(e)}function _re(e,t){return t==null&&(t={}),Fre(e,t)}function f8(e){return W4(e)}function Pre(e,t){wa.registerCallbackConstructor(e,t)}var On=class extends re.Serializable{getConfig(){return{}}},m8=class extends On{apply(e,t=1){return dae(e,t)}};m8.className="elu";re.registerClass(m8);var g8=class extends On{apply(e){return oh(e)}};g8.className="selu";re.registerClass(g8);var y8=class extends On{apply(e){return Ka(e)}};y8.className="relu";re.registerClass(y8);var A8=class extends On{apply(e){return V(()=>Ml(6,Ka(e)))}};A8.className="relu6";re.registerClass(A8);var x8=class extends On{apply(e){return e}};x8.className="linear";re.registerClass(x8);var b8=class extends On{apply(e){return Rn(e)}};b8.className="sigmoid";re.registerClass(b8);var v8=class extends On{apply(e){return cae(e)}};v8.className="hardSigmoid";re.registerClass(v8);var w8=class extends On{apply(e){return Ci(e)}};w8.className="softplus";re.registerClass(w8);var k8=class extends On{apply(e){return pae(e)}};k8.className="softsign";re.registerClass(k8);var I8=class extends On{apply(e){return Si(e)}};I8.className="tanh";re.registerClass(I8);var Wy=class extends On{apply(e,t=-1){return xd(e,t)}};Wy.className="softmax";re.registerClass(Wy);var S8=class extends On{apply(e,t=-1){return eh(e,t)}};S8.className="logSoftmax";re.registerClass(S8);var N8=class extends On{apply(e,t=1){return V(()=>Rn(e.mul(t)).mul(e))}};N8.className="swish";re.registerClass(N8);var T8=class extends On{apply(e){return V(()=>B(e,Si(Ci(e))))}};T8.className="mish";re.registerClass(T8);function rs(e){return e.getClassName()}function By(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"activation")}function ss(e){if(e==null){let t={};return t.className="linear",t.config={},By(t)}if(typeof e=="string"){let t={};return t.className=e,t.config={},By(t)}else return e instanceof On?e:By(e)}function Vy(e){if(e!=null&&typeof e!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}var C8=class extends re.Serializable{},Qd=class extends C8{constructor(e){super();Vy(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return V(()=>{let t=$t([1]);return this.hasL1&&(t=ie(t,Se(B(this.l1,Wt(e))))),this.hasL2&&(t=ie(t,Se(B(this.l2,qd(e))))),t.asScalar()})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}};Qd.className="L1L2";re.registerClass(Qd);function Lre(e){return Vy(e),new Qd({l1:e!=null?e.l1:null,l2:0})}function Wre(e){return Vy(e),new Qd({l2:e!=null?e.l2:null,l1:0})}var E8={l1l2:"L1L2"};function dt(e){return sy(e)}function R8(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"regularizer")}function vt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in E8?E8[e]:e,config:{}};return R8(t)}else return e instanceof C8?e:R8(e)}var jy=class extends Xe{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,t){e=Le(e);let n=Ka(e);return this.maxValue!=null&&(n=Mn(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){let e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}};jy.className="ReLU";re.registerClass(jy);var Uy=class extends Xe{constructor(e){super(e==null?{}:e);this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,t){let n=Le(e);return pd(n,this.alpha)}computeOutputShape(e){return e}getConfig(){let e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}};Uy.className="LeakyReLU";re.registerClass(Uy);var Hy=class extends Xe{constructor(e){super(e==null?{}:e);if(this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=bt(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=vt(e.alphaRegularizer),this.alphaConstraint=Ht(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new U(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=st(e);let t=e.slice(1);if(this.sharedAxes!=null)for(let a of this.sharedAxes)t[a-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);let n={};if(this.sharedAxes!=null)for(let a=1;a(Ft(t),t==="channelsFirst"?Qe(e,[0,2,3,1]):e))}function M8(e,t){return V(()=>(Ft(t),t==="channelsFirst"?Qe(e,[0,2,3,4,1]):e))}function Bre(e,t,n,a=1,r="valid",s,i=1){return V(()=>{if(s==null&&(s=Ra()),Ft(s),e.shape.length!==3)throw new U(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(t.shape.length!==3)throw new U(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new U(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if(s==="channelsFirst"&&(e=Qe(e,[0,2,1])),r==="causal")throw new _e("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=Gc(e,t,a,r==="same"?"same":"valid","NWC",i);return n!=null&&(o=$a(o,n)),o})}function F8(e,t,n,a=[1,1],r="valid",s,i,o=null){return V(()=>{if(s==null&&(s=Ra()),Ft(s),e.rank!==3&&e.rank!==4)throw new U(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(t.rank!==3&&t.rank!==4)throw new U(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let u=Ky(e,s);if(r==="causal")throw new _e("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return u=Kr.conv2d({x:u,filter:t,strides:a,pad:r==="same"?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),s==="channelsFirst"&&(u=Qe(u,[0,3,1,2])),u})}function Vre(e,t,n,a=[1,1,1],r="valid",s,i){return V(()=>{if(s==null&&(s=Ra()),Ft(s),e.rank!==4&&e.rank!==5)throw new U(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(t.rank!==4&&t.rank!==5)throw new U(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=M8(e,s);if(r==="causal")throw new _e("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=L1(o,t,a,r==="same"?"same":"valid","NDHWC",i),n!=null&&(o=$a(o,n)),s==="channelsFirst"&&(o=Qe(o,[0,4,1,2,3])),o})}var Zy=class extends Xe{constructor(e,t){super(t);if(this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",Zy.verifyArgs(t),this.rank=e,Jt(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new _e(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=ru(t.kernelSize,e,"kernelSize"),this.strides=ru(t.strides==null?1:t.strides,e,"strides"),this.padding=t.padding==null?"valid":t.padding,ca(this.padding),this.dataFormat=t.dataFormat==null?"channelsLast":t.dataFormat,Ft(this.dataFormat),this.activation=ss(t.activation),this.useBias=t.useBias==null?!0:t.useBias,this.biasInitializer=bt(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Ht(t.biasConstraint),this.biasRegularizer=vt(t.biasRegularizer),this.activityRegularizer=vt(t.activityRegularizer),this.dilationRate=ru(t.dilationRate==null?1:t.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new U(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new U(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new U(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(Qa("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!oy(e.kernelSize,"number",1,3))throw new U(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){let e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:rs(this.activation),useBias:this.useBias,biasInitializer:Tt(this.biasInitializer),biasRegularizer:dt(this.biasRegularizer),activityRegularizer:dt(this.activityRegularizer),biasConstraint:Ut(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}},ep=class extends Zy{constructor(e,t){super(e,t);this.kernel=null,ep.verifyArgs(t),this.filters=t.filters,Jt(this.filters,"filters"),this.kernelInitializer=bt(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Ht(t.kernelConstraint),this.kernelRegularizer=vt(t.kernelRegularizer)}build(e){e=st(e);let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new U(`The channel dimension of the input should be defined. Found ${e[t]}`);let n=e[t],a=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",a,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return V(()=>{e=Le(e);let n,a=this.bias==null?null:this.bias.read(),r=v4(this.activation.getClassName());if(r!=null&&this.rank===2)n=F8(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate,r);else{if(this.rank===1)n=Bre(e,this.kernel.read(),a,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)n=F8(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)n=Vre(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new _e("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(n=this.activation.apply(n))}return n})}computeOutputShape(e){e=st(e);let t=[],n=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let r=0;r 0 but got ${JSON.stringify(e.filters)}`)}},tp=class extends ep{constructor(e){super(2,e);tp.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!oy(e.kernelSize,"number",1,2))throw new U(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}};tp.className="Conv2D";re.registerClass(tp);var np=class extends ep{constructor(e){super(3,e);np.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new U(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}};np.className="Conv3D";re.registerClass(np);var Yy=class extends tp{constructor(e){super(e);if(this.inputSpec=[new zt({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new U(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=st(e),e.length!==4)throw new U("Input should have rank 4; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new U("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new zt({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return V(()=>{let n=Le(e);if(n.shape.length!==4)throw new U(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i;this.dataFormat==="channelsFirst"?(s=2,i=3):(s=1,i=2);let o=a[s],u=a[i],l=this.kernelSize[0],d=this.kernelSize[1],p=this.strides[0],c=this.strides[1],h=nr(o,p,l,this.padding),m=nr(u,c,d,this.padding),f=[r,h,m,this.filters];this.dataFormat!=="channelsLast"&&(n=Qe(n,[0,2,3,1]));let g=qc(n,this.kernel.read(),f,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(g=Qe(g,[0,3,1,2])),this.bias!=null&&(g=$a(g,this.bias.read(),this.dataFormat)),this.activation!=null&&(g=this.activation.apply(g)),g})}computeOutputShape(e){e=st(e);let t=e.slice(),n,a,r;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3):(n=3,a=1,r=2);let s=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],u=this.strides[1];return t[n]=this.filters,t[a]=nr(t[a],o,s,this.padding),t[r]=nr(t[r],u,i,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};Yy.className="Conv2DTranspose";re.registerClass(Yy);var Jy=class extends np{constructor(e){super(e);if(this.inputSpec=[new zt({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new U(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=st(e),e.length!==5)throw new U("Input should have rank 5; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new U("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new zt({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return V(()=>{let n=Le(e);if(n.shape.length!==5)throw new U(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i,o;this.dataFormat==="channelsFirst"?(o=2,s=3,i=4):(o=1,s=2,i=3);let u=a[o],l=a[s],d=a[i],p=this.kernelSize[0],c=this.kernelSize[1],h=this.kernelSize[2],m=this.strides[0],f=this.strides[1],g=this.strides[2],y=nr(u,m,p,this.padding),A=nr(l,f,c,this.padding),x=nr(d,g,h,this.padding),v=[r,y,A,x,this.filters];this.dataFormat!=="channelsLast"&&(n=Qe(n,[0,2,3,4,1]));let b=k3(n,this.kernel.read(),v,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(b=Qe(b,[0,4,1,2,3])),this.bias!==null&&(b=$a(b,this.bias.read(),this.dataFormat)),this.activation!==null&&(b=this.activation.apply(b)),b})}computeOutputShape(e){e=st(e);let t=e.slice(),n,a,r,s;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3,s=4):(n=4,a=1,r=2,s=3);let i=this.kernelSize[0],o=this.kernelSize[1],u=this.kernelSize[2],l=this.strides[0],d=this.strides[1],p=this.strides[2];return t[n]=this.filters,t[a]=nr(t[a],l,i,this.padding),t[r]=nr(t[r],d,o,this.padding),t[s]=nr(t[s],p,u,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};Jy.className="Conv3DTranspose";re.registerClass(Jy);var $8=class extends ep{constructor(e,t){super(e,t);if(this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,t.filters==null)throw new U("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(t.kernelInitializer!=null||t.kernelRegularizer!=null||t.kernelConstraint!=null)throw new U("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(t.padding!=null&&t.padding!=="same"&&t.padding!=="valid")throw new U(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=t.depthMultiplier==null?1:t.depthMultiplier,this.depthwiseInitializer=bt(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=vt(t.depthwiseRegularizer),this.depthwiseConstraint=Ht(t.depthwiseConstraint),this.pointwiseInitializer=bt(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=vt(t.pointwiseRegularizer),this.pointwiseConstraint=Ht(t.pointwiseConstraint)}build(e){if(e=st(e),e.length{e=Le(e);let n;if(this.rank===1)throw new _e("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=Qe(e,[0,2,3,1])),n=ag(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=$a(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),this.dataFormat==="channelsFirst"&&(n=Qe(n,[0,3,1,2])),n})}getConfig(){let e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Tt(this.depthwiseInitializer),e.pointwiseInitializer=Tt(this.pointwiseInitializer),e.depthwiseRegularizer=dt(this.depthwiseRegularizer),e.pointwiseRegularizer=dt(this.pointwiseRegularizer),e.depthwiseConstraint=Ut(this.depthwiseConstraint),e.pointwiseConstraint=Ut(this.pointwiseConstraint),e}};$8.className="SeparableConv";var Qy=class extends $8{constructor(e){super(2,e)}};Qy.className="SeparableConv2D";re.registerClass(Qy);var T0=class extends ep{constructor(e){super(1,e);T0.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){let e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!oy(e.kernelSize,"number",1,1))throw new U(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}};T0.className="Conv1D";re.registerClass(T0);var eA=class extends Xe{constructor(e){super(e);typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return V(()=>{if(e=Le(e),this.dataFormat==="channelsLast"){let n=s0(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return s0(n,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{let n=s0(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return s0(n,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){let e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};eA.className="Cropping2D";re.registerClass(eA);var tA=class extends Xe{constructor(e){super(e);this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,aae(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){let t=e[2]==null?null:this.size[0]*e[2],n=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],t,n]}else{let t=e[1]==null?null:this.size[0]*e[1],n=e[2]==null?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return V(()=>{let n=Le(e),a=n.shape;if(this.dataFormat==="channelsFirst"){n=Qe(n,[0,2,3,1]);let r=this.size[0]*a[2],s=this.size[1]*a[3],i=this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s]);return Qe(i,[0,3,1,2])}else{let r=this.size[0]*a[1],s=this.size[1]*a[2];return this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s])}})}getConfig(){let e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};tA.className="UpSampling2D";re.registerClass(tA);function jre(e,t,n=[1,1],a="valid",r,s){return V(()=>{r==null&&(r=Ra()),Ft(r);let i=Ky(e,r);if(e.rank!==4)throw new U(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(t.rank!==4)throw new U(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=Tl(i,t,n,a==="same"?"same":"valid","NHWC",s),r==="channelsFirst"&&(i=Qe(i,[0,3,1,2])),i})}var nA=class extends Zy{constructor(e){super(2,e);this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=bt(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Ht(e.depthwiseConstraint),this.depthwiseRegularizer=vt(e.depthwiseRegularizer)}build(e){if(e=st(e),e.length<4)throw new U(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);let t=this.dataFormat==="channelsFirst"?1:3;if(e[t]==null||e[t]<0)throw new U(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);let n=e[t],a=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",a,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return V(()=>{e=Le(e);let n=jre(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=$a(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),n})}computeOutputShape(e){e=st(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=za(t,this.kernelSize[0],this.padding,this.strides[0]),s=za(n,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],a,r,s]:[e[0],r,s,a]}getConfig(){let e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Tt(this.depthwiseInitializer),e.depthwiseRegularizer=dt(this.depthwiseRegularizer),e.depthwiseConstraint=Ut(this.depthwiseRegularizer),e}};nA.className="DepthwiseConv2D";re.registerClass(nA);function D8(e,t,n,a){if(Array.isArray(e)){if(t!=null||n!=null)throw new U("When inputs is an array, neither initialState or constants should be provided");a!=null&&(n=e.slice(e.length-a,e.length),e=e.slice(0,e.length-a)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(s){return s==null||Array.isArray(s)?s:[s]}return t=r(t),n=r(n),{inputs:e,initialState:t,constants:n}}function O8(e,t,n,a=!1,r,s,i=!1,o=!1){return V(()=>{let u=t.shape.length;if(u<3)throw new U(`Input should be at least 3D, but is ${u}D.`);let l=[1,0].concat(Fa(2,u));if(t=Qe(t,l),s!=null)throw new _e("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),r!=null&&(r=r.asType("bool").asType("float32"),r.rank===u-1&&(r=mn(r,-1)),r=Qe(r,l)),a&&(t=Hn(t,0),r!=null&&(r=Hn(r,0)));let d=[],p,c=n,h=t.shape[0],m=Gn(t),f;r!=null&&(f=Gn(r));for(let y=0;ye(A,c));if(r==null)p=x[0],c=x[1];else{let v=V(()=>{let b=f[y],w=Un(b).sub(b),N=x[0].mul(b).add(c[0].mul(w)),C=c.map((E,_)=>x[1][_].mul(b).add(E.mul(w)));return{output:N,newStates:C}});p=v.output,c=v.newStates}o&&d.push(p)}let g;return o&&(g=gn(d,1)),[p,g,c]})}var ar=class extends Xe{constructor(e){super(e);let t;if(e.cell==null)throw new U("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?t=new R0({cells:e.cell}):t=e.cell,t.stateSize==null)throw new U("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new zt({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return Fa(0,e).map(t=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Iy(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);let n=t[0],a;if(this.returnSequences?a=[e[0],e[1],n]:a=[e[0],n],this.returnState){let r=[];for(let s of t)r.push([e[0],s]);return[a].concat(r)}else return a}computeMask(e,t){return V(()=>{Array.isArray(t)&&(t=t[0]);let n=this.returnSequences?t:null;if(this.returnState){let a=this.states.map(r=>null);return[n].concat(a)}else return n})}get states(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ni.shape[i.shape.length-1]),s))throw new U(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=s.map(i=>new zt({shape:[null,i]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){V(()=>{if(!this.stateful)throw new vr("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape[0];if(n==null)throw new U("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>$t([n,a])):this.states_=[$t([n,this.cell.stateSize])];else if(e==null)he(this.states_),this.keptStates!=null&&(he(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>$t([n,a])):this.states_[0]=$t([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new U(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t===!0?this.keptStates.push(this.states_.slice()):he(this.states_);for(let a=0;aKt(a.clone()))})}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=D8(e,n,a,this.numConstants);e=r.inputs,n=r.initialState,a=r.constants;let s=[],i=[];if(n!=null){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(let o of n)this.stateSpec.push(new zt({shape:o.shape}));i=i.concat(this.stateSpec)}if(a!=null&&(t.constants=a,s=s.concat(a),this.numConstants=a.length),s[0]instanceof Da){let o=[e].concat(s),u=this.inputSpec.concat(i),l=this.inputSpec;this.inputSpec=u;let d=super.apply(o,t);return this.inputSpec=l,d}else return super.apply(e,t)}call(e,t){return V(()=>{let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;e=Le(e),r==null&&(this.stateful?r=this.states_:r=this.getInitialState(e));let s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new U(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");let i={training:a},o=O8((c,h)=>{let m=this.cell.call([c].concat(h),i);return[m[0],m.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),u=o[0],l=o[1],d=o[2];this.stateful&&this.resetStates(d,a);let p=this.returnSequences?l:u;return this.returnState?[p].concat(d):p})}getInitialState(e){return V(()=>{let t=$t(e.shape);return t=Se(t,[1,2]),t=Gd(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(n=>n>1?my(t,[1,n]):t):this.cell.stateSize>1?[my(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){let e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(t.numConstants=this.numConstants);let n=this.cell.getConfig();return this.getClassName()===ar.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){let a=t.cell,r=Oa(a,n);return new e(Object.assign(t,{cell:r}))}};ar.className="RNN";re.registerClass(ar);var ap=class extends Xe{},C0=class extends ap{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=bt(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=vt(e.kernelRegularizer),this.recurrentRegularizer=vt(e.recurrentRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.kernelConstraint=Ht(e.kernelConstraint),this.recurrentConstraint=Ht(e.recurrentConstraint),this.biasConstraint=Ht(e.biasConstraint),this.dropout=Ql([1,ns([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Ql([1,ns([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=st(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return V(()=>{if(e=e,e.length!==2)throw new U(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];let a=t.training==null?!1:t.training;0Un(e),rate:this.dropout,training:a})),0Un(n),rate:this.recurrentDropout,training:a}));let r,s=this.dropoutMask,i=this.recurrentDropoutMask;s!=null?r=er(B(e,s),this.kernel.read()):r=er(e,this.kernel.read()),this.bias!=null&&(r=$a(r,this.bias.read())),i!=null&&(n=B(n,i));let o=ie(r,er(n,this.recurrentKernel.read()));return this.activation!=null&&(o=this.activation.apply(o)),[o,o]})}getConfig(){let e=super.getConfig(),t={units:this.units,activation:rs(this.activation),useBias:this.useBias,kernelInitializer:Tt(this.kernelInitializer),recurrentInitializer:Tt(this.recurrentInitializer),biasInitializer:Tt(this.biasInitializer),kernelRegularizer:dt(this.kernelRegularizer),recurrentRegularizer:dt(this.recurrentRegularizer),biasRegularizer:dt(this.biasRegularizer),activityRegularizer:dt(this.activityRegularizer),kernelConstraint:Ut(this.kernelConstraint),recurrentConstraint:Ut(this.recurrentConstraint),biasConstraint:Ut(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}};C0.className="SimpleRNNCell";re.registerClass(C0);var aA=class extends ar{constructor(e){e.cell=new C0(e),super(e)}call(e,t){return V(()=>{this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return new e(t)}};aA.className="SimpleRNN";re.registerClass(aA);var E0=class extends ap{constructor(e){super(e);if(this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new U("GRUCell does not support reset_after parameter set to true.");this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ss(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=bt(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=vt(e.kernelRegularizer),this.recurrentRegularizer=vt(e.recurrentRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.kernelConstraint=Ht(e.kernelConstraint),this.recurrentConstraint=Ht(e.recurrentConstraint),this.biasConstraint=Ht(e.biasConstraint),this.dropout=Ql([1,ns([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Ql([1,ns([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=st(e);let t=e[e.length-1];this.kernel=this.addWeight("kernel",[t,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return V(()=>{if(e=e,e.length!==2)throw new U(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training==null?!1:t.training,a=e[1];e=e[0],0Un(e),rate:this.dropout,training:n,count:3})),0Un(a),rate:this.recurrentDropout,training:n,count:3}));let r=this.dropoutMask,s=this.recurrentDropoutMask,i,o,u;0{this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};rA.className="GRU";re.registerClass(rA);var rp=class extends ap{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ss(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=bt(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=vt(e.kernelRegularizer),this.recurrentRegularizer=vt(e.recurrentRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.kernelConstraint=Ht(e.kernelConstraint),this.recurrentConstraint=Ht(e.recurrentConstraint),this.biasConstraint=Ht(e.biasConstraint),this.dropout=Ql([1,ns([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Ql([1,ns([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;e=st(e);let n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let a;if(this.useBias){if(this.unitForgetBias){let r=this.biasInitializer,s=this.units;a=new(t=class extends va{apply(i,o){let u=r.apply([s]),l=new o0().apply([s]),d=r.apply([s*2]);return R4(R4(u,l),d)}},t.className="CustomInit",t)}else a=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,a,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return V(()=>{let n=t.training==null?!1:t.training;if(e=e,e.length!==3)throw new U(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let a=e[1],r=e[2];e=e[0],0Un(e),rate:this.dropout,training:n,count:4})),0Un(a),rate:this.recurrentDropout,training:n,count:4}));let s=this.dropoutMask,i=this.recurrentDropoutMask,o,u,l,d;0{this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};sA.className="LSTM";re.registerClass(sA);var R0=class extends ap{constructor(e){super(e);this.cells=e.cells}get stateSize(){let e=[];for(let t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return V(()=>{e=e;let n=e.slice(1),a=[];for(let i of this.cells.slice().reverse())Array.isArray(i.stateSize)?a.push(n.splice(0,i.stateSize.length)):a.push(n.splice(0,1));a.reverse();let r=[],s;for(let i=0;i{Ui(`RNNCell_${a}`,()=>{n.build(e),Array.isArray(n.stateSize)?t=n.stateSize[0]:t=n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){let e=super.getConfig(),t=a=>({className:a.getClassName(),config:a.getConfig()}),n={cells:this.cells.map(t)};return Object.assign({},e,n)}static fromConfig(e,t,n={}){let a=[];for(let r of t.cells)a.push(Oa(r,n));return new e({cells:a})}get trainableWeights(){if(!this.trainable)return[];let e=[];for(let t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.cells)t.push(...n.trainableWeights);return t.concat(e)}return e}getWeights(){let e=[];for(let t of this.cells)e.push(...t.weights);return Sy(e)}setWeights(e){let t=[];for(let n of this.cells){let a=n.weights.length,r=e.splice(a);for(let s=0;sF4(t(),n),i=()=>Xd(s,t,a);return!r||r<=1?Kt(i().clone()):Array(r).fill(void 0).map(i).map(o=>Kt(o.clone()))}var Ure=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r{if(this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new U("ConvRNN2D cell does not support constants");let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return V(()=>{let{stateSize:t}=this.cell,n=e.shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)],s=$t(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){V(()=>{if(!this.stateful)throw new vr("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)];if(n[0]==null)throw new U("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>$t(r)):this.states_=[$t(r)];else if(e==null)he(this.states_),this.keptStates!=null&&(he(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>$t(r)):this.states_[0]=$t(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new U(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):he(this.states_);for(let s=0;sKt(s.clone()))})}computeSingleOutputShape(e){let{dataFormat:t,filters:n,kernelSize:a,padding:r,strides:s,dilationRate:i}=this.cell,o=t==="channelsFirst",u=e[o?3:2],l=e[o?4:3],d=za(u,a[0],r,s[0],i[0]),p=za(l,a[1],r,s[1],i[1]);return[...e.slice(0,2),...o?[n,d,p]:[d,p,n]]}};z8.className="ConvRNN2D";var M0=class extends rp{constructor(e){let{filters:t,kernelSize:n,strides:a,padding:r,dataFormat:s,dilationRate:i}=e;super(Object.assign({},e,{units:t}));this.filters=t,Jt(this.filters,"filters"),this.kernelSize=ru(n,2,"kernelSize"),this.kernelSize.forEach(o=>Jt(o,"kernelSize")),this.strides=ru(a||1,2,"strides"),this.strides.forEach(o=>Jt(o,"strides")),this.padding=r||"valid",ca(this.padding),this.dataFormat=s||"channelsLast",Ft(this.dataFormat),this.dilationRate=ru(i||1,2,"dilationRate"),this.dilationRate.forEach(o=>Jt(o,"dilationRate"))}build(e){var t;e=st(e);let n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new U(`The channel dimension of the input should be defined. Found ${e[n]}`);let a=e[n],r=4,s=this.kernelSize.concat([a,this.filters*r]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);let i=this.kernelSize.concat([this.filters,this.filters*r]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let o;if(this.unitForgetBias){let u=this.biasInitializer,l=this.filters;o=new(t=class extends va{apply(d,p){let c=u.apply([l]),h=jn([l]),m=u.apply([l*2]);return fy([c,h,m])}},t.className="CustomInit",t)}else o=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*r],null,o,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return V(()=>{if(e.length!==3)throw new U(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training||!1,a=e[0],r=e[1],s=e[2],i=4;0Un(a),rate:this.dropout,training:n,count:i}));let o=this.dropoutMask,u=(K,ne,Q)=>!ne||!ne[Q]?K:B(ne[Q],K),l=u(a,o,0),d=u(a,o,1),p=u(a,o,2),c=u(a,o,3);0Un(r),rate:this.recurrentDropout,training:n,count:i}));let h=this.recurrentDropoutMask,m=u(r,h,0),f=u(r,h,1),g=u(r,h,2),y=u(r,h,3),A=3,[x,v,b,w]=Zt(this.kernel.read(),i,A),[N,C,E,_]=this.useBias?Zt(this.bias.read(),i):[null,null,null,null];l=this.inputConv(l,x,N,this.padding),d=this.inputConv(d,v,C,this.padding),p=this.inputConv(p,b,E,this.padding),c=this.inputConv(c,w,_,this.padding);let[$,S,z,O]=Zt(this.recurrentKernel.read(),i,A);m=this.recurrentConv(m,$),f=this.recurrentConv(f,S),g=this.recurrentConv(g,z),y=this.recurrentConv(y,O);let W=this.recurrentActivation.apply(ie(l,m)),G=this.recurrentActivation.apply(ie(d,f)),H=ie(B(G,s),B(W,this.activation.apply(ie(p,g)))),J=B(this.recurrentActivation.apply(ie(c,y)),this.activation.apply(H));return[J,J,H]})}getConfig(){let e=super.getConfig(),{units:t}=e,n=Ure(e,["units"]),a={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,a)}inputConv(e,t,n,a){let r=mr(e,t,this.strides,a||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return n?$a(r,n,this.dataFormat):r}recurrentConv(e,t){return mr(e,t,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}};M0.className="ConvLSTM2DCell";re.registerClass(M0);var iA=class extends z8{constructor(e){let t=new M0(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}};iA.className="ConvLSTM2D";re.registerClass(iA);var F0=class extends Xe{constructor(e){super(e);this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;let t=e.shape,n=[];for(let a=0;a{this.invokeCallHook(e,t);let n=Le(e);if(0F4(n,this.rate,r,this.seed),()=>n,a)}return e})}getConfig(){let e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}};F0.className="Dropout";re.registerClass(F0);var oA=class extends F0{constructor(e){super(e);this.inputSpec=[{ndim:3}]}getNoiseShape(e){let t=e.shape;return[t[0],1,t[2]]}};oA.className="SpatialDropout1D";re.registerClass(oA);var lA=class extends Xe{constructor(e){super(e);if(this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let t=null;e.batchSize!=null&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Ht(e.kernelConstraint),this.biasConstraint=Ht(e.biasConstraint),this.kernelRegularizer=vt(e.kernelRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.activityRegularizer=vt(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=st(e);let t=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){e=st(e);let t=e.slice();return t[t.length-1]=this.units,t}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e),a=v4(this.activation.getClassName()),r;return a!=null?r=er(n,this.kernel.read(),a,this.bias?this.bias.read():null):(r=er(n,this.kernel.read()),this.bias!=null&&(r=$a(r,this.bias.read())),this.activation!=null&&(r=this.activation.apply(r))),r})}getConfig(){let e={units:this.units,activation:rs(this.activation),useBias:this.useBias,kernelInitializer:Tt(this.kernelInitializer),biasInitializer:Tt(this.biasInitializer),kernelRegularizer:dt(this.kernelRegularizer),biasRegularizer:dt(this.biasRegularizer),activityRegularizer:dt(this.activityRegularizer),kernelConstraint:Ut(this.kernelConstraint),biasConstraint:Ut(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}};lA.className="Dense";re.registerClass(lA);var uA=class extends Xe{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=st(e);for(let t of e.slice(1))if(t==null)throw new U(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],ts(e,1)]}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e);if(this.dataFormat==="channelsFirst"&&n.rank>1){let a=[0];for(let r=2;r{this.invokeCallHook(e,t);let n=Le(e);return this.activation.apply(n)})}getConfig(){let e={activation:rs(this.activation)},t=super.getConfig();return Object.assign(e,t),e}};dA.className="Activation";re.registerClass(dA);var pA=class extends Xe{constructor(e){super(e);this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return V(()=>(e=Le(e),oae(e,this.n)))}getConfig(){let e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}};pA.className="RepeatVector";re.registerClass(pA);var cA=class extends Xe{constructor(e){super(e);this.targetShape=e.targetShape;for(let t=0;t{this.invokeCallHook(e,t);let n=Le(e),a=n.shape,r=a.slice(0,1).concat(this.fixUnknownDimension(a.slice(1),this.targetShape));return n.reshape(r)})}getConfig(){let e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}};cA.className="Reshape";re.registerClass(cA);var hA=class extends Xe{constructor(e){super(e);if(e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);let t=Fa(1,e.dims.length+1);if(!k.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new zt({ndim:this.dims.length+1})]}computeOutputShape(e){e=st(e);let t=e.slice();return this.dims.forEach((n,a)=>{t[a+1]=e[n]}),t}call(e,t){return Qe(Le(e),this.dimsIncludingBatch)}getConfig(){let e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}};hA.className="Permute";re.registerClass(hA);var fA=class extends Xe{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){let n=Le(e),a=-1;return id(Ri(n,this.maskValue),a)}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e),a=-1,r=!0,s=id(Ri(n,this.maskValue),a,r);return n.mul(s.asType(n.dtype))})}};fA.className="Masking";re.registerClass(fA);var mA=class extends Xe{constructor(e){super(e);if(this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let t=null;e.batchSize!=null&&(t=e.batchSize),e.inputLength==null?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(yt(e.inputLength))}this.inputDim=e.inputDim,Jt(this.inputDim,"inputDim"),this.outputDim=e.outputDim,Jt(this.outputDim,"outputDim"),this.embeddingsInitializer=bt(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=vt(e.embeddingsRegularizer),this.activityRegularizer=vt(e.activityRegularizer),this.embeddingsConstraint=Ht(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return V(()=>this.maskZero?(e=Le(e),Ri(e,Ge(e))):null)}computeOutputShape(e){if(e=st(e),this.inputLength==null)return[...e,this.outputDim];let t=yt(this.inputLength);if(t.length!==e.length-1)throw new U(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let a=0;a{this.invokeCallHook(e,t);let n=Le(e);return n.dtype!=="int32"&&(n=Hd(n,"int32")),M4(this.embeddings.read(),n.as1D()).reshape(st(this.computeOutputShape(n.shape)))})}getConfig(){let e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Tt(this.embeddingsInitializer),embeddingsRegularizer:dt(this.embeddingsRegularizer),activityRegularizer:dt(this.activityRegularizer),embeddingsConstraint:Ut(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}};mA.className="Embedding";re.registerClass(mA);var Ki=class extends Xe{constructor(e){super(e||{});this.supportsMasking=!0}mergeFunction(e){throw new _e}computeElementwiseOpOutputShape(e,t){if(e==null||t==null)return null;if(e.length1)throw new U(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=e[0]==null?null:e[0].slice(1);for(let r=1;rr.length);e.indexOf(null)===-1&&es(a).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return V(()=>{if(e=e,this.reshapeRequired){let n=[],a=e.map(r=>r.rank);if(a.indexOf(null)===-1){let r=ns(a);for(let s of e){let i=s.rank;for(let o=0;o1){let l=Fa(1,u).concat([0]);n.push(Qe(o,l)),r=!0}else n.push(o)}let s=this.mergeFunction(n),i=s.rank;if(r){if(i==null){let o=s.shape,u=o.length,l=o[u-1],d=[l].concat(o.slice(0,o.length-1));s=Qe(s.reshape([-1,l]),[1,0]).reshape(d)}else if(i>1){let o=[i-1].concat(Fa(0,i-1));s=Qe(s,o)}}return s}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let t;e[0]==null?t=null:t=e[0].slice(1);for(let a=1;a{if(t==null)return null;if(!Array.isArray(t))throw new U("`mask` should be an Array");if(!Array.isArray(e))throw new U("`inputs` should be an Array");if(t.length!==e.length)throw new U(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(a=>a==null))return null;t=t.map(a=>a==null?a:mn(a,0));let n=t[0];for(let a=1;a{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new U("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return V(()=>fy(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new U("A `Concatenate` layer should be called on a list of inputs.");let t=e,n=t[0].slice(),a=this.axis<0?n.length+this.axis:this.axis;for(let r of t.slice(1)){if(n[a]==null||r[a]==null){n[a]=null;break}n[a]+=r[a]}return n}computeMask(e,t){if(t==null)return null;if(!Array.isArray(t))throw new U("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new U("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new U(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return V(()=>{let n=!0;if(t.forEach(s=>{if(s!=null){n=!1;return}}),n)return null;let a=[];for(let s=0;s3||t.shape.length>3)throw new _e("batchDot is not implemented for tensors of 4D or higher rank yet");if(k.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),k.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),typeof n=="number"&&(n=[n,n]),e.dtype==="complex64"||t.dtype==="complex64")throw new _e("batchDot is not implemented for complex64-type Tensors yet.");let a=e.shape.length,r=t.shape.length;n==null&&(n=[a-1,r-2]);let s=n;return V(()=>{let i;if(a>r){i=a-r;let u=[];for(let l=0;la){i=r-a;let u=[];for(let l=0;l0){let u;a>r?u=a+r-3:u=a-1;let l=[];for(let d=u;d"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0],n=e[1];if(t.length>3||n.length>3)throw new _e("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);if(t[a[0]]!==n[a[1]])throw new U(`Dimension incompatibility: ${t[a[0]]} !== ${n[a[1]]}`)}mergeFunction(e){if(e.length!==2)throw new U(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t=e[0],n=e[1],a;return Array.isArray(this.axes)?a=this.axes.map((r,s)=>sp(r,e[s].shape.length)):a=[sp(this.axes,t.shape.length),sp(this.axes,n.shape.length)],this.normalize&&(t=x0(t,a[0]),n=x0(n,a[1])),Hre(t,n,a)}interpretAxes(e,t){let n;return Array.isArray(this.axes)?n=this.axes:n=[sp(this.axes,e.length),sp(this.axes,t.length)],n}computeOutputShape(e){k.assert(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new _e("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);t.splice(a[0],1),n.splice(a[1],1),n.splice(0,1);let r=t.concat(n);return r.length===1&&r.push(1),r}computeMask(e,t){return null}getConfig(){let e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}};wA.className="Dot";re.registerClass(wA);var kA=class extends Xe{constructor(e){super(e);this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e);return Xd(()=>i0(n.shape,0,this.stddev).add(n),()=>n,t.training||!1)})}};kA.className="GaussianNoise";re.registerClass(kA);var IA=class extends Xe{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e);return this.rate>0&&this.rate<1?Xd(()=>{let a=Math.sqrt(this.rate/(1-this.rate));return n.mul(i0(n.shape,1,a))},()=>n,t.training||!1):n})}};IA.className="GaussianDropout";re.registerClass(IA);var SA=class extends Xe{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Le(e).shape}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return V(()=>{if(this.rate<1&&this.rate>0){let n=this._getNoiseShape(e);return Xd(()=>{let a=Le(e),r=1.6732632423543772,s=1.0507009873554805,i=-r*s,o=qr(Fl(n),this.rate);o=Hd(o,"float32");let u=((1-this.rate)*(1+this.rate*i**2))**-.5,l=-u*i*this.rate;return a.mul(o).add(o.add(-1).mul(i)).mul(u).add(l)},()=>Le(e),t.training||!1)}return e})}};SA.className="AlphaDropout";re.registerClass(SA);function ip(e,t,n,a,r,s=.001){let i;if(e.rank===2)i=g3(e,t,n,a,r,s);else if(e.rank===3)i=y3(e,t,n,a,r,s);else if(e.rank===4)i=A3(e,t,n,a,r,s);else throw new _e(`batchNormalization is not implemented for array of rank ${e.rank} yet`);return i}function Gre(e,t,n,a,r=.001){return V(()=>{let s=nh(e,a),i=s.mean,o=s.variance;return[ip(e,i,o,n,t,r),i,o]})}function qre(e,t,n,a,r=.001){return V(()=>{let s=nh(e,a),i=s.mean,o=s.variance,u=[];for(let h of Fa(0,e.rank))a.indexOf(h)!==-1?u.push(1):u.push(e.shape[h]);let l=i.reshape(u),d=o.reshape(u),p=t==null?null:t.reshape(u),c=n==null?null:n.reshape(u);return[ip(e,l,d,c,p,r),i,o]})}function Xre(e,t,n,a,r=.001){return k.arraysEqual(a.slice().sort(),Fa(0,e.rank-1))?Gre(e,t,n,a,r):qre(e,t,n,a,r)}var NA=class extends Xe{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=bt(e.betaInitializer||"zeros"),this.gammaInitializer=bt(e.gammaInitializer||"ones"),this.movingMeanInitializer=bt(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=bt(e.movingVarianceInitializer||"ones"),this.betaConstraint=Ht(e.betaConstraint),this.gammaConstraint=Ht(e.gammaConstraint),this.betaRegularizer=vt(e.betaRegularizer),this.gammaRegularizer=vt(e.gammaRegularizer)}build(e){e=st(e);let t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(n==null)throw new U(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new zt({ndim:e.length,axes:{[t]:n}})];let a=[n];this.scale&&(this.gamma=this.addWeight("gamma",a,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",a,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",a,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",a,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return V(()=>{let n=t.training==null?!1:t.training,a=Le(e),r=a.shape,s=r.length,i=Fa(0,s),o=this.axis>=0?this.axis:this.axis+s;i.splice(o,1);let u=Bi(1,s);u[o]=r[o];let l=i.slice();l.sort();let d=!k.arraysEqual(l,Fa(0,s).slice(0,s-1)),p=()=>{if(d){let g=this.movingMean.read().reshape(u),y=this.movingVariance.read().reshape(u),A=this.center?this.beta.read().reshape(u):null,x=this.scale?this.gamma.read().reshape(u):null;return ip(a,g,y,A,x,this.epsilon)}else return ip(a,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!n)return p();let[c,h,m]=Xre(a,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(g,y,A)=>{V(()=>{let x=1-A,v=g.read(),b=v.sub(y).mul(x);g.write(v.sub(b))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,m,this.momentum)})(),c})}getConfig(){let e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Tt(this.betaInitializer),gammaInitializer:Tt(this.gammaInitializer),movingMeanInitializer:Tt(this.movingMeanInitializer),movingVarianceInitializer:Tt(this.movingVarianceInitializer),betaRegularizer:dt(this.betaRegularizer),gammaRegularizer:dt(this.gammaRegularizer),betaConstraint:Ut(this.betaConstraint),gammaConstraint:Ut(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}};NA.className="BatchNormalization";re.registerClass(NA);var TA=class extends Xe{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(let t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=bt(e.betaInitializer||"zeros"),this.gammaInitializer=bt(e.gammaInitializer||"ones"),this.betaRegularizer=vt(e.betaRegularizer),this.gammaRegularizer=vt(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=st(e);let t=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let r=0;r=t)throw new Error(`Invalid axis: ${r}`);if(this.axis.length!==es(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);let n=this.axis.map(r=>e[r]),a=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,a):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,a):this.beta=null,this.built=!0}call(e,t){let n=Le(e),a=n.shape,r=a.length;return V(()=>{let s=!0,{mean:i,variance:o}=nh(n,this.axis,s),u=Bi(1,r);for(let m of this.axis)u[m]=a[m];let l=m=>m!=null&&m.shape.length!==r&&this.axis!==[r-1]?m.reshape(u):m,d=l(this.gamma.read()),p=l(this.beta.read()),c=[],h=[];for(let m=0;m{if(e.rank!==4)throw new U(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(t==null&&(t=[[1,1],[1,1]]),t.length!==2||t[0].length!==2||t[1].length!==2)throw new U("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=Ra()),n!=="channelsLast"&&n!=="channelsFirst")throw new U(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let a;return n==="channelsFirst"?a=[[0,0],[0,0],t[0],t[1]]:a=[[0,0],t[0],t[1],[0,0]],gr(e,a)})}var CA=class extends Xe{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?Ra():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new U(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if(typeof e.padding[0]=="number")t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new U(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],e.padding[1].length!==2)throw new U(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new zt({ndim:4})]}computeOutputShape(e){e=st(e);let t,n;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?t=e[2]+this.padding[0][0]+this.padding[0][1]:t=null,e[3]!=null&&e[3]>=0?n=e[3]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],e[1],t,n]):(e[1]!=null&&e[1]>=0?t=e[1]+this.padding[0][0]+this.padding[0][1]:t=null,e[2]!=null&&e[2]>=0?n=e[2]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],t,n,e[3]])}call(e,t){return V(()=>Kre(Le(e),this.padding,this.dataFormat))}getConfig(){let e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};CA.className="ZeroPadding2D";re.registerClass(CA);function $0(e,t,n,a,r,s){return V(()=>{Ft(r),S4(s),ca(a),n==null&&(n=[1,1]),a==null&&(a="valid"),r==null&&(r=Ra()),s==null&&(s="max"),e=Ky(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=hd(e,t,n,o):i=ld(e,t,n,o),r==="channelsFirst"&&(i=Qe(i,[0,3,1,2])),i})}function _8(e,t,n,a,r,s){return V(()=>{Ft(r),S4(s),ca(a),n==null&&(n=[1,1,1]),a==null&&(a="valid"),r==null&&(r=Ra()),s==null&&(s="max"),e=M8(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=Y1(e,t,n,o):i=O1(e,t,n,o),r==="channelsFirst"&&(i=Qe(i,[0,4,1,2,3])),i})}var P8=class extends Xe{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new U(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(Jt(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new U(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);Jt(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,ca(this.padding),this.inputSpec=[new zt({ndim:3})]}computeOutputShape(e){e=st(e);let t=za(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return V(()=>{this.invokeCallHook(e,t),e=Gd(Le(e),2);let n=this.poolingFunction(Le(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Vt(n,[2])})}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}},EA=class extends P8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"max")}};EA.className="MaxPooling1D";re.registerClass(EA);var RA=class extends P8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"avg")}};RA.className="AveragePooling1D";re.registerClass(RA);var L8=class extends Xe{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new U(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];Jt(this.poolSize,"poolSize"),Jt(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),ca(this.padding),this.inputSpec=[new zt({ndim:4})]}computeOutputShape(e){e=st(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2];return t=za(t,this.poolSize[0],this.padding,this.strides[0]),n=za(n,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return V(()=>(this.invokeCallHook(e,t),this.poolingFunction(Le(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},MA=class extends L8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"max")}};MA.className="MaxPooling2D";re.registerClass(MA);var FA=class extends L8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"avg")}};FA.className="AveragePooling2D";re.registerClass(FA);var W8=class extends Xe{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new U(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];Jt(this.poolSize,"poolSize"),Jt(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),ca(this.padding),this.inputSpec=[new zt({ndim:5})]}computeOutputShape(e){e=st(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[4]:e[3];return t=za(t,this.poolSize[0],this.padding,this.strides[0]),n=za(n,this.poolSize[1],this.padding,this.strides[1]),a=za(a,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n,a]:[e[0],t,n,a,e[4]]}call(e,t){return V(()=>(this.invokeCallHook(e,t),this.poolingFunction(Le(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},$A=class extends W8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),_8(e,t,n,a,r,"max")}};$A.className="MaxPooling3D";re.registerClass($A);var DA=class extends W8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),_8(e,t,n,a,r,"avg")}};DA.className="AveragePooling3D";re.registerClass(DA);var B8=class extends Xe{constructor(e){super(e);this.inputSpec=[new zt({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new _e}},OA=class extends B8{constructor(e){super(e||{})}call(e,t){return V(()=>{let n=Le(e);return Nt(n,1)})}};OA.className="GlobalAveragePooling1D";re.registerClass(OA);var zA=class extends B8{constructor(e){super(e||{})}call(e,t){return V(()=>{let n=Le(e);return Vn(n,1)})}};zA.className="GlobalMaxPooling1D";re.registerClass(zA);var V8=class extends Xe{constructor(e){super(e);this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),this.inputSpec=[new zt({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new _e}getConfig(){let e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},_A=class extends V8{call(e,t){return V(()=>{let n=Le(e);return this.dataFormat==="channelsLast"?Nt(n,[1,2]):Nt(n,[2,3])})}};_A.className="GlobalAveragePooling2D";re.registerClass(_A);var PA=class extends V8{call(e,t){return V(()=>{let n=Le(e);return this.dataFormat==="channelsLast"?Vn(n,[1,2]):Vn(n,[2,3])})}};PA.className="GlobalMaxPooling2D";re.registerClass(PA);var j8=class extends Xe{constructor(e){super(e);this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){let e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){let a=t.layer,r=Oa(a,n);delete t.layer;let s={layer:r};return Object.assign(s,t),new e(s)}},LA=class extends j8{constructor(e){super(e);this.supportsMasking=!0}build(e){if(e=st(e),e.length<3)throw new U(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];let t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=st(e);let t=[e[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),a=e[1];return[n[0],a].concat(n.slice(1))}call(e,t){return V(()=>(e=Le(e),O8((n,a)=>[Le(this.layer.call(n,t)),[]],e,[],!1,null,null,!1,!0)[1]))}};LA.className="TimeDistributed";re.registerClass(LA);function Zre(e){ji(nae,"BidirectionalMergeMode",e)}var Yre="concat",WA=class extends j8{constructor(e){super(e);let t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Oa(n),t.goBackwards=t.goBackwards!==!0;let a={};if(a.className=e.layer.getClassName(),a.config=t,this.backwardLayer=Oa(a),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?Yre:e.mergeMode,Zre(this.mergeMode),e.weights)throw new _e("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){let t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t=this.forwardLayer.computeOutputShape(e);Array.isArray(t)&&Array.isArray(t[0])||(t=[t]),t=t;let n,a,r;return this.returnState&&(r=t.slice(1)),n=t[0],n=n,this.mergeMode==="concat"?(n[n.length-1]*=2,a=[n]):this.mergeMode==null?a=[n,n.slice()]:a=[n],this.returnState?this.mergeMode==null?a.concat(r).concat(r.slice()):[n].concat(r).concat(r.slice()):$n(a)}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=D8(e,n,a,this.numConstants);if(e=r.inputs,n=r.initialState,a=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(n==null||n.length===0)&&a==null)return super.apply(e,t);let s=[],i=[];if(n!=null){let u=n.length;if(u%2>0)throw new U("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);let l=n.map(d=>new zt({shape:d.shape}));this.forwardLayer.stateSpec=l.slice(0,u/2),this.backwardLayer.stateSpec=l.slice(u/2),i.push(...l)}if(a!=null)throw new _e("Support for constants in Bidirectional layers is not implemented yet.");let o=s[0]instanceof Da;for(let u of s)if(u instanceof Da!==o)throw new U("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){let u=[e].concat(s),l=this.inputSpec.concat(i),d=this.inputSpec;this.inputSpec=l;let p=super.apply(u,t);return this.inputSpec=d,p}else return super.apply(e,t)}call(e,t){return V(()=>{let n=t.initialState,a,r;if(n==null)a=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{let o=n.slice(0,n.length/2),u=n.slice(n.length/2);a=this.forwardLayer.call(e,Object.assign(t,{initialState:o})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:u}))}let s;this.returnState&&(Array.isArray(a)&&(s=a.slice(1).concat(r.slice(1))),a=a[0],r=r[0]),this.returnSequences&&(r=Hn(r,1));let i;return this.mergeMode==="concat"?i=fy([a,r]):this.mergeMode==="sum"?i=ie(a,r):this.mergeMode==="ave"?i=B(.5,ie(a,r)):this.mergeMode==="mul"?i=B(a,r):this.mergeMode==null&&(i=[a,r]),this.returnState?this.mergeMode==null?i.concat(s):[i].concat(s):i})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ui(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Ui(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){Array.isArray(t)&&(t=t[0]);let n;if(this.returnSequences?this.mergeMode==null?n=[t,t]:n=t:this.mergeMode==null?n=[null,null]:n=null,this.returnState){let a=this.forwardLayer.states.map(r=>null);return Array.isArray(n)?n.concat(a).concat(a):[n].concat(a).concat(a)}else return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){let e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){let n=Oa(t.layer);if(delete t.layer,t.numConstants!=null)throw new _e("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");let a=t;return a.layer=n,new e(a)}};WA.className="Bidirectional";re.registerClass(WA);function Jre(e){return new eu(e)}function Qre(e){return new Gy(e)}function ese(e){return new jy(e)}function tse(e){return new Uy(e)}function nse(e){return new Hy(e)}function ase(e){return new Xy(e)}function rse(e){return new qy(e)}function sse(e){return new T0(e)}function ise(e){return new tp(e)}function ose(e){return new Yy(e)}function lse(e){return new np(e)}function use(e){return new Jy(e)}function dse(e){return new Qy(e)}function pse(e){return new eA(e)}function cse(e){return new tA(e)}function hse(e){return new nA(e)}function fse(e){return new dA(e)}function mse(e){return new lA(e)}function gse(e){return new F0(e)}function yse(e){return new oA(e)}function Ase(e){return new uA(e)}function xse(e){return new pA(e)}function bse(e){return new cA(e)}function vse(e){return new hA(e)}function wse(e){return new mA(e)}function kse(e){return new gA(e)}function Ise(e){return new AA(e)}function Sse(e){return new vA(e)}function Nse(e){return new xA(e)}function Tse(e){return new bA(e)}function Cse(e){return new yA(e)}function Ese(e){return new wA(e)}function Rse(e){return new NA(e)}function Mse(e){return new TA(e)}function Fse(e){return new CA(e)}function BA(e){return new RA(e)}function $se(e){return BA(e)}function Dse(e){return BA(e)}function VA(e){return new FA(e)}function Ose(e){return VA(e)}function zse(e){return VA(e)}function jA(e){return new DA(e)}function _se(e){return jA(e)}function Pse(e){return jA(e)}function Lse(e){return new OA(e)}function Wse(e){return new _A(e)}function U8(e){return new zA(e)}function H8(e){return new PA(e)}function G8(e){return new EA(e)}function q8(e){return new MA(e)}function Bse(e){return new $A(e)}function Vse(e){return new rA(e)}function jse(e){return new E0(e)}function Use(e){return new sA(e)}function Hse(e){return new rp(e)}function Gse(e){return new aA(e)}function qse(e){return new C0(e)}function Xse(e){return new iA(e)}function Kse(e){return new M0(e)}function Zse(e){return new ar(e)}function Yse(e){return new R0(e)}function Jse(e){return new WA(e)}function Qse(e){return new LA(e)}var eie=U8,tie=H8,nie=G8,aie=q8;function rie(e){return new kA(e)}function sie(e){return new IA(e)}function iie(e){return new SA(e)}function oie(e){return new fA(e)}var X8={};Fe(X8,{MAPE:()=>Aie,MSE:()=>vie,binaryAccuracy:()=>lie,binaryCrossentropy:()=>uie,categoricalAccuracy:()=>pie,categoricalCrossentropy:()=>cie,cosineProximity:()=>mie,mape:()=>xie,meanAbsoluteError:()=>gie,meanAbsolutePercentageError:()=>yie,meanSquaredError:()=>bie,mse:()=>wie,precision:()=>hie,recall:()=>fie,sparseCategoricalAccuracy:()=>die});function lie(e,t){return Ey(e,t)}function uie(e,t){return Z4(e,t)}function die(e,t){return Y4(e,t)}function pie(e,t){return Ry(e,t)}function cie(e,t){return My(e,t)}function hie(e,t){return K4(e,t)}function fie(e,t){return Yae(e,t)}function mie(e,t){return Ty(e,t)}function gie(e,t){return b0(e,t)}function yie(e,t){return nu(e,t)}function Aie(e,t){return nu(e,t)}function xie(e,t){return nu(e,t)}function bie(e,t){return Gi(e,t)}function vie(e,t){return Gi(e,t)}function wie(e,t){return Gi(e,t)}var K8={};Fe(K8,{modelFromJSON:()=>Mre});var Z8={};Fe(Z8,{l1:()=>Iie,l1l2:()=>kie,l2:()=>Sie});function kie(e){return new Qd(e)}function Iie(e){return Lre(e)}function Sie(e){return Wre(e)}var Y8=class extends tu{constructor(){super(...arguments);this.model=null}setModel(e){if(!(e instanceof kr))throw new Error("model must be a LayersModel, not some other Container");this.model=e}};function D0(e,t){return et}var Q8=class extends Y8{constructor(e){super();if(e==null&&(e={}),e.restoreBestWeights)throw new _e("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,["auto","min","max"].indexOf(this.mode)===-1&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),this.mode==="min"?this.monitorFunc=D0:this.mode==="max"?this.monitorFunc=J8:this.monitor.indexOf("acc")!==-1?this.monitorFunc=J8:this.monitorFunc=D0,this.monitorFunc===D0&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,this.baseline!=null?this.best=this.baseline:this.best=this.monitorFunc===D0?Infinity:-Infinity}async onEpochEnd(e,t){await as(t);let n=this.getMonitorValue(t);n!=null&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){e==null&&(e={});let t=e[this.monitor];return t==null&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}};function Nie(e){return new Q8(e)}var Tie={earlyStopping:Nie},_a;(function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"})(_a||(_a={}));var ek;(function(e){let t;(function(n){n[n.LEGACY=0]="LEGACY",n[n.V1=1]="V1",n[n.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(ek||(ek={}));var UA={};function Cie(e,t){let n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};UA[e]=n}function tk(e){return UA[e]}function Eie(e){delete UA[e]}function I(e,t,n,a,r){let s=t.inputParams[e];if(s&&s.inputIndexStart!==void 0){let o=s.inputIndexStart,u=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd;if(s.type==="tensor")return kn(t.inputNames[s.inputIndexStart],n,a,r);if(s.type==="tensors")return t.inputNames.slice(o,u).map(p=>kn(p,n,a,r));let l=kn(t.inputNames.slice(o)[0],n,a,r),d=l.dataSync();return s.type==="number"?d[0]:k.toNestedArray(l.shape,d)}let i=t.attrParams[e];return i&&i.value}function kn(e,t,n,a){let[r,s]=Kn(e);if(a!=null){let o=a.getHashTableHandleByName(r);if(o!=null)return o}let i=n.currentContextIds.find(o=>!!t[O0(r,o)]);return i!==void 0?t[O0(r,i)][s]:void 0}function Rie(e,t,n){return t[O0(e,n.currentContextId)]}function Ir(e,t){let[n,a,r]=Kn(e);return[O0(n,t&&t.currentContextId),a,r]}function O0(e,t){return t?`${e}-${t}`:e}function Kn(e){let t=e.split(":");if(t.length===1)return[e,0,void 0];let n=t[0],a=t.length===3?t[1]:void 0,r=Number(t[t.length-1]);return[n,r,a]}function z0(e,t,n){let a=I("pad",e,t,n);if(a==="explicit"){a=I("explicitPaddings",e,t,n);let r=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)r[s][0]=a[s*2],r[s][1]=a[s*2+1];return r}return a}function Sr(e){return e.kept?e:Ha(e)}var nk={};Fe(nk,{json:()=>Mie});var Mie=[{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}]},{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}]}],ak={};Fe(ak,{json:()=>Fie});var Fie=[{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}]},{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}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{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}]}],rk={};Fe(rk,{json:()=>$ie});var $ie=[{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:"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"}]}],sk={};Fe(sk,{json:()=>Die});var Die=[{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},{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"}]},{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"}]}],ik={};Fe(ik,{json:()=>Oie});var Oie=[{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",notSupported:!0}]},{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:"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:"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"}]}],ok={};Fe(ok,{json:()=>zie});var zie=[{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}]}],lk={};Fe(lk,{json:()=>_ie});var _ie=[{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:"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"}]}],uk={};Fe(uk,{json:()=>Pie});var Pie=[{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"}]}],dk={};Fe(dk,{json:()=>Lie});var Lie=[{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"}],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"}]}],pk={};Fe(pk,{json:()=>Wie});var Wie=[{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"}]}],ck={};Fe(ck,{json:()=>Bie});var Bie=[{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}]},{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}]}],hk={};Fe(hk,{json:()=>Vie});var Vie=[{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:"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}]},{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"}]}],fk={};Fe(fk,{json:()=>jie});var jie=[{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"}]},{tfOpName:"SparseToDense",category:"normalization",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:!0,notSupported:!0}]}],mk={};Fe(mk,{json:()=>Uie});var Uie=[{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"}]},{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"}]}],gk={};Fe(gk,{json:()=>Hie});var Hie=[{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}]}],yk={};Fe(yk,{json:()=>Gie});var Gie=[{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"}]}],Ak={};Fe(Ak,{json:()=>qie});var qie=[{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}]}],xk={};Fe(xk,{json:()=>Xie});var Xie=[{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"}]}],bk={};Fe(bk,{json:()=>Kie});var Kie=[{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:"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:[]}],vk=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[nk,ak,rk,sk,ik,ok,lk,uk,dk,pk,ck,hk,fk,mk,gk,yk,Ak,xk,bk],t=[].concat(...e.map(n=>n.json));this.opMappers=t.reduce((n,a)=>(n[a.tfOpName]=a,n),{})}transformGraph(e,t={}){let n=e.node,a=[],r=[],s=[],i=n.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?a.push(m[f.name]):f.op==="Const"?r.push(m[f.name]):(f.input==null||f.input.length===0)&&s.push(m[f.name]),m),{}),o=[],u=[],l={},d={};t!=null&&(l=this.mapSignatureEntries(t.inputs),d=this.mapSignatureEntries(t.outputs));let p=Object.keys(i);p.forEach(m=>{let f=i[m];f.inputNames.forEach((g,y)=>{let[A,,x]=Ir(g),v=i[A];if(v.outputs!=null){let b=v.outputs.indexOf(x);if(b!==-1){let w=`${A}:${b}`;f.inputNames[y]=w}}f.inputs.push(v),v.children.push(f)})}),Object.keys(d).length===0?p.forEach(m=>{let f=i[m];f.children.length===0&&u.push(f)}):Object.keys(d).forEach(m=>{let[f]=Ir(m),g=i[f];g!=null&&(g.signatureKey=d[m],u.push(g))}),Object.keys(l).length>0?Object.keys(l).forEach(m=>{let[f]=Ir(m),g=i[f];g&&(g.signatureKey=l[m],o.push(g))}):o=a;let c={};e.library!=null&&e.library.function!=null&&(c=e.library.function.reduce((m,f)=>(m[f.signature.name]=this.mapFunction(f),m),{}));let h={nodes:i,inputs:o,outputs:u,weights:r,placeholders:a,signature:t,functions:c};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){let t=tk(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(a=>a.startsWith("^")?a.substr(1):a),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(n.inputParams=t.inputs.reduce((a,r)=>(a[r.name]={type:r.type,inputIndexStart:r.start,inputIndexEnd:r.end},a),{})),t.attrs!=null&&(n.attrParams=t.attrs.reduce((a,r)=>{let s=r.type,i;switch(r.type){case"string":i=HA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=HA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":i=QA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=QA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":i=qA(e.attr,r.tfName,r.defaultValue||0),i===void 0&&!!r.tfDeprecatedName&&(i=qA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":i=JA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=JA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":i=GA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=GA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":i=t2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=t2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":i=YA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=YA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":i=e2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=e2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":i=KA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=KA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":i=ZA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=ZA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":i=kk(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=kk(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${r.type} for op: ${e.op}`)}return a[r.name]={value:i,type:s},a},{})),n}mapFunction(e){let t=e.nodeDef,n=[],a=[],r={};t!=null&&(r=t.reduce((l,d)=>(l[d.name]=this.mapNode(d),d.op==="Const"&&a.push(l[d.name]),l),{}));let s=[],i=[];e.signature.inputArg.forEach(l=>{let[d]=Ir(l.name),p={name:d,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:XA(l.type),type:"dtype"}},children:[]};p.signatureKey=l.name,s.push(p),r[d]=p}),Object.keys(r).forEach(l=>{let d=r[l];d.inputNames.forEach((p,c)=>{let[h,,m]=Ir(p),f=r[h];if(f.outputs!=null){let g=f.outputs.indexOf(m);if(g!==-1){let y=`${h}:${g}`;d.inputNames[c]=y}}d.inputs.push(f),f.children.push(d)})});let o=e.ret;e.signature.outputArg.forEach(l=>{let[d,p]=Ir(o[l.name]),c=r[d];c!=null&&(c.defaultOutput=p,i.push(c))});let u=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:i,weights:a,placeholders:n,signature:u}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n),t),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return t!=null&&(n=t[n]),{name:n,dtype:e.type}}};function Zie(e){let t=te().global;if(typeof t.atob!="undefined")return t.atob(e);if(typeof Buffer!="undefined")return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function wk(e,t){let n=Array.isArray(e)?String.fromCharCode.apply(null,e):Zie(e);return t?n:n.toLowerCase()}function HA(e,t,n,a=!1){let r=e[t];return r!=null?wk(r.s,a):n}function GA(e,t,n){let a=e[t];return a?a.b:n}function qA(e,t,n){let a=e[t]||{},r=a.i!=null?a.i:a.f!=null?a.f:n;return typeof r=="number"?r:parseInt(r,10)}function XA(e){switch(typeof e=="string"&&(e=_a[e]),e){case _a.DT_FLOAT:return"float32";case _a.DT_INT32:case _a.DT_INT64:case _a.DT_INT8:case _a.DT_UINT8:return"int32";case _a.DT_BOOL:return"bool";case _a.DT_DOUBLE:return"float32";case _a.DT_STRING:return"string";default:return null}}function kk(e,t,n){let a=e[t];return a&&a.func?a.func.name:n}function KA(e,t,n){let a=e[t];return a&&a.type?XA(a.type):n}function ZA(e,t,n){let a=e[t];return a&&a.list&&a.list.type?a.list.type.map(r=>XA(r)):n}function Ik(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function YA(e,t,n){let a=e[t];return a&&a.shape?Ik(a.shape):n}function JA(e,t,n){let a=e[t];return a?((a.list.f&&a.list.f.length?a.list.f:a.list.i)||[]).map(r=>typeof r=="number"?r:parseInt(r,10)):n}function QA(e,t,n,a=!1){let r=e[t];return r&&r.list&&r.list.s?r.list.s.map(s=>wk(s,a)):n}function e2(e,t,n){let a=e[t];return a&&a.list&&a.list.shape?a.list.shape.map(r=>Ik(r)):n}function t2(e,t,n){let a=e[t];return a&&a.list&&a.list.b?a.list.b:n}var Yie=class{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(a=>this.getInput(a)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((a,r)=>(a[r]=this.getAttr(r),a),{}))}getInput(e){return kn(e,this.tensorMap,this.context)}getAttr(e,t){let n=this.node.rawAttrs[e];if(n.tensor!=null)return kn(e,this.tensorMap,this.context);if(n.i!=null||n.f!=null)return qA(this.node.rawAttrs,e,t);if(n.s!=null)return HA(this.node.rawAttrs,e,t);if(n.b!=null)return GA(this.node.rawAttrs,e,t);if(n.shape!=null)return YA(this.node.rawAttrs,e,t);if(n.type!=null)return KA(this.node.rawAttrs,e,t);if(n.list!=null){if(n.list.i!=null||n.list.f!=null)return JA(this.node.rawAttrs,e,t);if(n.list.s!=null)return QA(this.node.rawAttrs,e,t);if(n.list.shape!=null)return e2(this.node.rawAttrs,e,t);if(n.list.b!=null)return t2(this.node.rawAttrs,e,t);if(n.list.type!=null)return ZA(this.node.rawAttrs,e,t)}return t}},Jie=(e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[ie(I("a",e,t,n),I("b",e,t,n))];case"AddN":return[jc(I("tensors",e,t,n))];case"FloorMod":case"Mod":return[Q1(I("a",e,t,n),I("b",e,t,n))];case"Mul":return[B(I("a",e,t,n),I("b",e,t,n))];case"RealDiv":case"Div":return[me(I("a",e,t,n),I("b",e,t,n))];case"DivNoNan":return[V1(I("a",e,t,n),I("b",e,t,n))];case"FloorDiv":return[Vc(I("a",e,t,n),I("b",e,t,n))];case"Sub":return[ye(I("a",e,t,n),I("b",e,t,n))];case"Minimum":return[Ml(I("a",e,t,n),I("b",e,t,n))];case"Maximum":return[Xa(I("a",e,t,n),I("b",e,t,n))];case"Pow":return[yr(I("a",e,t,n),I("b",e,t,n))];case"SquaredDifference":return[hh(I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Qie=(e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Wt(I("x",e,t,n))];case"Acos":return[S1(I("x",e,t,n))];case"Acosh":return[N1(I("x",e,t,n))];case"Asin":return[C1(I("x",e,t,n))];case"Asinh":return[E1(I("x",e,t,n))];case"Atan":return[R1(I("x",e,t,n))];case"Atan2":return[M1(I("x",e,t,n),I("y",e,t,n))];case"Atanh":return[F1(I("x",e,t,n))];case"Ceil":return[_1(I("x",e,t,n))];case"Complex":return[Wr(I("real",e,t,n),I("imag",e,t,n))];case"Cos":return[dd(I("x",e,t,n))];case"Cosh":return[Xc(I("x",e,t,n))];case"Elu":return[Cl(I("x",e,t,n))];case"Erf":return[j1(I("x",e,t,n))];case"Exp":return[la(I("x",e,t,n))];case"Expm1":return[U1(I("x",e,t,n))];case"Floor":return[Rl(I("x",e,t,n))];case"Log":return[Bn(I("x",e,t,n))];case"Log1p":return[Jc(I("x",e,t,n))];case"Imag":return[Zc(I("x",e,t,n))];case"Neg":return[St(I("x",e,t,n))];case"Reciprocal":return[ng(I("x",e,t,n))];case"Real":return[yd(I("x",e,t,n))];case"Relu":return[Ka(I("x",e,t,n))];case"Round":return[sh(I("x",e,t,n))];case"Selu":return[oh(I("x",e,t,n))];case"Sigmoid":return[Rn(I("x",e,t,n))];case"Sin":return[lh(I("x",e,t,n))];case"Sign":return[rg(I("x",e,t,n))];case"Sinh":return[uh(I("x",e,t,n))];case"Softplus":return[Ci(I("x",e,t,n))];case"Sqrt":return[an(I("x",e,t,n))];case"Square":return[ot(I("x",e,t,n))];case"Tanh":return[Si(I("x",e,t,n))];case"Tan":return[og(I("x",e,t,n))];case"ClipByValue":return[Mn(I("x",e,t,n),I("clipValueMin",e,t,n),I("clipValueMax",e,t,n))];case"Relu6":return[rh(I("x",e,t,n))];case"Rsqrt":return[ih(kn(e.inputNames[0],t,n))];case"Prod":return[ah(I("x",e,t,n),I("axes",e,t,n))];case"LeakyRelu":return[pd(I("x",e,t,n),I("alpha",e,t,n))];case"Prelu":return[gd(I("x",e,t,n),I("alpha",e,t,n))];case"IsNan":return[G1(kn(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function ka(e,t,n=""){if(!(typeof e=="number"||typeof t=="number")){k.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let a=0;an+` Shapes ${e} and ${t} must match`)}}}function Sk(e){return!(typeof e=="number"||e.some(t=>t<0))}function op(e,t,n){let a=n2(e,n),r=!Sk(a);if(r&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${a}`);if(r&&t.forEach(s=>{a=n2(s.shape,a)}),!Sk(a))throw new Error(`Non-fully-defined elementShape: ${a}`);return a}function n2(e,t){if(typeof e=="number")return t;if(typeof t=="number")return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);let n=[];for(let a=0;a=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[a]=r>=0?r:s}return n}var eoe=class{constructor(e,t,n,a,r,s,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=a,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Kt(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()}`);let 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}`);let n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, +2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(l!=null){let u={};for(let h of Object.keys(ba))u[h]=ba[h];for(let h of Object.keys(n))u[h]=n[h];let d=s.config;d.customObjects=u;let p=Object.assign({},ba);for(let h of Object.keys(n))ba[h]=n[h];iy(s.config);let c=l(o,s.config,n,r);return ba=Object.assign({},p),c}else{let u=Object.assign({},ba);for(let p of Object.keys(n))ba[p]=n[p];let d=new o(s.config);return ba=Object.assign({},u),d}}}function Gne(e,t){return et?1:0}function r0(e,t){return-1*Gne(e,t)}function es(e){if(e==null)return e;let t=[];for(let n of e)t.indexOf(n)===-1&&t.push(n);return t}function qne(e){if(e==null)throw new U(`Invalid value in obj: ${JSON.stringify(e)}`);for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function ji(e,t,n){if(n!=null&&e.indexOf(n)<0)throw new U(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function oy(e,t,n=0,a=Infinity){return Qa(n>=0),Qa(a>=n),Array.isArray(e)&&e.length>=n&&e.length<=a&&e.every(r=>typeof r===t)}function Jt(e,t){Array.isArray(e)?(k.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((n,a)=>Jt(n,`element ${a+1} of ${t}`))):k.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${v4(e)}.`)}function v4(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>v4(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function Xne(e,t){let n=k.now(),a;return(...r)=>{let s=k.now();return s-nan(Se(B(e,e),t,!0)))}var jd=class extends re.Serializable{getConfig(){return{}}},uy=class extends jd{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return V(()=>{let t=ly(e,this.axis),n=Mn(t,0,this.maxValue);return B(e,me(n,ie(jt(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}};uy.className="MaxNorm";re.registerClass(uy);var dy=class extends jd{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return V(()=>me(e,ie(jt(),ly(e,this.axis))))}getConfig(){return{axis:this.axis}}};dy.className="UnitNorm";re.registerClass(dy);var py=class extends jd{apply(e){return Ka(e)}};py.className="NonNeg";re.registerClass(py);var cy=class extends jd{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return V(()=>{let t=ly(e,this.axis),n=ie(B(this.rate,Mn(t,this.minValue,this.maxValue)),B(1-this.rate,t));return B(e,me(n,ie(jt(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}};cy.className="MinMaxNorm";re.registerClass(cy);var k4={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Ut(e){return sy(e)}function I4(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"constraint")}function Ht(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in k4?k4[e]:e,config:{}};return I4(t)}else return e instanceof jd?e:I4(e)}function Kne(e){return new uy(e)}function Zne(e){return new dy(e)}function Yne(){return new py}function Jne(e){return new cy(e)}var S4={};Fe(S4,{constant:()=>vae,glorotNormal:()=>Cae,glorotUniform:()=>Tae,heNormal:()=>Eae,heUniform:()=>Rae,identity:()=>Sae,leCunNormal:()=>Mae,leCunUniform:()=>Fae,ones:()=>bae,orthogonal:()=>$ae,randomNormal:()=>kae,randomUniform:()=>wae,truncatedNormal:()=>Iae,varianceScaling:()=>Nae,zeros:()=>xae});var Qne=["channelsFirst","channelsLast"],eae=["nearest","bilinear"],tae=["valid","same","causal"],nae=["max","avg"],aae=["sum","mul","concat","ave"],Ql=new Map;function Ft(e){ji(Qne,"DataFormat",e)}function rae(e){ji(eae,"InterpolationFormat",e)}function ca(e){ji(tae,"PaddingMode",e)}function N4(e){ji(nae,"PoolMode",e)}var Ud=[],T4="/";function Ui(e,t){Ud.push(e);try{let n=t();return Ud.pop(),n}catch(n){throw Ud.pop(),n}}function sae(){return Ud.length===0?"":Ud.join(T4)+T4}function C4(e){if(!R4(e))throw new Error("Not a valid tensor name: '"+e+"'");return sae()+e}function E4(e){if(!R4(e))throw new Error("Not a valid tensor name: '"+e+"'");Ql.has(e)||Ql.set(e,0);let t=Ql.get(e);if(Ql.set(e,Ql.get(e)+1),t>0){let n=`${e}_${t}`;return Ql.set(n,1),n}else return e}var iae=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function R4(e){return!!e.match(iae)}function oae(e){return e===parseInt(e.toString(),10)}function ts(e,t,n){t==null&&(t=0),n==null&&(n=e.length);let a=1;for(let r=t;rt&&(t=a)}return t}function Fa(e,t){if(t{if(e.shape.length!==2)throw new U(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);let n=Gd(e,1);return my(n,[1,t,1])})}function uae(e){let t=[ts(e.shape)];return e.reshape(t)}function dae(e){if(e.rank<=1)throw new U(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);let t=[e.shape[0],ts(e.shape,1)];return e.reshape(t)}function Hi(e,t,n){return V(()=>{switch(e.rank){case 1:return dh(e,t,n);case 2:return sg(e,[t,0],[n,e.shape[1]]);case 3:return ph(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Ad(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Re(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Re(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new U(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function hy(e,t,n){return V(()=>{switch(e.rank){case 1:return dh(e,t,n);case 2:return sg(e,[0,t],[e.shape[0],n]);case 3:return ph(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Ad(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new U(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function s0(e,t,n,a){return V(()=>{switch(e.rank){case 1:return dh(e,t,n);case 2:switch(a){case 1:return Hi(e,t,n);case 2:return hy(e,t,n);default:throw new U(`The axis is not within the rank of the tensor ${a}`)}case 3:switch(a){case 1:return Hi(e,t,n);case 2:return ph(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return hy(e,t,n);default:throw new U(`The axis is not within the rank of the tensor ${a}`)}case 4:switch(a){case 1:return Hi(e,t,n);case 2:return Ad(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Ad(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return hy(e,t,n);default:throw new U(`The axis is not within the rank of the tensor ${a}`)}default:throw new U(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function fy(e,t=-1){let n;return t<0&&(n=e[0].rank,n!==0?t=n:t=0),t===e[0].rank&&(t=-1),lt(e,t)}function M4(e,t){switch(e.rank){case 1:return b3([e,t]);case 2:return Tl([e,t],0);case 3:return v3([e,t],0);case 4:return w3([e,t],0);default:throw new U(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function my(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new U(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Gr(e,t)}function i0(e,t=0,n=1,a,r){return W3(e,t,n,a,r)}function er(e,t,n,a){if(e.rank<2||t.rank<2)throw new _e(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){let r=e.shape.slice(-1)[0],s=t.shape.slice(-2)[0];if(r!==s)throw new _e(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(e.rank===2&&t.rank===2){let r=!1,s=!1;return Kr.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:a?gy(e.rank,a,Ra()):null,activation:n})}else{let r=e.shape.slice(),s=r.pop();e=e.reshape([-1,s]);let i=t.shape.slice(),o=i.pop(),l=i.pop(),u=[...i,o],d=Array.from({length:t.rank},(m,f)=>f===0?t.rank-2:f<=t.rank-2?f-1:f);t=t.transpose(d).reshape([l,-1]);let p=[...r,...u],c=!1,h=!1;return Kr.matMul({a:e,b:t,transposeA:c,transposeB:h,bias:a?gy(e.rank,a,Ra()):null,activation:n}).reshape(p)}}function F4(e,t,n){return V(()=>(Array.isArray(t)?t=Dt(t,"int32"):t=t.toInt(),Ti(e,t,n)))}function qd(e){return B(e,e)}function gy(e,t,n){let a=t.shape;if(t.rank!==1&&t.rank!==e)throw new U(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(e===5){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1,1]):t.reshape([1,a[3],a[0],a[1],a[2]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===4){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1]):t.reshape([1,a[2],a[0],a[1]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===3){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1]):t.reshape([1,a[1],a[0]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,a[0]]):t.reshape([1].concat(a))}else if(e<3)return t;throw new U(`Unsupported input rank by biasAdd: ${t.rank}`)}function $a(e,t,n){return V(()=>(n==null&&(n=Ra()),Ft(n),e.add(gy(e.rank,t,n))))}function pae(e,t=1){if(t!==1)throw new _e(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return El(e)}function cae(e){return V(()=>me(e,Wt(e).add(1)))}function $4(e,t,n,a){return V(()=>q3(e,t,n,a))}function hae(e){return V(()=>{let t=ie(.5,B(.2,e));return Mn(t,0,1)})}function Xd(e,t,n=!1){return n?e():t()}var fae=["fanIn","fanOut","fanAvg"],mae=["normal","uniform","truncatedNormal"];function gae(e){ji(fae,"FanMode",e)}function yae(e){ji(mae,"Distribution",e)}var va=class extends re.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}},yy=class extends va{apply(e,t){return $t(e,t)}};yy.className="Zeros";re.registerClass(yy);var o0=class extends va{apply(e,t){return jn(e,t)}};o0.className="Ones";re.registerClass(o0);var Ay=class extends va{constructor(e){super();if(typeof e!="object")throw new U(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new U(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return V(()=>B(ke(this.value),jn(e,t)))}getConfig(){return{value:this.value}}};Ay.className="Constant";re.registerClass(Ay);var xy=class extends va{constructor(e){super();this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return $l(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}};xy.className="RandomUniform";re.registerClass(xy);var by=class extends va{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new _e(`randomNormal does not support dType ${t}.`);return i0(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};by.className="RandomNormal";re.registerClass(by);var vy=class extends va{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new _e(`truncatedNormal does not support dType ${t}.`);return fh(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};vy.className="TruncatedNormal";re.registerClass(vy);var wy=class extends va{constructor(e){super();this.gain=e.gain!=null?e.gain:1}apply(e,t){return V(()=>{if(e.length!==2||e[0]!==e[1])throw new U("Identity matrix initializer can only be used for 2D square matrices.");return B(this.gain,H1(e[0]))})}getConfig(){return{gain:this.gain}}};wy.className="Identity";re.registerClass(wy);function Aae(e,t="channelsLast"){let n,a;if(Ft(t),e.length===2)n=e[0],a=e[1];else if([3,4,5].indexOf(e.length)!==-1){if(t==="channelsFirst"){let r=ts(e,2);n=e[1]*r,a=e[0]*r}else if(t==="channelsLast"){let r=ts(e,0,e.length-2);n=e[e.length-2]*r,a=e[e.length-1]*r}}else{let r=ts(e);n=Math.sqrt(r),a=Math.sqrt(r)}return[n,a]}var Dn=class extends va{constructor(e){super();if(e.scale<0)throw new U(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,gae(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,yae(this.distribution),this.seed=e.seed}apply(e,t){let n=Aae(e),a=n[0],r=n[1],s=this.scale;if(this.mode==="fanIn"?s/=Math.max(1,a):this.mode==="fanOut"?s/=Math.max(1,r):s/=Math.max(1,(a+r)/2),this.distribution==="normal"){let i=Math.sqrt(s);if(t=t||"float32",t!=="float32"&&t!=="int32")throw new _e(`${this.getClassName()} does not support dType ${t}.`);return fh(e,0,i,t,this.seed)}else{let i=Math.sqrt(3*s);return $l(e,-i,i,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}};Dn.className="VarianceScaling";re.registerClass(Dn);var l0=class extends Dn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};l0.className="GlorotUniform";re.registerClass(l0);var u0=class extends Dn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};u0.className="GlorotNormal";re.registerClass(u0);var d0=class extends Dn{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};d0.className="HeNormal";re.registerClass(d0);var p0=class extends Dn{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};p0.className="HeUniform";re.registerClass(p0);var c0=class extends Dn{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};c0.className="LeCunNormal";re.registerClass(c0);var h0=class extends Dn{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Dn.className}};h0.className="LeCunNormal";re.registerClass(h0);var ky=class extends va{constructor(e){super();if(this.DEFAULT_GAIN=1,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,this.seed!=null)throw new _e("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return V(()=>{if(e.length<2)throw new _e("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);let n=e[0]>e[1]?[e[1],e[0]]:e,a=i0(n,0,1,"float32"),r=i7.gramSchmidt(a);return e[0]>e[1]&&(r=r.transpose()),B(this.gain,r)})}getConfig(){return{gain:this.gain,seed:this.seed}}};ky.className="Orthogonal";re.registerClass(ky);var D4={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function O4(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"initializer")}function Tt(e){return sy(e)}function bt(e){if(typeof e=="string"){let t=e in D4?D4[e]:e;if(t==="GlorotNormal")return new u0;if(t==="GlorotUniform")return new l0;if(t==="HeNormal")return new d0;if(t==="HeUniform")return new p0;if(t==="LeCunNormal")return new c0;if(t==="LeCunUniform")return new h0;{let n={};return n.className=t,n.config={},O4(n)}}else return e instanceof va?e:O4(e)}function xae(){return new yy}function bae(){return new o0}function vae(e){return new Ay(e)}function wae(e){return new xy(e)}function kae(e){return new by(e)}function Iae(e){return new vy(e)}function Sae(e){return new wy(e)}function Nae(e){return new Dn(e)}function Tae(e){return new l0(e)}function Cae(e){return new u0(e)}function Eae(e){return new d0(e)}function Rae(e){return new p0(e)}function Mae(e){return new c0(e)}function Fae(e){return new h0(e)}function $ae(e){return new ky(e)}var z4={};Fe(z4,{Layer:()=>Xe,RNN:()=>ar,RNNCell:()=>ap,activation:()=>mse,add:()=>Ise,alphaDropout:()=>oie,average:()=>Sse,averagePooling1d:()=>BA,averagePooling2d:()=>VA,averagePooling3d:()=>jA,avgPool1d:()=>Dse,avgPool2d:()=>zse,avgPool3d:()=>Pse,avgPooling1d:()=>Ose,avgPooling2d:()=>_se,avgPooling3d:()=>Lse,batchNormalization:()=>Mse,bidirectional:()=>Qse,concatenate:()=>Nse,conv1d:()=>ise,conv2d:()=>ose,conv2dTranspose:()=>lse,conv3d:()=>use,conv3dTranspose:()=>dse,convLstm2d:()=>Kse,convLstm2dCell:()=>Zse,cropping2D:()=>cse,dense:()=>gse,depthwiseConv2d:()=>fse,dot:()=>Rse,dropout:()=>yse,elu:()=>ese,embedding:()=>kse,flatten:()=>xse,gaussianDropout:()=>iie,gaussianNoise:()=>sie,globalAveragePooling1d:()=>Wse,globalAveragePooling2d:()=>Bse,globalMaxPool1d:()=>tie,globalMaxPool2d:()=>nie,globalMaxPooling1d:()=>H8,globalMaxPooling2d:()=>G8,gru:()=>jse,gruCell:()=>Use,input:()=>m8,inputLayer:()=>Qre,layerNormalization:()=>Fse,leakyReLU:()=>nse,lstm:()=>Hse,lstmCell:()=>Gse,masking:()=>lie,maxPool1d:()=>aie,maxPool2d:()=>rie,maxPooling1d:()=>q8,maxPooling2d:()=>X8,maxPooling3d:()=>Vse,maximum:()=>Tse,minimum:()=>Cse,multiply:()=>Ese,permute:()=>wse,prelu:()=>ase,reLU:()=>tse,repeatVector:()=>bse,reshape:()=>vse,rnn:()=>Yse,separableConv2d:()=>pse,simpleRNN:()=>qse,simpleRNNCell:()=>Xse,softmax:()=>rse,spatialDropout1d:()=>Ase,stackedRNNCells:()=>Jse,thresholdedReLU:()=>sse,timeDistributed:()=>eie,upSampling2d:()=>hse,zeroPadding2d:()=>$se});var Dae=0;function _4(){return Dae++}var f0={};function m0(e=""){return e in f0||(f0[e]=0),f0[e]+=1,e+f0[e].toString()}function Iy(e){return Array.isArray(e)&&Array.isArray(e[0])}function g0(e){return e.length===0?[]:Array.isArray(e[0])?e:[e]}function Le(e){let t;if(Array.isArray(e)){if(e.length!==1)throw new U(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function st(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(e.length===1)return e=e,e[0];throw new U(`Expected exactly 1 Shape; got ${e.length}`)}else return e}function y0(e){let t=0;for(let n of e)n.shape.length===0?t+=1:t+=n.shape.reduce((a,r)=>a*r);return t}var P4="Variable",L4=class{constructor(e,t="float32",n=P4,a=!0,r=null){this.dtype=t==null?"float32":t,this.shape=e.shape,this.id=_4(),n=n==null?P4:n,this.originalName=C4(n),this.name=E4(this.originalName),this.trainable_=a,this.constraint=r,this.val=V3(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),Oae(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}};function Oae(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}function Sy(e){return e.map(t=>t.read())}function Ny(e){e.forEach(t=>{t[0].write(t[1])})}var zt=class{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}},Da=class{constructor(e,t,n,a,r,s,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=a,this.callArgs=r,this.outputTensorIndex=i,this.id=_4(),s!=null&&(this.originalName=C4(s),this.name=E4(this.originalName)),this.rank=t.length}},zae=0,A0=class{constructor(e,t){this.callArgs=t,this.id=zae++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(let n of e.inboundLayers)n!=null&&n.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){let e=[];for(let t of this.inboundLayers)t!=null?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}},_ae=0,Xe=class extends re.Serializable{constructor(e={}){super();this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=_ae++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){let n=this.getClassName();t=wr(n)+"_"+m0(n)}if(this.name=t,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let n;if(e.batchInputShape!=null)n=e.batchInputShape;else if(e.inputShape!=null){let r=null;e.batchSize!=null&&(r=e.batchSize),n=[r].concat(e.inputShape)}this.batchInputShape=n;let a=e.dtype;a==null&&(a=e.inputDType),a==null&&(a="float32"),this.dtype=a}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(this.inboundNodes.length===0)throw new Ma(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new U(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return $n(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return $n(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new vr(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new vr(`Layer ${this.name} is not connected, no input to return.`);return $n(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new vr(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new vr(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return $n(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=yt(e),this.inputSpec==null||this.inputSpec.length===0)return;let t=yt(this.inputSpec);if(e.length!==t.length)throw new U(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;nr.maxNDim)throw new U(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(r.minNDim!=null&&s=0?i[l]:i[i.length+l];if(u!=null&&[u,null].indexOf(d)===-1)throw new U(`Input ${n} is incompatible with layer ${this.name}: expected axis ${l} of input shape to have value ${u} but got shape ${i}.`)}}if(r.shape!=null)for(let i=0;i{if(!this.built){this.assertInputCompatibility(e);let s=[];for(let i of yt(e))s.push(i.shape);this.build($n(s)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t),i=yt(s),o=[];for(let l of i)n.indexOf(l)!==-1&&(l=l.clone()),o.push(l);if(s=$n(o),this.activityRegularizer!=null)throw new _e("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}else{let s=Pae(e),i=this.computeOutputShape(s),o,l=Lae(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?s[0]:s),i!=null&&i.length>0&&Array.isArray(i[0])?o=i.map((u,d)=>new Da(l,u,this,yt(e),t,this.name,d)):o=new Da(l,i,this,yt(e),t,this.name),this.addInboundNode(e,o,null,null,s,i,t),this._refCount++,this.activityRegularizer!=null)throw new _e("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,a)=>{n!=null&&e[a]!=null&&e[a]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new vr(`The layer ${this.name} has never been called and thus has no defined output shape.`);let e=[];for(let t of this.inboundNodes){let n=JSON.stringify(t.outputShapes);e.indexOf(n)===-1&&e.push(n)}if(e.length===1){let t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&t.length===1?t[0]:t}else throw new vr(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new Ma(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return y0(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Sy(e?this.trainableWeights:this.weights)}setWeights(e){V(()=>{let t=this.weights;if(t.length!==e.length)throw new U(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(t.length===0)return;let n=[],a=Sy(t);for(let r=0;rr.apply(l.read())),s==null&&(s=!0),s?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=yt(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(t!=null)if(Array.isArray(t))t.forEach(n=>{if(n!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return t}addInboundNode(e,t,n,a,r,s,i=null){let o=yt(e);t=yt(t),n=yt(n),a=yt(a),r=g0(r),s=g0(s);let l=[],u=[],d=[];for(let p of o)l.push(p.sourceLayer),u.push(p.nodeIndex),d.push(p.tensorIndex);new A0({outboundLayer:this,inboundLayers:l,nodeIndices:u,tensorIndices:d,inputTensors:o,outputTensors:t,inputMasks:n,outputMasks:a,inputShapes:r,outputShapes:s},i);for(let p=0;pe.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount==0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}};function Pae(e){e=yt(e);let t=[];for(let n of e)t.push(n.shape);return $n(t)}function Lae(e){return"float32"}function W4(e,t,n){if((t==null||n!=null&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),t.inboundNodes.length===0)return[e];{let a=t.inboundNodes[n];if(a.inboundLayers.length===0)return a.inputTensors;{let r=[];for(let s=0;s0){let r=await Promise.all(t);for(let s=0;sie(this.totals[a],B(r,n)));this.totals[a]=i,s!=null&&s.dispose()}}}async onEpochEnd(e,t){if(t!=null)for(let n of this.params.metrics)this.totals[n]!=null&&(typeof this.totals[n]=="number"?t[n]=this.totals[n]/this.seen:V(()=>{let a=B(me(1,this.seen),this.totals[n]);t[n]=a,this.totals[n].dispose(),Kt(t[n])}))}},H4=class extends nu{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){t==null&&(t={}),this.epoch.push(e);for(let n in t)this.history[n]==null&&(this.history[n]=[]),this.history[n].push(t[n])}async syncData(){let e=[],t=[],n=[];for(let r in this.history){let s=this.history[r];for(let i=0;inew G4(n,t))}var wa=class{constructor(){}static registerCallbackConstructor(e,t){k.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),wa.checkForDuplicate(t),wa.constructors[e]==null&&(wa.constructors[e]=[]),wa.constructors[e].push(t)}static checkForDuplicate(e){for(let t in wa.constructors)wa.constructors[+t].forEach(n=>{if(n===e)throw new U("Duplicate callback constructor.")})}static clear(){wa.constructors={}}static createCallbacks(e){let t=[];for(let n in wa.constructors){let a=+n;e>=a&&t.push(...wa.constructors[a])}return t.map(n=>new n)}};wa.constructors={};function X4(e,t,n,a,r,s,i,o,l){let u=new H4,d=[new Bae,...wa.createCallbacks(t)];e!=null&&d.push(...e),d.push(u);let p=new U4(d);return p.setParams({epochs:n,initialEpoch:a,samples:r,steps:s,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:p,history:u}}function Oa(e,t={},n=!1){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"layer",n)}function x0(e,t){return V(()=>{e.dtype!=="float32"&&(e=e.asType("float32"));let n=Se(qd(e),t,!0),a=Rl(n.shape,jt()),r=an(Xa(n,a));return me(e,r)})}function Gi(e,t){return V(()=>Nt(qd(ye(t,e)),-1))}function b0(e,t){return V(()=>Nt(Wt(ye(t,e)),-1))}function au(e,t){return V(()=>{let n=ye(e,t),a=Mn(Wt(e),jt(),Number.MAX_VALUE),r=Wt(me(n,a));return B(100,Nt(r,-1))})}function Vae(e,t){return V(()=>{let n=Mn(t,jt(),Number.MAX_VALUE),a=Bn(ie(1,n)),r=Mn(e,jt(),Number.MAX_VALUE),s=Bn(ie(1,r));return Nt(qd(ye(a,s)),-1)})}function jae(e,t){return V(()=>{let n=Xa(0,ye(1,B(e,t)));return Nt(qd(n),-1)})}function Uae(e,t){return V(()=>{let n=Xa(0,ye(1,B(e,t)));return Nt(n,-1)})}function Hae(e,t){return V(()=>{let n=Se(B(e,t),-1),a=Vn(B(ye(1,e),t),-1);return Xa(0,ie(1,ye(a,n)))})}function Gae(e,t){return V(()=>{let n=Math.log(2),a=ye(t,e),r=ye(ie(a,Ci(B(-2,a))),n);return Nt(r,-1)})}function Kd(e,t,n=!1){return V(()=>{if(n)t=xd(t);else{let a=Se(t,t.shape.length-1,!0);t=me(t,a)}return t=Mn(t,jt(),1-jt()),St(Se(B(e.toFloat(),Bn(t)),t.shape.length-1))})}function v0(e,t,n=!1){return V(()=>{let a=Ml(uae(e)).toInt();t=Mn(t,jt(),1-jt());let r=t.shape,s=wl(a,r[r.length-1]).reshape(r);return Kd(s,t,n)})}function qae(e,t){if(!k.arraysEqual(e.shape,t.shape))throw new U(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return V(()=>{let n=t.relu(),a=t.abs().neg();return n.sub(t.mul(e)).add(a.exp().log1p())})}function w0(e,t){return V(()=>{let n;return n=Mn(t,jt(),1-jt()),n=Bn(me(n,ye(1,n))),Nt(qae(e,n),-1)})}function Xae(e,t){return V(()=>{let n=Mn(e,jt(),1),a=Mn(t,jt(),1);return Se(B(e,Bn(me(n,a))),-1)})}function Kae(e,t){return V(()=>{let n=Bn(ie(jt(),t));return Nt(ye(t,B(e,n)),-1)})}function Ty(e,t){return V(()=>{let n=x0(e,-1),a=x0(t,-1),r=B(n,a);return St(Se(r,-1))})}var k0={meanSquaredError:Gi,meanAbsoluteError:b0,meanAbsolutePercentageError:au,meanSquaredLogarithmicError:Vae,squaredHinge:jae,hinge:Uae,categoricalHinge:Hae,logcosh:Gae,categoricalCrossentropy:Kd,sparseCategoricalCrossentropy:v0,binaryCrossentropy:w0,kullbackLeiblerDivergence:Xae,poisson:Kae,cosineProximity:Ty};function Cy(e){if(typeof e=="string"){if(e in k0)return k0[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new U(t)}else return e}function Ey(e,t){return V(()=>{let n=B(.5,Un(t)),a=Hd(Wn(t,n),e.dtype);return Nt(Hr(e,a),-1)})}function Ry(e,t){return V(()=>Hd(Hr(ki(e,-1),ki(t,-1)),"float32"))}function K4(e,t){return V(()=>xa(e.equal(1),t.equal(1)).sum().cast("float32"))}function Zae(e,t){return V(()=>xa(e.equal(1),t.equal(0)).sum().cast("float32"))}function Yae(e,t){return V(()=>xa(e.equal(0),t.equal(1)).sum().cast("float32"))}function Z4(e,t){return V(()=>{let n=K4(e,t),a=Yae(e,t),r=n.add(a);return un(Wn(r,0),n.div(r),0).cast("float32")})}function Jae(e,t){return V(()=>{let n=K4(e,t),a=Zae(e,t),r=n.add(a);return un(Wn(r,0),n.div(r),0).cast("float32")})}function Y4(e,t){return w0(e,t)}function J4(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),t=t.argMax(-1),t.dtype!==e.dtype&&(t=t.asType(e.dtype)),Hr(e,t).asType("float32")}var Qae=Gi,ere=Gi,tre=b0,nre=b0,are=au,rre=au,My=Kd,sre=Ty,Q4=v0,I0={binaryAccuracy:Ey,categoricalAccuracy:Ry,precision:Z4,categoricalCrossentropy:My,sparseCategoricalCrossentropy:Q4,mse:Qae,MSE:ere,mae:tre,MAE:nre,mape:are,MAPE:rre,cosine:sre};function ire(e){if(typeof e=="string"&&e in I0)return I0[e];if(typeof e!="string"&&e!=null)return e;throw new U(`Unknown metric ${e}`)}function S0(e){if(Qa(e!==null,`Unknown LossOrMetricFn ${e}`),typeof e=="string")return e;{let t;for(let n of Object.keys(k0))if(k0[n]===e){t=n;break}if(t!==void 0)return t;for(let n of Object.keys(I0))if(I0[n]===e){t=n;break}return t!==void 0?t:e.name}}function ore(e){let t={Adagrad:()=>Fi.adagrad(.01),Adadelta:()=>Fi.adadelta(1,.95,jt()),Adam:()=>Fi.adam(.001,.9,.999,jt()),Adamax:()=>Fi.adamax(.002,.9,.999,jt(),0),RMSProp:()=>Fi.rmsprop(.001,.9,0,jt()),SGD:()=>Fi.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new U(`Unknown Optimizer ${e}`)}var e8=1*1024*1024;function t8(e,t,n=!1){if(e==null||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype||!Fy(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){let a=JSON.stringify(e);a.length>e8&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${a.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${e8}.`)}}function Fy(e){if(e===null)return!0;if(typeof e=="object")if(Object.getPrototypeOf(e)===Object.prototype){let t=Object.keys(e);for(let n of t)if(typeof n!="string"||!Fy(e[n]))return!1;return!0}else if(Array.isArray(e)){for(let t of e)if(!Fy(t))return!1;return!0}else return!1;else{let t=typeof e;return t==="string"||t==="number"||t==="boolean"}}function lre(e,t,n,a=console.log){let r=dre(e),s=["Layer (type)","Output shape","Param #"];r?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(d=>Math.floor(t*d)));let i;if(!r){s.push("Receives inputs"),i=[];for(let d in e.nodesByDepth)i.push(...e.nodesByDepth[d])}a("_".repeat(t)),N0(s,n,a),a("=".repeat(t));let o=e.layers;for(let d=0;d1||r.length===1&&r[0].inboundLayers.length>1){t=!1;break}a.push(...r)}if(t)for(let r of e.layers){let s=!1;for(let i of r.inboundNodes)if(a.indexOf(i)!==-1)if(s){t=!1;break}else s=!0;if(!t)break}return t}function N0(e,t,n=console.log){let a="";for(let r=0;r0&&(a=a.slice(0,a.length-1)+" "),a+=e[r],a=a.slice(0,t[r]),a+=" ".repeat(t[r]-a.length);n(a)}function pre(e,t,n){let a;try{a=JSON.stringify(e.outputShape)}catch(o){a="multiple"}let r=e.name,s=e.getClassName(),i=[`${r} (${s})`,a,e.countParams().toString()];N0(i,t,n)}function cre(e,t,n,a){let r;try{r=JSON.stringify(e.outputShape)}catch(d){r="multiple"}let s=[];for(let d of e.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(d)===-1))for(let p=0;pm.name),l=[],u=t.names();for(let m of o)u.indexOf(m)!==-1?l.push(t.getValue(m)):l.push(null);a!=null&&(a.maxNumTensors=-Infinity,a.minNumTensors=Infinity);let d=o.join(",")+"|"+t.names().join(","),p,c;if(Oy[d]==null){let m=fre(i,t);p=m.sorted,c=m.recipientCounts,Oy[d]=p,a8[d]=c}p=Oy[d],c={},r||Object.assign(c,a8[d]);let h=new qi(t);for(let m=0;ma.maxNumTensors&&(a.maxNumTensors=E),E0,()=>"Expected at least one fetch, got none");let n=[],a={};if(e.length===1){let r=r8(e[0],t);n=r.sorted,a=r.recipientMap}else{let r=new Set;for(let s of e){let{sorted:i,recipientMap:o}=r8(s,t);for(let l of i)r.has(l.name)||(n.push(l),r.add(l.name));for(let l in o)a[l]==null&&(a[l]=new Set),o[l].forEach(u=>a[l].add(u))}}return{sorted:n,recipientCounts:mre(a)}}function mre(e){let t={};for(let n in e)t[n]=e[n].size;return t}function r8(e,t){let n=new Set,a=[],r={};for(let o of t.names())n.add(o);let s=[],i=[];for(s.push(e);s.length>0;){let o=s[s.length-1];if(n.has(o.name)){s.pop();continue}let l=i[i.length-1]===s.length-1;if(o.inputs.length===0||l)s.pop(),a.push(o),n.add(o.name),l&&i.pop();else{i.push(s.length-1);for(let u of o.inputs)r[u.name]==null&&(r[u.name]=new Set),r[u.name].add(o.name),!n.has(u.name)&&s.push(u)}}return{sorted:a,recipientMap:r}}function gre(e){let t;if(e.sourceLayer.inboundNodes.length===1)t=e.sourceLayer.output;else{let n=null;for(let a=0;ay.name)}`);es(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(y=>y.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(let y of this.outputs){let A=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;this.outputLayers.push(A),this.outputLayersNodeIndices.push(x),this.outputLayersTensorIndices.push(v)}for(let y of this.inputs){let A=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;Qa(x===0,"input layer has >1 nodes"),Qa(v===0,"input layer has >1 tensors"),this.inputLayers.push(A),this.inputLayersNodeIndices.push(x),this.inputLayersTensorIndices.push(v)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let y=0;yy.shape),this.internalOutputShapes=this.outputs.map(y=>y.shape);let t={},n={},a={},r={},s={},i=[],o=(y,A,x,v,b,w)=>{(v==null||b==null||w==null)&&(v=y.sourceLayer,b=y.nodeIndex,w=y.tensorIndex);let N=v.inboundNodes[b];if(x.indexOf(N)!==-1)throw new Ma(`The tensor ${y.name} at layer "${v.name}" is part of a cycle.`);if(A.indexOf(N)!==-1)return;this.containerNodes.add(tr.nodeKey(v,b)),v.id in s||(s[v.id]=Object.keys(s).length),x.indexOf(N)===-1&&x.push(N);let C=N.inboundLayers.length;for(let E=0;E=0;)x.splice(x.indexOf(N),1);i.push(N)},l=[],u=[];for(let y of this.outputs)o(y,l,u);let d=i.slice().reverse();for(let y of d){n[y.id]=y,y.id in t||(t[y.id]=0);let A=t[y.id],x=a[y.outboundLayer.id]==null?0:a[y.outboundLayer.id];A=Math.max(A,x),a[y.outboundLayer.id]=A,r[y.outboundLayer.id]=y.outboundLayer,t[y.id]=A;for(let v=0;vparseInt(y,10)).sort(r0);this.layers=[];for(let y of h){let A=c[y];A.sort((x,v)=>{let b=s[x.id],w=s[v.id];return bw?1:0});for(let x of A)x instanceof tr&&this.internalContainerRefs.push(x),this.layers.push(x)}this.layersByDepth=c,h=Object.keys(p).map(y=>parseInt(y,10)).sort(r0);let m=this.inputs.slice(),f=[];for(let y of h)for(let A of p[y]){let x=A.outboundLayer;if(x!=null){for(let v of A.inputTensors)if(m.indexOf(v)===-1)throw new Ma(`Graph disconnected: cannot obtain value for tensor ${v} at layer "${x.name}". The following previous layers were accessed without issue: ${f}`);for(let v of A.outputTensors)m.push(v);f.push(x.name)}}this.nodesByDepth=p;let g=this.layers.map(y=>y.name);for(let y of g){let A=g.filter(x=>x===y).length;if(A!==1)throw new Ma(`The name "${y}" is used ${A} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new A0({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(y=>null),outputMasks:this.outputs.map(y=>null),inputShapes:this.inputs.map(y=>y.shape),outputShapes:this.outputs.map(y=>y.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();let e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount==0){for(let t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(let t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(n=>n.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new U("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(let t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.layers)t.push(...n.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){let n={},a=0;for(let s of this.layers)for(let i of s.weights){if(n[i.originalName]!=null)throw new U(`Duplicate weight name: ${i.originalName}`);n[i.originalName]=i,a++}let r=[];for(let s in e){let i=s;if(n[s]==null){let o=s.split("/");i=o.slice(0,-2).concat([o[o.length-1]]).join("/")}if(n[i]!=null)r.push([n[i],e[s]]);else if(t)throw new U(`Provided weight data has no target variable: ${s}`);delete n[i]}if(t){let s=[];for(let i in n)s.push(i);if(s.length>0)throw new U(`${s.length} of ${a} weights are not set: ${s}`)}Ny(r)}updatedConfig(){let e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${Dy}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){let n=$y(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return V(()=>{e=yt(e);let n=new qi;for(let a=0;a{e=yt(e);let n;return t==null?n=Bi(null,e.length):n=yt(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){let t=g0(e);if(t.length!==this.inputLayers.length)throw new U(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);let n={};for(let i=0;iparseInt(i,10)).sort(r0);if(a.length>1)for(let i of a){let o=this.nodesByDepth[i];for(let l of o){let u=l.outboundLayer;if(this.inputLayers.map(m=>m.id).indexOf(u.id)!==-1)continue;let d=[];for(let m=0;mparseInt(o,10)).sort(r0);for(let o of a){let l=this.nodesByDepth[o];for(let u of l){let d=u.outboundLayer,p=u.inputTensors,c=u.outputTensors,h=new Array;for(let m of p)m.id in n&&h.push(n[m.id]);if(h.length===p.length){let m={},f,g,y,A;if(u.callArgs!=null&&(m=u.callArgs),h.length===1){let[x,v]=h[0];m.mask==null&&(m.mask=v),y=yt(d.call(x,m)),A=yt(d.computeMask(x,v)),f=[x],g=[v]}else f=h.map(x=>x[0]),g=h.map(x=>x[1]),m.mask==null&&(m.mask=g),y=yt(d.call(f,m)),A=yt(d.computeMask(f,g));if(d.activityRegularizer)throw new _e("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let x=0;x{let e=[];for(let t of this.layers)for(let n=0;n0){let m=[];for(let f=0;f0&&f.apply($n(y),A)}function l(f){let g=f.name,y=Oa(f,t.customObjects!=null?t.customObjects:{});y.setFastWeightInitDuringBuild(a),r[g]=y,f.inboundNodes.forEach(A=>{if(!(A instanceof Array))throw new U(`Corrupted configuration, expected array for nodeData: ${A}`);i(y,A)})}let u=t.name,d=t.layers;for(let f of d)l(f);for(;!qne(s);)for(let f of d){let g=r[f.name];if(g.name in s){let y=s[g.name];delete s[g.name];for(let A of y)o(g,A)}}let p=[],c=[],h=t.inputLayers;for(let f of h){let g=f[0],y=f[1],A=f[2];Qa(g in r);let x=r[g].inboundNodes[y].outputTensors;p.push(x[A])}let m=t.outputLayers;for(let f of m){let g=f[0],y=f[1],A=f[2];Qa(g in r);let x=r[g].inboundNodes[y].outputTensors;c.push(x[A])}return new e({inputs:p,outputs:c,name:u})}get stateful(){if(this._stateful)throw new U("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(let e of this.layers)if(e.stateful)return!0;return!1}resetStates(){V(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}};function yre(e,t,n){let a=t.length;if(e==null||Array.isArray(e)&&e.length===0)return t.map(r=>null);if(a===1)return Array.isArray(e)&&e.length===1?e:typeof e=="object"&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==a)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${a} outputs. Make sure a set of weights is provided for each model output.`);return e}else if(typeof e=="object"&&Object.keys(e).length>0&&typeof e[Object.keys(e)[0]]=="object"){let r=[];return t.forEach(s=>{s in e?r.push(e[s]):r.push(null)}),r}else throw new Error(`The model has multiple (${a}) outputs, so ${n} must be either an array with ${a} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function s8(e,t){return yre(e,t,"classWeight")}async function i8(e,t,n,a){if(t!=null||a!=null)throw new Error("Support sampleWeight is not implemented yet");if(n!=null){let r=V(()=>{if(e.shape.length===1)return e.clone();if(e.shape.length===2)if(e.shape[1]>1){let o=1;return e.argMax(o)}else{if(e.shape[1]===1)return e.reshape([e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),s=Array.from(await r.data());he(r);let i=[];return s.forEach(o=>{if(n[o]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${o} exists in the data but not in classWeight`);i.push(n[o])}),Dt(i,"float32")}else return null}function Are(e,t){return B(e,t)}var xre=32;function o8(e,t){let n,a,r=t;n=r.xs,a=r.ys,k.assert(n!=null&&a!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);let s=l8("input",e.inputNames,n),i=l8("output",e.outputNames,a),o=s[0].shape[0];k.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),k.assert(i.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let l=0;l`Batch size mismatch: input ${e.inputNames[l]} has ${s[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);for(let l=0;l`Batch size mismatch: output ${e.outputNames[l]} has ${i[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);return{xs:s,ys:i}}function l8(e,t,n){if(n instanceof Be)return[n];if(Array.isArray(n))return k.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{let a=[];for(let r of t){if(n[r]==null)throw new U(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);a.push(n[r])}return a}}function bre(e){if(e.length===3)throw new _e("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}async function vre(e,t,n){let a=n.batchesPerEpoch!=null;if(k.assert(e.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),k.assert(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),k.assert(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),k.assert(!a||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),k.assert(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{let r=n.validationData!=null,s,i;if(r)if(u8(n.validationData))k.assert(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{let g=bre(n.validationData);s=g.xs,i=g.ys}let o=e.makeTrainFunction(),l=e.getDedupedMetricsNames(),u;r?u=l.slice().concat(l.map(g=>"val_"+g)):u=l.slice();let d=q4(n.callbacks,n.yieldEvery),p=n.verbose==null?1:n.verbose,{callbackList:c,history:h}=X4(d,p,n.epochs,null,null,wre(t,n),null,r,u);c.setModel(e),e.history=h,await c.onTrainBegin(),e.stopTraining_=!1;let m=n.initialEpoch==null?0:n.initialEpoch,f=await t.iterator();for(;m=n.batchesPerEpoch:x.done){if(r){let v;u8(n.validationData)?v=yt(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):v=yt(e.evaluate(s,i,{batchSize:n.validationBatchSize==null?xre:n.validationBatchSize,verbose:0}));for(let b=0;b0)throw new _e("Verbose mode is not implemented yet.");k.assert(!a||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);let i=kre(t)?t:await t.iterator(),o=0,l=0;for(;a?l{if(u.value){let{xs:d,ys:p}=o8(e,u.value),c=d.concat(p),h=V(()=>r(c));if(he(c),l===0)for(let f=0;fie(s[f],B(m,g))),l>0&&he(y)}he(h),o+=m,++l}return s}),u.done){a&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let u=0;u0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function Jd(e,t,n){return e==null?[null]:Array.isArray(e)?e.map(a=>Hi(a,t,n-t)):Hi(e,t,n-t)}function _y(e,t){return V(()=>e==null?null:Array.isArray(e)?e.map(n=>_y(n,t)):F4(e,t.dtype==="int32"?t:t.toInt()))}function Py(e,t){let n=[],a=0,r=null;for(;a=e&&(r=e),n.push([a,r]),a=r;return n}async function Sre(e,t,n,a,r,s,i,o,l,u,d,p,c,h,m){r==null&&(r=32),s==null&&(s=1),d==null&&(d=!0),c==null&&(c=0);let f=!1;if(l!=null&&u!=null&&(f=!0),m!=null&&(f=!0,h==null))throw new U("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");let g=e.checkNumSamples(n,r,h,"steps_per_epoch"),y;g!=null&&(y=Fa(0,g)),i==null&&(i=1);let{callbackList:A,history:x}=X4(o,i,s,c,g,h,r,f,p);A.setModel(e),e.history=x,await A.onTrainBegin(),e.stopTraining_=!1;for(let v=c;v{let _=N[C][0],$=N[C][1],S=Hi(w,_,$-_);E.batch=C,E.size=$-_;let z=_y(n,S),O=t(z);for(let W=0;W0){if(m=!0,a.validationData.length===2)i=a.validationData[0],o=a.validationData[1];else throw a.validationData.length===3?new _e("validationData including sample weights is not supported yet."):new U(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${a.validationData} is invalid.`);let w=!0,N=await e.standardizeUserData(i,o,null,null,w,p);l=N[0],u=N[1],f=l.concat(u)}else if(a.validationSplit!=null&&a.validationSplit>0&&a.validationSplit<1){m=!0;let w=Math.floor(r[0].shape[0]*(1-a.validationSplit)),N=r[0].shape[0];l=Jd(r,w,N),r=Jd(r,0,w),u=Jd(s,w,N),s=Jd(s,0,w),f=l.concat(u)}else a.validationSteps!=null&&(m=!0);let g=r.concat(s).concat(d);e.checkTrainableWeightsConsistency();let y=e.makeTrainFunction(),A=e.getDedupedMetricsNames(),x,v;m?(e.makeTestFunction(),x=e.testFunction,v=A.slice().concat(A.map(w=>"val_"+w))):(x=null,f=[],v=A.slice());let b=q4(a.callbacks,a.yieldEvery);return await Sre(e,y,g,A,p,a.epochs,a.verbose,b,x,f,a.shuffle,v,a.initialEpoch,null,null)}finally{e.isTraining=!1,Xi(r,t),Xi(s,n),Xi(l,i),Xi(u,o),d!=null&&he(d)}}function d8(e){let t=[];e instanceof Be&&(e=[e]);for(let n=0;nn.push(r.id));else if(t!=null)for(let r in t){let s=t[r];n.push(s.id)}let a=[];if(e instanceof Be)n.indexOf(e.id)===-1&&a.push(e);else if(Array.isArray(e))e.forEach(r=>{n.indexOf(r.id)===-1&&a.push(r)});else if(e!=null)for(let r in e){let s=e[r];n.indexOf(s.id)===-1&&a.push(s)}a.forEach(r=>{r.isDisposed||r.dispose()})}function Tre(e){return e instanceof Be}function Ly(e){return Array.isArray(e)}function p8(e){return!Tre(e)&&!Ly(e)}function c8(e,t,n,a=!0,r=""){if(t==null||t.length===0){if(e!=null){let i=!1;if(Ly(e)&&e.length>0)i=!0;else if(p8(e)){for(let o in e)if(e.hasOwnProperty(o)){i=!0;break}}else i=!0;if(i)throw new U(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(e==null)return t.map(i=>null);let s;if(p8(e)){e=e,s=[];for(let i of t){if(e[i]==null)throw new U(`No data provided for "${i}". Need data for each key in: ${t}`);s.push(e[i])}}else if(Ly(e)){if(e=e,e.length!==t.length)throw new U(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(e=e,t.length>1)throw new U(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=d8(s),n!=null)for(let i=0;i=0&&u!==d)throw new U(`Error when checking ${r}: expected ${t[i]} to have shape [${n[i]}], but got array with shape [${o.shape}].`)}}return s}function Cre(e,t,n){let a=es(e.map(s=>s.shape[0]));a.sort();let r=es(t.map(s=>s.shape[0]));if(r.sort(),a.length>1)throw new U(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(s=>s.shape))}`);if(r.length>1)throw new U(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(s=>s.shape))}`);if(a.length>0&&r.length>0&&!k.arraysEqual(a,r))throw new U(`Input Tensors should have the same number of samples as target Tensors. Found ${a[0]} input sample(s) and ${r[0]} target sample(s).`)}function Ere(e,t,n){let a=[Gi,w0,Kd];for(let r=0;r1)throw new U(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(n!=null)for(let i=0;i[]);let n;if(typeof e=="string"||typeof e=="function")n=[e];else if(Array.isArray(e)||typeof e=="object")n=e;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);if(Array.isArray(n))return t.map(a=>n);{let a=[];for(let r of t){let s=n.hasOwnProperty(r)?n[r]:[];Array.isArray(s)||(s=[s]),a.push(s)}return a}}var Mre="layers-model",kr=class extends tr{constructor(e){super(e);this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new U("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");lre(this,e,t,n)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=ore(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof xr))throw new U("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(let s in e.loss)if(this.outputNames.indexOf(s)===-1)throw new U(`Unknown entry in loss dictionary: "${s}". Only expected the following keys: ${this.outputNames}`);for(let s of this.outputNames)e.loss[s]==null&&console.warn(`Output "${s}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${s} during training`),t.push(Cy(e.loss[s]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new U(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);t=e.loss.map(s=>Cy(s))}else{let s=Cy(e.loss);this.outputs.forEach(i=>{t.push(s)})}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let s=0;s{for(let s=0;s1&&(this.metricsTensors.push([i,s]),this.metricsNames.push(this.outputNames[s]+"_loss"))}});let a=Rre(e.metrics,this.outputNames),r=(s,i,o)=>{this.outputNames.length>1&&(i=this.outputNames[s]+"_"+i),this.metricsNames.push(i),this.metricsTensors.push([o,s])};Ui("metric",()=>{for(let s=0;s{let l="",u,d,p;for(let c of o){if(typeof c=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(c)!==-1){let m=this.internalOutputShapes[s];m[m.length-1]===1||this.lossFunctions[s]===w0?["accuracy","acc"].indexOf(c)!==-1?d=Ey:["crossentropy","ce"].indexOf(c)!==-1&&(d=Y4):this.lossFunctions[s]===v0?["accuracy","acc"].indexOf(c)!==-1?d=J4:["crossentropy","ce"].indexOf(c)!==-1&&(d=Q4):["accuracy","acc"].indexOf(c)!==-1?d=Ry:["crossentropy","ce"].indexOf(c)!==-1&&(d=My);let f;["accuracy","acc"].indexOf(c)!==-1?f="acc":["crossentropy","ce"].indexOf(c)!==-1&&(f="ce"),p=d,u=l+f}else p=ire(c),u=l+S0(c);let h;Ui(u,()=>{h=p}),r(s,u,h)}})(i)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){let a=n.batchSize==null?32:n.batchSize;zy(a);let r=!0,s=this.standardizeUserDataXY(e,t,r,a);try{let i=s[0].concat(s[1]);this.makeTestFunction();let o=this.testFunction,l=this.testLoop(o,i,a,n.verbose,n.steps);return $n(l)}finally{Xi(s[0],e),Xi(s[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),Ire(this,e,t)}checkNumSamples(e,t,n,a="steps"){let r;if(n!=null){if(r=null,t!=null)throw new U(`If ${a} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else if(e!=null)Array.isArray(e)?r=e[0].shape[0]:r=e.shape[0];else throw new U(`Either the input data should have a defined shape, or ${a} shoud be specified.`);return r}execute(e,t){if(Array.isArray(t)&&t.length===0)throw new U("`outputs` is an empty Array, which is not allowed.");let n=Array.isArray(t),a=n?t:[t],r=this.retrieveSymbolicTensors(a),s=new qi;if(e instanceof Be&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new U(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let o=0;oi.name);for(let i=0;i0){let a=[];throw t.forEach((r,s)=>{r==null&&a.push(e[s])}),new U(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(a)}`)}return t}predictLoop(e,t=32,n=!1){return V(()=>{let a=this.checkNumSamples(e);if(n)throw new _e("Verbose predictLoop() is not implemented yet.");let r=Py(a,t),s=this.outputs.map(i=>[]);for(let i=0;i{let o=r[i][0],l=r[i][1],u=Jd(e,o,l),d=[];if(Array.isArray(u))for(let c=0;cs[l].push(o));return $n(s.map(i=>lt(i,0)))})}predict(e,t={}){let n=d8(e);h8(n,this.inputNames,this.feedInputShapes,!1);try{let a=t.batchSize==null?32:t.batchSize;return zy(a),this.predictLoop(n,a)}finally{Xi(n,e)}}predictOnBatch(e){h8(e,this.inputNames,this.feedInputShapes,!0);let t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,a){if(this.optimizer_==null)throw new Ma("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");let r=[];for(let s=0;s0&&e[0].shape[0]%a!=0)throw new U(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${a}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,a,r=!0,s){let[i,o]=this.standardizeUserDataXY(e,t,r,s);if(n!=null)throw new Error("sample weight is not supported yet.");let l=null;if(a!=null){let u=s8(a,this.outputNames);l=[];for(let d=0;d{let s=this.checkNumSamples(t,n,r,"steps"),i=[];if(a>0)throw new _e("Verbose mode is not implemented yet.");if(r!=null)throw new _e("steps mode in testLoop() is not implemented yet");{let o=Py(s,n),l=Dt(Fa(0,s));for(let u=0;u1&&(r+=`_${b4(e.slice(0,n),a)}`),t.push(r)}return t}makeTrainFunction(){return e=>{let t=[],n=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),s=[],i=()=>{let u=[];for(let h=0;h1&&h{c=ie(c,h)}),c},o=this.collectedTrainableWeights.map(u=>u.read()),l=!0;return[this.optimizer_.minimize(i,l,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>V(()=>{let t=[],n,a=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let l=0;lwr(t))}else{let t=Object.keys(this.loss);e={};let n=this.loss;for(let a of t)if(typeof n[a]=="string")e[a]=wr(n[a]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[wr(S0(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>wr(S0(e)));{let e={};for(let t in this.metrics)e[t]=wr(S0(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");let t=Zd(e.optimizer_config),n=Oa(t),a;if(typeof e.loss=="string")a=Vi(e.loss);else if(Array.isArray(e.loss))a=e.loss.map(s=>Vi(s));else if(e.loss!=null){a={};for(let s in e.loss)a[s]=Vi(e.loss[s])}let r;if(Array.isArray(e.metrics))r=e.metrics.map(s=>Vi(s));else if(e.metrics!=null){r={};for(let s in e.metrics)r[s]=Vi(e.metrics[s])}this.compile({loss:a,metrics:r,optimizer:n})}async save(e,t){if(typeof e=="string"){let i=En.getSaveHandlers(e);if(i.length===0)throw new U(`Cannot find any save handlers for URL '${e}'`);if(i.length>1)throw new U(`Found more than one (${i.length}) save handlers for URL '${e}'`);e=i[0]}if(e.save==null)throw new U("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");let n=await En.encodeWeights(this.getNamedWeights(t)),a=!1,r=null,s={modelTopology:this.toJSON(r,a),format:Mre,generatedBy:`TensorFlow.js tfjs-layers v${Dy}`,convertedBy:null};if((t==null?!1:t.includeOptimizer)&&this.optimizer!=null){s.trainingConfig=this.getTrainingConfig();let i="optimizer",{data:o,specs:l}=await En.encodeWeights(await this.optimizer.getWeights(),i);n.specs.push(...l),n.data=En.concatenateArrayBuffers([n.data,o])}if(this.userDefinedMetadata!=null){let i=!0;t8(this.userDefinedMetadata,this.name,i),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){t8(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}};kr.className="Model";re.registerClass(kr);var f8=class extends kr{};f8.className="Functional";re.registerClass(f8);async function Fre(e,t){"modelTopology"in e||(e={modelTopology:e}),e=e;let n=e.modelTopology;n.model_config!=null&&(n=n.model_config);let a=Zd(n),r=Oa(a,t);if(e.weightsManifest!=null){let s=await En.loadWeights(e.weightsManifest,e.pathPrefix,r.weights.map(o=>o.originalName)),i={};for(let o of r.weights)i[o.originalName]=s[o.originalName];r.loadWeights(i),he(s)}return r}async function $re(e,t){if(t==null&&(t={}),typeof e=="string"){let n=En.getLoadHandlers(e,t);if(n.length===0)n.push(En.browserHTTPRequest(e,t));else if(n.length>1)throw new U(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return Dre(e,void 0,t)}async function Dre(e,t,n){if(n==null&&(n={}),e.load==null)throw new U("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let a=await e.load(),r=a.modelTopology;r.model_config!=null&&(r=r.model_config);let s=n.strict==null?!0:n.strict,i=a.weightData!=null&&a.weightSpecs!=null&&s,o=Oa(Zd(r),t,i),l=a.trainingConfig;if(l!=null&&o.loadTrainingConfig(l),a.userDefinedMetadata!=null&&o.setUserDefinedMetadata(a.userDefinedMetadata),a.weightData!=null){if(a.weightSpecs==null)throw new U("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");let{modelWeights:u,optimizerWeights:d}=Ore(a.weightData,a.weightSpecs);o.loadWeights(u,s),o.optimizer!=null&&d.length>0&&await o.optimizer.setWeights(d),he(u),he(d.map(p=>p.tensor))}return o}function Ore(e,t){let n=En.decodeWeights(e,t),a={},r=[];return t.forEach(s=>{s.group==="optimizer"?r.push({name:s.name,tensor:n[s.name]}):a[s.name]=n[s.name]}),{modelWeights:a,optimizerWeights:r}}var ru=class extends kr{constructor(e){super({inputs:[],outputs:[]});if(e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:m0("sequential_"),e.layers!=null)for(let t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(t=>t<0))throw new U(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){let t=e instanceof ru||e instanceof kr,n;if(t){if(n=e,n.outputs.length!==1)throw new U("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(n.inputs.length!==1)throw new U("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new U("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");let a=B4({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(a)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(e.inboundNodes.length!==1)throw new U(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new U("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=W4(this.outputs[0])}this.inboundNodes=[],new A0({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Bi(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(a=>a.shape),outputShapes:this.outputs[0].shape})}else{let a=e.apply(this.outputs[0]);if(Array.isArray(a))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[a],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{let e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return this.model==null&&this.build(),this.model.call(e,t)}build(e){if(st(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new kr({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return this.model==null&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new Ma("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},a=!1){let r,s={};if(t instanceof Array){if(t[0].className==null||t[0].className==="Merge")throw new U("Legacy serialization format not supported yet.");r=t}else k.assert(t.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),r=t.layers,delete t.layers,s=t;let i=new e(s);if(!(i instanceof ru))throw new _e(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(let o of r){let l=Oa(o,void 0,a);a&&l.setFastWeightInitDuringBuild(!0),i.add(l)}return i}set stopTraining(e){if(this.model==null)throw new U("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new U("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){let e=[];for(let t of this.layers){let n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}};ru.className="Sequential";re.registerClass(ru);function zre(e){return new kr(e)}function _re(e){return new ru(e)}function Pre(e,t){return t==null&&(t={}),$re(e,t)}function m8(e){return B4(e)}function Lre(e,t){wa.registerCallbackConstructor(e,t)}var On=class extends re.Serializable{getConfig(){return{}}},g8=class extends On{apply(e,t=1){return pae(e,t)}};g8.className="elu";re.registerClass(g8);var y8=class extends On{apply(e){return oh(e)}};y8.className="selu";re.registerClass(y8);var A8=class extends On{apply(e){return Ka(e)}};A8.className="relu";re.registerClass(A8);var x8=class extends On{apply(e){return V(()=>Fl(6,Ka(e)))}};x8.className="relu6";re.registerClass(x8);var b8=class extends On{apply(e){return e}};b8.className="linear";re.registerClass(b8);var v8=class extends On{apply(e){return Rn(e)}};v8.className="sigmoid";re.registerClass(v8);var w8=class extends On{apply(e){return hae(e)}};w8.className="hardSigmoid";re.registerClass(w8);var k8=class extends On{apply(e){return Ci(e)}};k8.className="softplus";re.registerClass(k8);var I8=class extends On{apply(e){return cae(e)}};I8.className="softsign";re.registerClass(I8);var S8=class extends On{apply(e){return Si(e)}};S8.className="tanh";re.registerClass(S8);var Wy=class extends On{apply(e,t=-1){return xd(e,t)}};Wy.className="softmax";re.registerClass(Wy);var N8=class extends On{apply(e,t=-1){return eh(e,t)}};N8.className="logSoftmax";re.registerClass(N8);var T8=class extends On{apply(e,t=1){return V(()=>Rn(e.mul(t)).mul(e))}};T8.className="swish";re.registerClass(T8);var C8=class extends On{apply(e){return V(()=>B(e,Si(Ci(e))))}};C8.className="mish";re.registerClass(C8);function rs(e){return e.getClassName()}function By(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"activation")}function ss(e){if(e==null){let t={};return t.className="linear",t.config={},By(t)}if(typeof e=="string"){let t={};return t.className=e,t.config={},By(t)}else return e instanceof On?e:By(e)}function Vy(e){if(e!=null&&typeof e!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}var E8=class extends re.Serializable{},Qd=class extends E8{constructor(e){super();Vy(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return V(()=>{let t=$t([1]);return this.hasL1&&(t=ie(t,Se(B(this.l1,Wt(e))))),this.hasL2&&(t=ie(t,Se(B(this.l2,qd(e))))),t.asScalar()})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}};Qd.className="L1L2";re.registerClass(Qd);function Wre(e){return Vy(e),new Qd({l1:e!=null?e.l1:null,l2:0})}function Bre(e){return Vy(e),new Qd({l2:e!=null?e.l2:null,l1:0})}var R8={l1l2:"L1L2"};function dt(e){return sy(e)}function M8(e,t={}){return Vd(e,re.SerializationMap.getMap().classNameMap,t,"regularizer")}function vt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in R8?R8[e]:e,config:{}};return M8(t)}else return e instanceof E8?e:M8(e)}var jy=class extends Xe{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,t){e=Le(e);let n=Ka(e);return this.maxValue!=null&&(n=Mn(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){let e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}};jy.className="ReLU";re.registerClass(jy);var Uy=class extends Xe{constructor(e){super(e==null?{}:e);this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,t){let n=Le(e);return pd(n,this.alpha)}computeOutputShape(e){return e}getConfig(){let e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}};Uy.className="LeakyReLU";re.registerClass(Uy);var Hy=class extends Xe{constructor(e){super(e==null?{}:e);if(this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=bt(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=vt(e.alphaRegularizer),this.alphaConstraint=Ht(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new U(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=st(e);let t=e.slice(1);if(this.sharedAxes!=null)for(let a of this.sharedAxes)t[a-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);let n={};if(this.sharedAxes!=null)for(let a=1;a(Ft(t),t==="channelsFirst"?Qe(e,[0,2,3,1]):e))}function F8(e,t){return V(()=>(Ft(t),t==="channelsFirst"?Qe(e,[0,2,3,4,1]):e))}function Vre(e,t,n,a=1,r="valid",s,i=1){return V(()=>{if(s==null&&(s=Ra()),Ft(s),e.shape.length!==3)throw new U(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(t.shape.length!==3)throw new U(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new U(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if(s==="channelsFirst"&&(e=Qe(e,[0,2,1])),r==="causal")throw new _e("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=Gc(e,t,a,r==="same"?"same":"valid","NWC",i);return n!=null&&(o=$a(o,n)),o})}function $8(e,t,n,a=[1,1],r="valid",s,i,o=null){return V(()=>{if(s==null&&(s=Ra()),Ft(s),e.rank!==3&&e.rank!==4)throw new U(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(t.rank!==3&&t.rank!==4)throw new U(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=Ky(e,s);if(r==="causal")throw new _e("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=Kr.conv2d({x:l,filter:t,strides:a,pad:r==="same"?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),s==="channelsFirst"&&(l=Qe(l,[0,3,1,2])),l})}function jre(e,t,n,a=[1,1,1],r="valid",s,i){return V(()=>{if(s==null&&(s=Ra()),Ft(s),e.rank!==4&&e.rank!==5)throw new U(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(t.rank!==4&&t.rank!==5)throw new U(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=F8(e,s);if(r==="causal")throw new _e("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=L1(o,t,a,r==="same"?"same":"valid","NDHWC",i),n!=null&&(o=$a(o,n)),s==="channelsFirst"&&(o=Qe(o,[0,4,1,2,3])),o})}var Zy=class extends Xe{constructor(e,t){super(t);if(this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",Zy.verifyArgs(t),this.rank=e,Jt(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new _e(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=su(t.kernelSize,e,"kernelSize"),this.strides=su(t.strides==null?1:t.strides,e,"strides"),this.padding=t.padding==null?"valid":t.padding,ca(this.padding),this.dataFormat=t.dataFormat==null?"channelsLast":t.dataFormat,Ft(this.dataFormat),this.activation=ss(t.activation),this.useBias=t.useBias==null?!0:t.useBias,this.biasInitializer=bt(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Ht(t.biasConstraint),this.biasRegularizer=vt(t.biasRegularizer),this.activityRegularizer=vt(t.activityRegularizer),this.dilationRate=su(t.dilationRate==null?1:t.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new U(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new U(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new U(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(Qa("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!oy(e.kernelSize,"number",1,3))throw new U(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){let e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:rs(this.activation),useBias:this.useBias,biasInitializer:Tt(this.biasInitializer),biasRegularizer:dt(this.biasRegularizer),activityRegularizer:dt(this.activityRegularizer),biasConstraint:Ut(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}},ep=class extends Zy{constructor(e,t){super(e,t);this.kernel=null,ep.verifyArgs(t),this.filters=t.filters,Jt(this.filters,"filters"),this.kernelInitializer=bt(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Ht(t.kernelConstraint),this.kernelRegularizer=vt(t.kernelRegularizer)}build(e){e=st(e);let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new U(`The channel dimension of the input should be defined. Found ${e[t]}`);let n=e[t],a=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",a,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return V(()=>{e=Le(e);let n,a=this.bias==null?null:this.bias.read(),r=w4(this.activation.getClassName());if(r!=null&&this.rank===2)n=$8(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate,r);else{if(this.rank===1)n=Vre(e,this.kernel.read(),a,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)n=$8(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)n=jre(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new _e("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(n=this.activation.apply(n))}return n})}computeOutputShape(e){e=st(e);let t=[],n=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let r=0;r 0 but got ${JSON.stringify(e.filters)}`)}},tp=class extends ep{constructor(e){super(2,e);tp.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!oy(e.kernelSize,"number",1,2))throw new U(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}};tp.className="Conv2D";re.registerClass(tp);var np=class extends ep{constructor(e){super(3,e);np.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new U(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}};np.className="Conv3D";re.registerClass(np);var Yy=class extends tp{constructor(e){super(e);if(this.inputSpec=[new zt({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new U(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=st(e),e.length!==4)throw new U("Input should have rank 4; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new U("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new zt({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return V(()=>{let n=Le(e);if(n.shape.length!==4)throw new U(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i;this.dataFormat==="channelsFirst"?(s=2,i=3):(s=1,i=2);let o=a[s],l=a[i],u=this.kernelSize[0],d=this.kernelSize[1],p=this.strides[0],c=this.strides[1],h=nr(o,p,u,this.padding),m=nr(l,c,d,this.padding),f=[r,h,m,this.filters];this.dataFormat!=="channelsLast"&&(n=Qe(n,[0,2,3,1]));let g=qc(n,this.kernel.read(),f,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(g=Qe(g,[0,3,1,2])),this.bias!=null&&(g=$a(g,this.bias.read(),this.dataFormat)),this.activation!=null&&(g=this.activation.apply(g)),g})}computeOutputShape(e){e=st(e);let t=e.slice(),n,a,r;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3):(n=3,a=1,r=2);let s=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[a]=nr(t[a],o,s,this.padding),t[r]=nr(t[r],l,i,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};Yy.className="Conv2DTranspose";re.registerClass(Yy);var Jy=class extends np{constructor(e){super(e);if(this.inputSpec=[new zt({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new U(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=st(e),e.length!==5)throw new U("Input should have rank 5; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new U("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new zt({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return V(()=>{let n=Le(e);if(n.shape.length!==5)throw new U(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i,o;this.dataFormat==="channelsFirst"?(o=2,s=3,i=4):(o=1,s=2,i=3);let l=a[o],u=a[s],d=a[i],p=this.kernelSize[0],c=this.kernelSize[1],h=this.kernelSize[2],m=this.strides[0],f=this.strides[1],g=this.strides[2],y=nr(l,m,p,this.padding),A=nr(u,f,c,this.padding),x=nr(d,g,h,this.padding),v=[r,y,A,x,this.filters];this.dataFormat!=="channelsLast"&&(n=Qe(n,[0,2,3,4,1]));let b=I3(n,this.kernel.read(),v,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(b=Qe(b,[0,4,1,2,3])),this.bias!==null&&(b=$a(b,this.bias.read(),this.dataFormat)),this.activation!==null&&(b=this.activation.apply(b)),b})}computeOutputShape(e){e=st(e);let t=e.slice(),n,a,r,s;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3,s=4):(n=4,a=1,r=2,s=3);let i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],d=this.strides[1],p=this.strides[2];return t[n]=this.filters,t[a]=nr(t[a],u,i,this.padding),t[r]=nr(t[r],d,o,this.padding),t[s]=nr(t[s],p,l,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};Jy.className="Conv3DTranspose";re.registerClass(Jy);var D8=class extends ep{constructor(e,t){super(e,t);if(this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,t.filters==null)throw new U("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(t.kernelInitializer!=null||t.kernelRegularizer!=null||t.kernelConstraint!=null)throw new U("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(t.padding!=null&&t.padding!=="same"&&t.padding!=="valid")throw new U(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=t.depthMultiplier==null?1:t.depthMultiplier,this.depthwiseInitializer=bt(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=vt(t.depthwiseRegularizer),this.depthwiseConstraint=Ht(t.depthwiseConstraint),this.pointwiseInitializer=bt(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=vt(t.pointwiseRegularizer),this.pointwiseConstraint=Ht(t.pointwiseConstraint)}build(e){if(e=st(e),e.length{e=Le(e);let n;if(this.rank===1)throw new _e("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=Qe(e,[0,2,3,1])),n=ag(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=$a(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),this.dataFormat==="channelsFirst"&&(n=Qe(n,[0,3,1,2])),n})}getConfig(){let e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Tt(this.depthwiseInitializer),e.pointwiseInitializer=Tt(this.pointwiseInitializer),e.depthwiseRegularizer=dt(this.depthwiseRegularizer),e.pointwiseRegularizer=dt(this.pointwiseRegularizer),e.depthwiseConstraint=Ut(this.depthwiseConstraint),e.pointwiseConstraint=Ut(this.pointwiseConstraint),e}};D8.className="SeparableConv";var Qy=class extends D8{constructor(e){super(2,e)}};Qy.className="SeparableConv2D";re.registerClass(Qy);var T0=class extends ep{constructor(e){super(1,e);T0.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){let e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!oy(e.kernelSize,"number",1,1))throw new U(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}};T0.className="Conv1D";re.registerClass(T0);var eA=class extends Xe{constructor(e){super(e);typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return V(()=>{if(e=Le(e),this.dataFormat==="channelsLast"){let n=s0(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return s0(n,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{let n=s0(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return s0(n,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){let e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};eA.className="Cropping2D";re.registerClass(eA);var tA=class extends Xe{constructor(e){super(e);this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,rae(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){let t=e[2]==null?null:this.size[0]*e[2],n=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],t,n]}else{let t=e[1]==null?null:this.size[0]*e[1],n=e[2]==null?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return V(()=>{let n=Le(e),a=n.shape;if(this.dataFormat==="channelsFirst"){n=Qe(n,[0,2,3,1]);let r=this.size[0]*a[2],s=this.size[1]*a[3],i=this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s]);return Qe(i,[0,3,1,2])}else{let r=this.size[0]*a[1],s=this.size[1]*a[2];return this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s])}})}getConfig(){let e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};tA.className="UpSampling2D";re.registerClass(tA);function Ure(e,t,n=[1,1],a="valid",r,s){return V(()=>{r==null&&(r=Ra()),Ft(r);let i=Ky(e,r);if(e.rank!==4)throw new U(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(t.rank!==4)throw new U(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=Cl(i,t,n,a==="same"?"same":"valid","NHWC",s),r==="channelsFirst"&&(i=Qe(i,[0,3,1,2])),i})}var nA=class extends Zy{constructor(e){super(2,e);this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=bt(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Ht(e.depthwiseConstraint),this.depthwiseRegularizer=vt(e.depthwiseRegularizer)}build(e){if(e=st(e),e.length<4)throw new U(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);let t=this.dataFormat==="channelsFirst"?1:3;if(e[t]==null||e[t]<0)throw new U(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);let n=e[t],a=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",a,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return V(()=>{e=Le(e);let n=Ure(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=$a(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),n})}computeOutputShape(e){e=st(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=za(t,this.kernelSize[0],this.padding,this.strides[0]),s=za(n,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],a,r,s]:[e[0],r,s,a]}getConfig(){let e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Tt(this.depthwiseInitializer),e.depthwiseRegularizer=dt(this.depthwiseRegularizer),e.depthwiseConstraint=Ut(this.depthwiseRegularizer),e}};nA.className="DepthwiseConv2D";re.registerClass(nA);function O8(e,t,n,a){if(Array.isArray(e)){if(t!=null||n!=null)throw new U("When inputs is an array, neither initialState or constants should be provided");a!=null&&(n=e.slice(e.length-a,e.length),e=e.slice(0,e.length-a)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(s){return s==null||Array.isArray(s)?s:[s]}return t=r(t),n=r(n),{inputs:e,initialState:t,constants:n}}function z8(e,t,n,a=!1,r,s,i=!1,o=!1){return V(()=>{let l=t.shape.length;if(l<3)throw new U(`Input should be at least 3D, but is ${l}D.`);let u=[1,0].concat(Fa(2,l));if(t=Qe(t,u),s!=null)throw new _e("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),r!=null&&(r=r.asType("bool").asType("float32"),r.rank===l-1&&(r=mn(r,-1)),r=Qe(r,u)),a&&(t=Hn(t,0),r!=null&&(r=Hn(r,0)));let d=[],p,c=n,h=t.shape[0],m=Gn(t),f;r!=null&&(f=Gn(r));for(let y=0;ye(A,c));if(r==null)p=x[0],c=x[1];else{let v=V(()=>{let b=f[y],w=Un(b).sub(b),N=x[0].mul(b).add(c[0].mul(w)),C=c.map((E,_)=>x[1][_].mul(b).add(E.mul(w)));return{output:N,newStates:C}});p=v.output,c=v.newStates}o&&d.push(p)}let g;return o&&(g=gn(d,1)),[p,g,c]})}var ar=class extends Xe{constructor(e){super(e);let t;if(e.cell==null)throw new U("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?t=new R0({cells:e.cell}):t=e.cell,t.stateSize==null)throw new U("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new zt({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return Fa(0,e).map(t=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Iy(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);let n=t[0],a;if(this.returnSequences?a=[e[0],e[1],n]:a=[e[0],n],this.returnState){let r=[];for(let s of t)r.push([e[0],s]);return[a].concat(r)}else return a}computeMask(e,t){return V(()=>{Array.isArray(t)&&(t=t[0]);let n=this.returnSequences?t:null;if(this.returnState){let a=this.states.map(r=>null);return[n].concat(a)}else return n})}get states(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ni.shape[i.shape.length-1]),s))throw new U(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=s.map(i=>new zt({shape:[null,i]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){V(()=>{if(!this.stateful)throw new vr("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape[0];if(n==null)throw new U("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>$t([n,a])):this.states_=[$t([n,this.cell.stateSize])];else if(e==null)he(this.states_),this.keptStates!=null&&(he(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>$t([n,a])):this.states_[0]=$t([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new U(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t===!0?this.keptStates.push(this.states_.slice()):he(this.states_);for(let a=0;aKt(a.clone()))})}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=O8(e,n,a,this.numConstants);e=r.inputs,n=r.initialState,a=r.constants;let s=[],i=[];if(n!=null){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(let o of n)this.stateSpec.push(new zt({shape:o.shape}));i=i.concat(this.stateSpec)}if(a!=null&&(t.constants=a,s=s.concat(a),this.numConstants=a.length),s[0]instanceof Da){let o=[e].concat(s),l=this.inputSpec.concat(i),u=this.inputSpec;this.inputSpec=l;let d=super.apply(o,t);return this.inputSpec=u,d}else return super.apply(e,t)}call(e,t){return V(()=>{let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;e=Le(e),r==null&&(this.stateful?r=this.states_:r=this.getInitialState(e));let s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new U(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");let i={training:a},o=z8((c,h)=>{let m=this.cell.call([c].concat(h),i);return[m[0],m.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],u=o[1],d=o[2];this.stateful&&this.resetStates(d,a);let p=this.returnSequences?u:l;return this.returnState?[p].concat(d):p})}getInitialState(e){return V(()=>{let t=$t(e.shape);return t=Se(t,[1,2]),t=Gd(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(n=>n>1?my(t,[1,n]):t):this.cell.stateSize>1?[my(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){let e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(t.numConstants=this.numConstants);let n=this.cell.getConfig();return this.getClassName()===ar.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){let a=t.cell,r=Oa(a,n);return new e(Object.assign(t,{cell:r}))}};ar.className="RNN";re.registerClass(ar);var ap=class extends Xe{},C0=class extends ap{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=bt(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=vt(e.kernelRegularizer),this.recurrentRegularizer=vt(e.recurrentRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.kernelConstraint=Ht(e.kernelConstraint),this.recurrentConstraint=Ht(e.recurrentConstraint),this.biasConstraint=Ht(e.biasConstraint),this.dropout=eu([1,ns([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=eu([1,ns([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=st(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return V(()=>{if(e=e,e.length!==2)throw new U(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];let a=t.training==null?!1:t.training;0Un(e),rate:this.dropout,training:a})),0Un(n),rate:this.recurrentDropout,training:a}));let r,s=this.dropoutMask,i=this.recurrentDropoutMask;s!=null?r=er(B(e,s),this.kernel.read()):r=er(e,this.kernel.read()),this.bias!=null&&(r=$a(r,this.bias.read())),i!=null&&(n=B(n,i));let o=ie(r,er(n,this.recurrentKernel.read()));return this.activation!=null&&(o=this.activation.apply(o)),[o,o]})}getConfig(){let e=super.getConfig(),t={units:this.units,activation:rs(this.activation),useBias:this.useBias,kernelInitializer:Tt(this.kernelInitializer),recurrentInitializer:Tt(this.recurrentInitializer),biasInitializer:Tt(this.biasInitializer),kernelRegularizer:dt(this.kernelRegularizer),recurrentRegularizer:dt(this.recurrentRegularizer),biasRegularizer:dt(this.biasRegularizer),activityRegularizer:dt(this.activityRegularizer),kernelConstraint:Ut(this.kernelConstraint),recurrentConstraint:Ut(this.recurrentConstraint),biasConstraint:Ut(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}};C0.className="SimpleRNNCell";re.registerClass(C0);var aA=class extends ar{constructor(e){e.cell=new C0(e),super(e)}call(e,t){return V(()=>{this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return new e(t)}};aA.className="SimpleRNN";re.registerClass(aA);var E0=class extends ap{constructor(e){super(e);if(this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new U("GRUCell does not support reset_after parameter set to true.");this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ss(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=bt(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=vt(e.kernelRegularizer),this.recurrentRegularizer=vt(e.recurrentRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.kernelConstraint=Ht(e.kernelConstraint),this.recurrentConstraint=Ht(e.recurrentConstraint),this.biasConstraint=Ht(e.biasConstraint),this.dropout=eu([1,ns([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=eu([1,ns([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=st(e);let t=e[e.length-1];this.kernel=this.addWeight("kernel",[t,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return V(()=>{if(e=e,e.length!==2)throw new U(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training==null?!1:t.training,a=e[1];e=e[0],0Un(e),rate:this.dropout,training:n,count:3})),0Un(a),rate:this.recurrentDropout,training:n,count:3}));let r=this.dropoutMask,s=this.recurrentDropoutMask,i,o,l;0{this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};rA.className="GRU";re.registerClass(rA);var rp=class extends ap{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ss(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=bt(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=vt(e.kernelRegularizer),this.recurrentRegularizer=vt(e.recurrentRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.kernelConstraint=Ht(e.kernelConstraint),this.recurrentConstraint=Ht(e.recurrentConstraint),this.biasConstraint=Ht(e.biasConstraint),this.dropout=eu([1,ns([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=eu([1,ns([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;e=st(e);let n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let a;if(this.useBias){if(this.unitForgetBias){let r=this.biasInitializer,s=this.units;a=new(t=class extends va{apply(i,o){let l=r.apply([s]),u=new o0().apply([s]),d=r.apply([s*2]);return M4(M4(l,u),d)}},t.className="CustomInit",t)}else a=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,a,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return V(()=>{let n=t.training==null?!1:t.training;if(e=e,e.length!==3)throw new U(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let a=e[1],r=e[2];e=e[0],0Un(e),rate:this.dropout,training:n,count:4})),0Un(a),rate:this.recurrentDropout,training:n,count:4}));let s=this.dropoutMask,i=this.recurrentDropoutMask,o,l,u,d;0{this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};sA.className="LSTM";re.registerClass(sA);var R0=class extends ap{constructor(e){super(e);this.cells=e.cells}get stateSize(){let e=[];for(let t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return V(()=>{e=e;let n=e.slice(1),a=[];for(let i of this.cells.slice().reverse())Array.isArray(i.stateSize)?a.push(n.splice(0,i.stateSize.length)):a.push(n.splice(0,1));a.reverse();let r=[],s;for(let i=0;i{Ui(`RNNCell_${a}`,()=>{n.build(e),Array.isArray(n.stateSize)?t=n.stateSize[0]:t=n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){let e=super.getConfig(),t=a=>({className:a.getClassName(),config:a.getConfig()}),n={cells:this.cells.map(t)};return Object.assign({},e,n)}static fromConfig(e,t,n={}){let a=[];for(let r of t.cells)a.push(Oa(r,n));return new e({cells:a})}get trainableWeights(){if(!this.trainable)return[];let e=[];for(let t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.cells)t.push(...n.trainableWeights);return t.concat(e)}return e}getWeights(){let e=[];for(let t of this.cells)e.push(...t.weights);return Sy(e)}setWeights(e){let t=[];for(let n of this.cells){let a=n.weights.length,r=e.splice(a);for(let s=0;s$4(t(),n),i=()=>Xd(s,t,a);return!r||r<=1?Kt(i().clone()):Array(r).fill(void 0).map(i).map(o=>Kt(o.clone()))}var Hre=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r{if(this.cell.dropoutMask!=null&&(he(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(he(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new U("ConvRNN2D cell does not support constants");let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return V(()=>{let{stateSize:t}=this.cell,n=e.shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)],s=$t(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){V(()=>{if(!this.stateful)throw new vr("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)];if(n[0]==null)throw new U("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>$t(r)):this.states_=[$t(r)];else if(e==null)he(this.states_),this.keptStates!=null&&(he(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>$t(r)):this.states_[0]=$t(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new U(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):he(this.states_);for(let s=0;sKt(s.clone()))})}computeSingleOutputShape(e){let{dataFormat:t,filters:n,kernelSize:a,padding:r,strides:s,dilationRate:i}=this.cell,o=t==="channelsFirst",l=e[o?3:2],u=e[o?4:3],d=za(l,a[0],r,s[0],i[0]),p=za(u,a[1],r,s[1],i[1]);return[...e.slice(0,2),...o?[n,d,p]:[d,p,n]]}};_8.className="ConvRNN2D";var M0=class extends rp{constructor(e){let{filters:t,kernelSize:n,strides:a,padding:r,dataFormat:s,dilationRate:i}=e;super(Object.assign({},e,{units:t}));this.filters=t,Jt(this.filters,"filters"),this.kernelSize=su(n,2,"kernelSize"),this.kernelSize.forEach(o=>Jt(o,"kernelSize")),this.strides=su(a||1,2,"strides"),this.strides.forEach(o=>Jt(o,"strides")),this.padding=r||"valid",ca(this.padding),this.dataFormat=s||"channelsLast",Ft(this.dataFormat),this.dilationRate=su(i||1,2,"dilationRate"),this.dilationRate.forEach(o=>Jt(o,"dilationRate"))}build(e){var t;e=st(e);let n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new U(`The channel dimension of the input should be defined. Found ${e[n]}`);let a=e[n],r=4,s=this.kernelSize.concat([a,this.filters*r]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);let i=this.kernelSize.concat([this.filters,this.filters*r]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let o;if(this.unitForgetBias){let l=this.biasInitializer,u=this.filters;o=new(t=class extends va{apply(d,p){let c=l.apply([u]),h=jn([u]),m=l.apply([u*2]);return fy([c,h,m])}},t.className="CustomInit",t)}else o=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*r],null,o,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return V(()=>{if(e.length!==3)throw new U(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training||!1,a=e[0],r=e[1],s=e[2],i=4;0Un(a),rate:this.dropout,training:n,count:i}));let o=this.dropoutMask,l=(K,ne,Q)=>!ne||!ne[Q]?K:B(ne[Q],K),u=l(a,o,0),d=l(a,o,1),p=l(a,o,2),c=l(a,o,3);0Un(r),rate:this.recurrentDropout,training:n,count:i}));let h=this.recurrentDropoutMask,m=l(r,h,0),f=l(r,h,1),g=l(r,h,2),y=l(r,h,3),A=3,[x,v,b,w]=Zt(this.kernel.read(),i,A),[N,C,E,_]=this.useBias?Zt(this.bias.read(),i):[null,null,null,null];u=this.inputConv(u,x,N,this.padding),d=this.inputConv(d,v,C,this.padding),p=this.inputConv(p,b,E,this.padding),c=this.inputConv(c,w,_,this.padding);let[$,S,z,O]=Zt(this.recurrentKernel.read(),i,A);m=this.recurrentConv(m,$),f=this.recurrentConv(f,S),g=this.recurrentConv(g,z),y=this.recurrentConv(y,O);let W=this.recurrentActivation.apply(ie(u,m)),G=this.recurrentActivation.apply(ie(d,f)),H=ie(B(G,s),B(W,this.activation.apply(ie(p,g)))),J=B(this.recurrentActivation.apply(ie(c,y)),this.activation.apply(H));return[J,J,H]})}getConfig(){let e=super.getConfig(),{units:t}=e,n=Hre(e,["units"]),a={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,a)}inputConv(e,t,n,a){let r=mr(e,t,this.strides,a||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return n?$a(r,n,this.dataFormat):r}recurrentConv(e,t){return mr(e,t,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}};M0.className="ConvLSTM2DCell";re.registerClass(M0);var iA=class extends _8{constructor(e){let t=new M0(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}};iA.className="ConvLSTM2D";re.registerClass(iA);var F0=class extends Xe{constructor(e){super(e);this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;let t=e.shape,n=[];for(let a=0;a{this.invokeCallHook(e,t);let n=Le(e);if(0$4(n,this.rate,r,this.seed),()=>n,a)}return e})}getConfig(){let e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}};F0.className="Dropout";re.registerClass(F0);var oA=class extends F0{constructor(e){super(e);this.inputSpec=[{ndim:3}]}getNoiseShape(e){let t=e.shape;return[t[0],1,t[2]]}};oA.className="SpatialDropout1D";re.registerClass(oA);var lA=class extends Xe{constructor(e){super(e);if(this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let t=null;e.batchSize!=null&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,Jt(this.units,"units"),this.activation=ss(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=bt(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=bt(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Ht(e.kernelConstraint),this.biasConstraint=Ht(e.biasConstraint),this.kernelRegularizer=vt(e.kernelRegularizer),this.biasRegularizer=vt(e.biasRegularizer),this.activityRegularizer=vt(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=st(e);let t=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){e=st(e);let t=e.slice();return t[t.length-1]=this.units,t}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e),a=w4(this.activation.getClassName()),r;return a!=null?r=er(n,this.kernel.read(),a,this.bias?this.bias.read():null):(r=er(n,this.kernel.read()),this.bias!=null&&(r=$a(r,this.bias.read())),this.activation!=null&&(r=this.activation.apply(r))),r})}getConfig(){let e={units:this.units,activation:rs(this.activation),useBias:this.useBias,kernelInitializer:Tt(this.kernelInitializer),biasInitializer:Tt(this.biasInitializer),kernelRegularizer:dt(this.kernelRegularizer),biasRegularizer:dt(this.biasRegularizer),activityRegularizer:dt(this.activityRegularizer),kernelConstraint:Ut(this.kernelConstraint),biasConstraint:Ut(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}};lA.className="Dense";re.registerClass(lA);var uA=class extends Xe{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=st(e);for(let t of e.slice(1))if(t==null)throw new U(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],ts(e,1)]}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e);if(this.dataFormat==="channelsFirst"&&n.rank>1){let a=[0];for(let r=2;r{this.invokeCallHook(e,t);let n=Le(e);return this.activation.apply(n)})}getConfig(){let e={activation:rs(this.activation)},t=super.getConfig();return Object.assign(e,t),e}};dA.className="Activation";re.registerClass(dA);var pA=class extends Xe{constructor(e){super(e);this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return V(()=>(e=Le(e),lae(e,this.n)))}getConfig(){let e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}};pA.className="RepeatVector";re.registerClass(pA);var cA=class extends Xe{constructor(e){super(e);this.targetShape=e.targetShape;for(let t=0;t{this.invokeCallHook(e,t);let n=Le(e),a=n.shape,r=a.slice(0,1).concat(this.fixUnknownDimension(a.slice(1),this.targetShape));return n.reshape(r)})}getConfig(){let e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}};cA.className="Reshape";re.registerClass(cA);var hA=class extends Xe{constructor(e){super(e);if(e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);let t=Fa(1,e.dims.length+1);if(!k.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new zt({ndim:this.dims.length+1})]}computeOutputShape(e){e=st(e);let t=e.slice();return this.dims.forEach((n,a)=>{t[a+1]=e[n]}),t}call(e,t){return Qe(Le(e),this.dimsIncludingBatch)}getConfig(){let e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}};hA.className="Permute";re.registerClass(hA);var fA=class extends Xe{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){let n=Le(e),a=-1;return id(Ri(n,this.maskValue),a)}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e),a=-1,r=!0,s=id(Ri(n,this.maskValue),a,r);return n.mul(s.asType(n.dtype))})}};fA.className="Masking";re.registerClass(fA);var mA=class extends Xe{constructor(e){super(e);if(this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let t=null;e.batchSize!=null&&(t=e.batchSize),e.inputLength==null?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(yt(e.inputLength))}this.inputDim=e.inputDim,Jt(this.inputDim,"inputDim"),this.outputDim=e.outputDim,Jt(this.outputDim,"outputDim"),this.embeddingsInitializer=bt(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=vt(e.embeddingsRegularizer),this.activityRegularizer=vt(e.activityRegularizer),this.embeddingsConstraint=Ht(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return V(()=>this.maskZero?(e=Le(e),Ri(e,Ge(e))):null)}computeOutputShape(e){if(e=st(e),this.inputLength==null)return[...e,this.outputDim];let t=yt(this.inputLength);if(t.length!==e.length-1)throw new U(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let a=0;a{this.invokeCallHook(e,t);let n=Le(e);return n.dtype!=="int32"&&(n=Hd(n,"int32")),F4(this.embeddings.read(),n.as1D()).reshape(st(this.computeOutputShape(n.shape)))})}getConfig(){let e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Tt(this.embeddingsInitializer),embeddingsRegularizer:dt(this.embeddingsRegularizer),activityRegularizer:dt(this.activityRegularizer),embeddingsConstraint:Ut(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}};mA.className="Embedding";re.registerClass(mA);var Ki=class extends Xe{constructor(e){super(e||{});this.supportsMasking=!0}mergeFunction(e){throw new _e}computeElementwiseOpOutputShape(e,t){if(e==null||t==null)return null;if(e.length1)throw new U(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=e[0]==null?null:e[0].slice(1);for(let r=1;rr.length);e.indexOf(null)===-1&&es(a).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return V(()=>{if(e=e,this.reshapeRequired){let n=[],a=e.map(r=>r.rank);if(a.indexOf(null)===-1){let r=ns(a);for(let s of e){let i=s.rank;for(let o=0;o1){let u=Fa(1,l).concat([0]);n.push(Qe(o,u)),r=!0}else n.push(o)}let s=this.mergeFunction(n),i=s.rank;if(r){if(i==null){let o=s.shape,l=o.length,u=o[l-1],d=[u].concat(o.slice(0,o.length-1));s=Qe(s.reshape([-1,u]),[1,0]).reshape(d)}else if(i>1){let o=[i-1].concat(Fa(0,i-1));s=Qe(s,o)}}return s}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let t;e[0]==null?t=null:t=e[0].slice(1);for(let a=1;a{if(t==null)return null;if(!Array.isArray(t))throw new U("`mask` should be an Array");if(!Array.isArray(e))throw new U("`inputs` should be an Array");if(t.length!==e.length)throw new U(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(a=>a==null))return null;t=t.map(a=>a==null?a:mn(a,0));let n=t[0];for(let a=1;a{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new U("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return V(()=>fy(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new U("A `Concatenate` layer should be called on a list of inputs.");let t=e,n=t[0].slice(),a=this.axis<0?n.length+this.axis:this.axis;for(let r of t.slice(1)){if(n[a]==null||r[a]==null){n[a]=null;break}n[a]+=r[a]}return n}computeMask(e,t){if(t==null)return null;if(!Array.isArray(t))throw new U("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new U("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new U(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return V(()=>{let n=!0;if(t.forEach(s=>{if(s!=null){n=!1;return}}),n)return null;let a=[];for(let s=0;s3||t.shape.length>3)throw new _e("batchDot is not implemented for tensors of 4D or higher rank yet");if(k.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),k.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),typeof n=="number"&&(n=[n,n]),e.dtype==="complex64"||t.dtype==="complex64")throw new _e("batchDot is not implemented for complex64-type Tensors yet.");let a=e.shape.length,r=t.shape.length;n==null&&(n=[a-1,r-2]);let s=n;return V(()=>{let i;if(a>r){i=a-r;let l=[];for(let u=0;ua){i=r-a;let l=[];for(let u=0;u0){let l;a>r?l=a+r-3:l=a-1;let u=[];for(let d=l;d"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0],n=e[1];if(t.length>3||n.length>3)throw new _e("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);if(t[a[0]]!==n[a[1]])throw new U(`Dimension incompatibility: ${t[a[0]]} !== ${n[a[1]]}`)}mergeFunction(e){if(e.length!==2)throw new U(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t=e[0],n=e[1],a;return Array.isArray(this.axes)?a=this.axes.map((r,s)=>sp(r,e[s].shape.length)):a=[sp(this.axes,t.shape.length),sp(this.axes,n.shape.length)],this.normalize&&(t=x0(t,a[0]),n=x0(n,a[1])),Gre(t,n,a)}interpretAxes(e,t){let n;return Array.isArray(this.axes)?n=this.axes:n=[sp(this.axes,e.length),sp(this.axes,t.length)],n}computeOutputShape(e){k.assert(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new _e("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);t.splice(a[0],1),n.splice(a[1],1),n.splice(0,1);let r=t.concat(n);return r.length===1&&r.push(1),r}computeMask(e,t){return null}getConfig(){let e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}};wA.className="Dot";re.registerClass(wA);var kA=class extends Xe{constructor(e){super(e);this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e);return Xd(()=>i0(n.shape,0,this.stddev).add(n),()=>n,t.training||!1)})}};kA.className="GaussianNoise";re.registerClass(kA);var IA=class extends Xe{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return V(()=>{this.invokeCallHook(e,t);let n=Le(e);return this.rate>0&&this.rate<1?Xd(()=>{let a=Math.sqrt(this.rate/(1-this.rate));return n.mul(i0(n.shape,1,a))},()=>n,t.training||!1):n})}};IA.className="GaussianDropout";re.registerClass(IA);var SA=class extends Xe{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Le(e).shape}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return V(()=>{if(this.rate<1&&this.rate>0){let n=this._getNoiseShape(e);return Xd(()=>{let a=Le(e),r=1.6732632423543772,s=1.0507009873554805,i=-r*s,o=qr($l(n),this.rate);o=Hd(o,"float32");let l=((1-this.rate)*(1+this.rate*i**2))**-.5,u=-l*i*this.rate;return a.mul(o).add(o.add(-1).mul(i)).mul(l).add(u)},()=>Le(e),t.training||!1)}return e})}};SA.className="AlphaDropout";re.registerClass(SA);function ip(e,t,n,a,r,s=.001){let i;if(e.rank===2)i=y3(e,t,n,a,r,s);else if(e.rank===3)i=A3(e,t,n,a,r,s);else if(e.rank===4)i=x3(e,t,n,a,r,s);else throw new _e(`batchNormalization is not implemented for array of rank ${e.rank} yet`);return i}function qre(e,t,n,a,r=.001){return V(()=>{let s=nh(e,a),i=s.mean,o=s.variance;return[ip(e,i,o,n,t,r),i,o]})}function Xre(e,t,n,a,r=.001){return V(()=>{let s=nh(e,a),i=s.mean,o=s.variance,l=[];for(let h of Fa(0,e.rank))a.indexOf(h)!==-1?l.push(1):l.push(e.shape[h]);let u=i.reshape(l),d=o.reshape(l),p=t==null?null:t.reshape(l),c=n==null?null:n.reshape(l);return[ip(e,u,d,c,p,r),i,o]})}function Kre(e,t,n,a,r=.001){return k.arraysEqual(a.slice().sort(),Fa(0,e.rank-1))?qre(e,t,n,a,r):Xre(e,t,n,a,r)}var NA=class extends Xe{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=bt(e.betaInitializer||"zeros"),this.gammaInitializer=bt(e.gammaInitializer||"ones"),this.movingMeanInitializer=bt(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=bt(e.movingVarianceInitializer||"ones"),this.betaConstraint=Ht(e.betaConstraint),this.gammaConstraint=Ht(e.gammaConstraint),this.betaRegularizer=vt(e.betaRegularizer),this.gammaRegularizer=vt(e.gammaRegularizer)}build(e){e=st(e);let t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(n==null)throw new U(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new zt({ndim:e.length,axes:{[t]:n}})];let a=[n];this.scale&&(this.gamma=this.addWeight("gamma",a,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",a,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",a,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",a,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return V(()=>{let n=t.training==null?!1:t.training,a=Le(e),r=a.shape,s=r.length,i=Fa(0,s),o=this.axis>=0?this.axis:this.axis+s;i.splice(o,1);let l=Bi(1,s);l[o]=r[o];let u=i.slice();u.sort();let d=!k.arraysEqual(u,Fa(0,s).slice(0,s-1)),p=()=>{if(d){let g=this.movingMean.read().reshape(l),y=this.movingVariance.read().reshape(l),A=this.center?this.beta.read().reshape(l):null,x=this.scale?this.gamma.read().reshape(l):null;return ip(a,g,y,A,x,this.epsilon)}else return ip(a,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!n)return p();let[c,h,m]=Kre(a,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(g,y,A)=>{V(()=>{let x=1-A,v=g.read(),b=v.sub(y).mul(x);g.write(v.sub(b))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,m,this.momentum)})(),c})}getConfig(){let e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Tt(this.betaInitializer),gammaInitializer:Tt(this.gammaInitializer),movingMeanInitializer:Tt(this.movingMeanInitializer),movingVarianceInitializer:Tt(this.movingVarianceInitializer),betaRegularizer:dt(this.betaRegularizer),gammaRegularizer:dt(this.gammaRegularizer),betaConstraint:Ut(this.betaConstraint),gammaConstraint:Ut(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}};NA.className="BatchNormalization";re.registerClass(NA);var TA=class extends Xe{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(let t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=bt(e.betaInitializer||"zeros"),this.gammaInitializer=bt(e.gammaInitializer||"ones"),this.betaRegularizer=vt(e.betaRegularizer),this.gammaRegularizer=vt(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=st(e);let t=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let r=0;r=t)throw new Error(`Invalid axis: ${r}`);if(this.axis.length!==es(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);let n=this.axis.map(r=>e[r]),a=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,a):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,a):this.beta=null,this.built=!0}call(e,t){let n=Le(e),a=n.shape,r=a.length;return V(()=>{let s=!0,{mean:i,variance:o}=nh(n,this.axis,s),l=Bi(1,r);for(let m of this.axis)l[m]=a[m];let u=m=>m!=null&&m.shape.length!==r&&this.axis!==[r-1]?m.reshape(l):m,d=u(this.gamma.read()),p=u(this.beta.read()),c=[],h=[];for(let m=0;m{if(e.rank!==4)throw new U(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(t==null&&(t=[[1,1],[1,1]]),t.length!==2||t[0].length!==2||t[1].length!==2)throw new U("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=Ra()),n!=="channelsLast"&&n!=="channelsFirst")throw new U(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let a;return n==="channelsFirst"?a=[[0,0],[0,0],t[0],t[1]]:a=[[0,0],t[0],t[1],[0,0]],gr(e,a)})}var CA=class extends Xe{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?Ra():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new U(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if(typeof e.padding[0]=="number")t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new U(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],e.padding[1].length!==2)throw new U(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new zt({ndim:4})]}computeOutputShape(e){e=st(e);let t,n;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?t=e[2]+this.padding[0][0]+this.padding[0][1]:t=null,e[3]!=null&&e[3]>=0?n=e[3]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],e[1],t,n]):(e[1]!=null&&e[1]>=0?t=e[1]+this.padding[0][0]+this.padding[0][1]:t=null,e[2]!=null&&e[2]>=0?n=e[2]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],t,n,e[3]])}call(e,t){return V(()=>Zre(Le(e),this.padding,this.dataFormat))}getConfig(){let e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};CA.className="ZeroPadding2D";re.registerClass(CA);function $0(e,t,n,a,r,s){return V(()=>{Ft(r),N4(s),ca(a),n==null&&(n=[1,1]),a==null&&(a="valid"),r==null&&(r=Ra()),s==null&&(s="max"),e=Ky(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=hd(e,t,n,o):i=ld(e,t,n,o),r==="channelsFirst"&&(i=Qe(i,[0,3,1,2])),i})}function P8(e,t,n,a,r,s){return V(()=>{Ft(r),N4(s),ca(a),n==null&&(n=[1,1,1]),a==null&&(a="valid"),r==null&&(r=Ra()),s==null&&(s="max"),e=F8(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=Y1(e,t,n,o):i=O1(e,t,n,o),r==="channelsFirst"&&(i=Qe(i,[0,4,1,2,3])),i})}var L8=class extends Xe{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new U(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(Jt(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new U(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);Jt(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,ca(this.padding),this.inputSpec=[new zt({ndim:3})]}computeOutputShape(e){e=st(e);let t=za(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return V(()=>{this.invokeCallHook(e,t),e=Gd(Le(e),2);let n=this.poolingFunction(Le(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Vt(n,[2])})}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}},EA=class extends L8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"max")}};EA.className="MaxPooling1D";re.registerClass(EA);var RA=class extends L8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"avg")}};RA.className="AveragePooling1D";re.registerClass(RA);var W8=class extends Xe{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new U(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];Jt(this.poolSize,"poolSize"),Jt(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),ca(this.padding),this.inputSpec=[new zt({ndim:4})]}computeOutputShape(e){e=st(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2];return t=za(t,this.poolSize[0],this.padding,this.strides[0]),n=za(n,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return V(()=>(this.invokeCallHook(e,t),this.poolingFunction(Le(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},MA=class extends W8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"max")}};MA.className="MaxPooling2D";re.registerClass(MA);var FA=class extends W8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),$0(e,t,n,a,r,"avg")}};FA.className="AveragePooling2D";re.registerClass(FA);var B8=class extends Xe{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new U(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];Jt(this.poolSize,"poolSize"),Jt(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),ca(this.padding),this.inputSpec=[new zt({ndim:5})]}computeOutputShape(e){e=st(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[4]:e[3];return t=za(t,this.poolSize[0],this.padding,this.strides[0]),n=za(n,this.poolSize[1],this.padding,this.strides[1]),a=za(a,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n,a]:[e[0],t,n,a,e[4]]}call(e,t){return V(()=>(this.invokeCallHook(e,t),this.poolingFunction(Le(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},$A=class extends B8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),P8(e,t,n,a,r,"max")}};$A.className="MaxPooling3D";re.registerClass($A);var DA=class extends B8{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Ft(r),ca(a),P8(e,t,n,a,r,"avg")}};DA.className="AveragePooling3D";re.registerClass(DA);var V8=class extends Xe{constructor(e){super(e);this.inputSpec=[new zt({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new _e}},OA=class extends V8{constructor(e){super(e||{})}call(e,t){return V(()=>{let n=Le(e);return Nt(n,1)})}};OA.className="GlobalAveragePooling1D";re.registerClass(OA);var zA=class extends V8{constructor(e){super(e||{})}call(e,t){return V(()=>{let n=Le(e);return Vn(n,1)})}};zA.className="GlobalMaxPooling1D";re.registerClass(zA);var j8=class extends Xe{constructor(e){super(e);this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Ft(this.dataFormat),this.inputSpec=[new zt({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new _e}getConfig(){let e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},_A=class extends j8{call(e,t){return V(()=>{let n=Le(e);return this.dataFormat==="channelsLast"?Nt(n,[1,2]):Nt(n,[2,3])})}};_A.className="GlobalAveragePooling2D";re.registerClass(_A);var PA=class extends j8{call(e,t){return V(()=>{let n=Le(e);return this.dataFormat==="channelsLast"?Vn(n,[1,2]):Vn(n,[2,3])})}};PA.className="GlobalMaxPooling2D";re.registerClass(PA);var U8=class extends Xe{constructor(e){super(e);this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){let e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){let a=t.layer,r=Oa(a,n);delete t.layer;let s={layer:r};return Object.assign(s,t),new e(s)}},LA=class extends U8{constructor(e){super(e);this.supportsMasking=!0}build(e){if(e=st(e),e.length<3)throw new U(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];let t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=st(e);let t=[e[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),a=e[1];return[n[0],a].concat(n.slice(1))}call(e,t){return V(()=>(e=Le(e),z8((n,a)=>[Le(this.layer.call(n,t)),[]],e,[],!1,null,null,!1,!0)[1]))}};LA.className="TimeDistributed";re.registerClass(LA);function Yre(e){ji(aae,"BidirectionalMergeMode",e)}var Jre="concat",WA=class extends U8{constructor(e){super(e);let t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Oa(n),t.goBackwards=t.goBackwards!==!0;let a={};if(a.className=e.layer.getClassName(),a.config=t,this.backwardLayer=Oa(a),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?Jre:e.mergeMode,Yre(this.mergeMode),e.weights)throw new _e("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){let t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t=this.forwardLayer.computeOutputShape(e);Array.isArray(t)&&Array.isArray(t[0])||(t=[t]),t=t;let n,a,r;return this.returnState&&(r=t.slice(1)),n=t[0],n=n,this.mergeMode==="concat"?(n[n.length-1]*=2,a=[n]):this.mergeMode==null?a=[n,n.slice()]:a=[n],this.returnState?this.mergeMode==null?a.concat(r).concat(r.slice()):[n].concat(r).concat(r.slice()):$n(a)}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=O8(e,n,a,this.numConstants);if(e=r.inputs,n=r.initialState,a=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(n==null||n.length===0)&&a==null)return super.apply(e,t);let s=[],i=[];if(n!=null){let l=n.length;if(l%2>0)throw new U("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);let u=n.map(d=>new zt({shape:d.shape}));this.forwardLayer.stateSpec=u.slice(0,l/2),this.backwardLayer.stateSpec=u.slice(l/2),i.push(...u)}if(a!=null)throw new _e("Support for constants in Bidirectional layers is not implemented yet.");let o=s[0]instanceof Da;for(let l of s)if(l instanceof Da!==o)throw new U("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){let l=[e].concat(s),u=this.inputSpec.concat(i),d=this.inputSpec;this.inputSpec=u;let p=super.apply(l,t);return this.inputSpec=d,p}else return super.apply(e,t)}call(e,t){return V(()=>{let n=t.initialState,a,r;if(n==null)a=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{let o=n.slice(0,n.length/2),l=n.slice(n.length/2);a=this.forwardLayer.call(e,Object.assign(t,{initialState:o})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:l}))}let s;this.returnState&&(Array.isArray(a)&&(s=a.slice(1).concat(r.slice(1))),a=a[0],r=r[0]),this.returnSequences&&(r=Hn(r,1));let i;return this.mergeMode==="concat"?i=fy([a,r]):this.mergeMode==="sum"?i=ie(a,r):this.mergeMode==="ave"?i=B(.5,ie(a,r)):this.mergeMode==="mul"?i=B(a,r):this.mergeMode==null&&(i=[a,r]),this.returnState?this.mergeMode==null?i.concat(s):[i].concat(s):i})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ui(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Ui(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){Array.isArray(t)&&(t=t[0]);let n;if(this.returnSequences?this.mergeMode==null?n=[t,t]:n=t:this.mergeMode==null?n=[null,null]:n=null,this.returnState){let a=this.forwardLayer.states.map(r=>null);return Array.isArray(n)?n.concat(a).concat(a):[n].concat(a).concat(a)}else return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){let e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){let n=Oa(t.layer);if(delete t.layer,t.numConstants!=null)throw new _e("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");let a=t;return a.layer=n,new e(a)}};WA.className="Bidirectional";re.registerClass(WA);function Qre(e){return new tu(e)}function ese(e){return new Gy(e)}function tse(e){return new jy(e)}function nse(e){return new Uy(e)}function ase(e){return new Hy(e)}function rse(e){return new Xy(e)}function sse(e){return new qy(e)}function ise(e){return new T0(e)}function ose(e){return new tp(e)}function lse(e){return new Yy(e)}function use(e){return new np(e)}function dse(e){return new Jy(e)}function pse(e){return new Qy(e)}function cse(e){return new eA(e)}function hse(e){return new tA(e)}function fse(e){return new nA(e)}function mse(e){return new dA(e)}function gse(e){return new lA(e)}function yse(e){return new F0(e)}function Ase(e){return new oA(e)}function xse(e){return new uA(e)}function bse(e){return new pA(e)}function vse(e){return new cA(e)}function wse(e){return new hA(e)}function kse(e){return new mA(e)}function Ise(e){return new gA(e)}function Sse(e){return new AA(e)}function Nse(e){return new vA(e)}function Tse(e){return new xA(e)}function Cse(e){return new bA(e)}function Ese(e){return new yA(e)}function Rse(e){return new wA(e)}function Mse(e){return new NA(e)}function Fse(e){return new TA(e)}function $se(e){return new CA(e)}function BA(e){return new RA(e)}function Dse(e){return BA(e)}function Ose(e){return BA(e)}function VA(e){return new FA(e)}function zse(e){return VA(e)}function _se(e){return VA(e)}function jA(e){return new DA(e)}function Pse(e){return jA(e)}function Lse(e){return jA(e)}function Wse(e){return new OA(e)}function Bse(e){return new _A(e)}function H8(e){return new zA(e)}function G8(e){return new PA(e)}function q8(e){return new EA(e)}function X8(e){return new MA(e)}function Vse(e){return new $A(e)}function jse(e){return new rA(e)}function Use(e){return new E0(e)}function Hse(e){return new sA(e)}function Gse(e){return new rp(e)}function qse(e){return new aA(e)}function Xse(e){return new C0(e)}function Kse(e){return new iA(e)}function Zse(e){return new M0(e)}function Yse(e){return new ar(e)}function Jse(e){return new R0(e)}function Qse(e){return new WA(e)}function eie(e){return new LA(e)}var tie=H8,nie=G8,aie=q8,rie=X8;function sie(e){return new kA(e)}function iie(e){return new IA(e)}function oie(e){return new SA(e)}function lie(e){return new fA(e)}var K8={};Fe(K8,{MAPE:()=>xie,MSE:()=>wie,binaryAccuracy:()=>uie,binaryCrossentropy:()=>die,categoricalAccuracy:()=>cie,categoricalCrossentropy:()=>hie,cosineProximity:()=>gie,mape:()=>bie,meanAbsoluteError:()=>yie,meanAbsolutePercentageError:()=>Aie,meanSquaredError:()=>vie,mse:()=>kie,precision:()=>fie,recall:()=>mie,sparseCategoricalAccuracy:()=>pie});function uie(e,t){return Ey(e,t)}function die(e,t){return Y4(e,t)}function pie(e,t){return J4(e,t)}function cie(e,t){return Ry(e,t)}function hie(e,t){return My(e,t)}function fie(e,t){return Z4(e,t)}function mie(e,t){return Jae(e,t)}function gie(e,t){return Ty(e,t)}function yie(e,t){return b0(e,t)}function Aie(e,t){return au(e,t)}function xie(e,t){return au(e,t)}function bie(e,t){return au(e,t)}function vie(e,t){return Gi(e,t)}function wie(e,t){return Gi(e,t)}function kie(e,t){return Gi(e,t)}var Z8={};Fe(Z8,{modelFromJSON:()=>Fre});var Y8={};Fe(Y8,{l1:()=>Sie,l1l2:()=>Iie,l2:()=>Nie});function Iie(e){return new Qd(e)}function Sie(e){return Wre(e)}function Nie(e){return Bre(e)}var J8=class extends nu{constructor(){super(...arguments);this.model=null}setModel(e){if(!(e instanceof kr))throw new Error("model must be a LayersModel, not some other Container");this.model=e}};function D0(e,t){return et}var ek=class extends J8{constructor(e){super();if(e==null&&(e={}),e.restoreBestWeights)throw new _e("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,["auto","min","max"].indexOf(this.mode)===-1&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),this.mode==="min"?this.monitorFunc=D0:this.mode==="max"?this.monitorFunc=Q8:this.monitor.indexOf("acc")!==-1?this.monitorFunc=Q8:this.monitorFunc=D0,this.monitorFunc===D0&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,this.baseline!=null?this.best=this.baseline:this.best=this.monitorFunc===D0?Infinity:-Infinity}async onEpochEnd(e,t){await as(t);let n=this.getMonitorValue(t);n!=null&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){e==null&&(e={});let t=e[this.monitor];return t==null&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}};function Tie(e){return new ek(e)}var Cie={earlyStopping:Tie},_a;(function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"})(_a||(_a={}));var tk;(function(e){let t;(function(n){n[n.LEGACY=0]="LEGACY",n[n.V1=1]="V1",n[n.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(tk||(tk={}));var UA={};function Eie(e,t){let n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};UA[e]=n}function nk(e){return UA[e]}function Rie(e){delete UA[e]}function I(e,t,n,a,r){let s=t.inputParams[e];if(s&&s.inputIndexStart!==void 0){let o=s.inputIndexStart,l=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd;if(s.type==="tensor")return kn(t.inputNames[s.inputIndexStart],n,a,r);if(s.type==="tensors")return t.inputNames.slice(o,l).map(p=>kn(p,n,a,r));let u=kn(t.inputNames.slice(o)[0],n,a,r),d=u.dataSync();return s.type==="number"?d[0]:k.toNestedArray(u.shape,d)}let i=t.attrParams[e];return i&&i.value}function kn(e,t,n,a){let[r,s]=Kn(e);if(a!=null){let o=a.getHashTableHandleByName(r);if(o!=null)return o}let i=n.currentContextIds.find(o=>!!t[O0(r,o)]);return i!==void 0?t[O0(r,i)][s]:void 0}function Mie(e,t,n){return t[O0(e,n.currentContextId)]}function Ir(e,t){let[n,a,r]=Kn(e);return[O0(n,t&&t.currentContextId),a,r]}function O0(e,t){return t?`${e}-${t}`:e}function Kn(e){let t=e.split(":");if(t.length===1)return[e,0,void 0];let n=t[0],a=t.length===3?t[1]:void 0,r=Number(t[t.length-1]);return[n,r,a]}function z0(e,t,n){let a=I("pad",e,t,n);if(a==="explicit"){a=I("explicitPaddings",e,t,n);let r=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)r[s][0]=a[s*2],r[s][1]=a[s*2+1];return r}return a}function Sr(e){return e.kept?e:Ha(e)}var ak={};Fe(ak,{json:()=>Fie});var Fie=[{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}]},{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}]}],rk={};Fe(rk,{json:()=>$ie});var $ie=[{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}]},{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}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{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}]}],sk={};Fe(sk,{json:()=>Die});var Die=[{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:"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"}]}],ik={};Fe(ik,{json:()=>Oie});var Oie=[{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},{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"}]},{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"}]}],ok={};Fe(ok,{json:()=>zie});var zie=[{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",notSupported:!0}]},{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:"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:"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"}]}],lk={};Fe(lk,{json:()=>_ie});var _ie=[{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}]}],uk={};Fe(uk,{json:()=>Pie});var Pie=[{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:"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"}]}],dk={};Fe(dk,{json:()=>Lie});var Lie=[{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"}]}],pk={};Fe(pk,{json:()=>Wie});var Wie=[{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"}],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"}]}],ck={};Fe(ck,{json:()=>Bie});var Bie=[{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"}]}],hk={};Fe(hk,{json:()=>Vie});var Vie=[{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}]},{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}]}],fk={};Fe(fk,{json:()=>jie});var jie=[{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:"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}]},{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"}]}],mk={};Fe(mk,{json:()=>Uie});var Uie=[{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"}]},{tfOpName:"SparseToDense",category:"normalization",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:!0,notSupported:!0}]}],gk={};Fe(gk,{json:()=>Hie});var Hie=[{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"}]},{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"}]}],yk={};Fe(yk,{json:()=>Gie});var Gie=[{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}]}],Ak={};Fe(Ak,{json:()=>qie});var qie=[{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"}]}],xk={};Fe(xk,{json:()=>Xie});var Xie=[{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}]}],bk={};Fe(bk,{json:()=>Kie});var Kie=[{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"}]}],vk={};Fe(vk,{json:()=>Zie});var Zie=[{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:"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:[]}],wk=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[ak,rk,sk,ik,ok,lk,uk,dk,pk,ck,hk,fk,mk,gk,yk,Ak,xk,bk,vk],t=[].concat(...e.map(n=>n.json));this.opMappers=t.reduce((n,a)=>(n[a.tfOpName]=a,n),{})}transformGraph(e,t={}){let n=e.node,a=[],r=[],s=[],i=n.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?a.push(m[f.name]):f.op==="Const"?r.push(m[f.name]):(f.input==null||f.input.length===0)&&s.push(m[f.name]),m),{}),o=[],l=[],u={},d={};t!=null&&(u=this.mapSignatureEntries(t.inputs),d=this.mapSignatureEntries(t.outputs));let p=Object.keys(i);p.forEach(m=>{let f=i[m];f.inputNames.forEach((g,y)=>{let[A,,x]=Ir(g),v=i[A];if(v.outputs!=null){let b=v.outputs.indexOf(x);if(b!==-1){let w=`${A}:${b}`;f.inputNames[y]=w}}f.inputs.push(v),v.children.push(f)})}),Object.keys(d).length===0?p.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(d).forEach(m=>{let[f]=Ir(m),g=i[f];g!=null&&(g.signatureKey=d[m],l.push(g))}),Object.keys(u).length>0?Object.keys(u).forEach(m=>{let[f]=Ir(m),g=i[f];g&&(g.signatureKey=u[m],o.push(g))}):o=a;let c={};e.library!=null&&e.library.function!=null&&(c=e.library.function.reduce((m,f)=>(m[f.signature.name]=this.mapFunction(f),m),{}));let h={nodes:i,inputs:o,outputs:l,weights:r,placeholders:a,signature:t,functions:c};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){let t=nk(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(a=>a.startsWith("^")?a.substr(1):a),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(n.inputParams=t.inputs.reduce((a,r)=>(a[r.name]={type:r.type,inputIndexStart:r.start,inputIndexEnd:r.end},a),{})),t.attrs!=null&&(n.attrParams=t.attrs.reduce((a,r)=>{let s=r.type,i;switch(r.type){case"string":i=HA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=HA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":i=QA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=QA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":i=qA(e.attr,r.tfName,r.defaultValue||0),i===void 0&&!!r.tfDeprecatedName&&(i=qA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":i=JA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=JA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":i=GA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=GA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":i=t2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=t2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":i=YA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=YA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":i=e2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=e2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":i=KA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=KA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":i=ZA(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=ZA(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":i=Ik(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=Ik(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${r.type} for op: ${e.op}`)}return a[r.name]={value:i,type:s},a},{})),n}mapFunction(e){let t=e.nodeDef,n=[],a=[],r={};t!=null&&(r=t.reduce((u,d)=>(u[d.name]=this.mapNode(d),d.op==="Const"&&a.push(u[d.name]),u),{}));let s=[],i=[];e.signature.inputArg.forEach(u=>{let[d]=Ir(u.name),p={name:d,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:XA(u.type),type:"dtype"}},children:[]};p.signatureKey=u.name,s.push(p),r[d]=p}),Object.keys(r).forEach(u=>{let d=r[u];d.inputNames.forEach((p,c)=>{let[h,,m]=Ir(p),f=r[h];if(f.outputs!=null){let g=f.outputs.indexOf(m);if(g!==-1){let y=`${h}:${g}`;d.inputNames[c]=y}}d.inputs.push(f),f.children.push(d)})});let o=e.ret;e.signature.outputArg.forEach(u=>{let[d,p]=Ir(o[u.name]),c=r[d];c!=null&&(c.defaultOutput=p,i.push(c))});let l=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:i,weights:a,placeholders:n,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n),t),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return t!=null&&(n=t[n]),{name:n,dtype:e.type}}};function Yie(e){let t=te().global;if(typeof t.atob!="undefined")return t.atob(e);if(typeof Buffer!="undefined")return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function kk(e,t){let n=Array.isArray(e)?String.fromCharCode.apply(null,e):Yie(e);return t?n:n.toLowerCase()}function HA(e,t,n,a=!1){let r=e[t];return r!=null?kk(r.s,a):n}function GA(e,t,n){let a=e[t];return a?a.b:n}function qA(e,t,n){let a=e[t]||{},r=a.i!=null?a.i:a.f!=null?a.f:n;return typeof r=="number"?r:parseInt(r,10)}function XA(e){switch(typeof e=="string"&&(e=_a[e]),e){case _a.DT_FLOAT:return"float32";case _a.DT_INT32:case _a.DT_INT64:case _a.DT_INT8:case _a.DT_UINT8:return"int32";case _a.DT_BOOL:return"bool";case _a.DT_DOUBLE:return"float32";case _a.DT_STRING:return"string";default:return null}}function Ik(e,t,n){let a=e[t];return a&&a.func?a.func.name:n}function KA(e,t,n){let a=e[t];return a&&a.type?XA(a.type):n}function ZA(e,t,n){let a=e[t];return a&&a.list&&a.list.type?a.list.type.map(r=>XA(r)):n}function Sk(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function YA(e,t,n){let a=e[t];return a&&a.shape?Sk(a.shape):n}function JA(e,t,n){let a=e[t];return a?((a.list.f&&a.list.f.length?a.list.f:a.list.i)||[]).map(r=>typeof r=="number"?r:parseInt(r,10)):n}function QA(e,t,n,a=!1){let r=e[t];return r&&r.list&&r.list.s?r.list.s.map(s=>kk(s,a)):n}function e2(e,t,n){let a=e[t];return a&&a.list&&a.list.shape?a.list.shape.map(r=>Sk(r)):n}function t2(e,t,n){let a=e[t];return a&&a.list&&a.list.b?a.list.b:n}var Jie=class{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(a=>this.getInput(a)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((a,r)=>(a[r]=this.getAttr(r),a),{}))}getInput(e){return kn(e,this.tensorMap,this.context)}getAttr(e,t){let n=this.node.rawAttrs[e];if(n.tensor!=null)return kn(e,this.tensorMap,this.context);if(n.i!=null||n.f!=null)return qA(this.node.rawAttrs,e,t);if(n.s!=null)return HA(this.node.rawAttrs,e,t);if(n.b!=null)return GA(this.node.rawAttrs,e,t);if(n.shape!=null)return YA(this.node.rawAttrs,e,t);if(n.type!=null)return KA(this.node.rawAttrs,e,t);if(n.list!=null){if(n.list.i!=null||n.list.f!=null)return JA(this.node.rawAttrs,e,t);if(n.list.s!=null)return QA(this.node.rawAttrs,e,t);if(n.list.shape!=null)return e2(this.node.rawAttrs,e,t);if(n.list.b!=null)return t2(this.node.rawAttrs,e,t);if(n.list.type!=null)return ZA(this.node.rawAttrs,e,t)}return t}},Qie=(e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[ie(I("a",e,t,n),I("b",e,t,n))];case"AddN":return[jc(I("tensors",e,t,n))];case"FloorMod":case"Mod":return[Q1(I("a",e,t,n),I("b",e,t,n))];case"Mul":return[B(I("a",e,t,n),I("b",e,t,n))];case"RealDiv":case"Div":return[me(I("a",e,t,n),I("b",e,t,n))];case"DivNoNan":return[V1(I("a",e,t,n),I("b",e,t,n))];case"FloorDiv":return[Vc(I("a",e,t,n),I("b",e,t,n))];case"Sub":return[ye(I("a",e,t,n),I("b",e,t,n))];case"Minimum":return[Fl(I("a",e,t,n),I("b",e,t,n))];case"Maximum":return[Xa(I("a",e,t,n),I("b",e,t,n))];case"Pow":return[yr(I("a",e,t,n),I("b",e,t,n))];case"SquaredDifference":return[hh(I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},eoe=(e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Wt(I("x",e,t,n))];case"Acos":return[S1(I("x",e,t,n))];case"Acosh":return[N1(I("x",e,t,n))];case"Asin":return[C1(I("x",e,t,n))];case"Asinh":return[E1(I("x",e,t,n))];case"Atan":return[R1(I("x",e,t,n))];case"Atan2":return[M1(I("x",e,t,n),I("y",e,t,n))];case"Atanh":return[F1(I("x",e,t,n))];case"Ceil":return[_1(I("x",e,t,n))];case"Complex":return[Wr(I("real",e,t,n),I("imag",e,t,n))];case"Cos":return[dd(I("x",e,t,n))];case"Cosh":return[Xc(I("x",e,t,n))];case"Elu":return[El(I("x",e,t,n))];case"Erf":return[j1(I("x",e,t,n))];case"Exp":return[la(I("x",e,t,n))];case"Expm1":return[U1(I("x",e,t,n))];case"Floor":return[Ml(I("x",e,t,n))];case"Log":return[Bn(I("x",e,t,n))];case"Log1p":return[Jc(I("x",e,t,n))];case"Imag":return[Zc(I("x",e,t,n))];case"Neg":return[St(I("x",e,t,n))];case"Reciprocal":return[ng(I("x",e,t,n))];case"Real":return[yd(I("x",e,t,n))];case"Relu":return[Ka(I("x",e,t,n))];case"Round":return[sh(I("x",e,t,n))];case"Selu":return[oh(I("x",e,t,n))];case"Sigmoid":return[Rn(I("x",e,t,n))];case"Sin":return[lh(I("x",e,t,n))];case"Sign":return[rg(I("x",e,t,n))];case"Sinh":return[uh(I("x",e,t,n))];case"Softplus":return[Ci(I("x",e,t,n))];case"Sqrt":return[an(I("x",e,t,n))];case"Square":return[ot(I("x",e,t,n))];case"Tanh":return[Si(I("x",e,t,n))];case"Tan":return[og(I("x",e,t,n))];case"ClipByValue":return[Mn(I("x",e,t,n),I("clipValueMin",e,t,n),I("clipValueMax",e,t,n))];case"Relu6":return[rh(I("x",e,t,n))];case"Rsqrt":return[ih(kn(e.inputNames[0],t,n))];case"Prod":return[ah(I("x",e,t,n),I("axes",e,t,n))];case"LeakyRelu":return[pd(I("x",e,t,n),I("alpha",e,t,n))];case"Prelu":return[gd(I("x",e,t,n),I("alpha",e,t,n))];case"IsNan":return[G1(kn(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function ka(e,t,n=""){if(!(typeof e=="number"||typeof t=="number")){k.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let a=0;an+` Shapes ${e} and ${t} must match`)}}}function Nk(e){return!(typeof e=="number"||e.some(t=>t<0))}function op(e,t,n){let a=n2(e,n),r=!Nk(a);if(r&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${a}`);if(r&&t.forEach(s=>{a=n2(s.shape,a)}),!Nk(a))throw new Error(`Non-fully-defined elementShape: ${a}`);return a}function n2(e,t){if(typeof e=="number")return t;if(typeof t=="number")return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);let n=[];for(let a=0;a=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[a]=r>=0?r:s}return n}var toe=class{constructor(e,t,n,a,r,s,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=a,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Kt(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()}`);let 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}`);let n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, 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),ka(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Kt(t),n.written=!0,this.tensors[e]=n}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((n,a)=>this.write(n,t[a]))}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 a=0;a=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,Gn(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 n=0,a=e.map(o=>(n+=o,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${n}, 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`);let r=n===0?0:t.size/n,s=[];V(()=>{t=q(t,[1,n,r]);for(let o=0;o{if(n!==r.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${r.dtype}`);ka(t,r.shape,"TensorList shape mismatch: "),Kt(r)}),this.idTensor=ke(0),this.maxNumElements=a,Kt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new lp([...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,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(n!==-1&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);ka(e,this.elementShape,"TensorList shape mismatch: ");let a=op(this.elementShape,this.tensors,e);return V(()=>{let r=this.tensors.map(s=>q(s,a));return gn(r,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.");let n=op(this.elementShape,this.tensors,e),a=this.tensors.pop();return ka(a.shape,e,"TensorList shape mismatch: "),q(a,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(ka(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Kt(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}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, 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.`);ka(this.tensors[e].shape,t,"TensorList shape mismatch: ");let a=op(this.elementShape,this.tensors,t);return q(this.tensors[e],a)}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.`);ka(this.elementShape,t.shape,"TensorList shape mismatch: "),Kt(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);ka(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());let a=op(this.elementShape,this.tensors,n);return e.length===0?ln([],[0].concat(a)):V(()=>{let r=e.map(s=>q(this.tensors[s],a));return gn(r,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);ka(this.elementShape,t,"TensorList shape mismatch: ");let n=op(this.elementShape,this.tensors,t);return this.size()===0?ln([],[0].concat(n)):V(()=>{let a=this.tensors.map(r=>q(r,n));return lt(a,0)})}};function toe(e,t,n){let a=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);let r=e.shape.slice(1);ka(r,t,"TensorList shape mismatch: ");let s=Gn(e);return new lp(s,t,a)}function noe(e,t,n){return new lp([],e,t,n)}function aoe(e,t,n,a){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);let r=Math.max(...t);if(a!=null&&a!==-1&&r>=a)throw new Error(`Max index must be < array size (${r} vs. ${a})`);let s=new lp([],n,e.dtype,a),i=Gn(e,0);return t.forEach((o,u)=>{s.setItem(o,i[u])}),s}function roe(e,t,n){let a=0,r=t.map(d=>(a+=d,a));if(a!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${n}, 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`);let r=n===0?0:t.size/n,s=[];V(()=>{t=q(t,[1,n,r]);for(let o=0;o{if(n!==r.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${r.dtype}`);ka(t,r.shape,"TensorList shape mismatch: "),Kt(r)}),this.idTensor=ke(0),this.maxNumElements=a,Kt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new lp([...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,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(n!==-1&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);ka(e,this.elementShape,"TensorList shape mismatch: ");let a=op(this.elementShape,this.tensors,e);return V(()=>{let r=this.tensors.map(s=>q(s,a));return gn(r,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.");let n=op(this.elementShape,this.tensors,e),a=this.tensors.pop();return ka(a.shape,e,"TensorList shape mismatch: "),q(a,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(ka(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Kt(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}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, 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.`);ka(this.tensors[e].shape,t,"TensorList shape mismatch: ");let a=op(this.elementShape,this.tensors,t);return q(this.tensors[e],a)}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.`);ka(this.elementShape,t.shape,"TensorList shape mismatch: "),Kt(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);ka(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());let a=op(this.elementShape,this.tensors,n);return e.length===0?ln([],[0].concat(a)):V(()=>{let r=e.map(s=>q(this.tensors[s],a));return gn(r,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);ka(this.elementShape,t,"TensorList shape mismatch: ");let n=op(this.elementShape,this.tensors,t);return this.size()===0?ln([],[0].concat(n)):V(()=>{let a=this.tensors.map(r=>q(r,n));return lt(a,0)})}};function noe(e,t,n){let a=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);let r=e.shape.slice(1);ka(r,t,"TensorList shape mismatch: ");let s=Gn(e);return new lp(s,t,a)}function aoe(e,t,n){return new lp([],e,t,n)}function roe(e,t,n,a){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);let r=Math.max(...t);if(a!=null&&a!==-1&&r>=a)throw new Error(`Max index must be < array size (${r} vs. ${a})`);let s=new lp([],n,e.dtype,a),i=Gn(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function soe(e,t,n){let a=0,r=t.map(d=>(a+=d,a));if(a!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${a}, and tensor's shape is: ${e.shape}`);let s=e.shape.slice(1),i=n2(s,n),o=a===0?0:e.size/a,u=V(()=>{let d=[];e=q(e,[1,a,o]);for(let p=0;p{switch(e.op){case"If":case"StatelessIf":{let a=I("thenBranch",e,t,n),r=I("elseBranch",e,t,n),s=I("cond",e,t,n),i=I("args",e,t,n);return(await s.data())[0]?n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{let a=I("body",e,t,n),r=I("cond",e,t,n),s=I("args",e,t,n),i=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),o=s.map(d=>d.id),u=await i[0].data();i.forEach(d=>{!d.kept&&o.indexOf(d.id)===-1&&d.dispose()});let l=s;for(;u[0];){let d=l;l=await n.functionMap[a].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);let p=l.map(h=>h.id);d.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()});let c=await n.functionMap[r].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);u=await c[0].data(),c.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()})}return l}case"LoopCond":{let a=I("pred",e,t,n);return[Sr(a)]}case"Switch":{let a=I("pred",e,t,n),r=I("data",e,t,n);return r.kept||(r=Sr(r)),(await a.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{let a=e.inputNames.find(r=>kn(r,t,n)!==void 0);if(a){let r=kn(a,t,n);return[Sr(r)]}return}case"Enter":{let a=I("frameName",e,t,n),r=I("tensor",e,t,n);return n.enterFrame(a),[Sr(r)]}case"Exit":{let a=I("tensor",e,t,n);return n.exitFrame(),[Sr(a)]}case"NextIteration":{let a=I("tensor",e,t,n);return n.nextIteration(),[Sr(a)]}case"TensorArrayV3":{let a=I("size",e,t,n),r=I("dtype",e,t,n),s=I("elementShape",e,t,n),i=I("dynamicSize",e,t,n),o=I("clearAfterRead",e,t,n),u=I("identicalElementShapes",e,t,n),l=I("name",e,t,n),d=new eoe(l,r,a,s,u,i,o);return n.addTensorArray(d),[d.idTensor,ke(1)]}case"TensorArrayWriteV3":{let a=I("tensorArrayId",e,t,n),r=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(a.id);return i.write(r,s),[i.idTensor]}case"TensorArrayReadV3":{let a=I("tensorArrayId",e,t,n),r=I("index",e,t,n);return[n.getTensorArray(a.id).read(r)]}case"TensorArrayGatherV3":{let a=I("tensorArrayId",e,t,n),r=I("indices",e,t,n),s=I("dtype",e,t,n);return[n.getTensorArray(a.id).gather(r,s)]}case"TensorArrayScatterV3":{let a=I("tensorArrayId",e,t,n),r=I("indices",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(a.id);return i.scatter(r,s),[i.idTensor]}case"TensorArrayConcatV3":{let a=I("tensorArrayId",e,t,n),r=n.getTensorArray(a.id),s=I("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{let a=I("tensorArrayId",e,t,n),r=I("tensor",e,t,n),s=I("lengths",e,t,n),i=n.getTensorArray(a.id);return i.split(s,r),[i.idTensor]}case"TensorArraySizeV3":{let a=I("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return[ke(r.size(),"int32")]}case"TensorArrayCloseV3":{let a=I("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{let a=I("tensorListId",e,t,n),r=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorList(a.id);return i.setItem(r,s),[i.idTensor]}case"TensorListGetItem":{let a=I("tensorListId",e,t,n),r=I("index",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(a.id).getItem(r,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let a=I("indices",e,t,n),r=I("tensor",e,t,n),s=I("elementShape",e,t,n),i=I("numElements",e,t,n),o=aoe(r,a,s,i);return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let a=I("elementShape",e,t,n),r=I("elementDType",e,t,n),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=I(s,e,t,n),o=noe(a,r,i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{let a=I("tensorListId",e,t,n),r=I("indices",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(a.id).gather(r,i,s)]}case"TensorListStack":{let a=I("tensorListId",e,t,n),r=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=I("numElements",e,t,n);return[n.getTensorList(a.id).stack(r,s,i)]}case"TensorListFromTensor":{let a=I("tensor",e,t,n),r=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=toe(a,r,s);return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":{let a=I("tensorListId",e,t,n),r=n.getTensorList(a.id),s=I("dtype",e,t,n),i=I("elementShape",e,t,n);return[r.concat(s,i)]}case"TensorListPushBack":{let a=I("tensorListId",e,t,n),r=I("tensor",e,t,n),s=n.getTensorList(a.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{let a=I("tensorListId",e,t,n),r=I("elementShape",e,t,n),s=I("elementDType",e,t,n);return[n.getTensorList(a.id).popBack(r,s)]}case"TensorListSplit":{let a=I("tensor",e,t,n),r=I("elementShape",e,t,n),s=I("lengths",e,t,n),i=roe(a,s,r);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Nk(e,t,n){let[a,r]=I("fusedOps",e,t,n),s=a==="biasadd",i=!s,o=r==="prelu",u=a==="fusedbatchnorm",l=I("numArgs",e,t,n);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(u)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let d=I("strides",e,t,n),p=z0(e,t,n),c=I("dataFormat",e,t,n).toUpperCase(),h=I("dilations",e,t,n),[m,f]=I("args",e,t,n);i&&(f=m,m=void 0);let g=I("leakyreluAlpha",e,t,n);return{stride:d,pad:p,dataFormat:c,dilations:h,biasArg:m,preluArg:f,activationFunc:r,leakyreluAlpha:g}}var ioe=(e,t,n)=>{switch(e.op){case"Conv1D":{let a=I("stride",e,t,n),r=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilation",e,t,n);return[Gc(I("x",e,t,n),I("filter",e,t,n),a,r,s,i)]}case"Conv2D":{let a=I("strides",e,t,n),r=z0(e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[mr(I("x",e,t,n),I("filter",e,t,n),[a[1],a[2]],r,s,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:u,activationFunc:l,leakyreluAlpha:d}=Nk(e,t,n);return[Kr.conv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:l,preluActivationWeights:u,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:u,activationFunc:l,leakyreluAlpha:d}=Nk(e,t,n);return[Kr.depthwiseConv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:l,preluActivationWeights:u,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let a=I("outputShape",e,t,n),r=I("strides",e,t,n),s=z0(e,t,n);return[qc(I("x",e,t,n),I("filter",e,t,n),a,[r[1],r[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let a=I("strides",e,t,n),r=z0(e,t,n),s=I("dilations",e,t,n),i=I("dataFormat",e,t,n).toUpperCase();return[Tl(I("input",e,t,n),I("filter",e,t,n),[a[1],a[2]],r,i,[s[1],s[2]])]}case"Conv3D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[L1(I("x",e,t,n),I("filter",e,t,n),[a[1],a[2],a[3]],r,s,[i[1],i[2],i[3]])]}case"AvgPool":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[ld(I("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPool":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[hd(I("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPoolWithArgmax":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n),i=I("includeBatchInIndex",e,t,n),{result:o,indexes:u}=z3(I("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r,i);return[o,u]}case"AvgPool3D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[O1(I("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"MaxPool3D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[Y1(I("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"Dilation2D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("dilations",e,t,n),i=a[1],o=a[2],u=s[1],l=s[2];return[B1(I("x",e,t,n),I("filter",e,t,n),[i,o],r,[u,l],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},ooe=(e,t,n)=>{switch(e.op){case"Fill":{let a=I("shape",e,t,n),r=I("dtype",e,t,n),s=I("value",e,t,n);return[El(a,s,r)]}case"LinSpace":{let a=I("start",e,t,n),r=I("stop",e,t,n),s=I("num",e,t,n);return[E3(a,r,s)]}case"Multinomial":{let a=I("logits",e,t,n),r=I("numSamples",e,t,n),s=I("seed",e,t,n);return[_3(a,r,s)]}case"OneHot":{let a=I("indices",e,t,n),r=I("depth",e,t,n),s=I("onValue",e,t,n),i=I("offValue",e,t,n);return[vl(a,r,s,i)]}case"Ones":return[jn(I("shape",e,t,n),I("dtype",e,t,n))];case"OnesLike":return[Un(I("x",e,t,n))];case"RandomUniform":return[Fl(I("shape",e,t,n),I("minval",e,t,n),I("maxval",e,t,n),I("dtype",e,t,n))];case"Range":{let a=I("start",e,t,n),r=I("stop",e,t,n),s=I("step",e,t,n);return[$l(a,r,s,I("dtype",e,t,n))]}case"TruncatedNormal":{let a=I("shape",e,t,n),r=I("mean",e,t,n),s=I("stdDev",e,t,n),i=I("seed",e,t,n);return[fh(a,r,s,I("dtype",e,t,n),i)]}case"Zeros":return[$t(I("shape",e,t,n),I("dtype",e,t,n))];case"ZerosLike":return[Ge(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function a2(e,t,n){let a=I("boxes",e,t,n),r=I("scores",e,t,n),s=I("maxOutputSize",e,t,n),i=I("iouThreshold",e,t,n),o=I("scoreThreshold",e,t,n),u=I("softNmsSigma",e,t,n);return{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:u}}var loe=async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:u}=a2(e,t,n),l=await De.nonMaxSuppressionWithScoreAsync(a,r,s,i,o,u);return[l.selectedIndices,l.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=a2(e,t,n),u=I("padToMaxOutputSize",e,t,n),l=await De.nonMaxSuppressionPaddedAsync(a,r,s,i,o,u);return[l.selectedIndices,l.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=a2(e,t,n);return[await De.nonMaxSuppressionAsync(a,r,s,i,o)]}case"Where":{let a=ge(I("condition",e,t,n),"bool"),r=[await dg(a)];return a.dispose(),r}case"ListDiff":return W3(I("x",e,t,n),I("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}},uoe=(e,t,n)=>{switch(e.op){case"TopKV2":{let a=I("x",e,t,n),r=I("k",e,t,n),s=I("sorted",e,t,n),i=lg(a,r,s);return[i.values,i.indices]}case"Unique":{let a=I("x",e,t,n),r=mh(a);return[r.values,r.indices]}case"UniqueV2":{let a=I("x",e,t,n),r=I("axis",e,t,n),s=mh(a,r);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},doe=(e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let a=I("default",e,t,n);return[kn(e.name,t,n)||a];case"Placeholder":return[kn(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let l=I("x",e,t,n);return[Sr(l)]}case"IdentityN":return I("x",e,t,n).map(l=>Sr(l));case"Snapshot":let r=I("x",e,t,n);return[Sr(r)];case"Shape":return[Dt(I("x",e,t,n).shape,"int32")];case"ShapeN":return I("x",e,t,n).map(l=>Dt(l.shape));case"Size":return[ke(I("x",e,t,n).size,"int32")];case"Rank":return[ke(I("x",e,t,n).rank,"int32")];case"NoOp":return[ke(1)];case"Print":let s=I("x",e,t,n),i=I("data",e,t,n),o=I("message",e,t,n),u=I("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let l=0;le.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return ke(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let n=await e.data();return this.tensorMap.forEach(a=>a.dispose()),this.tensorMap.clear(),V(()=>{let a=Gn(t),r=n.length,s=a.length;k.assert(r===s,()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${s} elements.`);for(let i=0;i{let a=[];for(let r=0;r{switch(e.op){case"HashTable":case"HashTableV2":{let r=I("keyDType",e,t,n),s=I("valueDType",e,t,n),i=new poe(r,s);return a.addHashTable(e.name,i),[i.handle]}case"LookupTableImport":case"LookupTableImportV2":{let r=I("tableHandle",e,t,n,a),s=I("keys",e,t,n),i=I("values",e,t,n);return[await a.getHashTableById(r.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let r=I("tableHandle",e,t,n,a),s=I("keys",e,t,n),i=I("defaultValue",e,t,n);return[await a.getHashTableById(r.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let r=I("tableHandle",e,t,n,a);return[a.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},hoe=(e,t,n)=>{switch(e.op){case"ResizeBilinear":{let a=I("images",e,t,n),r=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[De.resizeBilinear(a,[r[0],r[1]],s,i)]}case"ResizeNearestNeighbor":{let a=I("images",e,t,n),r=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[De.resizeNearestNeighbor(a,[r[0],r[1]],s,i)]}case"CropAndResize":{let a=I("image",e,t,n),r=I("boxes",e,t,n),s=I("boxInd",e,t,n),i=I("cropSize",e,t,n),o=I("method",e,t,n),u=I("extrapolationValue",e,t,n);return[De.cropAndResize(a,r,s,i,o,u)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},foe=(e,t,n)=>{switch(e.op){case"Equal":return[Hr(I("a",e,t,n),I("b",e,t,n))];case"NotEqual":return[Ri(I("a",e,t,n),I("b",e,t,n))];case"Greater":return[Wn(I("a",e,t,n),I("b",e,t,n))];case"GreaterEqual":return[qr(I("a",e,t,n),I("b",e,t,n))];case"Less":return[Yc(I("a",e,t,n),I("b",e,t,n))];case"LessEqual":return[Xr(I("a",e,t,n),I("b",e,t,n))];case"LogicalAnd":return[xa(I("a",e,t,n),I("b",e,t,n))];case"LogicalNot":return[cd(I("a",e,t,n))];case"LogicalOr":return[th(I("a",e,t,n),I("b",e,t,n))];case"Select":case"SelectV2":return[un(I("condition",e,t,n),I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},moe=(e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[je(I("a",e,t,n),I("b",e,t,n),I("transposeA",e,t,n),I("transposeB",e,t,n))];case"Einsum":return[N3(I("equation",e,t,n),...I("tensors",e,t,n))];case"Transpose":return[Qe(I("x",e,t,n),I("perm",e,t,n))];case"_FusedMatMul":let[a,r]=I("fusedOps",e,t,n),s=a==="biasadd",i=r==="prelu",o=I("numArgs",e,t,n),u=I("leakyreluAlpha",e,t,n);if(s){if(i&&o!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&o!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[l,d]=I("args",e,t,n);return[Kr.matMul({a:I("a",e,t,n),b:I("b",e,t,n),transposeA:I("transposeA",e,t,n),transposeB:I("transposeB",e,t,n),bias:l,activation:r,preluActivationWeights:d,leakyreluAlpha:u})];default:throw TypeError(`Node type ${e.op} is not implemented`)}},goe=(e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[Ni(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"FusedBatchNormV3":return[Ni(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"LRN":return[q1(I("x",e,t,n),I("radius",e,t,n),I("bias",e,t,n),I("alpha",e,t,n),I("beta",e,t,n))];case"Softmax":return[xd(I("x",e,t,n))];case"LogSoftmax":return[eh(I("x",e,t,n))];case"SparseToDense":return[pg(I("sparseIndices",e,t,n),I("outputShape",e,t,n),I("sparseValues",e,t,n),I("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},yoe=(e,t,n)=>{switch(e.op){case"Max":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Vn(I("x",e,t,n),i,o)]}case"Mean":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Nt(I("x",e,t,n),i,o)]}case"Min":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[fd(I("x",e,t,n),i,o)]}case"Sum":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Se(I("x",e,t,n),i,o)]}case"All":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Uc(I("x",e,t,n),i,o)]}case"Any":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[id(I("x",e,t,n),i,o)]}case"ArgMax":{let i=I("axis",e,t,n);return[ki(I("x",e,t,n),i)]}case"ArgMin":{let i=I("axis",e,t,n);return[T1(I("x",e,t,n),i)]}case"Prod":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[ah(I("x",e,t,n),i,o)]}case"Cumsum":{let i=I("axis",e,t,n),o=I("exclusive",e,t,n),u=I("reverse",e,t,n);return[Kc(I("x",e,t,n),i,o,u)]}case"Bincount":let a=I("x",e,t,n),r=I("weights",e,t,n),s=I("size",e,t,n);return[z1(a,r,s)];case"DenseBincount":{let i=I("x",e,t,n),o=I("weights",e,t,n),u=I("size",e,t,n),l=I("binaryOutput",e,t,n);return[I3(i,o,u,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Aoe=(e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{let a=I("n",e,t,n),r=I("axis",e,t,n),s=I("tensors",e,t,n);return s=s.slice(0,a),[lt(s,r)]}case"Gather":{let a=I("x",e,t,n),r=I("indices",e,t,n);return[Ti(a,ge(r,"int32"),0)]}case"GatherV2":{let a=I("axis",e,t,n),r=I("batchDims",e,t,n),s=I("x",e,t,n),i=I("indices",e,t,n);return[Ti(s,ge(i,"int32"),a,r)]}case"Reverse":{let a=I("dims",e,t,n),r=[];for(let i=0;i{let a=I("axis",e,t,n),r=I("tensors",e,t,n),s=r[0].shape,i=Vt(r[0]).shape,o=r.map(u=>{let l=k.arraysEqual(u.shape,s);if(!l&&!k.arraysEqual(Vt(u).shape,i))throw new Error("the input tensors shape does not match");return l?u:q(u,s)});return[gn(o,a)]});case"Unpack":{let a=I("axis",e,t,n),r=I("tensor",e,t,n);return Gn(r,a)}case"Tile":{let a=I("reps",e,t,n);return[Gr(I("x",e,t,n),a)]}case"Split":case"SplitV":{let a=I("axis",e,t,n),r=I("numOrSizeSplits",e,t,n),s=I("x",e,t,n);return Zt(s,r,a)}case"ScatterNd":{let a=I("indices",e,t,n),r=I("values",e,t,n),s=I("shape",e,t,n);return[U3(a,r,s)]}case"GatherNd":{let a=I("x",e,t,n),r=I("indices",e,t,n);return[H3(a,r)]}case"SparseToDense":{let a=I("sparseIndices",e,t,n),r=I("outputShape",e,t,n),s=I("sparseValues",e,t,n),i=I("defaultValue",e,t,n);return[pg(a,s,r,s.dtype===i.dtype?i:ge(i,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},xoe=(e,t,n)=>{switch(e.op){case"SparseFillEmptyRows":{let{outputIndices:a,outputValues:r,emptyRowIndicator:s,reverseIndexMap:i}=wd.sparseFillEmptyRows(I("indices",e,t,n),I("values",e,t,n),I("denseShape",e,t,n),I("defaultValue",e,t,n));return[a,r,s,i]}case"SparseReshape":{let{outputIndices:a,outputShape:r}=wd.sparseReshape(I("inputIndices",e,t,n),I("inputShape",e,t,n),I("newShape",e,t,n));return[a,r]}case"SparseSegmentMean":return[wd.sparseSegmentMean(I("data",e,t,n),I("indices",e,t,n),I("segmentIds",e,t,n))];case"SparseSegmentSum":return[wd.sparseSegmentSum(I("data",e,t,n),I("indices",e,t,n),I("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},boe=(e,t,n)=>{switch(e.op){case"FFT":return[bd(I("x",e,t,n))];case"IFFT":return[Dl(I("x",e,t,n))];case"RFFT":return[vd(I("x",e,t,n))];case"IRFFT":return[ch(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},voe=(e,t,n)=>{switch(e.op){case"StringNGrams":{let{nGrams:a,nGramsSplits:r}=vh.stringNGrams(I("data",e,t,n),I("dataSplits",e,t,n),I("separator",e,t,n),I("nGramWidths",e,t,n),I("leftPad",e,t,n),I("rightPad",e,t,n),I("padWidth",e,t,n),I("preserveShortSequences",e,t,n));return[a,r]}case"StringSplit":{let{indices:a,values:r,shape:s}=vh.stringSplit(I("input",e,t,n),I("delimiter",e,t,n),I("skipEmpty",e,t,n));return[a,r,s]}case"StringToHashBucketFast":return[vh.stringToHashBucketFast(I("input",e,t,n),I("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},woe=(e,t,n)=>{switch(e.op){case"Cast":return[ge(I("x",e,t,n),I("dtype",e,t,n))];case"ExpandDims":{let a=I("axis",e,t,n);return[mn(I("x",e,t,n),a)]}case"Squeeze":{let a=I("axis",e,t,n);return[Vt(I("x",e,t,n),a)]}case"Reshape":return[q(I("x",e,t,n),I("shape",e,t,n))];case"MirrorPad":return[J1(I("x",e,t,n),I("padding",e,t,n),I("mode",e,t,n))];case"PadV2":case"Pad":return[gr(I("x",e,t,n),I("padding",e,t,n),I("constantValue",e,t,n))];case"SpaceToBatchND":{let a=I("blockShape",e,t,n),r=I("paddings",e,t,n);return[md(I("x",e,t,n),a,r)]}case"BatchToSpaceND":{let a=I("blockShape",e,t,n),r=I("crops",e,t,n);return[ud(I("x",e,t,n),a,r)]}case"DepthToSpace":{let a=I("blockSize",e,t,n),r=I("dataFormat",e,t,n).toUpperCase();return[W1(I("x",e,t,n),a,r)]}case"BroadcastTo":return[Sl(I("x",e,t,n),I("shape",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Tk(e,t,n,a){let r=((s,i,o)=>{switch(s.category){case"arithmetic":return V(()=>Jie(s,i,o));case"basic_math":return V(()=>Qie(s,i,o));case"control":return soe(s,i,o);case"convolution":return V(()=>ioe(s,i,o));case"creation":return V(()=>ooe(s,i,o));case"dynamic":return loe(s,i,o);case"evaluation":return V(()=>uoe(s,i,o));case"image":return V(()=>hoe(s,i,o));case"graph":return V(()=>doe(s,i,o));case"logical":return V(()=>foe(s,i,o));case"matrices":return V(()=>moe(s,i,o));case"normalization":return V(()=>goe(s,i,o));case"reduction":return V(()=>yoe(s,i,o));case"slice_join":return V(()=>Aoe(s,i,o));case"sparse":return V(()=>xoe(s,i,o));case"spectral":return V(()=>boe(s,i,o));case"string":return V(()=>voe(s,i,o));case"transformation":return V(()=>woe(s,i,o));case"hash_table":return coe(s,i,o,a);case"custom":let u=tk(s.op);if(u&&u.customExecutor)return u.customExecutor(new Yie(s,i,o));throw TypeError(`Custom op ${s.op} is not registered.`);default:throw TypeError(`Unknown op '${s.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return k.isPromise(r)?r.then(s=>[].concat(s)):[].concat(r)}var Ck=class{constructor(e={},t={},n={},a={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=a,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(){let e=[];for(let t=0;tt.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++;let 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(let t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(let t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}};function Ek(e,t,n,a){let r=new Set,s=[],i=null,o=null,u=new Set,l=Object.keys(e).map(c=>Kn(c)[0]),d=[];a!=null&&(d=a.map(c=>Kn(c.name)[0]));let p=[...t];for(;p.length>0;){let c=p.pop();if((Rk(c)||Toe(c)||Coe(c))&&i==null&&(i=c,o=i.children.map(h=>h.name).filter(h=>r.has(h))),r.add(c.name),n[c.name]==null&&l.indexOf(c.name)===-1&&d.indexOf(c.name)===-1){if(c.inputs.length===0){s.push(c.name);continue}c.inputs.forEach(h=>{u.has(h.name)||(u.add(h.name),p.push(h))})}}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:i,syncInputs:o}}function koe(e,t,n){let{usedNodes:a,inputs:r}=n,s=[],i=Object.keys(r).map(d=>Kn(d)[0]).map(d=>e.nodes[d]),o=e.initNodes;i.forEach(d=>{a.has(d.name)&&s.push(d)}),e.weights.forEach(d=>{a.has(d.name)&&s.push(d)}),o!=null&&o.forEach(d=>{a.has(d.name)&&s.push(d)});let u=new Set,l=[];for(;s.length>0;){let d=s.pop();u.add(d.name),t[d.name]||l.push(d),d.children.forEach(p=>{!u.has(p.name)&&a.has(p.name)&&p.inputs.every(c=>u.has(c.name))&&s.push(p)})}return l}var Ioe=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],Soe=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Noe=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function Rk(e){return Ioe.indexOf(e.op)>=0}function Toe(e){return Soe.indexOf(e.op)>=0}function Coe(e){return Noe.indexOf(e.op)>=0}var r2=class{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},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(n=>{this._functionExecutorMap[n]=new r2(e.functions[n],this)})}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){let t=Object.keys(e).map(n=>e[n].map(a=>a.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=>{let t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){let n=e.map(r=>r.name).sort(),a=t.map(r=>r.name).sort();return n.join(this.SEPERATOR)+"--"+a.join(this.SEPERATOR)}compile(e,t){let n=Ek(e,t,this.weightMap,this._initNodes),{missingInputs:a,dynamicNode:r,syncInputs:s}=n;if(r!=null)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(a.length>0){let i=t.map(u=>u.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${i}] from the provided inputs [${o}]. Missing the following inputs: [${a}]`)}return koe(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);let n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let a=n.map(d=>this.graph.nodes[Kn(d)[0]]),r=t.map(d=>Kn(d)[0]),s=r.map(d=>this.graph.nodes[d]);s.length===0&&(s=this._outputs);let i=this.getCompilationKey(a,s),o=this.compiledMap.get(i);o==null&&(o=this.compile(e,s),this.compiledMap.set(i,o));let u={},l={};return V(()=>{let d=new Ck(this.weightMap,u,l,this.functionExecutorMap),p=Object.assign({},this.weightMap);Object.keys(e).forEach(m=>{let[f,g]=Kn(m),y=[];y[g]=e[m],p[f]=y});let c=this.getFrozenTensorIds(p),h={};for(let m=0;mkn(m,p,d))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(n=>e[n]).map(n=>n.map(a=>a.id)));return new Set(t)}checkTensorForDisposal(e,t,n,a,r,s,i){t.category==="control"||s.indexOf(e)!==-1||(n[e].forEach(o=>{o!=null&&(i[o.id]=(i[o.id]||0)+t.children.length)}),t.inputs.forEach(o=>{if(o.category!=="control"){let u=Rie(o.name,n,a);u!=null&&u.forEach(l=>{if(l&&!l.kept&&!r.has(l.id)){let d=i[l.id];d===1?(l.dispose(),delete i[l.id]):d!=null&&i[l.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,a={},r={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));let s=new Ck(this.weightMap,a,r,this.functionExecutorMap),i=await this.executeWithControlFlow(e,s,t,n),o=t.map(p=>kn(p,i,s)),u=o.map(p=>p.id),l=Object.keys(e).map(p=>e[p].id),d=new Set([...u,...l,...this.weightIds]);return Object.keys(i).forEach(p=>{i[p].forEach(c=>{c&&!c.kept&&!c.isDisposed&&!d.has(c.id)&&c.dispose()})}),this.parent==null&&s.dispose(d),o}async executeFunctionAsync(e,t,n){let a=e.reduce((r,s,i)=>(r[this.inputs[i].name]=s,r),{});return this._executeAsync(a,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,a){let r=Object.keys(e),s=r.map(A=>this.graph.nodes[Kn(A)[0]]),i=n.map(A=>Kn(A)[0]),o=i.map(A=>this.graph.nodes[A]);o.length===0&&(o=this._outputs);let{usedNodes:u,missingInputs:l,dynamicNode:d,syncInputs:p}=Ek(e,o,this.weightMap,this._initNodes),c=[...s,...this.graph.weights,...this._initNodes||[]].map(A=>({node:A,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(A=>{let[x,v]=Kn(A),b=[];b[v]=e[A],h[x]=b});let m={},f=this.getFrozenTensorIds(h),g={};for(;c.length>0;){let A=this.processStack(s,c,t,h,g,f,i,m,u);await Promise.all(A)}d==null&&!a&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let y=o.filter(A=>!Rk(A)&&!kn(A.name,h,t)).map(A=>A.name);if(y.length>0){let A="";throw d!=null&&(A=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${l}]. ${A}`)}return h}processStack(e,t,n,a,r,s,i,o,u){let l=[];for(;t.length>0;){let d=t.pop();n.currentContext=d.contexts;let p="";if(d.node.op==="Enter"&&I("isConstant",d.node,a,n)&&([p]=Ir(d.node.name,n)),a[d.node.name]==null){let c=Tk(d.node,a,n,this._resourceManager);p||([p]=Ir(d.node.name,n));let h=n.currentContext;k.isPromise(c)?l.push(c.then(m=>(a[p]=m,n.currentContext=h,this.checkTensorForDisposal(p,d.node,a,n,s,i,o),this.processChildNodes(d.node,t,n,a,r,u),m))):(a[p]=c,this.checkTensorForDisposal(p,d.node,a,n,s,i,o),this.processChildNodes(d.node,t,n,a,r,u))}else this.processChildNodes(d.node,t,n,a,r,u)}return l}processChildNodes(e,t,n,a,r,s){e.children.forEach(i=>{let[o]=Ir(i.name,n);r[o]||!s.has(i.name)||(i.op==="Merge"?i.inputNames.some(u=>!!kn(u,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})):i.inputNames.every(u=>!!kn(u,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{let n=e[t],[a]=Kn(t),r=this.graph.nodes[a];if(r.attrParams.shape&&r.attrParams.shape.value){let s=r.attrParams.shape.value,i=s.length===n.shape.length&&n.shape.every((o,u)=>s[u]===-1||s[u]===o);k.assert(i,()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${s}], but was [${n.shape}]`)}r.attrParams.dtype&&r.attrParams.dtype.value&&k.assert(n.dtype===r.attrParams.dtype.value,()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){let t={};for(let n in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[n]!=null){let a=this._signature.inputs[n];t[a.name]=e[n]}else t[n]=e[n];return t}checkInputs(e){let t=Object.keys(e).filter(n=>{let[a]=Kn(n);return this.graph.nodes[a]==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=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[t]!=null?this._signature.outputs[t].name:t,{})}checkOutputs(e){e.forEach(t=>{let[n]=Kn(t);if(!this.graph.nodes[n])throw new Error(`The output '${t}' is not found in the graph`)})}},Eoe=class{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(let e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(let e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}},Roe="?tfjs-format=file",Moe="model.json",Mk=class{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",t==null&&(this.loadOptions={}),this.resourceManager=new Eoe}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}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=En.browserHTTPRequest(e,this.loadOptions);else{let t=En.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(En.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]}}async 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.");let e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,n;this.artifacts.userDefinedMetadata!=null&&this.artifacts.userDefinedMetadata.signature!=null?n=this.artifacts.userDefinedMetadata.signature:n=this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let a=En.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new r2(vk.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(a),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let r=vk.Instance.transformGraph(e.modelInitializer);this.initializer=new r2(r),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if(typeof e=="string"){let n=En.getSaveHandlers(e);if(n.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(n.length>1)throw new Error(`Found more than one (${n.length}) save handlers for URL '${e}'`);e=n[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)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Be)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((t,n,a)=>(t[n]=e[a],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}};async function ct(e,t={}){if(e==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");t==null&&(t={}),t.fromTFHub&&e.load==null&&(e.endsWith("/")||(e=e+"/"),e=`${e}${Moe}${Roe}`);let n=new Mk(e,t);return await n.load(),n}var Foe="3.7.0",Fk={};Fe(Fk,{CSVDataset:()=>Uk,Dataset:()=>iu,FileDataSource:()=>Yk,TextLineDataset:()=>Bk,URLDataSource:()=>Jk,array:()=>tle,csv:()=>cle,func:()=>hle,generator:()=>fle,microphone:()=>gle,version_data:()=>yle,webcam:()=>mle,zip:()=>nle});var $oe=gs(N5()),Doe=gs(N5());function Ooe(e,t){return _0(e,t)}function _0(e,t,n=new Map,a=new Set){if(e==null)return null;if(a.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse)if(su(e)){let s=Array.isArray(e)?[]:{};a.add(e);for(let i in e){let o=e[i],u=_0(o,t,n,a);s[i]=u}return a.delete(e),s}else throw new Error(`Can't recurse into non-iterable type: ${e}`);else return n.set(e,r.value),r.value}function zoe(e,t=Dk){return $k(e,t)}function $k(e,t,n=new Set){let a=e[0];if(n.has(a))throw new Error("Circular references are not supported.");let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse)if(su(a)){let s=Array.isArray(a)?[]:{};n.add(a);for(let i in a){let o=e.map(l=>l[i]),u=$k(o,t,n);s[i]=u}return n.delete(a),s}else throw new Error(`Can't recurse into non-iterable type: ${a}`);else return r.value}function Dk(e){return e===null?null:su(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function Ok(e,t){let n=new Map;_0(e,t,n);for(let a of Array.from(n.keys())){let r=n.get(a);if(k.isPromise(r)){let s=await r;n.set(a,s)}}return _0(e,t,n)}function su(e){return e!=null&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||typeof e=="object"&&!(e instanceof Be))}function _oe(e){return e==null||Poe(e)||Array.isArray(e)||typeof e=="object"&&e instanceof Be||k.isTypedArray(e)}function Poe(e){return e===null||typeof e!="object"&&typeof e!="function"}function Loe(e){return Ooe(e,Woe)}function Woe(e){return e instanceof Be?{value:e.clone(),recurse:!1}:su(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var zk=class{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,e==null)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return this.length()===0}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(let t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);let e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}},s2=class extends zk{constructor(){super(s2.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){let e=this.capacity*2,t=new Array(e),n=this.length();for(let a=0;at===!0)}rowMajorBatch(e,t=!0){return new Xoe(this,e,t)}columnMajorBatch(e,t=!0,n=Dk){return this.rowMajorBatch(e,t).map(a=>zoe(a,n))}concatenate(e,t){return new Lk(_k([this,e]),t)}take(e){return e<0||e==null?this:new qoe(this,e)}skip(e){return e<0||e==null?this:new Goe(this,e)}prefetch(e){return new Wk(this,e)}shuffle(e,t){return new ele(this,e,t)}serial(){return new Hoe(this)}},joe=class extends Qt{constructor(e){super();this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};let e=this.items[this.trav];return this.trav++,{value:Loe(e),done:!1}}},Uoe=class extends Qt{constructor(e){super();this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}},Hoe=class extends Qt{constructor(e){super();this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}},Goe=class extends Qt{constructor(e,t){super();this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}},Xoe=class extends Qt{constructor(e,t,n=!0){super();this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){let e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}},Koe=class extends Qt{constructor(e,t){super();this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){let e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;he(e.value)}}},Zoe=class extends Qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Sa.getTensorsInContainer(e.value),n=this.transform(e.value),a=Sa.getTensorsInContainer(n);for(let r of t)Sa.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},Yoe=class extends Qt{constructor(e,t){super();this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}},Pk=class extends Qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Sa.getTensorsInContainer(e.value),n=await this.transform(e.value),a=Sa.getTensorsInContainer(n);for(let r of t)Sa.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},o2=class extends Qt{constructor(){super();this.outputQueue=new s2,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.outputQueue.length()===0;)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}},Joe=class extends o2{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){let e=await this.upstream.next();if(e.done)return!1;let t=Sa.getTensorsInContainer(e.value),n=this.transform(e.value),a=Sa.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(let r of t)Sa.isTensorInList(r,a)||r.dispose();return!0}},Lk=class extends Qt{constructor(e,t){super();this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,this.iterator==null){let n=await this.moreIterators.next();if(n.done)return{value:null,done:!0};this.iterator=n.value,this.baseErrorHandler!=null&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}let t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}},os;(function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"})(os||(os={}));var Qoe=class extends Qt{constructor(e,t=os.FAIL){super();this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;function a(s){return s instanceof Qt?{value:s.next().then(i=>(t++,i.done&&n++,i.value)),recurse:!1}:{value:null,recurse:!0}}let r=await Ok(this.iterators,a);if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case os.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case os.SHORTEST:return{value:null,done:!0};case os.LONGEST:default:}return this.count++,{value:r,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}},Wk=class extends Qt{constructor(e,t){super();this.upstream=e,this.bufferSize=t,this.buffer=new zk(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){let e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}},ele=class extends Wk{constructor(e,t,n){super(e,t);this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Doe.alea(n||k.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){let e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(t.done)this.upstreamExhausted=!0;else return this.refill(),t}return{value:null,done:!0}}},iu=class{constructor(){this.size=null}batch(e,t=!0){let n=this;k.assert(e>0,()=>`batchSize needs to be positive, but it is - ${e}`);let a;return this.size===Infinity||this.size==null?a=this.size:t?a=Math.ceil(this.size/e):a=Math.floor(this.size/e),Zn(async()=>(await n.iterator()).columnMajorBatch(e,t,ale),a)}concatenate(e){let t=this,n;return this.size===Infinity||e.size===Infinity?n=Infinity:this.size!=null&&e.size!=null?n=this.size+e.size:n=null,Zn(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){let t=this,n;return this.size===Infinity?n=Infinity:n=null,Zn(async()=>(await t.iterator()).filter(a=>V(()=>e(a))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){let t=this;return Zn(async()=>(await t.iterator()).map(n=>V(()=>e(n))),this.size)}mapAsync(e){let t=this;return Zn(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");let t=this;return Zn(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){let t=this,n;return this.size!=null&&e>0?n=this.size*e:e===0?n=0:this.size!=null&&(e===void 0||e<0)?n=Infinity:n=null,Zn(async()=>{let a=i2(async()=>({value:await t.iterator(),done:!1}));return Boe(a.take(e))},n)}skip(e){let t=this,n;return this.size!=null&&e>=0&&this.size>=e?n=this.size-e:this.size!=null&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);let a=this,r=$oe.alea(t||k.now().toString());return Zn(async()=>{let s=r.int32();return n&&(s+=r.int32()),(await a.iterator()).shuffle(e,s.toString())},this.size)}take(e){let t=this,n;return this.size!=null&&this.size>e?n=e:this.size!=null&&this.size<=e?n=this.size:n=null,Zn(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}};iu.MAX_BUFFER_SIZE=1e4;function Zn(e,t=null){return new class extends iu{constructor(){super(...arguments);this.size=t}async iterator(){return e()}}}function tle(e){return Zn(async()=>_k(e),e.length)}function nle(e){if(!su(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n{let n=await Ok(e,a=>{if(a instanceof iu)return{value:a.iterator(),recurse:!1};if(su(a))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")});return Voe(n,os.SHORTEST)},t)}function ale(e){if(e===null)return null;let t=e[0];return _oe(t)?{value:rle(e),recurse:!1}:{value:null,recurse:!0}}function rle(e){if(e.length===0)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Be?gn(e):ln(e)}var Bk=class extends iu{constructor(e){super();this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split(` -`).map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}},P0='"',up=Symbol("out"),Vk=Symbol("field"),L0=Symbol("quote"),l2=Symbol("quoteafterquote"),jk=Symbol("quoteinquote"),Uk=class extends iu{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new Bk(e),t||(t={}),this.hasHeader=t.hasHeader!==!1,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(k.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){let e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&k.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);let t=this.fullColumnNames.reduce((a,r)=>(a[r]=a[r]+1||1,a),{}),n=Object.keys(t).filter(a=>t[a]>1);if(k.assert(n.length===0,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs){for(let a of Object.keys(this.columnConfigs))if(this.fullColumnNames.indexOf(a)===-1)throw new Error('The key "'+a+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){let e=await(await this.base.iterator()).next();if(e.done)throw new Error("No data was found for CSV parsing.");let t=e.value;return this.parseRow(t,!1)}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){let t=this.parseRow(e),n={},a={};for(let r=0;r14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=e.includeSpectrogram!==!1,this.includeWaveform=e.includeWaveform===!0,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(te().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");let t=new Hk(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:this.audioTrackConstraints==null?!0:this.audioTrackConstraints,video:!1})}catch(n){throw new Error(`Error thrown while initializing video stream: ${n.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");let e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,!this.sampleRateHz)this.sampleRateHz=this.audioContext.sampleRate;else if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`);let t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=this.fftSize*2,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t,n=await this.getAudioData();if(this.includeSpectrogram){let a=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(a,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){let a=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(a,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){let e=[],t=[],n=0;return new Promise(a=>{let r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-Infinity&&a({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),a({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),this.stream!=null&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){let t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((a,r)=>n.set(a,r*t)),n}getTensorFromAudioDataArray(e,t){let n=new Float32Array(k.sizeFromShape(t));return n.set(e,n.length-e.length),ln(n,t)}},Gk=class extends Qt{constructor(e,t){super();if(this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=Dt([0],"int32"),this.webcamConfig.centerCrop){let n=this.webcamConfig.resizeWidth*1/this.webcamVideoElement.width,a=this.webcamConfig.resizeHeight*1/this.webcamVideoElement.height,r=(1-n)/2,s=(1-a)/2,i=r+n,o=a+s;this.cropBox=Ta([s,r,o,i],[1,4])}else this.cropBox=Ta([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(te().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}let n=new Gk(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&k.assert(this.webcamConfig.facingMode==="user"||this.webcamConfig.facingMode==="environment",()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=oa.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(this.resize)try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{e.dispose()}else return{value:e,done:!1}}needToResize(){return!!(this.webcamConfig.resizeWidth&&this.webcamConfig.resizeHeight&&(this.webcamVideoElement.width!==this.webcamConfig.resizeWidth||this.webcamVideoElement.height!==this.webcamConfig.resizeHeight))}cropAndResizeFrame(e){return V(()=>{let t=mn(ge(e,"float32"),0),n;n=De.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");let a=n.shape;return q(n,a.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}},qk=class{},Xk=class extends Qt{split(e){return new sle(this,e)}},sle=class extends Xk{constructor(e,t){super();this.upstream=e,this.impl=new ile(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},ile=class extends o2{constructor(e,t){super();this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){let e=await this.upstream.next();if(e.done)return this.carryover===""?!1:(this.outputQueue.push(this.carryover),this.carryover="",!0);let t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(let n of t.slice(0,-1))this.outputQueue.push(n);return this.carryover=t[t.length-1],!0}},ole=class extends Qt{decodeUTF8(){return new lle(this)}},lle=class extends Xk{constructor(e){super();this.upstream=e,this.impl=new ule(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},ule=class extends o2{constructor(e){super();if(this.upstream=e,te().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{let{StringDecoder:t}=mS();this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){let e=await this.upstream.next(),t;if(e.done)return!1;t=e.value;let n;return te().get("IS_BROWSER")?n=this.decoder.decode(t,{stream:!0}):n=this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0}},Kk=class extends ole{constructor(e,t={}){super();this.file=e,this.options=t,k.assert(e instanceof Uint8Array||(te().get("IS_BROWSER")?e instanceof File||e instanceof Blob:!1),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1024*1024}summary(){return`FileChunks ${this.file}`}async next(){return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?{value:null,done:!0}:{value:await new Promise((e,t)=>{let n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{let a=new FileReader;a.onload=s=>{let i=a.result;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),!(i instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(i)},a.onabort=s=>t(new Error("Aborted")),a.onerror=s=>t(new Error(s.type));let r=this.file.slice(this.offset,n);a.readAsArrayBuffer(r)}this.offset=n}),done:!1}}};async function dle(e,t={}){let n,a;typeof e=="string"?n=e:(n=e.url,a=ple(e));let r=await k.fetch(n,a);if(r.ok){let s=new Uint8Array(await r.arrayBuffer());return new Kk(s,t)}else throw new Error(r.statusText)}var ple=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});function Zk(e){return typeof e=="string"&&e.substr(0,7)==="file://"}var Yk=class extends qk{constructor(e,t={}){super();this.input=e,this.options=t}async iterator(){if(Zk(this.input)&&te().get("IS_NODE")){let e=po("fs");this.input=e.readFileSync(this.input.substr(7))}return new Kk(this.input,this.options)}},Jk=class extends qk{constructor(e,t={}){super();this.url=e,this.fileOptions=t}async iterator(){return Zk(this.url)?new Yk(this.url,this.fileOptions).iterator():dle(this.url,this.fileOptions)}};function cle(e,t={}){return new Uk(new Jk(e),t)}function hle(e){let t=i2(e);return Zn(async()=>t)}function fle(e){return Zn(async()=>{let t=await e();return i2(()=>t.next())})}async function mle(e,t){return Gk.create(e,t)}async function gle(e){return Hk.create(e)}var yle="3.7.0",Ale={tfjs:(_m==null?void 0:_m.version)||void 0,"tfjs-core":(Pm==null?void 0:Pm.version)||void 0,"tfjs-data":(Lm==null?void 0:Lm.version)||void 0,"tfjs-layers":(Wm==null?void 0:Wm.version)||void 0,"tfjs-converter":(Bm==null?void 0:Bm.version)||void 0,"tfjs-backend-cpu":q7||void 0,"tfjs-backend-webgl":gw||void 0,"tfjs-backend-wasm":l4||void 0};var Yn={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function Qk(){if(!I1(Yn.name)){de("backend registration:",Yn.name);try{Yn.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Yn.width,Yn.height):document.createElement("canvas")}catch(e){de("error: cannot create canvas:",e);return}try{Yn.gl=Yn.canvas.getContext("webgl2",Yn.webGLattr)}catch(e){de("error: cannot get WebGL2 context:",e);return}try{Oh(2,Yn.gl)}catch(e){de("error: cannot set WebGL2 context:",e);return}try{let e=new Vh(Yn.gl);kl(Yn.name,()=>new Xl(e),Yn.priority)}catch(e){de("error: cannot register WebGL backend:",e);return}try{gl("webgl").forEach(t=>{let n={...t,backendName:Yn.name};gi(n)})}catch(e){de("error: cannot update WebGL backend registration:",e);return}try{sa.set("WEBGL_VERSION",2)}catch(e){de("error: cannot set WebGL backend flags:",e);return}de("backend registered:",Yn.name)}}function e9(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:a}}function pp(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function ou(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function lu(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return De.cropAndResize(t,s,[0],n)}function W0(e,t=1.5){let n=ou(e),a=pp(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function B0(e){let t=ou(e),n=pp(e),r=Math.max(...n)/2,s=[Math.round(t[0]-r),Math.round(t[1]-r)],i=[Math.round(t[0]+r),Math.round(t[1]+r)];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function u2(e){let t=e.map(s=>s[0]),n=e.map(s=>s[1]),a=[Math.min(...t),Math.min(...n)],r=[Math.max(...t),Math.max(...n)];return{startPoint:a,endPoint:r,landmarks:e}}var t9=e=>({startPoint:Re(e,[0,0],[-1,2]),endPoint:Re(e,[0,2],[-1,2])});var V0=[[1,0,0],[0,1,0],[0,0,1]];function xle(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function d2(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return xle(n)}function n9(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function ls(e,t){let n=0;for(let a=0;a{let l=De.resizeBilinear(t,[this.inputSize,this.inputSize]).div(127.5).sub(.5),d=this.model.execute(l),p;if(Array.isArray(d)){let f=d.sort((x,v)=>x.size-v.size),g=lt([f[0],f[2]],2),y=lt([f[1],f[3]],2);p=lt([y,g],1).squeeze(0)}else p=Vt(d);let c=vle(p,this.anchors,[this.inputSize,this.inputSize]),h=Re(p,[0,0],[-1,1]),m=Rn(h).squeeze().dataSync();return[p,c,m]}),s=await De.nonMaxSuppressionAsync(a,r,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),i=s.arraySync();s.dispose();let o=[];for(let u=0;uthis.config.face.detector.minConfidence){let d=Re(a,[i[u],0],[1,-1]),p=t9(d);d.dispose();let c=this.anchorsData[i[u]],h=V(()=>Re(n,[i[u],o9-1],[1,-1]).squeeze().reshape([o9,-1]));o.push({box:p,landmarks:h,anchor:c,confidence:l})}}return n.dispose(),a.dispose(),{boxes:o,scaleFactor:[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]}}};async function u9(e){let t=await ct(ft(e.modelBasePath,e.face.detector.modelPath),{fromTFHub:e.face.detector.modelPath.includes("tfhub.dev")}),n=new l9(t,e);return!t||!t.modelUrl?de("load model failed:",e.face.detector.modelPath):e.debug&&de("load model:",t.modelUrl),n}var rr={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},p2=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],cp=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],Zi=[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,130,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,116,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];var wle=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],kle=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],Ile=[33,133,362,263,1,78,308],fue=wle.map(e=>cp[e]),mue=kle.map(e=>cp[e]),gue=Ile.map(e=>cp[e]);var c2=rr.leftEyeLower0,h2=rr.rightEyeLower0,uu={leftBounds:[c2[0],c2[c2.length-1]],rightBounds:[h2[0],h2[h2.length-1]]},U0={count:468,mouth:13,symmetryLine:[13,rr.midwayBetweenEyes[0]]},d9={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},du={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function H0(e,t,n,a){for(let r=0;r[s[0]/this.meshSize*(p[0]-this.meshSize/2),s[1]/this.meshSize*(p[1]-this.meshSize/2),p[2]]),o=a!==0?j0(a,[0,0]):V0,u=a!==0?i.map(p=>[...s9(p,o),p[2]]):i,l=a!==0?r9(r):V0,d=[...ou({startPoint:n.startPoint,endPoint:n.endPoint}),1];return u.map(p=>[Math.round(p[0]+ls(d,l[0])),Math.round(p[1]+ls(d,l[1])),Math.round(p[2])])}getLeftToRightEyeDepthDifference(t){let n=t[uu.leftBounds[0]][2],a=t[uu.rightBounds[0]][2];return n-a}getEyeBox(t,n,a,r,s=!1){let i=B0(W0(u2([t[a],t[r]]),this.irisEnlarge)),o=pp(i),u=De.cropAndResize(n,[[i.startPoint[1]/this.meshSize,i.startPoint[0]/this.meshSize,i.endPoint[1]/this.meshSize,i.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return s&&sa.flags.IS_BROWSER&&(u=De.flipLeftRight(u)),{box:i,boxSize:o,crop:u}}getEyeCoords(t,n,a,r=!1){let s=[];for(let i=0;i{let l=i;return u===2?l=r:u===4&&(l=s),[o[0],o[1],l]})}async predict(t,n){let a=!1,r;if((this.skipped===0||this.skipped>n.face.detector.skipFrames||!n.face.mesh.enabled||!n.skipFrame)&&(r=await this.boundingBoxDetector.getBoundingBoxes(t),this.skipped=0),n.skipFrame&&this.skipped++,!n.skipFrame||r&&r.boxes&&(!n.face.mesh.enabled||r.boxes.length!==this.detectedFaces&&this.detectedFaces!==n.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let i of r.boxes)this.storedBoxes.push({startPoint:i.box.startPoint.dataSync(),endPoint:i.box.endPoint.dataSync(),landmarks:i.landmarks.arraySync(),confidence:i.confidence});this.storedBoxes.length>0&&(a=!0)}if(a){if(!r||!r.boxes||r.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let i=0;i{i.box.startPoint.dispose(),i.box.endPoint.dispose(),i.landmarks.dispose()});let s=V(()=>this.storedBoxes.map((i,o)=>{let u,l=0,d;if(n.face.detector.rotation&&n.face.mesh.enabled&&sa.flags.IS_BROWSER){let[x,v]=i.landmarks.length>=U0.count?U0.symmetryLine:d9.symmetryLine;l=d2(i.landmarks[x],i.landmarks[v]);let b=ou({startPoint:i.startPoint,endPoint:i.endPoint}),w=[b[0]/t.shape[2],b[1]/t.shape[1]],N=De.rotateWithOffset(t,l,0,w);d=j0(-l,b),n.face.mesh.enabled?u=lu({startPoint:i.startPoint,endPoint:i.endPoint},N,[this.meshSize,this.meshSize]).div(255):u=lu({startPoint:i.startPoint,endPoint:i.endPoint},N,[this.boxSize,this.boxSize]).div(255)}else{d=V0;let x=t.clone();n.face.mesh.enabled?u=lu({startPoint:i.startPoint,endPoint:i.endPoint},x,[this.meshSize,this.meshSize]).div(255):u=lu({startPoint:i.startPoint,endPoint:i.endPoint},x,[this.boxSize,this.boxSize]).div(255)}if(!n.face.mesh.enabled)return{mesh:[],box:i,faceConfidence:null,boxConfidence:i.confidence,confidence:i.confidence,image:u};let[,p,c]=this.meshDetector.execute(u),h=p.dataSync()[0];if(h=U0.count?U0.symmetryLine:d9.symmetryLine;l=d2(i.landmarks[x],i.landmarks[v]);let b=ou({startPoint:i.startPoint,endPoint:i.endPoint}),w=[b[0]/t.shape[2],b[1]/t.shape[1]],N=De.rotateWithOffset(t.toFloat(),l,0,w);d=j0(-l,b),u=lu({startPoint:i.startPoint,endPoint:i.endPoint},N,[this.meshSize,this.meshSize]).div(255)}let A={mesh:g,box:i,faceConfidence:h,boxConfidence:i.confidence,image:u};return this.storedBoxes[o]={...B0(i),confidence:i.confidence,faceConfidence:h},A}));return n.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(i=>i.confidence>n.face.detector.minConfidence)),this.detectedFaces=s.length,s}};var Rt=[null,null,null],m2;async function p9(e,t){let n=await m2.predict(e,t),a=[],r=0;for(let s of n||[]){if(!s||s.isDisposedInternal)continue;let i=s.mesh.map(d=>[d[0]/(e.shape[2]||0),d[1]/(e.shape[1]||0),d[2]/m2.meshSize]),o={};if(s.mesh&&s.mesh.length>0)for(let d of Object.keys(rr))o[d]=rr[d].map(p=>s.mesh[p]);let u=s.box?[Math.trunc(Math.max(0,s.box.startPoint[0])),Math.trunc(Math.max(0,s.box.startPoint[1])),Math.trunc(Math.min(e.shape[2]||0,s.box.endPoint[0])-Math.max(0,s.box.startPoint[0])),Math.trunc(Math.min(e.shape[1]||0,s.box.endPoint[1])-Math.max(0,s.box.startPoint[1]))]:[0,0,0,0],l=s.box?[s.box.startPoint[0]/(e.shape[2]||0),s.box.startPoint[1]/(e.shape[1]||0),(s.box.endPoint[0]-s.box.startPoint[0])/(e.shape[2]||0),(s.box.endPoint[1]-s.box.startPoint[1])/(e.shape[1]||0)]:[0,0,0,0];a.push({id:r++,score:Math.round(100*s.faceConfidence||100*s.boxConfidence||0)/100,boxScore:Math.round(100*s.boxConfidence)/100,faceScore:Math.round(100*s.faceConfidence)/100,box:u,boxRaw:l,mesh:s.mesh,meshRaw:i,annotations:o,image:s.image,tensor:s.image}),s.coords&&s.coords.dispose()}return a}async function g2(e){return!Rt[0]&&e.face.enabled||!Rt[1]&&e.face.mesh.enabled||!Rt[2]&&e.face.iris.enabled?(Rt=await Promise.all([!Rt[0]&&e.face.enabled?u9(e):null,!Rt[1]&&e.face.mesh.enabled?ct(ft(e.modelBasePath,e.face.mesh.modelPath),{fromTFHub:e.face.mesh.modelPath.includes("tfhub.dev")}):null,!Rt[2]&&e.face.iris.enabled?ct(ft(e.modelBasePath,e.face.iris.modelPath),{fromTFHub:e.face.iris.modelPath.includes("tfhub.dev")}):null]),e.face.mesh.enabled&&(!Rt[1]||!Rt[1].modelUrl?de("load model failed:",e.face.mesh.modelPath):e.debug&&de("load model:",Rt[1].modelUrl)),e.face.iris.enabled&&(!Rt[2]||!Rt[2].modelUrl?de("load model failed:",e.face.iris.modelPath):e.debug&&de("load model:",Rt[2].modelUrl))):e.debug&&(Rt[0]&&de("cached model:",Rt[0].model.modelUrl),Rt[1]&&de("cached model:",Rt[1].modelUrl),Rt[2]&&de("cached model:",Rt[2].modelUrl)),m2=new f2(Rt[0],Rt[1],Rt[2]),Rt}var c9=Zi,h9=cp;var Sle=["angry","disgust","fear","happy","sad","surprise","neutral"],Pa,G0=[],f9=0,y2=Number.MAX_SAFE_INTEGER,A2=[.2989,.587,.114];async function x2(e){return Pa?e.debug&&de("cached model:",Pa.modelUrl):(Pa=await ct(ft(e.modelBasePath,e.face.emotion.modelPath)),!Pa||!Pa.modelUrl?de("load model failed:",e.face.emotion.modelPath):e.debug&&de("load model:",Pa.modelUrl)),Pa}async function b2(e,t,n,a){return Pa?y20?(y2++,G0[n]):(y2=0,new Promise(async r=>{let s=De.resizeBilinear(e,[Pa.inputs[0].shape[2],Pa.inputs[0].shape[1]],!1),[i,o,u]=Zt(s,3,3);s.dispose();let l=B(i,A2[0]),d=B(o,A2[1]),p=B(u,A2[2]);i.dispose(),o.dispose(),u.dispose();let c=jc([l,d,p]);l.dispose(),d.dispose(),p.dispose();let h=V(()=>c.sub(.5).mul(2));c.dispose();let m=[];if(t.face.emotion.enabled){let f=await Pa.predict(h),g=f.dataSync();he(f);for(let y=0;yt.face.emotion.minConfidence&&m.push({score:Math.min(.99,Math.trunc(100*g[y])/100),emotion:Sle[y]});m.sort((y,A)=>A.score-y.score)}h.dispose(),G0[n]=m,f9=a,r(m)})):null}var La,q0=[],m9=0,v2=Number.MAX_SAFE_INTEGER;async function w2(e){let t=ft(e.modelBasePath,e.face.description.modelPath);return La?e.debug&&de("cached model:",t):(La=await ct(t),La?e.debug&&de("load model:",t):de("load model failed:",e.face.description.modelPath)),La}function k2(e,t,n=2){if(!e||!t||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return 0;let a=5*e.map((s,i)=>Math.abs(e[i]-t[i])**n).reduce((s,i)=>s+i,0)**(1/n);return Math.max(0,100-a)/100}function g9(e,t,n=0){let a={similarity:0,name:"",source:"",embedding:[]};if(!e||!t||!Array.isArray(e)||!Array.isArray(t))return a;for(let r of t)if(r.embedding&&r.name){let s=k2(e,r.embedding);s>n&&s>a.similarity&&(a={...r,similarity:s})}return a}function I2(e){return V(()=>{let n=e.image||e.tensor||e;if(!(n instanceof Be))return null;let a=[[.05,.15,.85,.85]];return La.inputs[0].shape?(n.shape.length===3?De.cropAndResize(mn(n,0),a,[0],[La.inputs[0].shape[2],La.inputs[0].shape[1]]):De.cropAndResize(n,a,[0],[La.inputs[0].shape[2],La.inputs[0].shape[1]])).mul(255):null})}async function S2(e,t,n,a){var r,s;return La?v20?(v2++,q0[n]):(v2=0,new Promise(async i=>{let o=I2(e),u,l={age:0,gender:"unknown",genderScore:0,descriptor:[]};t.face.description.enabled&&(u=await La.predict(o)),he(o),u&&(V(()=>{let d=u.find(f=>f.shape[1]===1).dataSync(),p=Math.trunc(200*Math.abs(d[0]-.5))/100;p>t.face.description.minConfidence&&(l.gender=d[0]<=.5?"female":"male",l.genderScore=Math.min(.99,p));let c=u.find(f=>f.shape[1]===100).argMax(1).dataSync()[0],h=u.find(f=>f.shape[1]===100).dataSync();l.age=Math.round(h[c-1]>h[c+1]?10*c-100*h[c-1]:10*c+100*h[c+1])/10;let m=u.find(f=>f.shape[1]===1024);l.descriptor=[...m.dataSync()]}),u.forEach(d=>he(d))),q0[n]=l,m9=a,i(l)})):null}var Nle=e=>{let t=(p,c)=>Math.atan2(p[1]-c[1],p[0]-c[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],a=1,r=e.mesh[33][2]>e.mesh[263][2],s=r?e.mesh[473]:e.mesh[468],i=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],o=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],u=[(i[0]-s[0])/o[0]-n[0],a*(s[1]-i[1])/o[1]-n[1]],l=Math.sqrt(u[0]**2+u[1]**2);return l=Math.min(l,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],u)+Math.PI/2)%Math.PI,strength:l}},Tle=(e,t)=>{let n=g=>{let y=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]);return g[0]/=y,g[1]/=y,g[2]/=y,g},a=(g,y)=>{let A=g[0]-y[0],x=g[1]-y[1],v=g[2]-y[2];return[A,x,v]},r=(g,y)=>{let A=g[1]*y[2]-g[2]*y[1],x=g[2]*y[0]-g[0]*y[2],v=g[0]*y[1]-g[1]*y[0];return[A,x,v]},s=g=>{let[y,A,x,v,b,w,N,C,E]=g,_,$,S;return v<1?v>-1?(S=Math.asin(v),$=Math.atan2(-N,y),_=Math.atan2(-w,b)):(S=-Math.PI/2,$=-Math.atan2(C,E),_=0):(S=Math.PI/2,$=Math.atan2(C,E),_=0),{pitch:2*-_,yaw:2*-$,roll:2*-S}},i=g=>{let y=(x,v,b,w)=>Math.atan2(w-v,b-x);return{pitch:y(g[10][1],g[10][2],g[152][1],g[152][2]),yaw:y(g[33][0],g[33][2],g[263][0],g[263][2]),roll:y(g[33][0],g[33][1],g[263][0],g[263][1])}},o=e.meshRaw;if(!o||o.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let u=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[o[10],o[152],o[234],o[454]].map(g=>[g[0]*t[0]/u,g[1]*t[1]/u,g[2]]),d=n(a(l[1],l[0])),p=n(a(l[3],l[2])),c=n(r(p,d));p=r(d,c);let h=[p[0],p[1],p[2],d[0],d[1],d[2],c[0],c[1],c[2]],m=s(h),f=o.length===478?Nle(e):{bearing:0,strength:0};return{angle:m,matrix:h,gaze:f}},N2=async(e,t)=>{var d,p,c,h,m,f;let n,a,r,s,i,o,u=[];e.state="run:face",n=Je();let l=await p9(t,e.config);if(e.performance.face=Math.trunc(Je()-n),!t.shape||t.shape.length!==4)return[];if(!l)return[];for(let g=0;g(e[t]=n,e),{}),Cle=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Ele=Cle.map(([e,t])=>[fp[e],fp[t]]),A9=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function x9(e){let t=e.reduce(({maxX:n,maxY:a,minX:r,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(n,i),maxY:Math.max(a,o),minX:Math.min(r,i),minY:Math.min(s,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function b9(e,[t,n],[a,r]){let s=t/a,i=n/r,o=(l,d)=>({id:d,score:l.score,boxRaw:[l.box[0]/r,l.box[1]/a,l.box[2]/r,l.box[3]/a],box:[Math.trunc(l.box[0]*i),Math.trunc(l.box[1]*s),Math.trunc(l.box[2]*i),Math.trunc(l.box[3]*s)],keypoints:l.keypoints.map(({score:p,part:c,position:h})=>({score:p,part:c,position:[Math.trunc(h.x*i),Math.trunc(h.y*s)],positionRaw:[h.x/a,h.y/a]}))});return e.map((l,d)=>o(l,d))}var T2=class{constructor(t,n){this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function v9(e,t,n,a){let r=n-e,s=a-t;return r*r+s*s}function M2(e,t){return{x:e.x+t.x,y:e.y+t.y}}var X0=1,pu=16,Rle=50**2;function w9(e,t,n,a,r,s,i=2){let o=y=>({y:s.get(y.y,y.x,e),x:s.get(y.y,y.x,s.shape[2]/2+e)}),u=(y,A,x)=>({y:R2(Math.round(y.y/pu),0,A-1),x:R2(Math.round(y.x/pu),0,x-1)}),[l,d]=a.shape,p=u(t.position,l,d),c=o(p),m=M2(t.position,c);for(let y=0;y[fp[c],fp[h]]),i=s.map(([,c])=>c),o=s.map(([c])=>c),u=t.shape[2],l=i.length,d=new Array(u),p=E2(e.part,pu,n);d[e.part.id]={score:e.score,part:hp[e.part.id],position:p};for(let c=l-1;c>=0;--c){let h=i[c],m=o[c];d[h]&&!d[m]&&(d[m]=w9(c,d[h],m,t,n,r))}for(let c=0;ct){o=!1;break}if(!o)break}return o}function $le(e,t){let[n,a,r]=t.shape,s=new T2(n*a*r,({score:i})=>i);for(let i=0;i{var i;let s=(i=r[a])==null?void 0:i.position;return s?v9(n,t,s.y,s.x)<=Rle:!1})}function Dle(e,t){return t.reduce((a,{position:r,score:s},i)=>(k9(e,r,i)||(a+=s),a),0)/t.length}function I9(e,t,n,a,r,s){let i=[],o=$le(s,t);for(;i.lengthh.score>s);let p=Dle(i,d),c=x9(d);p>s&&i.push({keypoints:d,box:c,score:Math.round(100*p)/100})}return i}var Jn,Ole=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function F2(e,t){let n=V(()=>{if(!Jn.inputs[0].shape)return[];let o=De.resizeBilinear(e,[Jn.inputs[0].shape[2],Jn.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),l=Jn.execute(o,Ole).map(d=>Vt(d,[0]));return l[1]=l[1].sigmoid(),l}),a=await Promise.all(n.map(i=>i.buffer()));for(let i of n)i.dispose();let r=await I9(a[0],a[1],a[2],a[3],t.body.maxDetected,t.body.minConfidence);return Jn.inputs[0].shape?b9(r,[e.shape[1],e.shape[2]],[Jn.inputs[0].shape[2],Jn.inputs[0].shape[1]]):[]}async function $2(e){return Jn?e.debug&&de("cached model:",Jn.modelUrl):(Jn=await ct(ft(e.modelBasePath,e.body.modelPath)),!Jn||!Jn.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",Jn.modelUrl)),Jn}function K0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function mp(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function S9(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return De.cropAndResize(t,s,[0],n)}function N9(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],r=e.palmLandmarks.map(s=>[s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:a,palmLandmarks:r,confidence:e.confidence}}function Z0(e,t=1.5){let n=mp(e),a=K0(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function Y0(e){let t=mp(e),n=K0(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}var T9=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var D2=class{constructor(t){var n;this.model=t,this.anchors=T9.map(a=>[a.x,a.y]),this.anchorsTensor=Ta(this.anchors),this.inputSize=(n=this.model)==null?void 0:n.inputs[0].shape[2],this.inputSizeTensor=Dt([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=Dt([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){return V(()=>{let n=Re(t,[0,0],[-1,2]),a=Re(t,[0,2],[-1,2]),r=ie(me(n,this.inputSizeTensor),this.anchorsTensor),s=me(a,this.doubleInputSizeTensor),i=B(ye(r,s),this.inputSizeTensor),o=B(ie(r,s),this.inputSizeTensor);return Nl([i,o],1)})}normalizeLandmarks(t,n){return V(()=>{let a=ie(me(t.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[n]);return B(a,this.inputSizeTensor)})}async getBoxes(t,n){let a=this.model.predict(t),r=Vt(a);a.dispose();let s=V(()=>Rn(Re(r,[0,0],[-1,1])).squeeze()),i=s.dataSync(),o=Re(r,[0,1],[-1,4]),u=this.normalizeBoxes(o);o.dispose();let l=await De.nonMaxSuppressionAsync(u,i,n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence),d=l.arraySync();s.dispose(),l.dispose();let p=[];for(let c of d)if(i[c]>=n.hand.minConfidence){let h=Re(u,[c,0],[1,-1]),m=Re(r,[c,5],[1,14]),f=V(()=>this.normalizeLandmarks(m,c).reshape([-1,2]));m.dispose(),p.push({box:h,palmLandmarks:f,confidence:i[c]})}return r.dispose(),u.dispose(),p}async estimateHandBounds(t,n){let a=t.shape[1],r=t.shape[2],s=V(()=>t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),i=await this.getBoxes(s,n);s.dispose();let o=[];if(!i||i.length===0)return o;for(let u of i){let l=u.box.dataSync(),d=l.slice(0,2),p=l.slice(2,4),c=u.palmLandmarks.arraySync();u.box.dispose(),u.palmLandmarks.dispose(),o.push(N9({startPoint:d,endPoint:p,palmLandmarks:c,confidence:u.confidence},[r/this.inputSize,a/this.inputSize]))}return o}};function zle(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function C9(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return zle(n)}var E9=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function us(e,t){let n=0;for(let a=0;ai[0]),a=t.map(i=>i[1]),r=[Math.min(...n),Math.min(...a)],s=[Math.max(...n),Math.max(...a)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let a=t.map(s=>z2([...s,1],n)),r=this.calculateLandmarksBoundingBox(a);return Z0(Y0(r),Ple)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),a=Z0(Y0(n),F9);a.palmLandmarks=[];for(let r=0;r<$9.length;r++)a.palmLandmarks.push(t[$9[r]].slice(0,2));return a}transformRawCoords(t,n,a,r){let s=K0(n),i=[s[0]/this.inputSize,s[1]/this.inputSize,(s[0]+s[1])/this.inputSize/2],o=t.map(h=>[i[0]*(h[0]-this.inputSize/2),i[1]*(h[1]-this.inputSize/2),i[2]*h[2]]),u=O2(a,[0,0]),l=o.map(h=>[...z2(h,u),h[2]]),d=M9(r),p=[...mp(n),1],c=[us(p,d[0]),us(p,d[1])];return l.map(h=>[Math.trunc(h[0]+c[0]),Math.trunc(h[1]+c[1]),Math.trunc(h[2])])}async estimateHands(t,n){let a=!1,r;(this.skipped===0||this.skipped>n.hand.skipFrames||!n.hand.landmarks||!n.skipFrame)&&(r=await this.handDetector.estimateHandBounds(t,n),this.skipped=0),n.skipFrame&&this.skipped++,r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(a=!0));let s=[];for(let i=0;i=n.hand.minConfidence){let x=q(y,[-1,3]),v=x.arraySync();y.dispose(),x.dispose();let b=this.transformRawCoords(v,h,u,c),w=this.getBoxForHandLandmarks(b);this.storedBoxes[i]={...w,confidence:A};let N={landmarks:b,confidence:A,box:{topLeft:w.startPoint,bottomRight:w.endPoint}};s.push(N)}else this.storedBoxes[i]=null;y.dispose()}else{let u=Z0(Y0(o),F9),l={confidence:o.confidence,box:{topLeft:u.startPoint,bottomRight:u.endPoint}};s.push(l)}}return this.storedBoxes=this.storedBoxes.filter(i=>i!==null),this.detectedHands=s.length,s}};var D9={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},ds,ps,O9;async function P2(e,t){let n=await O9.estimateHands(e,t);if(!n)return[];let a=[];for(let r=0;rn[r].landmarks[d]);let i=n[r].landmarks,o=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],u=[0,0,0,0];if(i&&i.length>0){for(let l of i)l[0]o[2]&&(o[2]=l[0]),l[1]>o[3]&&(o[3]=l[1]);o[2]-=o[0],o[3]-=o[1],u=[o[0]/(e.shape[2]||0),o[1]/(e.shape[1]||0),o[2]/(e.shape[2]||0),o[3]/(e.shape[1]||0)]}else o=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],u=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];a.push({id:r,score:Math.round(100*n[r].confidence)/100,box:o,boxRaw:u,keypoints:i,annotations:s})}return a}async function L2(e){!ds||!ps?([ds,ps]=await Promise.all([e.hand.enabled?ct(ft(e.modelBasePath,e.hand.detector.modelPath),{fromTFHub:e.hand.detector.modelPath.includes("tfhub.dev")}):null,e.hand.landmarks?ct(ft(e.modelBasePath,e.hand.skeleton.modelPath),{fromTFHub:e.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),e.hand.enabled&&(!ds||!ds.modelUrl?de("load model failed:",e.hand.detector.modelPath):e.debug&&de("load model:",ds.modelUrl),!ps||!ps.modelUrl?de("load model failed:",e.hand.skeleton.modelPath):e.debug&&de("load model:",ps.modelUrl))):(e.debug&&de("cached model:",ds.modelUrl),e.debug&&de("cached model:",ps.modelUrl));let t=new D2(ds);return O9=new _2(t,ps),[ds,ps]}var z9=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],_9=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var zn;async function J0(e){return zn?e.debug&&de("cached model:",zn.modelUrl):(zn=await ct(ft(e.modelBasePath,e.body.modelPath)),zn.width=parseInt(zn.signature.inputs["input_1:0"].tensorShape.dim[2].size),zn.height=parseInt(zn.signature.inputs["input_1:0"].tensorShape.dim[1].size),!zn||!zn.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",zn.modelUrl)),zn}async function W2(e,t){var f;if(!zn)return[];if(!t.body.enabled)return[];let n={width:e.shape[2]||0,height:e.shape[1]||0},a=De.resizeBilinear(e,[zn.width,zn.height],!1),r=me(a,[255]);a.dispose();let s=await zn.predict(r),i=((f=s.find(g=>g.size===195||g.size===155))==null?void 0:f.dataSync())||[];s.forEach(g=>g.dispose()),r.dispose();let o=[],u=(i==null?void 0:i.length)===195?z9:_9,l=5;for(let g=0;gg.position[0]),p=o.map(g=>g.position[1]),c=[Math.min(...d),Math.min(...p),Math.max(...d)-Math.min(...d),Math.max(...p)-Math.min(...d)],h=[0,0,0,0],m=o.reduce((g,y)=>y.score>g?y.score:g,0);return[{id:0,score:m,box:c,boxRaw:h,keypoints:o}]}var _n,sr=[],B2=[0,0,0,0],V2=[0,0,0,0],Q0=0,j2=Number.MAX_SAFE_INTEGER,Ble=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","pelvis","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"];async function P9(e){return _n?e.debug&&de("cached model:",_n.modelUrl):(_n=await ct(ft(e.modelBasePath,e.body.modelPath)),!_n||!_n.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",_n.modelUrl)),_n}function Vle(e,t){let[n,a]=e.shape;return V(()=>{let r=(o,u)=>ye(o,B(me(o,ke(u,"int32")),ke(u,"int32"))),s=q(e,[a*n]),i=Vn(s,0).dataSync()[0];if(i>t){let o=ki(s,0),u=r(o,n).dataSync()[0],l=me(o,ke(n,"int32")).dataSync()[0];return[u,l,i]}return[0,0,i]})}async function U2(e,t){return j20?(j2++,[{id:0,score:Q0,box:B2,boxRaw:V2,keypoints:sr}]):(j2=0,new Promise(async n=>{let a=V(()=>{if(!_n.inputs[0].shape)return null;let l=De.resizeBilinear(e,[_n.inputs[0].shape[2],_n.inputs[0].shape[1]],!1);return B(l,2).sub(1)}),r;if(t.body.enabled&&(r=await _n.predict(a)),a.dispose(),r){sr.length=0;let l=r.squeeze();he(r);let d=l.unstack(2);he(l);for(let p=0;pt.body.minConfidence&&sr.push({score:Math.round(100*m)/100,part:Ble[p],positionRaw:[c/_n.inputs[0].shape[2],h/_n.inputs[0].shape[1]],position:[Math.round(e.shape[2]*c/_n.inputs[0].shape[2]),Math.round(e.shape[1]*h/_n.inputs[0].shape[1])]})}d.forEach(p=>he(p))}Q0=sr.reduce((l,d)=>d.score>l?d.score:l,0);let s=sr.map(l=>l.position[0]),i=sr.map(l=>l.position[1]);B2=[Math.min(...s),Math.min(...i),Math.max(...s)-Math.min(...s),Math.max(...i)-Math.min(...i)];let o=sr.map(l=>l.positionRaw[0]),u=sr.map(l=>l.positionRaw[1]);V2=[Math.min(...o),Math.min(...u),Math.max(...o)-Math.min(...o),Math.max(...u)-Math.min(...u)],n([{id:0,score:Q0,box:B2,boxRaw:V2,keypoints:sr}])}))}var Wa,ir=[],H2=[0,0,0,0],G2=[0,0,0,0],cu=0,q2=Number.MAX_SAFE_INTEGER,jle=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"];async function X2(e){return Wa?e.debug&&de("cached model:",Wa.modelUrl):(Wa=await ct(ft(e.modelBasePath,e.body.modelPath)),!Wa||!Wa.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",Wa.modelUrl)),Wa}async function K2(e,t){return q20?(q2++,[{id:0,score:cu,box:H2,boxRaw:G2,keypoints:ir}]):(q2=0,new Promise(async n=>{let a=V(()=>{if(!Wa.inputs[0].shape)return null;let l=De.resizeBilinear(e,[Wa.inputs[0].shape[2],Wa.inputs[0].shape[1]],!1);return ge(l,"int32")}),r;if(t.body.enabled&&(r=await Wa.predict(a)),a.dispose(),r){ir.length=0;let l=r.arraySync();he(r);let d=l[0][0];for(let p=0;pt.body.minConfidence&&ir.push({score:Math.round(100*cu)/100,part:jle[p],positionRaw:[d[p][1],d[p][0]],position:[Math.round((e.shape[2]||0)*d[p][1]),Math.round((e.shape[1]||0)*d[p][0])]})}cu=ir.reduce((l,d)=>d.score>l?d.score:l,0);let s=ir.map(l=>l.position[0]),i=ir.map(l=>l.position[1]);H2=[Math.min(...s),Math.min(...i),Math.max(...s)-Math.min(...s),Math.max(...i)-Math.min(...i)];let o=ir.map(l=>l.positionRaw[0]),u=ir.map(l=>l.positionRaw[1]);G2=[Math.min(...o),Math.min(...u),Math.max(...o)-Math.min(...o),Math.max(...u)-Math.min(...u)],n([{id:0,score:cu,box:H2,boxRaw:G2,keypoints:ir}])}))}var hu=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var Qn,Z2=[],Y2=Number.MAX_SAFE_INTEGER,ef=2.5;async function J2(e){if(Qn)e.debug&&de("cached model:",Qn.modelUrl);else{Qn=await ct(ft(e.modelBasePath,e.object.modelPath));let t=Object.values(Qn.modelSignature.inputs);if(Qn.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Qn.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!Qn||!Qn.modelUrl?de("load model failed:",e.object.modelPath):e.debug&&de("load model:",Qn.modelUrl)}return Qn}async function Ule(e,t,n,a){let r=0,s=[];for(let l of[1,2,4])V(()=>{var g,y;let d=l*13,p=(g=e.find(A=>A.shape[1]===d**2&&A.shape[2]===hu.length))==null?void 0:g.squeeze(),c=(y=e.find(A=>A.shape[1]===d**2&&A.shape[2]a.object.minConfidence&&x!==61){let b=(.5+Math.trunc(A%d))/d,w=(.5+Math.trunc(A/d))/d,N=m[A].map(W=>W*(d/l/t)),[C,E]=[b-ef/l*N[0],w-ef/l*N[1]],[_,$]=[b+ef/l*N[2]-C,w+ef/l*N[3]-E],S=[C,E,_,$];S=S.map(W=>Math.max(0,Math.min(W,1)));let z=[S[0]*n[0],S[1]*n[1],S[2]*n[0],S[3]*n[1]],O={id:r++,score:Math.round(100*v)/100,class:x+1,label:hu[x].label,box:z.map(W=>Math.trunc(W)),boxRaw:S};s.push(O)}}});e.forEach(l=>he(l));let i=s.map(l=>[l.boxRaw[1],l.boxRaw[0],l.boxRaw[3],l.boxRaw[2]]),o=s.map(l=>l.score),u=[];if(i&&i.length>0){let l=await De.nonMaxSuppressionAsync(i,o,a.object.maxDetected,a.object.iouThreshold,a.object.minConfidence);u=l.dataSync(),he(l)}return s=s.filter((l,d)=>u.includes(d)).sort((l,d)=>d.score-l.score),s}async function Q2(e,t){return Y20?(Y2++,Z2):(Y2=0,new Promise(async n=>{let a=[e.shape[2],e.shape[1]],r=De.resizeBilinear(e,[Qn.inputSize,Qn.inputSize],!1),s=r.div(255),i=s.transpose([0,3,1,2]);s.dispose(),r.dispose();let o;t.object.enabled&&(o=await Qn.predict(i)),i.dispose();let u=await Ule(o,Qn.inputSize,a,t);Z2=u,n(u)}))}var ea,e5=[],t5=Number.MAX_SAFE_INTEGER;async function n5(e){if(ea)e.debug&&de("cached model:",ea.modelUrl);else{ea=await ct(ft(e.modelBasePath,e.object.modelPath));let t=Object.values(ea.modelSignature.inputs);if(ea.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!ea.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!ea||!ea.modelUrl?de("load model failed:",e.object.modelPath):e.debug&&de("load model:",ea.modelUrl)}return ea}async function Hle(e,t,n,a){if(!e)return[];let r=[],s=e.arraySync(),i=Vt(e);e.dispose();let o=Zt(i,6,1);i.dispose();let l=gn([o[1],o[0],o[3],o[2]],1).squeeze(),d=o[4].squeeze(),p=o[5].squeeze();o.forEach(f=>f.dispose());let c=await De.nonMaxSuppressionAsync(l,d,a.object.maxDetected,a.object.iouThreshold,a.object.minConfidence);l.dispose(),d.dispose(),p.dispose();let h=c.dataSync();c.dispose();let m=0;for(let f of h){let g=Math.trunc(100*s[0][f][4])/100,y=s[0][f][5],A=hu[y].label,x=[s[0][f][0]/t,s[0][f][1]/t,s[0][f][2]/t,s[0][f][3]/t],v=[Math.trunc(x[0]*n[0]),Math.trunc(x[1]*n[1]),Math.trunc(x[2]*n[0]),Math.trunc(x[3]*n[1])];r.push({id:m++,score:g,class:y,label:A,box:v,boxRaw:x})}return r}async function a5(e,t){return t50?(t5++,e5):(t5=0,new Promise(async n=>{let a=[e.shape[2],e.shape[1]],r=De.resizeBilinear(e,[ea.inputSize,ea.inputSize]),s=t.object.enabled?ea.execute(r,["tower_0/detections"]):null;r.dispose();let i=await Hle(s,ea.inputSize,a,t);e5=i,n(i)}))}var L9=e=>{if(!e)return[];let t=[];for(let n=0;nu.part==="leftWrist"),r=e[n].keypoints.find(u=>u.part==="rightWrist"),s=e[n].keypoints.find(u=>u.part==="nose");s&&a&&r&&a.position.yu.part==="leftShoulder"),o=e[n].keypoints.find(u=>u.part==="rightShoulder");i&&o&&t.push({body:n,gesture:`leaning ${i.position.y>o.position.y?"left":"right"}`})}return t},W9=e=>{if(!e)return[];let t=[];for(let n=0;n0){let a=e[n].mesh[33][2]-e[n].mesh[263][2];Math.abs(a)<10?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${a<0?"left":"right"}`}),Math.abs(e[n].mesh[374][1]-e[n].mesh[386][1])/Math.abs(e[n].mesh[443][1]-e[n].mesh[450][1])<.2&&t.push({face:n,gesture:"blink left eye"}),Math.abs(e[n].mesh[145][1]-e[n].mesh[159][1])/Math.abs(e[n].mesh[223][1]-e[n].mesh[230][1])<.2&&t.push({face:n,gesture:"blink right eye"});let i=Math.min(100,500*Math.abs(e[n].mesh[13][1]-e[n].mesh[14][1])/Math.abs(e[n].mesh[10][1]-e[n].mesh[152][1]));i>10&&t.push({face:n,gesture:`mouth ${Math.trunc(i)}% open`});let o=e[n].mesh[152][2];Math.abs(o)>10&&t.push({face:n,gesture:`head ${o<0?"up":"down"}`})}return t},B9=e=>{if(!e)return[];let t=[];for(let n=0;n.06||p>.06)&&(l=!1),c>.06&&t.push({iris:n,gesture:"looking right"}),p>.06&&t.push({iris:n,gesture:"looking left"});let h=Math.abs(e[n].mesh[145][1]-e[n].annotations.rightEyeIris[0][1])/e[n].box[3],m=Math.abs(e[n].mesh[374][1]-e[n].annotations.leftEyeIris[0][1])/e[n].box[3];(m<.01||h<.01||m>.022||h>.022)&&(l=!1),(m<.01||h<.01)&&t.push({iris:n,gesture:"looking down"}),(m>.022||h>.022)&&t.push({iris:n,gesture:"looking up"}),l&&t.push({iris:n,gesture:"looking center"})}return t},V9=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=a.reduce((i,o)=>i.position[2]i.position[1](l[c]=0,p))},r=function(o,u){let l=e.createShader(u);if(e.shaderSource(l,o),e.compileShader(l),!e.getShaderParameter(l,e.COMPILE_STATUS))throw new Error("Filter: GL compile failed",e.getShaderInfoLog(l));return l};this.uniform={},this.attribute={};let s=r(t,e.VERTEX_SHADER),i=r(n,e.FRAGMENT_SHADER);if(this.id=e.createProgram(),e.attachShader(this.id,s),e.attachShader(this.id,i),e.linkProgram(this.id),!e.getProgramParameter(this.id,e.LINK_STATUS))throw new Error("Filter: GL link failed",e.getProgramInfoLog(this.id));e.useProgram(this.id),a(t,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=e.getAttribLocation(this.id,o);a(t,"uniform",this.uniform),a(n,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=e.getUniformLocation(this.id,o)}function j9(e){e||(e={});let t=0,n=null,a=!1,r=-1,s=[null,null],i=[],o=-1,u=-1,l=null,d=null,p={},c=e.canvas||document.createElement("canvas"),h={},m={INTERMEDIATE:1},f=c.getContext("webgl");if(!f)throw new Error("Filter: getContext() failed");this.addFilter=function(b){let w=Array.prototype.slice.call(arguments,1),N=p[b];i.push({func:N,args:w})},this.reset=function(){i=[]};let g=function(b,w){if(!(b===o&&w===u)){if(c.width=b,o=b,c.height=w,u=w,!l){let N=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);l=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,l),f.bufferData(f.ARRAY_BUFFER,N,f.STATIC_DRAW),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}f.viewport(0,0,o,u),s=[null,null]}},y=function(b,w){let N=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,N);let C=f.createRenderbuffer();f.bindRenderbuffer(f.RENDERBUFFER,C);let E=f.createTexture();return f.bindTexture(f.TEXTURE_2D,E),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,b,w,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,E,0),f.bindTexture(f.TEXTURE_2D,null),f.bindFramebuffer(f.FRAMEBUFFER,null),{fbo:N,texture:E}},A=function(b){return s[b]=s[b]||y(o,u),s[b]},x=function(b=null){var E,_;let w=null,N=null,C=!1;t===0?w=n:w=(E=A(r))==null?void 0:E.texture,t++,a&&!(b&m.INTERMEDIATE)?(N=null,C=t%2==0):(r=(r+1)%2,N=(_=A(r))==null?void 0:_.fbo),f.bindTexture(f.TEXTURE_2D,w),f.bindFramebuffer(f.FRAMEBUFFER,N),f.uniform1f(d.uniform.flipY,C?-1:1),f.drawArrays(f.TRIANGLES,0,6)};this.apply=function(b){if(g(b.width,b.height),t=0,n||(n=f.createTexture()),f.bindTexture(f.TEXTURE_2D,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b),i.length===0)return x(),c;for(let w=0;w{let d=[];e=q(e,[1,a,o]);for(let p=0;p{switch(e.op){case"If":case"StatelessIf":{let a=I("thenBranch",e,t,n),r=I("elseBranch",e,t,n),s=I("cond",e,t,n),i=I("args",e,t,n);return(await s.data())[0]?n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{let a=I("body",e,t,n),r=I("cond",e,t,n),s=I("args",e,t,n),i=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),o=s.map(d=>d.id),l=await i[0].data();i.forEach(d=>{!d.kept&&o.indexOf(d.id)===-1&&d.dispose()});let u=s;for(;l[0];){let d=u;u=await n.functionMap[a].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);let p=u.map(h=>h.id);d.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()});let c=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await c[0].data(),c.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()})}return u}case"LoopCond":{let a=I("pred",e,t,n);return[Sr(a)]}case"Switch":{let a=I("pred",e,t,n),r=I("data",e,t,n);return r.kept||(r=Sr(r)),(await a.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{let a=e.inputNames.find(r=>kn(r,t,n)!==void 0);if(a){let r=kn(a,t,n);return[Sr(r)]}return}case"Enter":{let a=I("frameName",e,t,n),r=I("tensor",e,t,n);return n.enterFrame(a),[Sr(r)]}case"Exit":{let a=I("tensor",e,t,n);return n.exitFrame(),[Sr(a)]}case"NextIteration":{let a=I("tensor",e,t,n);return n.nextIteration(),[Sr(a)]}case"TensorArrayV3":{let a=I("size",e,t,n),r=I("dtype",e,t,n),s=I("elementShape",e,t,n),i=I("dynamicSize",e,t,n),o=I("clearAfterRead",e,t,n),l=I("identicalElementShapes",e,t,n),u=I("name",e,t,n),d=new toe(u,r,a,s,l,i,o);return n.addTensorArray(d),[d.idTensor,ke(1)]}case"TensorArrayWriteV3":{let a=I("tensorArrayId",e,t,n),r=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(a.id);return i.write(r,s),[i.idTensor]}case"TensorArrayReadV3":{let a=I("tensorArrayId",e,t,n),r=I("index",e,t,n);return[n.getTensorArray(a.id).read(r)]}case"TensorArrayGatherV3":{let a=I("tensorArrayId",e,t,n),r=I("indices",e,t,n),s=I("dtype",e,t,n);return[n.getTensorArray(a.id).gather(r,s)]}case"TensorArrayScatterV3":{let a=I("tensorArrayId",e,t,n),r=I("indices",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(a.id);return i.scatter(r,s),[i.idTensor]}case"TensorArrayConcatV3":{let a=I("tensorArrayId",e,t,n),r=n.getTensorArray(a.id),s=I("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{let a=I("tensorArrayId",e,t,n),r=I("tensor",e,t,n),s=I("lengths",e,t,n),i=n.getTensorArray(a.id);return i.split(s,r),[i.idTensor]}case"TensorArraySizeV3":{let a=I("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return[ke(r.size(),"int32")]}case"TensorArrayCloseV3":{let a=I("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{let a=I("tensorListId",e,t,n),r=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorList(a.id);return i.setItem(r,s),[i.idTensor]}case"TensorListGetItem":{let a=I("tensorListId",e,t,n),r=I("index",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(a.id).getItem(r,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let a=I("indices",e,t,n),r=I("tensor",e,t,n),s=I("elementShape",e,t,n),i=I("numElements",e,t,n),o=roe(r,a,s,i);return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let a=I("elementShape",e,t,n),r=I("elementDType",e,t,n),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=I(s,e,t,n),o=aoe(a,r,i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{let a=I("tensorListId",e,t,n),r=I("indices",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(a.id).gather(r,i,s)]}case"TensorListStack":{let a=I("tensorListId",e,t,n),r=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=I("numElements",e,t,n);return[n.getTensorList(a.id).stack(r,s,i)]}case"TensorListFromTensor":{let a=I("tensor",e,t,n),r=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=noe(a,r,s);return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":{let a=I("tensorListId",e,t,n),r=n.getTensorList(a.id),s=I("dtype",e,t,n),i=I("elementShape",e,t,n);return[r.concat(s,i)]}case"TensorListPushBack":{let a=I("tensorListId",e,t,n),r=I("tensor",e,t,n),s=n.getTensorList(a.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{let a=I("tensorListId",e,t,n),r=I("elementShape",e,t,n),s=I("elementDType",e,t,n);return[n.getTensorList(a.id).popBack(r,s)]}case"TensorListSplit":{let a=I("tensor",e,t,n),r=I("elementShape",e,t,n),s=I("lengths",e,t,n),i=soe(a,s,r);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Tk(e,t,n){let[a,r]=I("fusedOps",e,t,n),s=a==="biasadd",i=!s,o=r==="prelu",l=a==="fusedbatchnorm",u=I("numArgs",e,t,n);if(s){if(o&&u!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&s&&u!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let d=I("strides",e,t,n),p=z0(e,t,n),c=I("dataFormat",e,t,n).toUpperCase(),h=I("dilations",e,t,n),[m,f]=I("args",e,t,n);i&&(f=m,m=void 0);let g=I("leakyreluAlpha",e,t,n);return{stride:d,pad:p,dataFormat:c,dilations:h,biasArg:m,preluArg:f,activationFunc:r,leakyreluAlpha:g}}var ooe=(e,t,n)=>{switch(e.op){case"Conv1D":{let a=I("stride",e,t,n),r=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilation",e,t,n);return[Gc(I("x",e,t,n),I("filter",e,t,n),a,r,s,i)]}case"Conv2D":{let a=I("strides",e,t,n),r=z0(e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[mr(I("x",e,t,n),I("filter",e,t,n),[a[1],a[2]],r,s,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:u,leakyreluAlpha:d}=Tk(e,t,n);return[Kr.conv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:u,preluActivationWeights:l,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:u,leakyreluAlpha:d}=Tk(e,t,n);return[Kr.depthwiseConv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:u,preluActivationWeights:l,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let a=I("outputShape",e,t,n),r=I("strides",e,t,n),s=z0(e,t,n);return[qc(I("x",e,t,n),I("filter",e,t,n),a,[r[1],r[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let a=I("strides",e,t,n),r=z0(e,t,n),s=I("dilations",e,t,n),i=I("dataFormat",e,t,n).toUpperCase();return[Cl(I("input",e,t,n),I("filter",e,t,n),[a[1],a[2]],r,i,[s[1],s[2]])]}case"Conv3D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[L1(I("x",e,t,n),I("filter",e,t,n),[a[1],a[2],a[3]],r,s,[i[1],i[2],i[3]])]}case"AvgPool":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[ld(I("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPool":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[hd(I("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPoolWithArgmax":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n),i=I("includeBatchInIndex",e,t,n),{result:o,indexes:l}=_3(I("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r,i);return[o,l]}case"AvgPool3D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[O1(I("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"MaxPool3D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[Y1(I("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"Dilation2D":{let a=I("strides",e,t,n),r=I("pad",e,t,n),s=I("dilations",e,t,n),i=a[1],o=a[2],l=s[1],u=s[2];return[B1(I("x",e,t,n),I("filter",e,t,n),[i,o],r,[l,u],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},loe=(e,t,n)=>{switch(e.op){case"Fill":{let a=I("shape",e,t,n),r=I("dtype",e,t,n),s=I("value",e,t,n);return[Rl(a,s,r)]}case"LinSpace":{let a=I("start",e,t,n),r=I("stop",e,t,n),s=I("num",e,t,n);return[R3(a,r,s)]}case"Multinomial":{let a=I("logits",e,t,n),r=I("numSamples",e,t,n),s=I("seed",e,t,n);return[P3(a,r,s)]}case"OneHot":{let a=I("indices",e,t,n),r=I("depth",e,t,n),s=I("onValue",e,t,n),i=I("offValue",e,t,n);return[wl(a,r,s,i)]}case"Ones":return[jn(I("shape",e,t,n),I("dtype",e,t,n))];case"OnesLike":return[Un(I("x",e,t,n))];case"RandomUniform":return[$l(I("shape",e,t,n),I("minval",e,t,n),I("maxval",e,t,n),I("dtype",e,t,n))];case"Range":{let a=I("start",e,t,n),r=I("stop",e,t,n),s=I("step",e,t,n);return[Dl(a,r,s,I("dtype",e,t,n))]}case"TruncatedNormal":{let a=I("shape",e,t,n),r=I("mean",e,t,n),s=I("stdDev",e,t,n),i=I("seed",e,t,n);return[fh(a,r,s,I("dtype",e,t,n),i)]}case"Zeros":return[$t(I("shape",e,t,n),I("dtype",e,t,n))];case"ZerosLike":return[Ge(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function a2(e,t,n){let a=I("boxes",e,t,n),r=I("scores",e,t,n),s=I("maxOutputSize",e,t,n),i=I("iouThreshold",e,t,n),o=I("scoreThreshold",e,t,n),l=I("softNmsSigma",e,t,n);return{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var uoe=async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}=a2(e,t,n),u=await De.nonMaxSuppressionWithScoreAsync(a,r,s,i,o,l);return[u.selectedIndices,u.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=a2(e,t,n),l=I("padToMaxOutputSize",e,t,n),u=await De.nonMaxSuppressionPaddedAsync(a,r,s,i,o,l);return[u.selectedIndices,u.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=a2(e,t,n);return[await De.nonMaxSuppressionAsync(a,r,s,i,o)]}case"Where":{let a=ge(I("condition",e,t,n),"bool"),r=[await dg(a)];return a.dispose(),r}case"ListDiff":return B3(I("x",e,t,n),I("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}},doe=(e,t,n)=>{switch(e.op){case"TopKV2":{let a=I("x",e,t,n),r=I("k",e,t,n),s=I("sorted",e,t,n),i=lg(a,r,s);return[i.values,i.indices]}case"Unique":{let a=I("x",e,t,n),r=mh(a);return[r.values,r.indices]}case"UniqueV2":{let a=I("x",e,t,n),r=I("axis",e,t,n),s=mh(a,r);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},poe=(e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let a=I("default",e,t,n);return[kn(e.name,t,n)||a];case"Placeholder":return[kn(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let u=I("x",e,t,n);return[Sr(u)]}case"IdentityN":return I("x",e,t,n).map(u=>Sr(u));case"Snapshot":let r=I("x",e,t,n);return[Sr(r)];case"Shape":return[Dt(I("x",e,t,n).shape,"int32")];case"ShapeN":return I("x",e,t,n).map(u=>Dt(u.shape));case"Size":return[ke(I("x",e,t,n).size,"int32")];case"Rank":return[ke(I("x",e,t,n).rank,"int32")];case"NoOp":return[ke(1)];case"Print":let s=I("x",e,t,n),i=I("data",e,t,n),o=I("message",e,t,n),l=I("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let u=0;ue.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return ke(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let n=await e.data();return this.tensorMap.forEach(a=>a.dispose()),this.tensorMap.clear(),V(()=>{let a=Gn(t),r=n.length,s=a.length;k.assert(r===s,()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${s} elements.`);for(let i=0;i{let a=[];for(let r=0;r{switch(e.op){case"HashTable":case"HashTableV2":{let r=I("keyDType",e,t,n),s=I("valueDType",e,t,n),i=new coe(r,s);return a.addHashTable(e.name,i),[i.handle]}case"LookupTableImport":case"LookupTableImportV2":{let r=I("tableHandle",e,t,n,a),s=I("keys",e,t,n),i=I("values",e,t,n);return[await a.getHashTableById(r.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let r=I("tableHandle",e,t,n,a),s=I("keys",e,t,n),i=I("defaultValue",e,t,n);return[await a.getHashTableById(r.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let r=I("tableHandle",e,t,n,a);return[a.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},foe=(e,t,n)=>{switch(e.op){case"ResizeBilinear":{let a=I("images",e,t,n),r=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[De.resizeBilinear(a,[r[0],r[1]],s,i)]}case"ResizeNearestNeighbor":{let a=I("images",e,t,n),r=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[De.resizeNearestNeighbor(a,[r[0],r[1]],s,i)]}case"CropAndResize":{let a=I("image",e,t,n),r=I("boxes",e,t,n),s=I("boxInd",e,t,n),i=I("cropSize",e,t,n),o=I("method",e,t,n),l=I("extrapolationValue",e,t,n);return[De.cropAndResize(a,r,s,i,o,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},moe=(e,t,n)=>{switch(e.op){case"Equal":return[Hr(I("a",e,t,n),I("b",e,t,n))];case"NotEqual":return[Ri(I("a",e,t,n),I("b",e,t,n))];case"Greater":return[Wn(I("a",e,t,n),I("b",e,t,n))];case"GreaterEqual":return[qr(I("a",e,t,n),I("b",e,t,n))];case"Less":return[Yc(I("a",e,t,n),I("b",e,t,n))];case"LessEqual":return[Xr(I("a",e,t,n),I("b",e,t,n))];case"LogicalAnd":return[xa(I("a",e,t,n),I("b",e,t,n))];case"LogicalNot":return[cd(I("a",e,t,n))];case"LogicalOr":return[th(I("a",e,t,n),I("b",e,t,n))];case"Select":case"SelectV2":return[un(I("condition",e,t,n),I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},goe=(e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[je(I("a",e,t,n),I("b",e,t,n),I("transposeA",e,t,n),I("transposeB",e,t,n))];case"Einsum":return[T3(I("equation",e,t,n),...I("tensors",e,t,n))];case"Transpose":return[Qe(I("x",e,t,n),I("perm",e,t,n))];case"_FusedMatMul":let[a,r]=I("fusedOps",e,t,n),s=a==="biasadd",i=r==="prelu",o=I("numArgs",e,t,n),l=I("leakyreluAlpha",e,t,n);if(s){if(i&&o!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&o!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[u,d]=I("args",e,t,n);return[Kr.matMul({a:I("a",e,t,n),b:I("b",e,t,n),transposeA:I("transposeA",e,t,n),transposeB:I("transposeB",e,t,n),bias:u,activation:r,preluActivationWeights:d,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}},yoe=(e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[Ni(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"FusedBatchNormV3":return[Ni(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"LRN":return[q1(I("x",e,t,n),I("radius",e,t,n),I("bias",e,t,n),I("alpha",e,t,n),I("beta",e,t,n))];case"Softmax":return[xd(I("x",e,t,n))];case"LogSoftmax":return[eh(I("x",e,t,n))];case"SparseToDense":return[pg(I("sparseIndices",e,t,n),I("outputShape",e,t,n),I("sparseValues",e,t,n),I("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Aoe=(e,t,n)=>{switch(e.op){case"Max":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Vn(I("x",e,t,n),i,o)]}case"Mean":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Nt(I("x",e,t,n),i,o)]}case"Min":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[fd(I("x",e,t,n),i,o)]}case"Sum":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Se(I("x",e,t,n),i,o)]}case"All":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Uc(I("x",e,t,n),i,o)]}case"Any":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[id(I("x",e,t,n),i,o)]}case"ArgMax":{let i=I("axis",e,t,n);return[ki(I("x",e,t,n),i)]}case"ArgMin":{let i=I("axis",e,t,n);return[T1(I("x",e,t,n),i)]}case"Prod":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[ah(I("x",e,t,n),i,o)]}case"Cumsum":{let i=I("axis",e,t,n),o=I("exclusive",e,t,n),l=I("reverse",e,t,n);return[Kc(I("x",e,t,n),i,o,l)]}case"Bincount":let a=I("x",e,t,n),r=I("weights",e,t,n),s=I("size",e,t,n);return[z1(a,r,s)];case"DenseBincount":{let i=I("x",e,t,n),o=I("weights",e,t,n),l=I("size",e,t,n),u=I("binaryOutput",e,t,n);return[S3(i,o,l,u)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},xoe=(e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{let a=I("n",e,t,n),r=I("axis",e,t,n),s=I("tensors",e,t,n);return s=s.slice(0,a),[lt(s,r)]}case"Gather":{let a=I("x",e,t,n),r=I("indices",e,t,n);return[Ti(a,ge(r,"int32"),0)]}case"GatherV2":{let a=I("axis",e,t,n),r=I("batchDims",e,t,n),s=I("x",e,t,n),i=I("indices",e,t,n);return[Ti(s,ge(i,"int32"),a,r)]}case"Reverse":{let a=I("dims",e,t,n),r=[];for(let i=0;i{let a=I("axis",e,t,n),r=I("tensors",e,t,n),s=r[0].shape,i=Vt(r[0]).shape,o=r.map(l=>{let u=k.arraysEqual(l.shape,s);if(!u&&!k.arraysEqual(Vt(l).shape,i))throw new Error("the input tensors shape does not match");return u?l:q(l,s)});return[gn(o,a)]});case"Unpack":{let a=I("axis",e,t,n),r=I("tensor",e,t,n);return Gn(r,a)}case"Tile":{let a=I("reps",e,t,n);return[Gr(I("x",e,t,n),a)]}case"Split":case"SplitV":{let a=I("axis",e,t,n),r=I("numOrSizeSplits",e,t,n),s=I("x",e,t,n);return Zt(s,r,a)}case"ScatterNd":{let a=I("indices",e,t,n),r=I("values",e,t,n),s=I("shape",e,t,n);return[H3(a,r,s)]}case"GatherNd":{let a=I("x",e,t,n),r=I("indices",e,t,n);return[G3(a,r)]}case"SparseToDense":{let a=I("sparseIndices",e,t,n),r=I("outputShape",e,t,n),s=I("sparseValues",e,t,n),i=I("defaultValue",e,t,n);return[pg(a,s,r,s.dtype===i.dtype?i:ge(i,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},boe=(e,t,n)=>{switch(e.op){case"SparseFillEmptyRows":{let{outputIndices:a,outputValues:r,emptyRowIndicator:s,reverseIndexMap:i}=wd.sparseFillEmptyRows(I("indices",e,t,n),I("values",e,t,n),I("denseShape",e,t,n),I("defaultValue",e,t,n));return[a,r,s,i]}case"SparseReshape":{let{outputIndices:a,outputShape:r}=wd.sparseReshape(I("inputIndices",e,t,n),I("inputShape",e,t,n),I("newShape",e,t,n));return[a,r]}case"SparseSegmentMean":return[wd.sparseSegmentMean(I("data",e,t,n),I("indices",e,t,n),I("segmentIds",e,t,n))];case"SparseSegmentSum":return[wd.sparseSegmentSum(I("data",e,t,n),I("indices",e,t,n),I("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},voe=(e,t,n)=>{switch(e.op){case"FFT":return[bd(I("x",e,t,n))];case"IFFT":return[Ol(I("x",e,t,n))];case"RFFT":return[vd(I("x",e,t,n))];case"IRFFT":return[ch(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},woe=(e,t,n)=>{switch(e.op){case"StringNGrams":{let{nGrams:a,nGramsSplits:r}=vh.stringNGrams(I("data",e,t,n),I("dataSplits",e,t,n),I("separator",e,t,n),I("nGramWidths",e,t,n),I("leftPad",e,t,n),I("rightPad",e,t,n),I("padWidth",e,t,n),I("preserveShortSequences",e,t,n));return[a,r]}case"StringSplit":{let{indices:a,values:r,shape:s}=vh.stringSplit(I("input",e,t,n),I("delimiter",e,t,n),I("skipEmpty",e,t,n));return[a,r,s]}case"StringToHashBucketFast":return[vh.stringToHashBucketFast(I("input",e,t,n),I("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},koe=(e,t,n)=>{switch(e.op){case"Cast":return[ge(I("x",e,t,n),I("dtype",e,t,n))];case"ExpandDims":{let a=I("axis",e,t,n);return[mn(I("x",e,t,n),a)]}case"Squeeze":{let a=I("axis",e,t,n);return[Vt(I("x",e,t,n),a)]}case"Reshape":return[q(I("x",e,t,n),I("shape",e,t,n))];case"MirrorPad":return[J1(I("x",e,t,n),I("padding",e,t,n),I("mode",e,t,n))];case"PadV2":case"Pad":return[gr(I("x",e,t,n),I("padding",e,t,n),I("constantValue",e,t,n))];case"SpaceToBatchND":{let a=I("blockShape",e,t,n),r=I("paddings",e,t,n);return[md(I("x",e,t,n),a,r)]}case"BatchToSpaceND":{let a=I("blockShape",e,t,n),r=I("crops",e,t,n);return[ud(I("x",e,t,n),a,r)]}case"DepthToSpace":{let a=I("blockSize",e,t,n),r=I("dataFormat",e,t,n).toUpperCase();return[W1(I("x",e,t,n),a,r)]}case"BroadcastTo":return[Nl(I("x",e,t,n),I("shape",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Ck(e,t,n,a){let r=((s,i,o)=>{switch(s.category){case"arithmetic":return V(()=>Qie(s,i,o));case"basic_math":return V(()=>eoe(s,i,o));case"control":return ioe(s,i,o);case"convolution":return V(()=>ooe(s,i,o));case"creation":return V(()=>loe(s,i,o));case"dynamic":return uoe(s,i,o);case"evaluation":return V(()=>doe(s,i,o));case"image":return V(()=>foe(s,i,o));case"graph":return V(()=>poe(s,i,o));case"logical":return V(()=>moe(s,i,o));case"matrices":return V(()=>goe(s,i,o));case"normalization":return V(()=>yoe(s,i,o));case"reduction":return V(()=>Aoe(s,i,o));case"slice_join":return V(()=>xoe(s,i,o));case"sparse":return V(()=>boe(s,i,o));case"spectral":return V(()=>voe(s,i,o));case"string":return V(()=>woe(s,i,o));case"transformation":return V(()=>koe(s,i,o));case"hash_table":return hoe(s,i,o,a);case"custom":let l=nk(s.op);if(l&&l.customExecutor)return l.customExecutor(new Jie(s,i,o));throw TypeError(`Custom op ${s.op} is not registered.`);default:throw TypeError(`Unknown op '${s.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return k.isPromise(r)?r.then(s=>[].concat(s)):[].concat(r)}var Ek=class{constructor(e={},t={},n={},a={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=a,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(){let e=[];for(let t=0;tt.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++;let 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(let t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(let t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}};function Rk(e,t,n,a){let r=new Set,s=[],i=null,o=null,l=new Set,u=Object.keys(e).map(c=>Kn(c)[0]),d=[];a!=null&&(d=a.map(c=>Kn(c.name)[0]));let p=[...t];for(;p.length>0;){let c=p.pop();if((Mk(c)||Coe(c)||Eoe(c))&&i==null&&(i=c,o=i.children.map(h=>h.name).filter(h=>r.has(h))),r.add(c.name),n[c.name]==null&&u.indexOf(c.name)===-1&&d.indexOf(c.name)===-1){if(c.inputs.length===0){s.push(c.name);continue}c.inputs.forEach(h=>{l.has(h.name)||(l.add(h.name),p.push(h))})}}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:i,syncInputs:o}}function Ioe(e,t,n){let{usedNodes:a,inputs:r}=n,s=[],i=Object.keys(r).map(d=>Kn(d)[0]).map(d=>e.nodes[d]),o=e.initNodes;i.forEach(d=>{a.has(d.name)&&s.push(d)}),e.weights.forEach(d=>{a.has(d.name)&&s.push(d)}),o!=null&&o.forEach(d=>{a.has(d.name)&&s.push(d)});let l=new Set,u=[];for(;s.length>0;){let d=s.pop();l.add(d.name),t[d.name]||u.push(d),d.children.forEach(p=>{!l.has(p.name)&&a.has(p.name)&&p.inputs.every(c=>l.has(c.name))&&s.push(p)})}return u}var Soe=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],Noe=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Toe=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function Mk(e){return Soe.indexOf(e.op)>=0}function Coe(e){return Noe.indexOf(e.op)>=0}function Eoe(e){return Toe.indexOf(e.op)>=0}var r2=class{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},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(n=>{this._functionExecutorMap[n]=new r2(e.functions[n],this)})}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){let t=Object.keys(e).map(n=>e[n].map(a=>a.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=>{let t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){let n=e.map(r=>r.name).sort(),a=t.map(r=>r.name).sort();return n.join(this.SEPERATOR)+"--"+a.join(this.SEPERATOR)}compile(e,t){let n=Rk(e,t,this.weightMap,this._initNodes),{missingInputs:a,dynamicNode:r,syncInputs:s}=n;if(r!=null)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(a.length>0){let i=t.map(l=>l.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${i}] from the provided inputs [${o}]. Missing the following inputs: [${a}]`)}return Ioe(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);let n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let a=n.map(d=>this.graph.nodes[Kn(d)[0]]),r=t.map(d=>Kn(d)[0]),s=r.map(d=>this.graph.nodes[d]);s.length===0&&(s=this._outputs);let i=this.getCompilationKey(a,s),o=this.compiledMap.get(i);o==null&&(o=this.compile(e,s),this.compiledMap.set(i,o));let l={},u={};return V(()=>{let d=new Ek(this.weightMap,l,u,this.functionExecutorMap),p=Object.assign({},this.weightMap);Object.keys(e).forEach(m=>{let[f,g]=Kn(m),y=[];y[g]=e[m],p[f]=y});let c=this.getFrozenTensorIds(p),h={};for(let m=0;mkn(m,p,d))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(n=>e[n]).map(n=>n.map(a=>a.id)));return new Set(t)}checkTensorForDisposal(e,t,n,a,r,s,i){t.category==="control"||s.indexOf(e)!==-1||(n[e].forEach(o=>{o!=null&&(i[o.id]=(i[o.id]||0)+t.children.length)}),t.inputs.forEach(o=>{if(o.category!=="control"){let l=Mie(o.name,n,a);l!=null&&l.forEach(u=>{if(u&&!u.kept&&!r.has(u.id)){let d=i[u.id];d===1?(u.dispose(),delete i[u.id]):d!=null&&i[u.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,a={},r={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));let s=new Ek(this.weightMap,a,r,this.functionExecutorMap),i=await this.executeWithControlFlow(e,s,t,n),o=t.map(p=>kn(p,i,s)),l=o.map(p=>p.id),u=Object.keys(e).map(p=>e[p].id),d=new Set([...l,...u,...this.weightIds]);return Object.keys(i).forEach(p=>{i[p].forEach(c=>{c&&!c.kept&&!c.isDisposed&&!d.has(c.id)&&c.dispose()})}),this.parent==null&&s.dispose(d),o}async executeFunctionAsync(e,t,n){let a=e.reduce((r,s,i)=>(r[this.inputs[i].name]=s,r),{});return this._executeAsync(a,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,a){let r=Object.keys(e),s=r.map(A=>this.graph.nodes[Kn(A)[0]]),i=n.map(A=>Kn(A)[0]),o=i.map(A=>this.graph.nodes[A]);o.length===0&&(o=this._outputs);let{usedNodes:l,missingInputs:u,dynamicNode:d,syncInputs:p}=Rk(e,o,this.weightMap,this._initNodes),c=[...s,...this.graph.weights,...this._initNodes||[]].map(A=>({node:A,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(A=>{let[x,v]=Kn(A),b=[];b[v]=e[A],h[x]=b});let m={},f=this.getFrozenTensorIds(h),g={};for(;c.length>0;){let A=this.processStack(s,c,t,h,g,f,i,m,l);await Promise.all(A)}d==null&&!a&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let y=o.filter(A=>!Mk(A)&&!kn(A.name,h,t)).map(A=>A.name);if(y.length>0){let A="";throw d!=null&&(A=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${u}]. ${A}`)}return h}processStack(e,t,n,a,r,s,i,o,l){let u=[];for(;t.length>0;){let d=t.pop();n.currentContext=d.contexts;let p="";if(d.node.op==="Enter"&&I("isConstant",d.node,a,n)&&([p]=Ir(d.node.name,n)),a[d.node.name]==null){let c=Ck(d.node,a,n,this._resourceManager);p||([p]=Ir(d.node.name,n));let h=n.currentContext;k.isPromise(c)?u.push(c.then(m=>(a[p]=m,n.currentContext=h,this.checkTensorForDisposal(p,d.node,a,n,s,i,o),this.processChildNodes(d.node,t,n,a,r,l),m))):(a[p]=c,this.checkTensorForDisposal(p,d.node,a,n,s,i,o),this.processChildNodes(d.node,t,n,a,r,l))}else this.processChildNodes(d.node,t,n,a,r,l)}return u}processChildNodes(e,t,n,a,r,s){e.children.forEach(i=>{let[o]=Ir(i.name,n);r[o]||!s.has(i.name)||(i.op==="Merge"?i.inputNames.some(l=>!!kn(l,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})):i.inputNames.every(l=>!!kn(l,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{let n=e[t],[a]=Kn(t),r=this.graph.nodes[a];if(r.attrParams.shape&&r.attrParams.shape.value){let s=r.attrParams.shape.value,i=s.length===n.shape.length&&n.shape.every((o,l)=>s[l]===-1||s[l]===o);k.assert(i,()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${s}], but was [${n.shape}]`)}r.attrParams.dtype&&r.attrParams.dtype.value&&k.assert(n.dtype===r.attrParams.dtype.value,()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){let t={};for(let n in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[n]!=null){let a=this._signature.inputs[n];t[a.name]=e[n]}else t[n]=e[n];return t}checkInputs(e){let t=Object.keys(e).filter(n=>{let[a]=Kn(n);return this.graph.nodes[a]==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=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[t]!=null?this._signature.outputs[t].name:t,{})}checkOutputs(e){e.forEach(t=>{let[n]=Kn(t);if(!this.graph.nodes[n])throw new Error(`The output '${t}' is not found in the graph`)})}},Roe=class{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(let e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(let e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}},Moe="?tfjs-format=file",Foe="model.json",Fk=class{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",t==null&&(this.loadOptions={}),this.resourceManager=new Roe}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}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=En.browserHTTPRequest(e,this.loadOptions);else{let t=En.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(En.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]}}async 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.");let e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,n;this.artifacts.userDefinedMetadata!=null&&this.artifacts.userDefinedMetadata.signature!=null?n=this.artifacts.userDefinedMetadata.signature:n=this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let a=En.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new r2(wk.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(a),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let r=wk.Instance.transformGraph(e.modelInitializer);this.initializer=new r2(r),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if(typeof e=="string"){let n=En.getSaveHandlers(e);if(n.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(n.length>1)throw new Error(`Found more than one (${n.length}) save handlers for URL '${e}'`);e=n[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)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Be)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((t,n,a)=>(t[n]=e[a],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}};async function ct(e,t={}){if(e==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");t==null&&(t={}),t.fromTFHub&&e.load==null&&(e.endsWith("/")||(e=e+"/"),e=`${e}${Foe}${Moe}`);let n=new Fk(e,t);return await n.load(),n}var $oe="3.7.0",$k={};Fe($k,{CSVDataset:()=>Hk,Dataset:()=>ou,FileDataSource:()=>Jk,TextLineDataset:()=>Vk,URLDataSource:()=>Qk,array:()=>nle,csv:()=>hle,func:()=>fle,generator:()=>mle,microphone:()=>yle,version_data:()=>Ale,webcam:()=>gle,zip:()=>ale});var Doe=gs(T5()),Ooe=gs(T5());function zoe(e,t){return _0(e,t)}function _0(e,t,n=new Map,a=new Set){if(e==null)return null;if(a.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse)if(iu(e)){let s=Array.isArray(e)?[]:{};a.add(e);for(let i in e){let o=e[i],l=_0(o,t,n,a);s[i]=l}return a.delete(e),s}else throw new Error(`Can't recurse into non-iterable type: ${e}`);else return n.set(e,r.value),r.value}function _oe(e,t=Ok){return Dk(e,t)}function Dk(e,t,n=new Set){let a=e[0];if(n.has(a))throw new Error("Circular references are not supported.");let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse)if(iu(a)){let s=Array.isArray(a)?[]:{};n.add(a);for(let i in a){let o=e.map(u=>u[i]),l=Dk(o,t,n);s[i]=l}return n.delete(a),s}else throw new Error(`Can't recurse into non-iterable type: ${a}`);else return r.value}function Ok(e){return e===null?null:iu(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function zk(e,t){let n=new Map;_0(e,t,n);for(let a of Array.from(n.keys())){let r=n.get(a);if(k.isPromise(r)){let s=await r;n.set(a,s)}}return _0(e,t,n)}function iu(e){return e!=null&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||typeof e=="object"&&!(e instanceof Be))}function Poe(e){return e==null||Loe(e)||Array.isArray(e)||typeof e=="object"&&e instanceof Be||k.isTypedArray(e)}function Loe(e){return e===null||typeof e!="object"&&typeof e!="function"}function Woe(e){return zoe(e,Boe)}function Boe(e){return e instanceof Be?{value:e.clone(),recurse:!1}:iu(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var _k=class{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,e==null)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return this.length()===0}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(let t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);let e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}},s2=class extends _k{constructor(){super(s2.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){let e=this.capacity*2,t=new Array(e),n=this.length();for(let a=0;at===!0)}rowMajorBatch(e,t=!0){return new Koe(this,e,t)}columnMajorBatch(e,t=!0,n=Ok){return this.rowMajorBatch(e,t).map(a=>_oe(a,n))}concatenate(e,t){return new Wk(Pk([this,e]),t)}take(e){return e<0||e==null?this:new Xoe(this,e)}skip(e){return e<0||e==null?this:new qoe(this,e)}prefetch(e){return new Bk(this,e)}shuffle(e,t){return new tle(this,e,t)}serial(){return new Goe(this)}},Uoe=class extends Qt{constructor(e){super();this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};let e=this.items[this.trav];return this.trav++,{value:Woe(e),done:!1}}},Hoe=class extends Qt{constructor(e){super();this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}},Goe=class extends Qt{constructor(e){super();this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}},qoe=class extends Qt{constructor(e,t){super();this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}},Koe=class extends Qt{constructor(e,t,n=!0){super();this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){let e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}},Zoe=class extends Qt{constructor(e,t){super();this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){let e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;he(e.value)}}},Yoe=class extends Qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Sa.getTensorsInContainer(e.value),n=this.transform(e.value),a=Sa.getTensorsInContainer(n);for(let r of t)Sa.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},Joe=class extends Qt{constructor(e,t){super();this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}},Lk=class extends Qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Sa.getTensorsInContainer(e.value),n=await this.transform(e.value),a=Sa.getTensorsInContainer(n);for(let r of t)Sa.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},o2=class extends Qt{constructor(){super();this.outputQueue=new s2,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.outputQueue.length()===0;)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}},Qoe=class extends o2{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){let e=await this.upstream.next();if(e.done)return!1;let t=Sa.getTensorsInContainer(e.value),n=this.transform(e.value),a=Sa.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(let r of t)Sa.isTensorInList(r,a)||r.dispose();return!0}},Wk=class extends Qt{constructor(e,t){super();this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,this.iterator==null){let n=await this.moreIterators.next();if(n.done)return{value:null,done:!0};this.iterator=n.value,this.baseErrorHandler!=null&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}let t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}},os;(function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"})(os||(os={}));var ele=class extends Qt{constructor(e,t=os.FAIL){super();this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;function a(s){return s instanceof Qt?{value:s.next().then(i=>(t++,i.done&&n++,i.value)),recurse:!1}:{value:null,recurse:!0}}let r=await zk(this.iterators,a);if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case os.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case os.SHORTEST:return{value:null,done:!0};case os.LONGEST:default:}return this.count++,{value:r,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}},Bk=class extends Qt{constructor(e,t){super();this.upstream=e,this.bufferSize=t,this.buffer=new _k(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){let e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}},tle=class extends Bk{constructor(e,t,n){super(e,t);this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Ooe.alea(n||k.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){let e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(t.done)this.upstreamExhausted=!0;else return this.refill(),t}return{value:null,done:!0}}},ou=class{constructor(){this.size=null}batch(e,t=!0){let n=this;k.assert(e>0,()=>`batchSize needs to be positive, but it is + ${e}`);let a;return this.size===Infinity||this.size==null?a=this.size:t?a=Math.ceil(this.size/e):a=Math.floor(this.size/e),Zn(async()=>(await n.iterator()).columnMajorBatch(e,t,rle),a)}concatenate(e){let t=this,n;return this.size===Infinity||e.size===Infinity?n=Infinity:this.size!=null&&e.size!=null?n=this.size+e.size:n=null,Zn(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){let t=this,n;return this.size===Infinity?n=Infinity:n=null,Zn(async()=>(await t.iterator()).filter(a=>V(()=>e(a))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){let t=this;return Zn(async()=>(await t.iterator()).map(n=>V(()=>e(n))),this.size)}mapAsync(e){let t=this;return Zn(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");let t=this;return Zn(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){let t=this,n;return this.size!=null&&e>0?n=this.size*e:e===0?n=0:this.size!=null&&(e===void 0||e<0)?n=Infinity:n=null,Zn(async()=>{let a=i2(async()=>({value:await t.iterator(),done:!1}));return Voe(a.take(e))},n)}skip(e){let t=this,n;return this.size!=null&&e>=0&&this.size>=e?n=this.size-e:this.size!=null&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);let a=this,r=Doe.alea(t||k.now().toString());return Zn(async()=>{let s=r.int32();return n&&(s+=r.int32()),(await a.iterator()).shuffle(e,s.toString())},this.size)}take(e){let t=this,n;return this.size!=null&&this.size>e?n=e:this.size!=null&&this.size<=e?n=this.size:n=null,Zn(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}};ou.MAX_BUFFER_SIZE=1e4;function Zn(e,t=null){return new class extends ou{constructor(){super(...arguments);this.size=t}async iterator(){return e()}}}function nle(e){return Zn(async()=>Pk(e),e.length)}function ale(e){if(!iu(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n{let n=await zk(e,a=>{if(a instanceof ou)return{value:a.iterator(),recurse:!1};if(iu(a))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")});return joe(n,os.SHORTEST)},t)}function rle(e){if(e===null)return null;let t=e[0];return Poe(t)?{value:sle(e),recurse:!1}:{value:null,recurse:!0}}function sle(e){if(e.length===0)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Be?gn(e):ln(e)}var Vk=class extends ou{constructor(e){super();this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split(` +`).map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}},P0='"',up=Symbol("out"),jk=Symbol("field"),L0=Symbol("quote"),l2=Symbol("quoteafterquote"),Uk=Symbol("quoteinquote"),Hk=class extends ou{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new Vk(e),t||(t={}),this.hasHeader=t.hasHeader!==!1,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(k.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){let e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&k.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);let t=this.fullColumnNames.reduce((a,r)=>(a[r]=a[r]+1||1,a),{}),n=Object.keys(t).filter(a=>t[a]>1);if(k.assert(n.length===0,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs){for(let a of Object.keys(this.columnConfigs))if(this.fullColumnNames.indexOf(a)===-1)throw new Error('The key "'+a+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){let e=await(await this.base.iterator()).next();if(e.done)throw new Error("No data was found for CSV parsing.");let t=e.value;return this.parseRow(t,!1)}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){let t=this.parseRow(e),n={},a={};for(let r=0;r14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=e.includeSpectrogram!==!1,this.includeWaveform=e.includeWaveform===!0,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(te().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");let t=new Gk(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:this.audioTrackConstraints==null?!0:this.audioTrackConstraints,video:!1})}catch(n){throw new Error(`Error thrown while initializing video stream: ${n.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");let e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,!this.sampleRateHz)this.sampleRateHz=this.audioContext.sampleRate;else if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`);let t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=this.fftSize*2,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t,n=await this.getAudioData();if(this.includeSpectrogram){let a=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(a,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){let a=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(a,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){let e=[],t=[],n=0;return new Promise(a=>{let r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-Infinity&&a({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),a({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),this.stream!=null&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){let t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((a,r)=>n.set(a,r*t)),n}getTensorFromAudioDataArray(e,t){let n=new Float32Array(k.sizeFromShape(t));return n.set(e,n.length-e.length),ln(n,t)}},qk=class extends Qt{constructor(e,t){super();if(this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=Dt([0],"int32"),this.webcamConfig.centerCrop){let n=this.webcamConfig.resizeWidth*1/this.webcamVideoElement.width,a=this.webcamConfig.resizeHeight*1/this.webcamVideoElement.height,r=(1-n)/2,s=(1-a)/2,i=r+n,o=a+s;this.cropBox=Ta([s,r,o,i],[1,4])}else this.cropBox=Ta([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(te().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}let n=new qk(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&k.assert(this.webcamConfig.facingMode==="user"||this.webcamConfig.facingMode==="environment",()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=oa.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(this.resize)try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{e.dispose()}else return{value:e,done:!1}}needToResize(){return!!(this.webcamConfig.resizeWidth&&this.webcamConfig.resizeHeight&&(this.webcamVideoElement.width!==this.webcamConfig.resizeWidth||this.webcamVideoElement.height!==this.webcamConfig.resizeHeight))}cropAndResizeFrame(e){return V(()=>{let t=mn(ge(e,"float32"),0),n;n=De.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");let a=n.shape;return q(n,a.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}},Xk=class{},Kk=class extends Qt{split(e){return new ile(this,e)}},ile=class extends Kk{constructor(e,t){super();this.upstream=e,this.impl=new ole(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},ole=class extends o2{constructor(e,t){super();this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){let e=await this.upstream.next();if(e.done)return this.carryover===""?!1:(this.outputQueue.push(this.carryover),this.carryover="",!0);let t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(let n of t.slice(0,-1))this.outputQueue.push(n);return this.carryover=t[t.length-1],!0}},lle=class extends Qt{decodeUTF8(){return new ule(this)}},ule=class extends Kk{constructor(e){super();this.upstream=e,this.impl=new dle(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},dle=class extends o2{constructor(e){super();if(this.upstream=e,te().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{let{StringDecoder:t}=gS();this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){let e=await this.upstream.next(),t;if(e.done)return!1;t=e.value;let n;return te().get("IS_BROWSER")?n=this.decoder.decode(t,{stream:!0}):n=this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0}},Zk=class extends lle{constructor(e,t={}){super();this.file=e,this.options=t,k.assert(e instanceof Uint8Array||(te().get("IS_BROWSER")?e instanceof File||e instanceof Blob:!1),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1024*1024}summary(){return`FileChunks ${this.file}`}async next(){return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?{value:null,done:!0}:{value:await new Promise((e,t)=>{let n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{let a=new FileReader;a.onload=s=>{let i=a.result;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),!(i instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(i)},a.onabort=s=>t(new Error("Aborted")),a.onerror=s=>t(new Error(s.type));let r=this.file.slice(this.offset,n);a.readAsArrayBuffer(r)}this.offset=n}),done:!1}}};async function ple(e,t={}){let n,a;typeof e=="string"?n=e:(n=e.url,a=cle(e));let r=await k.fetch(n,a);if(r.ok){let s=new Uint8Array(await r.arrayBuffer());return new Zk(s,t)}else throw new Error(r.statusText)}var cle=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});function Yk(e){return typeof e=="string"&&e.substr(0,7)==="file://"}var Jk=class extends Xk{constructor(e,t={}){super();this.input=e,this.options=t}async iterator(){if(Yk(this.input)&&te().get("IS_NODE")){let e=co("fs");this.input=e.readFileSync(this.input.substr(7))}return new Zk(this.input,this.options)}},Qk=class extends Xk{constructor(e,t={}){super();this.url=e,this.fileOptions=t}async iterator(){return Yk(this.url)?new Jk(this.url,this.fileOptions).iterator():ple(this.url,this.fileOptions)}};function hle(e,t={}){return new Hk(new Qk(e),t)}function fle(e){let t=i2(e);return Zn(async()=>t)}function mle(e){return Zn(async()=>{let t=await e();return i2(()=>t.next())})}async function gle(e,t){return qk.create(e,t)}async function yle(e){return Gk.create(e)}var Ale="3.7.0",xle={tfjs:(_m==null?void 0:_m.version)||void 0,"tfjs-core":(Pm==null?void 0:Pm.version)||void 0,"tfjs-data":(Lm==null?void 0:Lm.version)||void 0,"tfjs-layers":(Wm==null?void 0:Wm.version)||void 0,"tfjs-converter":(Bm==null?void 0:Bm.version)||void 0,"tfjs-backend-cpu":X7||void 0,"tfjs-backend-webgl":yw||void 0,"tfjs-backend-wasm":u4||void 0};var Yn={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function e9(){if(!I1(Yn.name)){de("backend registration:",Yn.name);try{Yn.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Yn.width,Yn.height):document.createElement("canvas")}catch(e){de("error: cannot create canvas:",e);return}try{Yn.gl=Yn.canvas.getContext("webgl2",Yn.webGLattr)}catch(e){de("error: cannot get WebGL2 context:",e);return}try{Oh(2,Yn.gl)}catch(e){de("error: cannot set WebGL2 context:",e);return}try{let e=new Vh(Yn.gl);Il(Yn.name,()=>new Kl(e),Yn.priority)}catch(e){de("error: cannot register WebGL backend:",e);return}try{yl("webgl").forEach(t=>{let n={...t,backendName:Yn.name};gi(n)})}catch(e){de("error: cannot update WebGL backend registration:",e);return}try{sa.set("WEBGL_VERSION",2)}catch(e){de("error: cannot set WebGL backend flags:",e);return}de("backend registered:",Yn.name)}}function t9(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:a}}function pp(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function lu(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function uu(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return De.cropAndResize(t,s,[0],n)}function W0(e,t=1.5){let n=lu(e),a=pp(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function B0(e){let t=lu(e),n=pp(e),r=Math.max(...n)/2,s=[Math.round(t[0]-r),Math.round(t[1]-r)],i=[Math.round(t[0]+r),Math.round(t[1]+r)];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function u2(e){let t=e.map(s=>s[0]),n=e.map(s=>s[1]),a=[Math.min(...t),Math.min(...n)],r=[Math.max(...t),Math.max(...n)];return{startPoint:a,endPoint:r,landmarks:e}}var n9=e=>({startPoint:Re(e,[0,0],[-1,2]),endPoint:Re(e,[0,2],[-1,2])});var V0=[[1,0,0],[0,1,0],[0,0,1]];function ble(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function d2(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return ble(n)}function a9(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function ls(e,t){let n=0;for(let a=0;a{let u=De.resizeBilinear(t,[this.inputSize,this.inputSize]).div(127.5).sub(.5),d=this.model.execute(u),p;if(Array.isArray(d)){let f=d.sort((x,v)=>x.size-v.size),g=lt([f[0],f[2]],2),y=lt([f[1],f[3]],2);p=lt([y,g],1).squeeze(0)}else p=Vt(d);let c=wle(p,this.anchors,[this.inputSize,this.inputSize]),h=Re(p,[0,0],[-1,1]),m=Rn(h).squeeze().dataSync();return[p,c,m]}),s=await De.nonMaxSuppressionAsync(a,r,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),i=s.arraySync();s.dispose();let o=[];for(let l=0;lthis.config.face.detector.minConfidence){let d=Re(a,[i[l],0],[1,-1]),p=n9(d);d.dispose();let c=this.anchorsData[i[l]],h=V(()=>Re(n,[i[l],l9-1],[1,-1]).squeeze().reshape([l9,-1]));o.push({box:p,landmarks:h,anchor:c,confidence:u})}}return n.dispose(),a.dispose(),{boxes:o,scaleFactor:[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]}}};async function d9(e){let t=await ct(ft(e.modelBasePath,e.face.detector.modelPath),{fromTFHub:e.face.detector.modelPath.includes("tfhub.dev")}),n=new u9(t,e);return!t||!t.modelUrl?de("load model failed:",e.face.detector.modelPath):e.debug&&de("load model:",t.modelUrl),n}var rr={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},p2=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],cp=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],Zi=[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,130,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,116,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];var kle=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],Ile=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],Sle=[33,133,362,263,1,78,308],fue=kle.map(e=>cp[e]),mue=Ile.map(e=>cp[e]),gue=Sle.map(e=>cp[e]);var c2=rr.leftEyeLower0,h2=rr.rightEyeLower0,du={leftBounds:[c2[0],c2[c2.length-1]],rightBounds:[h2[0],h2[h2.length-1]]},U0={count:468,mouth:13,symmetryLine:[13,rr.midwayBetweenEyes[0]]},p9={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},pu={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function H0(e,t,n,a){for(let r=0;r[s[0]/this.meshSize*(p[0]-this.meshSize/2),s[1]/this.meshSize*(p[1]-this.meshSize/2),p[2]]),o=a!==0?j0(a,[0,0]):V0,l=a!==0?i.map(p=>[...i9(p,o),p[2]]):i,u=a!==0?s9(r):V0,d=[...lu({startPoint:n.startPoint,endPoint:n.endPoint}),1];return l.map(p=>[Math.round(p[0]+ls(d,u[0])),Math.round(p[1]+ls(d,u[1])),Math.round(p[2])])}getLeftToRightEyeDepthDifference(t){let n=t[du.leftBounds[0]][2],a=t[du.rightBounds[0]][2];return n-a}getEyeBox(t,n,a,r,s=!1){let i=B0(W0(u2([t[a],t[r]]),this.irisEnlarge)),o=pp(i),l=De.cropAndResize(n,[[i.startPoint[1]/this.meshSize,i.startPoint[0]/this.meshSize,i.endPoint[1]/this.meshSize,i.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return s&&sa.flags.IS_BROWSER&&(l=De.flipLeftRight(l)),{box:i,boxSize:o,crop:l}}getEyeCoords(t,n,a,r=!1){let s=[];for(let i=0;i{let u=i;return l===2?u=r:l===4&&(u=s),[o[0],o[1],u]})}async predict(t,n){let a=!1,r;if((this.skipped===0||this.skipped>n.face.detector.skipFrames||!n.face.mesh.enabled||!n.skipFrame)&&(r=await this.boundingBoxDetector.getBoundingBoxes(t),this.skipped=0),n.skipFrame&&this.skipped++,!n.skipFrame||r&&r.boxes&&(!n.face.mesh.enabled||r.boxes.length!==this.detectedFaces&&this.detectedFaces!==n.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let i of r.boxes)this.storedBoxes.push({startPoint:i.box.startPoint.dataSync(),endPoint:i.box.endPoint.dataSync(),landmarks:i.landmarks.arraySync(),confidence:i.confidence});this.storedBoxes.length>0&&(a=!0)}if(a){if(!r||!r.boxes||r.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let i=0;i{i.box.startPoint.dispose(),i.box.endPoint.dispose(),i.landmarks.dispose()});let s=V(()=>this.storedBoxes.map((i,o)=>{let l,u=0,d;if(n.face.detector.rotation&&n.face.mesh.enabled&&sa.flags.IS_BROWSER){let[x,v]=i.landmarks.length>=U0.count?U0.symmetryLine:p9.symmetryLine;u=d2(i.landmarks[x],i.landmarks[v]);let b=lu({startPoint:i.startPoint,endPoint:i.endPoint}),w=[b[0]/t.shape[2],b[1]/t.shape[1]],N=De.rotateWithOffset(t,u,0,w);d=j0(-u,b),n.face.mesh.enabled?l=uu({startPoint:i.startPoint,endPoint:i.endPoint},N,[this.meshSize,this.meshSize]).div(255):l=uu({startPoint:i.startPoint,endPoint:i.endPoint},N,[this.boxSize,this.boxSize]).div(255)}else{d=V0;let x=t.clone();n.face.mesh.enabled?l=uu({startPoint:i.startPoint,endPoint:i.endPoint},x,[this.meshSize,this.meshSize]).div(255):l=uu({startPoint:i.startPoint,endPoint:i.endPoint},x,[this.boxSize,this.boxSize]).div(255)}if(!n.face.mesh.enabled)return{mesh:[],box:i,faceConfidence:null,boxConfidence:i.confidence,confidence:i.confidence,image:l};let[,p,c]=this.meshDetector.execute(l),h=p.dataSync()[0];if(h=U0.count?U0.symmetryLine:p9.symmetryLine;u=d2(i.landmarks[x],i.landmarks[v]);let b=lu({startPoint:i.startPoint,endPoint:i.endPoint}),w=[b[0]/t.shape[2],b[1]/t.shape[1]],N=De.rotateWithOffset(t.toFloat(),u,0,w);d=j0(-u,b),l=uu({startPoint:i.startPoint,endPoint:i.endPoint},N,[this.meshSize,this.meshSize]).div(255)}let A={mesh:g,box:i,faceConfidence:h,boxConfidence:i.confidence,image:l};return this.storedBoxes[o]={...B0(i),confidence:i.confidence,faceConfidence:h},A}));return n.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(i=>i.confidence>n.face.detector.minConfidence)),this.detectedFaces=s.length,s}};var Rt=[null,null,null],m2;async function c9(e,t){let n=await m2.predict(e,t),a=[],r=0;for(let s of n||[]){if(!s||s.isDisposedInternal)continue;let i=s.mesh.map(d=>[d[0]/(e.shape[2]||0),d[1]/(e.shape[1]||0),d[2]/m2.meshSize]),o={};if(s.mesh&&s.mesh.length>0)for(let d of Object.keys(rr))o[d]=rr[d].map(p=>s.mesh[p]);let l=s.box?[Math.trunc(Math.max(0,s.box.startPoint[0])),Math.trunc(Math.max(0,s.box.startPoint[1])),Math.trunc(Math.min(e.shape[2]||0,s.box.endPoint[0])-Math.max(0,s.box.startPoint[0])),Math.trunc(Math.min(e.shape[1]||0,s.box.endPoint[1])-Math.max(0,s.box.startPoint[1]))]:[0,0,0,0],u=s.box?[s.box.startPoint[0]/(e.shape[2]||0),s.box.startPoint[1]/(e.shape[1]||0),(s.box.endPoint[0]-s.box.startPoint[0])/(e.shape[2]||0),(s.box.endPoint[1]-s.box.startPoint[1])/(e.shape[1]||0)]:[0,0,0,0];a.push({id:r++,score:Math.round(100*s.faceConfidence||100*s.boxConfidence||0)/100,boxScore:Math.round(100*s.boxConfidence)/100,faceScore:Math.round(100*s.faceConfidence)/100,box:l,boxRaw:u,mesh:s.mesh,meshRaw:i,annotations:o,image:s.image,tensor:s.image}),s.coords&&s.coords.dispose()}return a}async function g2(e){return!Rt[0]&&e.face.enabled||!Rt[1]&&e.face.mesh.enabled||!Rt[2]&&e.face.iris.enabled?(Rt=await Promise.all([!Rt[0]&&e.face.enabled?d9(e):null,!Rt[1]&&e.face.mesh.enabled?ct(ft(e.modelBasePath,e.face.mesh.modelPath),{fromTFHub:e.face.mesh.modelPath.includes("tfhub.dev")}):null,!Rt[2]&&e.face.iris.enabled?ct(ft(e.modelBasePath,e.face.iris.modelPath),{fromTFHub:e.face.iris.modelPath.includes("tfhub.dev")}):null]),e.face.mesh.enabled&&(!Rt[1]||!Rt[1].modelUrl?de("load model failed:",e.face.mesh.modelPath):e.debug&&de("load model:",Rt[1].modelUrl)),e.face.iris.enabled&&(!Rt[2]||!Rt[2].modelUrl?de("load model failed:",e.face.iris.modelPath):e.debug&&de("load model:",Rt[2].modelUrl))):e.debug&&(Rt[0]&&de("cached model:",Rt[0].model.modelUrl),Rt[1]&&de("cached model:",Rt[1].modelUrl),Rt[2]&&de("cached model:",Rt[2].modelUrl)),m2=new f2(Rt[0],Rt[1],Rt[2]),Rt}var h9=Zi,f9=cp;var Nle=["angry","disgust","fear","happy","sad","surprise","neutral"],Pa,G0=[],m9=0,y2=Number.MAX_SAFE_INTEGER,A2=[.2989,.587,.114];async function x2(e){return Pa?e.debug&&de("cached model:",Pa.modelUrl):(Pa=await ct(ft(e.modelBasePath,e.face.emotion.modelPath)),!Pa||!Pa.modelUrl?de("load model failed:",e.face.emotion.modelPath):e.debug&&de("load model:",Pa.modelUrl)),Pa}async function b2(e,t,n,a){return Pa?y20?(y2++,G0[n]):(y2=0,new Promise(async r=>{let s=De.resizeBilinear(e,[Pa.inputs[0].shape[2],Pa.inputs[0].shape[1]],!1),[i,o,l]=Zt(s,3,3);s.dispose();let u=B(i,A2[0]),d=B(o,A2[1]),p=B(l,A2[2]);i.dispose(),o.dispose(),l.dispose();let c=jc([u,d,p]);u.dispose(),d.dispose(),p.dispose();let h=V(()=>c.sub(.5).mul(2));c.dispose();let m=[];if(t.face.emotion.enabled){let f=await Pa.predict(h),g=f.dataSync();he(f);for(let y=0;yt.face.emotion.minConfidence&&m.push({score:Math.min(.99,Math.trunc(100*g[y])/100),emotion:Nle[y]});m.sort((y,A)=>A.score-y.score)}h.dispose(),G0[n]=m,m9=a,r(m)})):null}var La,q0=[],g9=0,v2=Number.MAX_SAFE_INTEGER;async function w2(e){let t=ft(e.modelBasePath,e.face.description.modelPath);return La?e.debug&&de("cached model:",t):(La=await ct(t),La?e.debug&&de("load model:",t):de("load model failed:",e.face.description.modelPath)),La}function k2(e,t,n=2){if(!e||!t||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return 0;let a=5*e.map((s,i)=>Math.abs(e[i]-t[i])**n).reduce((s,i)=>s+i,0)**(1/n);return Math.max(0,100-a)/100}function y9(e,t,n=0){let a={similarity:0,name:"",source:"",embedding:[]};if(!e||!t||!Array.isArray(e)||!Array.isArray(t))return a;for(let r of t)if(r.embedding&&r.name){let s=k2(e,r.embedding);s>n&&s>a.similarity&&(a={...r,similarity:s})}return a}function I2(e){return V(()=>{let n=e.image||e.tensor||e;if(!(n instanceof Be))return null;let a=[[.05,.15,.85,.85]];return La.inputs[0].shape?(n.shape.length===3?De.cropAndResize(mn(n,0),a,[0],[La.inputs[0].shape[2],La.inputs[0].shape[1]]):De.cropAndResize(n,a,[0],[La.inputs[0].shape[2],La.inputs[0].shape[1]])).mul(255):null})}async function S2(e,t,n,a){var r,s;return La?v20?(v2++,q0[n]):(v2=0,new Promise(async i=>{let o=I2(e),l,u={age:0,gender:"unknown",genderScore:0,descriptor:[]};t.face.description.enabled&&(l=await La.predict(o)),he(o),l&&(V(()=>{let d=l.find(f=>f.shape[1]===1).dataSync(),p=Math.trunc(200*Math.abs(d[0]-.5))/100;p>t.face.description.minConfidence&&(u.gender=d[0]<=.5?"female":"male",u.genderScore=Math.min(.99,p));let c=l.find(f=>f.shape[1]===100).argMax(1).dataSync()[0],h=l.find(f=>f.shape[1]===100).dataSync();u.age=Math.round(h[c-1]>h[c+1]?10*c-100*h[c-1]:10*c+100*h[c+1])/10;let m=l.find(f=>f.shape[1]===1024);u.descriptor=[...m.dataSync()]}),l.forEach(d=>he(d))),q0[n]=u,g9=a,i(u)})):null}var Tle=e=>{let t=(p,c)=>Math.atan2(p[1]-c[1],p[0]-c[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],a=1,r=e.mesh[33][2]>e.mesh[263][2],s=r?e.mesh[473]:e.mesh[468],i=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],o=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(i[0]-s[0])/o[0]-n[0],a*(s[1]-i[1])/o[1]-n[1]],u=Math.sqrt(l[0]**2+l[1]**2);return u=Math.min(u,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:u}},Cle=(e,t)=>{let n=g=>{let y=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]);return g[0]/=y,g[1]/=y,g[2]/=y,g},a=(g,y)=>{let A=g[0]-y[0],x=g[1]-y[1],v=g[2]-y[2];return[A,x,v]},r=(g,y)=>{let A=g[1]*y[2]-g[2]*y[1],x=g[2]*y[0]-g[0]*y[2],v=g[0]*y[1]-g[1]*y[0];return[A,x,v]},s=g=>{let[y,A,x,v,b,w,N,C,E]=g,_,$,S;return v<1?v>-1?(S=Math.asin(v),$=Math.atan2(-N,y),_=Math.atan2(-w,b)):(S=-Math.PI/2,$=-Math.atan2(C,E),_=0):(S=Math.PI/2,$=Math.atan2(C,E),_=0),{pitch:2*-_,yaw:2*-$,roll:2*-S}},i=g=>{let y=(x,v,b,w)=>Math.atan2(w-v,b-x);return{pitch:y(g[10][1],g[10][2],g[152][1],g[152][2]),yaw:y(g[33][0],g[33][2],g[263][0],g[263][2]),roll:y(g[33][0],g[33][1],g[263][0],g[263][1])}},o=e.meshRaw;if(!o||o.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let l=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,u=[o[10],o[152],o[234],o[454]].map(g=>[g[0]*t[0]/l,g[1]*t[1]/l,g[2]]),d=n(a(u[1],u[0])),p=n(a(u[3],u[2])),c=n(r(p,d));p=r(d,c);let h=[p[0],p[1],p[2],d[0],d[1],d[2],c[0],c[1],c[2]],m=s(h),f=o.length===478?Tle(e):{bearing:0,strength:0};return{angle:m,matrix:h,gaze:f}},N2=async(e,t)=>{var d,p,c,h,m,f;let n,a,r,s,i,o,l=[];e.state="run:face",n=Ke();let u=await c9(t,e.config);if(e.performance.face=Math.trunc(Ke()-n),!t.shape||t.shape.length!==4)return[];if(!u)return[];for(let g=0;g(e[t]=n,e),{}),Ele=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Rle=Ele.map(([e,t])=>[fp[e],fp[t]]),x9=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function b9(e){let t=e.reduce(({maxX:n,maxY:a,minX:r,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(n,i),maxY:Math.max(a,o),minX:Math.min(r,i),minY:Math.min(s,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function v9(e,[t,n],[a,r]){let s=t/a,i=n/r,o=(u,d)=>({id:d,score:u.score,boxRaw:[u.box[0]/r,u.box[1]/a,u.box[2]/r,u.box[3]/a],box:[Math.trunc(u.box[0]*i),Math.trunc(u.box[1]*s),Math.trunc(u.box[2]*i),Math.trunc(u.box[3]*s)],keypoints:u.keypoints.map(({score:p,part:c,position:h})=>({score:p,part:c,position:[Math.trunc(h.x*i),Math.trunc(h.y*s)],positionRaw:[h.x/a,h.y/a]}))});return e.map((u,d)=>o(u,d))}var T2=class{constructor(t,n){this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function w9(e,t,n,a){let r=n-e,s=a-t;return r*r+s*s}function M2(e,t){return{x:e.x+t.x,y:e.y+t.y}}var X0=1,cu=16,Mle=50**2;function k9(e,t,n,a,r,s,i=2){let o=y=>({y:s.get(y.y,y.x,e),x:s.get(y.y,y.x,s.shape[2]/2+e)}),l=(y,A,x)=>({y:R2(Math.round(y.y/cu),0,A-1),x:R2(Math.round(y.x/cu),0,x-1)}),[u,d]=a.shape,p=l(t.position,u,d),c=o(p),m=M2(t.position,c);for(let y=0;y[fp[c],fp[h]]),i=s.map(([,c])=>c),o=s.map(([c])=>c),l=t.shape[2],u=i.length,d=new Array(l),p=E2(e.part,cu,n);d[e.part.id]={score:e.score,part:hp[e.part.id],position:p};for(let c=u-1;c>=0;--c){let h=i[c],m=o[c];d[h]&&!d[m]&&(d[m]=k9(c,d[h],m,t,n,r))}for(let c=0;ct){o=!1;break}if(!o)break}return o}function Dle(e,t){let[n,a,r]=t.shape,s=new T2(n*a*r,({score:i})=>i);for(let i=0;i{var i;let s=(i=r[a])==null?void 0:i.position;return s?w9(n,t,s.y,s.x)<=Mle:!1})}function Ole(e,t){return t.reduce((a,{position:r,score:s},i)=>(I9(e,r,i)||(a+=s),a),0)/t.length}function S9(e,t,n,a,r,s){let i=[],o=Dle(s,t);for(;i.lengthh.score>s);let p=Ole(i,d),c=b9(d);p>s&&i.push({keypoints:d,box:c,score:Math.round(100*p)/100})}return i}var Jn,zle=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function F2(e,t){let n=V(()=>{if(!Jn.inputs[0].shape)return[];let o=De.resizeBilinear(e,[Jn.inputs[0].shape[2],Jn.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),u=Jn.execute(o,zle).map(d=>Vt(d,[0]));return u[1]=u[1].sigmoid(),u}),a=await Promise.all(n.map(i=>i.buffer()));for(let i of n)i.dispose();let r=await S9(a[0],a[1],a[2],a[3],t.body.maxDetected,t.body.minConfidence);return Jn.inputs[0].shape?v9(r,[e.shape[1],e.shape[2]],[Jn.inputs[0].shape[2],Jn.inputs[0].shape[1]]):[]}async function $2(e){return Jn?e.debug&&de("cached model:",Jn.modelUrl):(Jn=await ct(ft(e.modelBasePath,e.body.modelPath)),!Jn||!Jn.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",Jn.modelUrl)),Jn}function K0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function mp(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function N9(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return De.cropAndResize(t,s,[0],n)}function T9(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],r=e.palmLandmarks.map(s=>[s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:a,palmLandmarks:r,confidence:e.confidence}}function Z0(e,t=1.5){let n=mp(e),a=K0(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function Y0(e){let t=mp(e),n=K0(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}var C9=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var D2=class{constructor(t){var n;this.model=t,this.anchors=C9.map(a=>[a.x,a.y]),this.anchorsTensor=Ta(this.anchors),this.inputSize=(n=this.model)==null?void 0:n.inputs[0].shape[2],this.inputSizeTensor=Dt([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=Dt([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){return V(()=>{let n=Re(t,[0,0],[-1,2]),a=Re(t,[0,2],[-1,2]),r=ie(me(n,this.inputSizeTensor),this.anchorsTensor),s=me(a,this.doubleInputSizeTensor),i=B(ye(r,s),this.inputSizeTensor),o=B(ie(r,s),this.inputSizeTensor);return Tl([i,o],1)})}normalizeLandmarks(t,n){return V(()=>{let a=ie(me(t.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[n]);return B(a,this.inputSizeTensor)})}async getBoxes(t,n){let a=this.model.predict(t),r=Vt(a);a.dispose();let s=V(()=>Rn(Re(r,[0,0],[-1,1])).squeeze()),i=s.dataSync(),o=Re(r,[0,1],[-1,4]),l=this.normalizeBoxes(o);o.dispose();let u=await De.nonMaxSuppressionAsync(l,i,n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence),d=u.arraySync();s.dispose(),u.dispose();let p=[];for(let c of d)if(i[c]>=n.hand.minConfidence){let h=Re(l,[c,0],[1,-1]),m=Re(r,[c,5],[1,14]),f=V(()=>this.normalizeLandmarks(m,c).reshape([-1,2]));m.dispose(),p.push({box:h,palmLandmarks:f,confidence:i[c]})}return r.dispose(),l.dispose(),p}async estimateHandBounds(t,n){let a=t.shape[1],r=t.shape[2],s=V(()=>t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),i=await this.getBoxes(s,n);s.dispose();let o=[];if(!i||i.length===0)return o;for(let l of i){let u=l.box.dataSync(),d=u.slice(0,2),p=u.slice(2,4),c=l.palmLandmarks.arraySync();l.box.dispose(),l.palmLandmarks.dispose(),o.push(T9({startPoint:d,endPoint:p,palmLandmarks:c,confidence:l.confidence},[r/this.inputSize,a/this.inputSize]))}return o}};function _le(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function E9(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return _le(n)}var R9=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function us(e,t){let n=0;for(let a=0;ai[0]),a=t.map(i=>i[1]),r=[Math.min(...n),Math.min(...a)],s=[Math.max(...n),Math.max(...a)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let a=t.map(s=>z2([...s,1],n)),r=this.calculateLandmarksBoundingBox(a);return Z0(Y0(r),Lle)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),a=Z0(Y0(n),$9);a.palmLandmarks=[];for(let r=0;r[i[0]*(h[0]-this.inputSize/2),i[1]*(h[1]-this.inputSize/2),i[2]*h[2]]),l=O2(a,[0,0]),u=o.map(h=>[...z2(h,l),h[2]]),d=F9(r),p=[...mp(n),1],c=[us(p,d[0]),us(p,d[1])];return u.map(h=>[Math.trunc(h[0]+c[0]),Math.trunc(h[1]+c[1]),Math.trunc(h[2])])}async estimateHands(t,n){let a=!1,r;(this.skipped===0||this.skipped>n.hand.skipFrames||!n.hand.landmarks||!n.skipFrame)&&(r=await this.handDetector.estimateHandBounds(t,n),this.skipped=0),n.skipFrame&&this.skipped++,r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(a=!0));let s=[];for(let i=0;i=n.hand.minConfidence){let x=q(y,[-1,3]),v=x.arraySync();y.dispose(),x.dispose();let b=this.transformRawCoords(v,h,l,c),w=this.getBoxForHandLandmarks(b);this.storedBoxes[i]={...w,confidence:A};let N={landmarks:b,confidence:A,box:{topLeft:w.startPoint,bottomRight:w.endPoint}};s.push(N)}else this.storedBoxes[i]=null;y.dispose()}else{let l=Z0(Y0(o),$9),u={confidence:o.confidence,box:{topLeft:l.startPoint,bottomRight:l.endPoint}};s.push(u)}}return this.storedBoxes=this.storedBoxes.filter(i=>i!==null),this.detectedHands=s.length,s}};var O9={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},ds,ps,z9;async function P2(e,t){let n=await z9.estimateHands(e,t);if(!n)return[];let a=[];for(let r=0;rn[r].landmarks[d]);let i=n[r].landmarks,o=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(i&&i.length>0){for(let u of i)u[0]o[2]&&(o[2]=u[0]),u[1]>o[3]&&(o[3]=u[1]);o[2]-=o[0],o[3]-=o[1],l=[o[0]/(e.shape[2]||0),o[1]/(e.shape[1]||0),o[2]/(e.shape[2]||0),o[3]/(e.shape[1]||0)]}else o=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];a.push({id:r,score:Math.round(100*n[r].confidence)/100,box:o,boxRaw:l,keypoints:i,annotations:s})}return a}async function L2(e){!ds||!ps?([ds,ps]=await Promise.all([e.hand.enabled?ct(ft(e.modelBasePath,e.hand.detector.modelPath),{fromTFHub:e.hand.detector.modelPath.includes("tfhub.dev")}):null,e.hand.landmarks?ct(ft(e.modelBasePath,e.hand.skeleton.modelPath),{fromTFHub:e.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),e.hand.enabled&&(!ds||!ds.modelUrl?de("load model failed:",e.hand.detector.modelPath):e.debug&&de("load model:",ds.modelUrl),!ps||!ps.modelUrl?de("load model failed:",e.hand.skeleton.modelPath):e.debug&&de("load model:",ps.modelUrl))):(e.debug&&de("cached model:",ds.modelUrl),e.debug&&de("cached model:",ps.modelUrl));let t=new D2(ds);return z9=new _2(t,ps),[ds,ps]}var _9=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],P9=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var zn;async function J0(e){return zn?e.debug&&de("cached model:",zn.modelUrl):(zn=await ct(ft(e.modelBasePath,e.body.modelPath)),zn.width=parseInt(zn.signature.inputs["input_1:0"].tensorShape.dim[2].size),zn.height=parseInt(zn.signature.inputs["input_1:0"].tensorShape.dim[1].size),!zn||!zn.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",zn.modelUrl)),zn}async function W2(e,t){var f;if(!zn)return[];if(!t.body.enabled)return[];let n={width:e.shape[2]||0,height:e.shape[1]||0},a=De.resizeBilinear(e,[zn.width,zn.height],!1),r=me(a,[255]);a.dispose();let s=await zn.predict(r),i=((f=s.find(g=>g.size===195||g.size===155))==null?void 0:f.dataSync())||[];s.forEach(g=>g.dispose()),r.dispose();let o=[],l=(i==null?void 0:i.length)===195?_9:P9,u=5;for(let g=0;gg.position[0]),p=o.map(g=>g.position[1]),c=[Math.min(...d),Math.min(...p),Math.max(...d)-Math.min(...d),Math.max(...p)-Math.min(...d)],h=[0,0,0,0],m=o.reduce((g,y)=>y.score>g?y.score:g,0);return[{id:0,score:m,box:c,boxRaw:h,keypoints:o}]}var _n,sr=[],B2=[0,0,0,0],V2=[0,0,0,0],Q0=0,j2=Number.MAX_SAFE_INTEGER,Vle=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","pelvis","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"];async function L9(e){return _n?e.debug&&de("cached model:",_n.modelUrl):(_n=await ct(ft(e.modelBasePath,e.body.modelPath)),!_n||!_n.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",_n.modelUrl)),_n}function jle(e,t){let[n,a]=e.shape;return V(()=>{let r=(o,l)=>ye(o,B(me(o,ke(l,"int32")),ke(l,"int32"))),s=q(e,[a*n]),i=Vn(s,0).dataSync()[0];if(i>t){let o=ki(s,0),l=r(o,n).dataSync()[0],u=me(o,ke(n,"int32")).dataSync()[0];return[l,u,i]}return[0,0,i]})}async function U2(e,t){return j20?(j2++,[{id:0,score:Q0,box:B2,boxRaw:V2,keypoints:sr}]):(j2=0,new Promise(async n=>{let a=V(()=>{if(!_n.inputs[0].shape)return null;let u=De.resizeBilinear(e,[_n.inputs[0].shape[2],_n.inputs[0].shape[1]],!1);return B(u,2).sub(1)}),r;if(t.body.enabled&&(r=await _n.predict(a)),a.dispose(),r){sr.length=0;let u=r.squeeze();he(r);let d=u.unstack(2);he(u);for(let p=0;pt.body.minConfidence&&sr.push({score:Math.round(100*m)/100,part:Vle[p],positionRaw:[c/_n.inputs[0].shape[2],h/_n.inputs[0].shape[1]],position:[Math.round(e.shape[2]*c/_n.inputs[0].shape[2]),Math.round(e.shape[1]*h/_n.inputs[0].shape[1])]})}d.forEach(p=>he(p))}Q0=sr.reduce((u,d)=>d.score>u?d.score:u,0);let s=sr.map(u=>u.position[0]),i=sr.map(u=>u.position[1]);B2=[Math.min(...s),Math.min(...i),Math.max(...s)-Math.min(...s),Math.max(...i)-Math.min(...i)];let o=sr.map(u=>u.positionRaw[0]),l=sr.map(u=>u.positionRaw[1]);V2=[Math.min(...o),Math.min(...l),Math.max(...o)-Math.min(...o),Math.max(...l)-Math.min(...l)],n([{id:0,score:Q0,box:B2,boxRaw:V2,keypoints:sr}])}))}var Wa,ir=[],H2=[0,0,0,0],G2=[0,0,0,0],hu=0,q2=Number.MAX_SAFE_INTEGER,Ule=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"];async function X2(e){return Wa?e.debug&&de("cached model:",Wa.modelUrl):(Wa=await ct(ft(e.modelBasePath,e.body.modelPath)),!Wa||!Wa.modelUrl?de("load model failed:",e.body.modelPath):e.debug&&de("load model:",Wa.modelUrl)),Wa}async function K2(e,t){return q20?(q2++,[{id:0,score:hu,box:H2,boxRaw:G2,keypoints:ir}]):(q2=0,new Promise(async n=>{let a=V(()=>{if(!Wa.inputs[0].shape)return null;let u=De.resizeBilinear(e,[Wa.inputs[0].shape[2],Wa.inputs[0].shape[1]],!1);return ge(u,"int32")}),r;if(t.body.enabled&&(r=await Wa.predict(a)),a.dispose(),r){ir.length=0;let u=r.arraySync();he(r);let d=u[0][0];for(let p=0;pt.body.minConfidence&&ir.push({score:Math.round(100*hu)/100,part:Ule[p],positionRaw:[d[p][1],d[p][0]],position:[Math.round((e.shape[2]||0)*d[p][1]),Math.round((e.shape[1]||0)*d[p][0])]})}hu=ir.reduce((u,d)=>d.score>u?d.score:u,0);let s=ir.map(u=>u.position[0]),i=ir.map(u=>u.position[1]);H2=[Math.min(...s),Math.min(...i),Math.max(...s)-Math.min(...s),Math.max(...i)-Math.min(...i)];let o=ir.map(u=>u.positionRaw[0]),l=ir.map(u=>u.positionRaw[1]);G2=[Math.min(...o),Math.min(...l),Math.max(...o)-Math.min(...o),Math.max(...l)-Math.min(...l)],n([{id:0,score:hu,box:H2,boxRaw:G2,keypoints:ir}])}))}var fu=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var Qn,Z2=[],Y2=Number.MAX_SAFE_INTEGER,ef=2.5;async function J2(e){if(Qn)e.debug&&de("cached model:",Qn.modelUrl);else{Qn=await ct(ft(e.modelBasePath,e.object.modelPath));let t=Object.values(Qn.modelSignature.inputs);if(Qn.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Qn.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!Qn||!Qn.modelUrl?de("load model failed:",e.object.modelPath):e.debug&&de("load model:",Qn.modelUrl)}return Qn}async function Hle(e,t,n,a){let r=0,s=[];for(let u of[1,2,4])V(()=>{var g,y;let d=u*13,p=(g=e.find(A=>A.shape[1]===d**2&&A.shape[2]===fu.length))==null?void 0:g.squeeze(),c=(y=e.find(A=>A.shape[1]===d**2&&A.shape[2]a.object.minConfidence&&x!==61){let b=(.5+Math.trunc(A%d))/d,w=(.5+Math.trunc(A/d))/d,N=m[A].map(W=>W*(d/u/t)),[C,E]=[b-ef/u*N[0],w-ef/u*N[1]],[_,$]=[b+ef/u*N[2]-C,w+ef/u*N[3]-E],S=[C,E,_,$];S=S.map(W=>Math.max(0,Math.min(W,1)));let z=[S[0]*n[0],S[1]*n[1],S[2]*n[0],S[3]*n[1]],O={id:r++,score:Math.round(100*v)/100,class:x+1,label:fu[x].label,box:z.map(W=>Math.trunc(W)),boxRaw:S};s.push(O)}}});e.forEach(u=>he(u));let i=s.map(u=>[u.boxRaw[1],u.boxRaw[0],u.boxRaw[3],u.boxRaw[2]]),o=s.map(u=>u.score),l=[];if(i&&i.length>0){let u=await De.nonMaxSuppressionAsync(i,o,a.object.maxDetected,a.object.iouThreshold,a.object.minConfidence);l=u.dataSync(),he(u)}return s=s.filter((u,d)=>l.includes(d)).sort((u,d)=>d.score-u.score),s}async function Q2(e,t){return Y20?(Y2++,Z2):(Y2=0,new Promise(async n=>{let a=[e.shape[2],e.shape[1]],r=De.resizeBilinear(e,[Qn.inputSize,Qn.inputSize],!1),s=r.div(255),i=s.transpose([0,3,1,2]);s.dispose(),r.dispose();let o;t.object.enabled&&(o=await Qn.predict(i)),i.dispose();let l=await Hle(o,Qn.inputSize,a,t);Z2=l,n(l)}))}var ea,e5=[],t5=Number.MAX_SAFE_INTEGER;async function n5(e){if(ea)e.debug&&de("cached model:",ea.modelUrl);else{ea=await ct(ft(e.modelBasePath,e.object.modelPath));let t=Object.values(ea.modelSignature.inputs);if(ea.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!ea.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!ea||!ea.modelUrl?de("load model failed:",e.object.modelPath):e.debug&&de("load model:",ea.modelUrl)}return ea}async function Gle(e,t,n,a){if(!e)return[];let r=[],s=e.arraySync(),i=Vt(e);e.dispose();let o=Zt(i,6,1);i.dispose();let u=gn([o[1],o[0],o[3],o[2]],1).squeeze(),d=o[4].squeeze(),p=o[5].squeeze();o.forEach(f=>f.dispose());let c=await De.nonMaxSuppressionAsync(u,d,a.object.maxDetected,a.object.iouThreshold,a.object.minConfidence);u.dispose(),d.dispose(),p.dispose();let h=c.dataSync();c.dispose();let m=0;for(let f of h){let g=Math.trunc(100*s[0][f][4])/100,y=s[0][f][5],A=fu[y].label,x=[s[0][f][0]/t,s[0][f][1]/t,s[0][f][2]/t,s[0][f][3]/t],v=[Math.trunc(x[0]*n[0]),Math.trunc(x[1]*n[1]),Math.trunc(x[2]*n[0]),Math.trunc(x[3]*n[1])];r.push({id:m++,score:g,class:y,label:A,box:v,boxRaw:x})}return r}async function a5(e,t){return t50?(t5++,e5):(t5=0,new Promise(async n=>{let a=[e.shape[2],e.shape[1]],r=De.resizeBilinear(e,[ea.inputSize,ea.inputSize]),s=t.object.enabled?ea.execute(r,["tower_0/detections"]):null;r.dispose();let i=await Gle(s,ea.inputSize,a,t);e5=i,n(i)}))}var W9=e=>{if(!e)return[];let t=[];for(let n=0;nl.part==="leftWrist"),r=e[n].keypoints.find(l=>l.part==="rightWrist"),s=e[n].keypoints.find(l=>l.part==="nose");s&&a&&r&&a.position.yl.part==="leftShoulder"),o=e[n].keypoints.find(l=>l.part==="rightShoulder");i&&o&&t.push({body:n,gesture:`leaning ${i.position.y>o.position.y?"left":"right"}`})}return t},B9=e=>{if(!e)return[];let t=[];for(let n=0;n0){let a=e[n].mesh[33][2]-e[n].mesh[263][2];Math.abs(a)<10?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${a<0?"left":"right"}`}),Math.abs(e[n].mesh[374][1]-e[n].mesh[386][1])/Math.abs(e[n].mesh[443][1]-e[n].mesh[450][1])<.2&&t.push({face:n,gesture:"blink left eye"}),Math.abs(e[n].mesh[145][1]-e[n].mesh[159][1])/Math.abs(e[n].mesh[223][1]-e[n].mesh[230][1])<.2&&t.push({face:n,gesture:"blink right eye"});let i=Math.min(100,500*Math.abs(e[n].mesh[13][1]-e[n].mesh[14][1])/Math.abs(e[n].mesh[10][1]-e[n].mesh[152][1]));i>10&&t.push({face:n,gesture:`mouth ${Math.trunc(i)}% open`});let o=e[n].mesh[152][2];Math.abs(o)>10&&t.push({face:n,gesture:`head ${o<0?"up":"down"}`})}return t},V9=e=>{if(!e)return[];let t=[];for(let n=0;n.06||p>.06)&&(u=!1),c>.06&&t.push({iris:n,gesture:"looking right"}),p>.06&&t.push({iris:n,gesture:"looking left"});let h=Math.abs(e[n].mesh[145][1]-e[n].annotations.rightEyeIris[0][1])/e[n].box[3],m=Math.abs(e[n].mesh[374][1]-e[n].annotations.leftEyeIris[0][1])/e[n].box[3];(m<.01||h<.01||m>.022||h>.022)&&(u=!1),(m<.01||h<.01)&&t.push({iris:n,gesture:"looking down"}),(m>.022||h>.022)&&t.push({iris:n,gesture:"looking up"}),u&&t.push({iris:n,gesture:"looking center"})}return t},j9=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=a.reduce((i,o)=>i.position[2]i.position[1](u[c]=0,p))},r=function(o,l){let u=e.createShader(l);if(e.shaderSource(u,o),e.compileShader(u),!e.getShaderParameter(u,e.COMPILE_STATUS))throw new Error("Filter: GL compile failed",e.getShaderInfoLog(u));return u};this.uniform={},this.attribute={};let s=r(t,e.VERTEX_SHADER),i=r(n,e.FRAGMENT_SHADER);if(this.id=e.createProgram(),e.attachShader(this.id,s),e.attachShader(this.id,i),e.linkProgram(this.id),!e.getProgramParameter(this.id,e.LINK_STATUS))throw new Error("Filter: GL link failed",e.getProgramInfoLog(this.id));e.useProgram(this.id),a(t,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=e.getAttribLocation(this.id,o);a(t,"uniform",this.uniform),a(n,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=e.getUniformLocation(this.id,o)}function U9(e){e||(e={});let t=0,n=null,a=!1,r=-1,s=[null,null],i=[],o=-1,l=-1,u=null,d=null,p={},c=e.canvas||document.createElement("canvas"),h={},m={INTERMEDIATE:1},f=c.getContext("webgl");if(!f)throw new Error("Filter: getContext() failed");this.addFilter=function(b){let w=Array.prototype.slice.call(arguments,1),N=p[b];i.push({func:N,args:w})},this.reset=function(){i=[]};let g=function(b,w){if(!(b===o&&w===l)){if(c.width=b,o=b,c.height=w,l=w,!u){let N=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);u=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,u),f.bufferData(f.ARRAY_BUFFER,N,f.STATIC_DRAW),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}f.viewport(0,0,o,l),s=[null,null]}},y=function(b,w){let N=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,N);let C=f.createRenderbuffer();f.bindRenderbuffer(f.RENDERBUFFER,C);let E=f.createTexture();return f.bindTexture(f.TEXTURE_2D,E),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,b,w,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,E,0),f.bindTexture(f.TEXTURE_2D,null),f.bindFramebuffer(f.FRAMEBUFFER,null),{fbo:N,texture:E}},A=function(b){return s[b]=s[b]||y(o,l),s[b]},x=function(b=null){var E,_;let w=null,N=null,C=!1;t===0?w=n:w=(E=A(r))==null?void 0:E.texture,t++,a&&!(b&m.INTERMEDIATE)?(N=null,C=t%2==0):(r=(r+1)%2,N=(_=A(r))==null?void 0:_.fbo),f.bindTexture(f.TEXTURE_2D,w),f.bindFramebuffer(f.FRAMEBUFFER,N),f.uniform1f(d.uniform.flipY,C?-1:1),f.drawArrays(f.TRIANGLES,0,6)};this.apply=function(b){if(g(b.width,b.height),t=0,n||(n=f.createTexture()),f.bindTexture(f.TEXTURE_2D,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b),i.length===0)return x(),c;for(let w=0;w0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!r||!s)return{tensor:null,canvas:Ee};let i=r,o=s;if(i>tf&&(i=tf,o=i*s/r),o>tf&&(o=tf,i=o*r/s),t.filter.width>0?i=t.filter.width:t.filter.height>0&&(i=r*(t.filter.height/s)),t.filter.height>0?o=t.filter.height:t.filter.width>0&&(o=s*(t.filter.width/r)),!i||!o)throw new Error("Human: Input cannot determine dimension");(!Ee||(Ee==null?void 0:Ee.width)!==i||(Ee==null?void 0:Ee.height)!==o)&&(Ee=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas"),(Ee==null?void 0:Ee.width)!==i&&(Ee.width=i),(Ee==null?void 0:Ee.height)!==o&&(Ee.height=o));let u=Ee.getContext("2d");if(e instanceof ImageData?u.putImageData(e,0,0):t.filter.flip&&typeof u.translate!="undefined"?(u.translate(r,0),u.scale(-1,1),u.drawImage(e,0,0,r,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),u.setTransform(1,0,0,1,0,0)):u.drawImage(e,0,0,r,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),t.filter.enabled){if((!_t||!wt||Ee.width!==wt.width||(Ee==null?void 0:Ee.height)!==(wt==null?void 0:wt.height))&&(wt=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height):document.createElement("canvas"),(wt==null?void 0:wt.width)!==(Ee==null?void 0:Ee.width)&&(wt.width=Ee==null?void 0:Ee.width),(wt==null?void 0:wt.height)!==(Ee==null?void 0:Ee.height)&&(wt.height=Ee==null?void 0:Ee.height),_t=sa.flags.IS_BROWSER?new j9({canvas:wt}):null),!_t)return{tensor:null,canvas:Ee};_t.reset(),_t.addFilter("brightness",t.filter.brightness),t.filter.contrast!==0&&_t.addFilter("contrast",t.filter.contrast),t.filter.sharpness!==0&&_t.addFilter("sharpen",t.filter.sharpness),t.filter.blur!==0&&_t.addFilter("blur",t.filter.blur),t.filter.saturation!==0&&_t.addFilter("saturation",t.filter.saturation),t.filter.hue!==0&&_t.addFilter("hue",t.filter.hue),t.filter.negative&&_t.addFilter("negative"),t.filter.sepia&&_t.addFilter("sepia"),t.filter.vintage&&_t.addFilter("brownie"),t.filter.sepia&&_t.addFilter("sepia"),t.filter.kodachrome&&_t.addFilter("kodachrome"),t.filter.technicolor&&_t.addFilter("technicolor"),t.filter.polaroid&&_t.addFilter("polaroid"),t.filter.pixelate!==0&&_t.addFilter("pixelate",t.filter.pixelate),_t.apply(Ee)}else wt=Ee,_t&&(_t=null);let l;if(wt.data){let d=[wt.height,wt.width,3];l=Lc(wt.data,d,"int32")}else if(wt instanceof ImageData)l=oa?oa.fromPixels(wt):null;else if(t.backend==="webgl"||t.backend==="humangl"){let d=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");d.width=i,d.height=o;let p=d.getContext("2d");p==null||p.drawImage(wt,0,0),l=oa?oa.fromPixels(d):null}else{let d=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");d.width=i,d.height=o;let p=d.getContext("2d");p==null||p.drawImage(wt,0,0);let c=p==null?void 0:p.getImageData(0,0,i,o);l=oa?oa.fromPixels(c):null}if(l){let d=l.toFloat();n=d.expandDims(0),l.dispose(),d.dispose()}}let a=t.filter.return?wt:null;return{tensor:n,canvas:a}}var i5={};b5(i5,{all:()=>Kle,body:()=>G9,canvas:()=>Xle,face:()=>H9,gesture:()=>U9,hand:()=>q9,object:()=>X9,options:()=>cs,person:()=>qle});var cs={color:"rgba(173, 216, 230, 0.6)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 14px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!0,drawPolygons:!0,drawGaze:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!0},nf=e=>Math.round(e*180/Math.PI);function r5(e,t,n,a=0,r){e.fillStyle=r.useDepth&&a?`rgba(${127.5+2*a}, ${127.5-2*a}, 255, 0.3)`:r.color,e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function gp(e,t,n,a,r,s){if(e.beginPath(),s.useCurves){let i=(t+t+a)/2,o=(n+n+r)/2;e.ellipse(i,o,a/2,r/2,0,0,2*Math.PI)}else e.lineWidth=s.lineWidth,e.moveTo(t+s.roundRect,n),e.lineTo(t+a-s.roundRect,n),e.quadraticCurveTo(t+a,n,t+a,n+s.roundRect),e.lineTo(t+a,n+r-s.roundRect),e.quadraticCurveTo(t+a,n+r,t+a-s.roundRect,n+r),e.lineTo(t+s.roundRect,n+r),e.quadraticCurveTo(t,n+r,t,n+r-s.roundRect),e.lineTo(t,n+s.roundRect),e.quadraticCurveTo(t,n,t+s.roundRect,n),e.closePath();e.stroke()}function s5(e,t=[],n){if(!(t===void 0||t.length===0)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let a of t){let r=a[2]||0;e.strokeStyle=n.useDepth&&r?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&r?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.lineTo(a[0],Math.round(a[1]))}e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function yp(e,t=[],n){if(!(t===void 0||t.length===0)){if(!n.useCurves||t.length<=2){s5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let a=0;a1&&u[1].length>0){let l=o[1]>0?`#${o[1]}`:"",d=`${o[0]} ${l}: ${u[1]}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(d,8,2+s*a.lineHeight)),r.fillStyle=a.labelColor,r.fillText(d,6,0+s*a.lineHeight),s+=1}}}async function H9(e,t,n){var s,i,o,u;let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r)for(let l of t){r.font=a.font,r.strokeStyle=a.color,r.fillStyle=a.color,a.drawBoxes&&gp(r,l.box[0],l.box[1],l.box[2],l.box[3],a);let d=[];if(d.push(`face: ${Math.trunc(100*l.score)}%`),l.genderScore&&d.push(`${l.gender||""} ${Math.trunc(100*l.genderScore)}%`),l.age&&d.push(`age: ${l.age||""}`),l.iris&&d.push(`distance: ${l.iris}`),l.emotion&&l.emotion.length>0){let p=l.emotion.map(c=>`${Math.trunc(100*c.score)}% ${c.emotion}`);p.length>3&&(p.length=3),d.push(p.join(" "))}l.rotation&&l.rotation.angle&&l.rotation.gaze&&(l.rotation.angle.roll&&d.push(`roll: ${nf(l.rotation.angle.roll)}\xB0 yaw:${nf(l.rotation.angle.yaw)}\xB0 pitch:${nf(l.rotation.angle.pitch)}\xB0`),l.rotation.gaze.bearing&&d.push(`gaze: ${nf(l.rotation.gaze.bearing)}\xB0`)),d.length===0&&d.push("face"),r.fillStyle=a.color;for(let p=d.length-1;p>=0;p--){let c=Math.max(l.box[0],0),h=p*a.lineHeight+l.box[1];a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(d[p],c+5,h+16)),r.fillStyle=a.labelColor,r.fillText(d[p],c+4,h+15)}if(r.lineWidth=1,l.mesh&&l.mesh.length>0){if(a.drawPoints)for(let p of l.mesh)r5(r,p[0],p[1],p[2],a);if(a.drawPolygons){r.lineWidth=1;for(let p=0;pl.mesh[h]);s5(r,c,a)}if(l.annotations&&l.annotations.leftEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let p=Math.abs(l.annotations.leftEyeIris[3][0]-l.annotations.leftEyeIris[1][0])/2,c=Math.abs(l.annotations.leftEyeIris[4][1]-l.annotations.leftEyeIris[2][1])/2;r.ellipse(l.annotations.leftEyeIris[0][0],l.annotations.leftEyeIris[0][1],p,c,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}if(l.annotations&&l.annotations.rightEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let p=Math.abs(l.annotations.rightEyeIris[3][0]-l.annotations.rightEyeIris[1][0])/2,c=Math.abs(l.annotations.rightEyeIris[4][1]-l.annotations.rightEyeIris[2][1])/2;r.ellipse(l.annotations.rightEyeIris[0][0],l.annotations.rightEyeIris[0][1],p,c,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}if(a.drawGaze&&((i=(s=l.rotation)==null?void 0:s.gaze)==null?void 0:i.strength)&&((u=(o=l.rotation)==null?void 0:o.gaze)==null?void 0:u.bearing)&&l.annotations.leftEyeIris&&l.annotations.rightEyeIris&&l.annotations.leftEyeIris[0]&&l.annotations.rightEyeIris[0]){r.strokeStyle="pink",r.beginPath();let p=[l.annotations.leftEyeIris[0][0]+Math.sin(l.rotation.gaze.bearing)*l.rotation.gaze.strength*l.box[3],l.annotations.leftEyeIris[0][1]+Math.cos(l.rotation.gaze.bearing)*l.rotation.gaze.strength*l.box[2]];r.moveTo(l.annotations.leftEyeIris[0][0],l.annotations.leftEyeIris[0][1]),r.lineTo(p[0],p[1]);let c=[l.annotations.rightEyeIris[0][0]+Math.sin(l.rotation.gaze.bearing)*l.rotation.gaze.strength*l.box[3],l.annotations.rightEyeIris[0][1]+Math.cos(l.rotation.gaze.bearing)*l.rotation.gaze.strength*l.box[2]];r.moveTo(l.annotations.rightEyeIris[0][0],l.annotations.rightEyeIris[0][1]),r.lineTo(c[0],c[1]),r.stroke()}}}}}async function G9(e,t,n){var s;let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round";for(let i=0;il.part==="leftShoulder"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightShoulder"),o&&u.push([o.position[0],o.position[1]]),yp(r,u,a),u.length=0,o=t[i].keypoints.find(l=>l.part==="rightShoulder"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightHip"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftHip"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftShoulder"),o&&u.push([o.position[0],o.position[1]]),u.length===4&&s5(r,u,a),u.length=0,o=t[i].keypoints.find(l=>l.part==="leftHip"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftKnee"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftAnkle"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftHeel"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftFoot"),o&&u.push([o.position[0],o.position[1]]),yp(r,u,a),u.length=0,o=t[i].keypoints.find(l=>l.part==="rightHip"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightKnee"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightAnkle"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightHeel"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightFoot"),o&&u.push([o.position[0],o.position[1]]),yp(r,u,a),u.length=0,o=t[i].keypoints.find(l=>l.part==="leftShoulder"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftElbow"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftWrist"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="leftPalm"),o&&u.push([o.position[0],o.position[1]]),yp(r,u,a),u.length=0,o=t[i].keypoints.find(l=>l.part==="rightShoulder"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightElbow"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightWrist"),o&&u.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(l=>l.part==="rightPalm"),o&&u.push([o.position[0],o.position[1]]),yp(r,u,a)}}}}async function q9(e,t,n){let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t){if(a.drawBoxes&&(r.strokeStyle=a.color,r.fillStyle=a.color,gp(r,s.box[0],s.box[1],s.box[2],s.box[3],a),a.drawLabels&&(a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText("hand",s.box[0]+3,1+s.box[1]+a.lineHeight,s.box[2])),r.fillStyle=a.labelColor,r.fillText("hand",s.box[0]+2,0+s.box[1]+a.lineHeight,s.box[2])),r.stroke()),a.drawPoints&&s.keypoints&&s.keypoints.length>0)for(let i of s.keypoints)r.fillStyle=a.useDepth?`rgba(${127.5+2*i[2]}, ${127.5-2*i[2]}, 255, 0.5)`:a.color,r5(r,i[0],i[1],0,a);if(a.drawLabels){let i=(o,u)=>{r.fillStyle=a.useDepth?`rgba(${127.5+2*o[o.length-1][2]}, ${127.5-2*o[o.length-1][2]}, 255, 0.5)`:a.color,r.fillText(u,o[o.length-1][0]+4,o[o.length-1][1]+4)};r.font=a.font,i(s.annotations.indexFinger,"index"),i(s.annotations.middleFinger,"middle"),i(s.annotations.ringFinger,"ring"),i(s.annotations.pinky,"pinky"),i(s.annotations.thumb,"thumb"),i(s.annotations.palmBase,"palm")}if(a.drawPolygons){let i=o=>{if(!!o)for(let u=0;u0?u-1:0][0],o[u>0?u-1:0][1]),r.lineTo(o[u][0],o[u][1]),r.stroke()};r.lineWidth=a.lineWidth,i(s.annotations.indexFinger),i(s.annotations.middleFinger),i(s.annotations.ringFinger),i(s.annotations.pinky),i(s.annotations.thumb)}}}}async function X9(e,t,n){let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t)if(a.drawBoxes){if(r.strokeStyle=a.color,r.fillStyle=a.color,gp(r,s.box[0],s.box[1],s.box[2],s.box[3],a),a.drawLabels){let i=`${Math.round(100*s.score)}% ${s.label}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(i,s.box[0]+3,1+s.box[1]+a.lineHeight,s.box[2])),r.fillStyle=a.labelColor,r.fillText(i,s.box[0]+2,0+s.box[1]+a.lineHeight,s.box[2])}r.stroke()}}}async function qle(e,t,n){let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s=0;sO.box[0]&&N.box[0]O.box[1]&&N.box[1]+N.box[3]C.body.box[0]&&O.box[0]+O.box[2]C.body.box[1]&&O.box[1]+O.box[3]C.body.box[0]&&O.box[1]+O.box[3]>C.body.box[1]&&O.box[1]+O.box[3]{O&&O.length===4&&(E.push(O[0],O[0]+O[2]),_.push(O[1],O[1]+O[3]))};$((y=C.face)==null?void 0:y.box),$((A=C.body)==null?void 0:A.box),$((v=(x=C.hands)==null?void 0:x.left)==null?void 0:v.box),$((w=(b=C.hands)==null?void 0:b.right)==null?void 0:w.box);let S=Math.min(...E),z=Math.min(..._);C.box=[S,z,Math.max(...E)-S,Math.max(..._)-z],r&&r.length===4&&(C.boxRaw=[C.box[0]/r[2],C.box[1]/r[1],C.box[2]/r[2],C.box[3]/r[1]]),i.push(C)}return i}var $e={face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0};function Z9(e){var r,s,i,o,u,l,d,p,c,h,m,f,g,y,A,x,v,b,w,N,C;let t=Date.now()-e.timestamp,n=t<1e3?8-Math.log(t):1;if($e.canvas=e.canvas,!$e.body||e.body.length!==$e.body.length)$e.body=JSON.parse(JSON.stringify(e.body));else for(let E=0;E((n-1)*$e.body[E].box[O]+z)/n),$=e.body[E].boxRaw.map((z,O)=>((n-1)*$e.body[E].boxRaw[O]+z)/n),S=e.body[E].keypoints.map((z,O)=>({score:z.score,part:z.part,position:[$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].position[0]+z.position[0])/n:z.position[0],$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].position[1]+z.position[1])/n:z.position[1]],positionRaw:[$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].positionRaw[0]+z.positionRaw[0])/n:z.position[0],$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].positionRaw[1]+z.positionRaw[1])/n:z.position[1]]}));$e.body[E]={...e.body[E],box:_,boxRaw:$,keypoints:S}}if(!$e.hand||e.hand.length!==$e.hand.length)$e.hand=JSON.parse(JSON.stringify(e.hand));else for(let E=0;E((n-1)*$e.hand[E].box[G]+W)/n),$=e.hand[E].boxRaw.map((W,G)=>((n-1)*$e.hand[E].boxRaw[G]+W)/n),S=e.hand[E].keypoints.map((W,G)=>W.map((H,J)=>((n-1)*$e.hand[E].keypoints[G][J]+H)/n)),z=Object.keys(e.hand[E].annotations),O={};for(let W of z)O[W]=e.hand[E].annotations[W].map((G,H)=>G.map((J,K)=>((n-1)*$e.hand[E].annotations[W][H][K]+J)/n));$e.hand[E]={...e.hand[E],box:_,boxRaw:$,keypoints:S,annotations:O}}if(!$e.face||e.face.length!==$e.face.length)$e.face=JSON.parse(JSON.stringify(e.face));else for(let E=0;E((n-1)*$e.face[E].box[O]+z)/n),$=e.face[E].boxRaw.map((z,O)=>((n-1)*$e.face[E].boxRaw[O]+z)/n),S={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};S.matrix=(r=e.face[E].rotation)==null?void 0:r.matrix,S.angle={roll:((n-1)*(((i=(s=$e.face[E].rotation)==null?void 0:s.angle)==null?void 0:i.roll)||0)+(((u=(o=e.face[E].rotation)==null?void 0:o.angle)==null?void 0:u.roll)||0))/n,yaw:((n-1)*(((d=(l=$e.face[E].rotation)==null?void 0:l.angle)==null?void 0:d.yaw)||0)+(((c=(p=e.face[E].rotation)==null?void 0:p.angle)==null?void 0:c.yaw)||0))/n,pitch:((n-1)*(((m=(h=$e.face[E].rotation)==null?void 0:h.angle)==null?void 0:m.pitch)||0)+(((g=(f=e.face[E].rotation)==null?void 0:f.angle)==null?void 0:g.pitch)||0))/n},S.gaze={bearing:((n-1)*(((A=(y=$e.face[E].rotation)==null?void 0:y.gaze)==null?void 0:A.bearing)||0)+(((v=(x=e.face[E].rotation)==null?void 0:x.gaze)==null?void 0:v.bearing)||0))/n,strength:((n-1)*(((w=(b=$e.face[E].rotation)==null?void 0:b.gaze)==null?void 0:w.strength)||0)+(((C=(N=e.face[E].rotation)==null?void 0:N.gaze)==null?void 0:C.strength)||0))/n},$e.face[E]={...e.face[E],rotation:S,box:_,boxRaw:$}}if(!$e.object||e.object.length!==$e.object.length)$e.object=JSON.parse(JSON.stringify(e.object));else for(let E=0;E((n-1)*$e.object[E].box[z]+S)/n),$=e.object[E].boxRaw.map((S,z)=>((n-1)*$e.object[E].boxRaw[z]+S)/n);$e.object[E]={...e.object[E],box:_,boxRaw:$}}let a=e.persons;if(!$e.persons||a.length!==$e.persons.length)$e.persons=JSON.parse(JSON.stringify(a));else for(let E=0;E((n-1)*$e.persons[E].box[$]+_)/n);return $e.gesture=e.gesture,$e.performance=e.performance,$e}var ha,o5=!1;async function af(e){return ha?e.debug&&de("cached model:",ha.modelUrl):(ha=await ct(ft(e.modelBasePath,e.segmentation.modelPath)),!ha||!ha.modelUrl?de("load model failed:",e.segmentation.modelPath):e.debug&&de("load model:",ha.modelUrl)),ha}async function Zle(e,t){var h,m,f,g;if(!t.segmentation.enabled||!e.tensor||!e.canvas||!ha||!ha.inputs[0].shape)return null;let n=De.resizeBilinear(e.tensor,[ha.inputs[0].shape[1],ha.inputs[0].shape[2]],!1),a=n.div(255),r=ha.predict(a);he(n),he(a);let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(e.canvas.width,e.canvas.height):document.createElement("canvas");s.width=e.canvas.width,s.height=e.canvas.height;let i=Vt(r,0),o;if(i.shape[2]===2){let y=i.softmax(),[A,x]=Gn(y,2),v=x.expandDims(2),b=v.expandDims(0);he(y),he(A),he(x);let w=De.cropAndResize(b,[[0,0,.5,.5]],[0],[(h=e.tensor)==null?void 0:h.shape[1],(m=e.tensor)==null?void 0:m.shape[2]]);o=w.squeeze(0),he(w),he(v),he(b)}else o=De.resizeBilinear(i,[(f=e.tensor)==null?void 0:f.shape[1],(g=e.tensor)==null?void 0:g.shape[2]]);oa&&await oa.toPixels(o,s),he(o),he(i),he(r);let u=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(e.canvas.width,e.canvas.height):document.createElement("canvas");u.width=e.canvas.width,u.height=e.canvas.height;let l=u.getContext("2d");l.filter="blur(8px",await l.drawImage(s,0,0);let d=l.getImageData(0,0,e.canvas.width,e.canvas.height).data,p=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(e.canvas.width,e.canvas.height):document.createElement("canvas");p.width=e.canvas.width,p.height=e.canvas.height;let c=p.getContext("2d");return await c.drawImage(e.canvas,0,0),c.globalCompositeOperation="darken",c.filter="blur(8px)",await c.drawImage(s,0,0),c.globalCompositeOperation="source-over",c.filter="none",e.canvas=p,d}async function Y9(e,t,n){var s;if(o5)return null;o5=!0,n.segmentation.enabled||(n.segmentation.enabled=!0),ha||await af(n);let a=fu(e,n),r=await Zle(a,n);if(he(a.tensor),t&&r){let i=fu(t,n),o=i.canvas;he(i.tensor);let u=a.canvas,l=(s=u.getContext("2d"))==null?void 0:s.getImageData(0,0,u.width,u.height).data,d=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(u.width,u.height):document.createElement("canvas");d.width=u.width,d.height=u.height;let p=d.getContext("2d");p.globalCompositeOperation="copy",p.drawImage(o,0,0,d.width,d.height);let c=p.getImageData(0,0,d.width,d.height);for(let h=0;h0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!r||!s)return{tensor:null,canvas:Ee};let i=r,o=s;if(i>tf&&(i=tf,o=i*s/r),o>tf&&(o=tf,i=o*r/s),t.filter.width>0?i=t.filter.width:t.filter.height>0&&(i=r*(t.filter.height/s)),t.filter.height>0?o=t.filter.height:t.filter.width>0&&(o=s*(t.filter.width/r)),!i||!o)throw new Error("Human: Input cannot determine dimension");(!Ee||(Ee==null?void 0:Ee.width)!==i||(Ee==null?void 0:Ee.height)!==o)&&(Ee=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas"),(Ee==null?void 0:Ee.width)!==i&&(Ee.width=i),(Ee==null?void 0:Ee.height)!==o&&(Ee.height=o));let l=Ee.getContext("2d");if(e instanceof ImageData?l.putImageData(e,0,0):t.filter.flip&&typeof l.translate!="undefined"?(l.translate(r,0),l.scale(-1,1),l.drawImage(e,0,0,r,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),l.setTransform(1,0,0,1,0,0)):l.drawImage(e,0,0,r,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),t.filter.enabled){if((!_t||!wt||Ee.width!==wt.width||(Ee==null?void 0:Ee.height)!==(wt==null?void 0:wt.height))&&(wt=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height):document.createElement("canvas"),(wt==null?void 0:wt.width)!==(Ee==null?void 0:Ee.width)&&(wt.width=Ee==null?void 0:Ee.width),(wt==null?void 0:wt.height)!==(Ee==null?void 0:Ee.height)&&(wt.height=Ee==null?void 0:Ee.height),_t=sa.flags.IS_BROWSER?new U9({canvas:wt}):null),!_t)return{tensor:null,canvas:Ee};_t.reset(),_t.addFilter("brightness",t.filter.brightness),t.filter.contrast!==0&&_t.addFilter("contrast",t.filter.contrast),t.filter.sharpness!==0&&_t.addFilter("sharpen",t.filter.sharpness),t.filter.blur!==0&&_t.addFilter("blur",t.filter.blur),t.filter.saturation!==0&&_t.addFilter("saturation",t.filter.saturation),t.filter.hue!==0&&_t.addFilter("hue",t.filter.hue),t.filter.negative&&_t.addFilter("negative"),t.filter.sepia&&_t.addFilter("sepia"),t.filter.vintage&&_t.addFilter("brownie"),t.filter.sepia&&_t.addFilter("sepia"),t.filter.kodachrome&&_t.addFilter("kodachrome"),t.filter.technicolor&&_t.addFilter("technicolor"),t.filter.polaroid&&_t.addFilter("polaroid"),t.filter.pixelate!==0&&_t.addFilter("pixelate",t.filter.pixelate),_t.apply(Ee)}else wt=Ee,_t&&(_t=null);let u;if(wt.data){let d=[wt.height,wt.width,3];u=Lc(wt.data,d,"int32")}else if(wt instanceof ImageData)u=oa?oa.fromPixels(wt):null;else if(t.backend==="webgl"||t.backend==="humangl"){let d=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");d.width=i,d.height=o;let p=d.getContext("2d");p==null||p.drawImage(wt,0,0),u=oa?oa.fromPixels(d):null}else{let d=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");d.width=i,d.height=o;let p=d.getContext("2d");p==null||p.drawImage(wt,0,0);let c=p==null?void 0:p.getImageData(0,0,i,o);u=oa?oa.fromPixels(c):null}if(u){let d=u.toFloat();n=d.expandDims(0),u.dispose(),d.dispose()}}let a=t.filter.return?wt:null;return{tensor:n,canvas:a}}var i5={};v5(i5,{all:()=>Zle,body:()=>q9,canvas:()=>Kle,face:()=>G9,gesture:()=>H9,hand:()=>X9,object:()=>K9,options:()=>cs,person:()=>Xle});var cs={color:"rgba(173, 216, 230, 0.6)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 14px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!0,drawPolygons:!0,drawGaze:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!0},nf=e=>Math.round(e*180/Math.PI);function r5(e,t,n,a=0,r){e.fillStyle=r.useDepth&&a?`rgba(${127.5+2*a}, ${127.5-2*a}, 255, 0.3)`:r.color,e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function gp(e,t,n,a,r,s){if(e.beginPath(),s.useCurves){let i=(t+t+a)/2,o=(n+n+r)/2;e.ellipse(i,o,a/2,r/2,0,0,2*Math.PI)}else e.lineWidth=s.lineWidth,e.moveTo(t+s.roundRect,n),e.lineTo(t+a-s.roundRect,n),e.quadraticCurveTo(t+a,n,t+a,n+s.roundRect),e.lineTo(t+a,n+r-s.roundRect),e.quadraticCurveTo(t+a,n+r,t+a-s.roundRect,n+r),e.lineTo(t+s.roundRect,n+r),e.quadraticCurveTo(t,n+r,t,n+r-s.roundRect),e.lineTo(t,n+s.roundRect),e.quadraticCurveTo(t,n,t+s.roundRect,n),e.closePath();e.stroke()}function s5(e,t=[],n){if(!(t===void 0||t.length===0)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let a of t){let r=a[2]||0;e.strokeStyle=n.useDepth&&r?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&r?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:n.color,e.lineTo(a[0],Math.round(a[1]))}e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function yp(e,t=[],n){if(!(t===void 0||t.length===0)){if(!n.useCurves||t.length<=2){s5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let a=0;a1&&l[1].length>0){let u=o[1]>0?`#${o[1]}`:"",d=`${o[0]} ${u}: ${l[1]}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(d,8,2+s*a.lineHeight)),r.fillStyle=a.labelColor,r.fillText(d,6,0+s*a.lineHeight),s+=1}}}async function G9(e,t,n){var s,i,o,l;let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r)for(let u of t){r.font=a.font,r.strokeStyle=a.color,r.fillStyle=a.color,a.drawBoxes&&gp(r,u.box[0],u.box[1],u.box[2],u.box[3],a);let d=[];if(d.push(`face: ${Math.trunc(100*u.score)}%`),u.genderScore&&d.push(`${u.gender||""} ${Math.trunc(100*u.genderScore)}%`),u.age&&d.push(`age: ${u.age||""}`),u.iris&&d.push(`distance: ${u.iris}`),u.emotion&&u.emotion.length>0){let p=u.emotion.map(c=>`${Math.trunc(100*c.score)}% ${c.emotion}`);p.length>3&&(p.length=3),d.push(p.join(" "))}u.rotation&&u.rotation.angle&&u.rotation.gaze&&(u.rotation.angle.roll&&d.push(`roll: ${nf(u.rotation.angle.roll)}\xB0 yaw:${nf(u.rotation.angle.yaw)}\xB0 pitch:${nf(u.rotation.angle.pitch)}\xB0`),u.rotation.gaze.bearing&&d.push(`gaze: ${nf(u.rotation.gaze.bearing)}\xB0`)),d.length===0&&d.push("face"),r.fillStyle=a.color;for(let p=d.length-1;p>=0;p--){let c=Math.max(u.box[0],0),h=p*a.lineHeight+u.box[1];a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(d[p],c+5,h+16)),r.fillStyle=a.labelColor,r.fillText(d[p],c+4,h+15)}if(r.lineWidth=1,u.mesh&&u.mesh.length>0){if(a.drawPoints)for(let p of u.mesh)r5(r,p[0],p[1],p[2],a);if(a.drawPolygons){r.lineWidth=1;for(let p=0;pu.mesh[h]);s5(r,c,a)}if(u.annotations&&u.annotations.leftEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let p=Math.abs(u.annotations.leftEyeIris[3][0]-u.annotations.leftEyeIris[1][0])/2,c=Math.abs(u.annotations.leftEyeIris[4][1]-u.annotations.leftEyeIris[2][1])/2;r.ellipse(u.annotations.leftEyeIris[0][0],u.annotations.leftEyeIris[0][1],p,c,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}if(u.annotations&&u.annotations.rightEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let p=Math.abs(u.annotations.rightEyeIris[3][0]-u.annotations.rightEyeIris[1][0])/2,c=Math.abs(u.annotations.rightEyeIris[4][1]-u.annotations.rightEyeIris[2][1])/2;r.ellipse(u.annotations.rightEyeIris[0][0],u.annotations.rightEyeIris[0][1],p,c,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}if(a.drawGaze&&((i=(s=u.rotation)==null?void 0:s.gaze)==null?void 0:i.strength)&&((l=(o=u.rotation)==null?void 0:o.gaze)==null?void 0:l.bearing)&&u.annotations.leftEyeIris&&u.annotations.rightEyeIris&&u.annotations.leftEyeIris[0]&&u.annotations.rightEyeIris[0]){r.strokeStyle="pink",r.beginPath();let p=[u.annotations.leftEyeIris[0][0]+Math.sin(u.rotation.gaze.bearing)*u.rotation.gaze.strength*u.box[3],u.annotations.leftEyeIris[0][1]+Math.cos(u.rotation.gaze.bearing)*u.rotation.gaze.strength*u.box[2]];r.moveTo(u.annotations.leftEyeIris[0][0],u.annotations.leftEyeIris[0][1]),r.lineTo(p[0],p[1]);let c=[u.annotations.rightEyeIris[0][0]+Math.sin(u.rotation.gaze.bearing)*u.rotation.gaze.strength*u.box[3],u.annotations.rightEyeIris[0][1]+Math.cos(u.rotation.gaze.bearing)*u.rotation.gaze.strength*u.box[2]];r.moveTo(u.annotations.rightEyeIris[0][0],u.annotations.rightEyeIris[0][1]),r.lineTo(c[0],c[1]),r.stroke()}}}}}async function q9(e,t,n){var s;let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round";for(let i=0;iu.part==="leftShoulder"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightShoulder"),o&&l.push([o.position[0],o.position[1]]),yp(r,l,a),l.length=0,o=t[i].keypoints.find(u=>u.part==="rightShoulder"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightHip"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftHip"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftShoulder"),o&&l.push([o.position[0],o.position[1]]),l.length===4&&s5(r,l,a),l.length=0,o=t[i].keypoints.find(u=>u.part==="leftHip"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftKnee"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftAnkle"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftHeel"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftFoot"),o&&l.push([o.position[0],o.position[1]]),yp(r,l,a),l.length=0,o=t[i].keypoints.find(u=>u.part==="rightHip"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightKnee"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightAnkle"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightHeel"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightFoot"),o&&l.push([o.position[0],o.position[1]]),yp(r,l,a),l.length=0,o=t[i].keypoints.find(u=>u.part==="leftShoulder"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftElbow"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftWrist"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="leftPalm"),o&&l.push([o.position[0],o.position[1]]),yp(r,l,a),l.length=0,o=t[i].keypoints.find(u=>u.part==="rightShoulder"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightElbow"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightWrist"),o&&l.push([o.position[0],o.position[1]]),o=t[i].keypoints.find(u=>u.part==="rightPalm"),o&&l.push([o.position[0],o.position[1]]),yp(r,l,a)}}}}async function X9(e,t,n){let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t){if(a.drawBoxes&&(r.strokeStyle=a.color,r.fillStyle=a.color,gp(r,s.box[0],s.box[1],s.box[2],s.box[3],a),a.drawLabels&&(a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText("hand",s.box[0]+3,1+s.box[1]+a.lineHeight,s.box[2])),r.fillStyle=a.labelColor,r.fillText("hand",s.box[0]+2,0+s.box[1]+a.lineHeight,s.box[2])),r.stroke()),a.drawPoints&&s.keypoints&&s.keypoints.length>0)for(let i of s.keypoints)r.fillStyle=a.useDepth?`rgba(${127.5+2*i[2]}, ${127.5-2*i[2]}, 255, 0.5)`:a.color,r5(r,i[0],i[1],0,a);if(a.drawLabels){let i=(o,l)=>{r.fillStyle=a.useDepth?`rgba(${127.5+2*o[o.length-1][2]}, ${127.5-2*o[o.length-1][2]}, 255, 0.5)`:a.color,r.fillText(l,o[o.length-1][0]+4,o[o.length-1][1]+4)};r.font=a.font,i(s.annotations.indexFinger,"index"),i(s.annotations.middleFinger,"middle"),i(s.annotations.ringFinger,"ring"),i(s.annotations.pinky,"pinky"),i(s.annotations.thumb,"thumb"),i(s.annotations.palmBase,"palm")}if(a.drawPolygons){let i=o=>{if(!!o)for(let l=0;l0?l-1:0][0],o[l>0?l-1:0][1]),r.lineTo(o[l][0],o[l][1]),r.stroke()};r.lineWidth=a.lineWidth,i(s.annotations.indexFinger),i(s.annotations.middleFinger),i(s.annotations.ringFinger),i(s.annotations.pinky),i(s.annotations.thumb)}}}}async function K9(e,t,n){let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t)if(a.drawBoxes){if(r.strokeStyle=a.color,r.fillStyle=a.color,gp(r,s.box[0],s.box[1],s.box[2],s.box[3],a),a.drawLabels){let i=`${Math.round(100*s.score)}% ${s.label}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(i,s.box[0]+3,1+s.box[1]+a.lineHeight,s.box[2])),r.fillStyle=a.labelColor,r.fillText(i,s.box[0]+2,0+s.box[1]+a.lineHeight,s.box[2])}r.stroke()}}}async function Xle(e,t,n){let a=Ln(cs,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s=0;sO.box[0]&&N.box[0]O.box[1]&&N.box[1]+N.box[3]C.body.box[0]&&O.box[0]+O.box[2]C.body.box[1]&&O.box[1]+O.box[3]C.body.box[0]&&O.box[1]+O.box[3]>C.body.box[1]&&O.box[1]+O.box[3]{O&&O.length===4&&(E.push(O[0],O[0]+O[2]),_.push(O[1],O[1]+O[3]))};$((y=C.face)==null?void 0:y.box),$((A=C.body)==null?void 0:A.box),$((v=(x=C.hands)==null?void 0:x.left)==null?void 0:v.box),$((w=(b=C.hands)==null?void 0:b.right)==null?void 0:w.box);let S=Math.min(...E),z=Math.min(..._);C.box=[S,z,Math.max(...E)-S,Math.max(..._)-z],r&&r.length===4&&(C.boxRaw=[C.box[0]/r[2],C.box[1]/r[1],C.box[2]/r[2],C.box[3]/r[1]]),i.push(C)}return i}var $e={face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0};function Y9(e){var r,s,i,o,l,u,d,p,c,h,m,f,g,y,A,x,v,b,w,N,C;let t=Date.now()-e.timestamp,n=t<1e3?8-Math.log(t):1;if($e.canvas=e.canvas,!$e.body||e.body.length!==$e.body.length)$e.body=JSON.parse(JSON.stringify(e.body));else for(let E=0;E((n-1)*$e.body[E].box[O]+z)/n),$=e.body[E].boxRaw.map((z,O)=>((n-1)*$e.body[E].boxRaw[O]+z)/n),S=e.body[E].keypoints.map((z,O)=>({score:z.score,part:z.part,position:[$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].position[0]+z.position[0])/n:z.position[0],$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].position[1]+z.position[1])/n:z.position[1]],positionRaw:[$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].positionRaw[0]+z.positionRaw[0])/n:z.position[0],$e.body[E].keypoints[O]?((n-1)*$e.body[E].keypoints[O].positionRaw[1]+z.positionRaw[1])/n:z.position[1]]}));$e.body[E]={...e.body[E],box:_,boxRaw:$,keypoints:S}}if(!$e.hand||e.hand.length!==$e.hand.length)$e.hand=JSON.parse(JSON.stringify(e.hand));else for(let E=0;E((n-1)*$e.hand[E].box[G]+W)/n),$=e.hand[E].boxRaw.map((W,G)=>((n-1)*$e.hand[E].boxRaw[G]+W)/n),S=e.hand[E].keypoints.map((W,G)=>W.map((H,J)=>((n-1)*$e.hand[E].keypoints[G][J]+H)/n)),z=Object.keys(e.hand[E].annotations),O={};for(let W of z)O[W]=e.hand[E].annotations[W].map((G,H)=>G.map((J,K)=>((n-1)*$e.hand[E].annotations[W][H][K]+J)/n));$e.hand[E]={...e.hand[E],box:_,boxRaw:$,keypoints:S,annotations:O}}if(!$e.face||e.face.length!==$e.face.length)$e.face=JSON.parse(JSON.stringify(e.face));else for(let E=0;E((n-1)*$e.face[E].box[O]+z)/n),$=e.face[E].boxRaw.map((z,O)=>((n-1)*$e.face[E].boxRaw[O]+z)/n),S={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};S.matrix=(r=e.face[E].rotation)==null?void 0:r.matrix,S.angle={roll:((n-1)*(((i=(s=$e.face[E].rotation)==null?void 0:s.angle)==null?void 0:i.roll)||0)+(((l=(o=e.face[E].rotation)==null?void 0:o.angle)==null?void 0:l.roll)||0))/n,yaw:((n-1)*(((d=(u=$e.face[E].rotation)==null?void 0:u.angle)==null?void 0:d.yaw)||0)+(((c=(p=e.face[E].rotation)==null?void 0:p.angle)==null?void 0:c.yaw)||0))/n,pitch:((n-1)*(((m=(h=$e.face[E].rotation)==null?void 0:h.angle)==null?void 0:m.pitch)||0)+(((g=(f=e.face[E].rotation)==null?void 0:f.angle)==null?void 0:g.pitch)||0))/n},S.gaze={bearing:((n-1)*(((A=(y=$e.face[E].rotation)==null?void 0:y.gaze)==null?void 0:A.bearing)||0)+(((v=(x=e.face[E].rotation)==null?void 0:x.gaze)==null?void 0:v.bearing)||0))/n,strength:((n-1)*(((w=(b=$e.face[E].rotation)==null?void 0:b.gaze)==null?void 0:w.strength)||0)+(((C=(N=e.face[E].rotation)==null?void 0:N.gaze)==null?void 0:C.strength)||0))/n},$e.face[E]={...e.face[E],rotation:S,box:_,boxRaw:$}}if(!$e.object||e.object.length!==$e.object.length)$e.object=JSON.parse(JSON.stringify(e.object));else for(let E=0;E((n-1)*$e.object[E].box[z]+S)/n),$=e.object[E].boxRaw.map((S,z)=>((n-1)*$e.object[E].boxRaw[z]+S)/n);$e.object[E]={...e.object[E],box:_,boxRaw:$}}let a=e.persons;if(!$e.persons||a.length!==$e.persons.length)$e.persons=JSON.parse(JSON.stringify(a));else for(let E=0;E((n-1)*$e.persons[E].box[$]+_)/n);return $e.gesture=e.gesture,$e.performance=e.performance,$e}var ha,o5=!1;async function af(e){return ha?e.debug&&de("cached model:",ha.modelUrl):(ha=await ct(ft(e.modelBasePath,e.segmentation.modelPath)),!ha||!ha.modelUrl?de("load model failed:",e.segmentation.modelPath):e.debug&&de("load model:",ha.modelUrl)),ha}async function l5(e){var m,f;let t=((m=e.tensor)==null?void 0:m.shape[1])||0,n=((f=e.tensor)==null?void 0:f.shape[2])||0;if(!e.tensor||!ha||!ha.inputs[0].shape)return null;let a=De.resizeBilinear(e.tensor,[ha.inputs[0].shape[1],ha.inputs[0].shape[2]],!1),r=a.div(255),s=ha.predict(r);he(a),he(r);let i=Vt(s,0),o;if(i.shape[2]===2){let g=i.softmax(),[y,A]=Gn(g,2),x=A.expandDims(2),v=x.expandDims(0);he(g),he(y),he(A);let b=De.cropAndResize(v,[[0,0,.5,.5]],[0],[t,n]);o=b.squeeze(0),he(b),he(x),he(v)}else o=De.resizeBilinear(i,[t,n]);if(typeof document=="undefined")return o.dataSync();let l=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(t,n):document.createElement("canvas");l.width=t,l.height=n,oa&&await oa.toPixels(o,l),he(o),he(i),he(s);let u=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(t,n):document.createElement("canvas");u.width=t,u.height=n;let d=u.getContext("2d");d.filter="blur(8px",await d.drawImage(l,0,0);let p=d.getImageData(0,0,t,n).data,c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(t,n):document.createElement("canvas");c.width=t,c.height=n;let h=c.getContext("2d");return e.canvas&&await h.drawImage(e.canvas,0,0),h.globalCompositeOperation="darken",h.filter="blur(8px)",await h.drawImage(l,0,0),h.globalCompositeOperation="source-over",h.filter="none",e.canvas=c,p}async function J9(e,t,n){var s;if(o5)return null;o5=!0,ha||await af(n);let a=Yi(e,n),r=await l5(a);if(he(a.tensor),t&&r){let i=Yi(t,n),o=i.canvas;he(i.tensor);let l=a.canvas,u=(s=l.getContext("2d"))==null?void 0:s.getImageData(0,0,l.width,l.height).data,d=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(l.width,l.height):document.createElement("canvas");d.width=l.width,d.height=l.height;let p=d.getContext("2d");p.globalCompositeOperation="copy",p.drawImage(o,0,0,d.width,d.height);let c=p.getImageData(0,0,d.width,d.height);for(let h=0;h{if(!pn(this,Ap))return;let n=this.tf.engine().state.numTensors,a=pn(this,mu);Ia(this,mu,n);let r=n-a;r!==0&&de(...t,r)};ra(this,of,t=>{if(!pn(this,xp))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Be))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});ra(this,bp,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=Je();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&de("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&de("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&de("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&de(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&de("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&Qk();try{await this.tf.setBackend(this.config.backend)}catch(r){de("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&this.config.deallocate&&(de("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&de(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.performance.backend=Math.trunc(Je()-a)}});this.next=t=>Z9(t||this.result);ra(this,lf,async t=>{if(this.config.cacheSensitivity===0)return!1;let n=32,a=t.resizeBilinear([Math.trunc(t.shape[1]/n),Math.trunc(t.shape[2]/n)]),r=a.dataSync(),s=0;for(let u=0;u10*this.config.cacheSensitivity?0:i),o});ra(this,uf,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(rf);break;case"full":n=await t(sf);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});ra(this,df,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+rf;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+sf;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));ra(this,pf,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(rf)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(sf)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&de("Warmup tfjs-node not loaded");return a});this.config=Ln(w5,t||{}),this.tf=dp,this.draw=i5,this.version=J9,this.state="idle",Ia(this,mu,0),Ia(this,Ap,!1),Ia(this,xp,!1),Ia(this,Yi,!0),Ia(this,gu,0),this.performance={backend:0,load:0,image:0,frames:0,cached:0,changed:0,total:0,draw:0},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,movenet:null,handpose:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null,segmentation:null},this.image=n=>fu(n,this.config),this.faceTriangulation=c9,this.faceUVMap=h9,this.sysinfo=k5(),Ia(this,Ji,1)}similarity(t,n){return k2(t,n)}segmentation(t,n){return Y9(t,n,this.config)}enhance(t){return I2(t)}match(t,n,a=0){return g9(t,n,a)}async load(t){this.state="load";let n=Je();t&&(this.config=Ln(this.config,t)),pn(this,Yi)&&(this.config.debug&&de(`version: ${this.version}`),this.config.debug&&de(`tfjs version: ${this.tf.version_core}`),this.config.debug&&de("platform:",this.sysinfo.platform),this.config.debug&&de("agent:",this.sysinfo.agent),await pn(this,bp).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&de("configuration:",this.config),this.config.debug&&de("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.efficientpose,this.models.movenet,this.models.nanodet,this.models.centernet,this.models.faceres,this.models.segmentation]=await Promise.all([this.models.face||(this.config.face.enabled?g2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?x2(this.config):null),this.models.handpose||(this.config.hand.enabled?L2(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?$2(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?J0(this.config):null),this.models.efficientpose||(this.config.body.enabled&&this.config.body.modelPath.includes("efficientpose")?P9(this.config):null),this.models.movenet||(this.config.body.enabled&&this.config.body.modelPath.includes("movenet")?X2(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?J2(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?n5(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?w2(this.config):null),this.models.segmentation||(this.config.segmentation.enabled?af(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await g2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await x2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await L2(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await $2(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await J0(this.config)),this.config.body.enabled&&!this.models.efficientpose&&this.config.body.modelPath.includes("efficientpose")&&(this.models.efficientpose=await J0(this.config)),this.config.body.enabled&&!this.models.movenet&&this.config.body.modelPath.includes("movenet")&&(this.models.movenet=await X2(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await J2(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await n5(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await w2(this.config)),this.config.segmentation.enabled&&!this.models.segmentation&&(this.models.segmentation=await af(this.config))),pn(this,Yi)&&(this.config.debug&&de("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),Ia(this,Yi,!1));let a=Math.trunc(Je()-n);a>(this.performance.load||0)&&(this.performance.load=a)}async detect(t,n){return new Promise(async a=>{this.state="config";let r;this.config=Ln(this.config,n),this.state="check";let s=pn(this,of).call(this,t);s&&(de(s,t),a({error:s}));let i=Je();await pn(this,bp).call(this),await this.load(),r=Je();let o=fu(t,this.config);if(!o||!o.tensor){de("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.performance.image=Math.trunc(Je()-r),this.analyze("Get Image:"),r=Je(),this.config.skipFrame=await pn(this,lf).call(this,o.tensor),this.performance.frames||(this.performance.frames=0),this.performance.cached||(this.performance.cached=0),this.performance.frames++,this.config.skipFrame&&this.performance.cached++,this.performance.changed=Math.trunc(Je()-r),this.analyze("Check Changed:");let u,l,d,p,c;this.config.async?(u=this.config.face.enabled?N2(this,o.tensor):[],this.performance.face&&delete this.performance.face):(this.state="run:face",r=Je(),u=this.config.face.enabled?await N2(this,o.tensor):[],c=Math.trunc(Je()-r),c>0&&(this.performance.face=c)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?F2(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?l=this.config.body.enabled?W2(o.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?l=this.config.body.enabled?U2(o.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(l=this.config.body.enabled?K2(o.tensor,this.config):[]),this.performance.body&&delete this.performance.body):(this.state="run:body",r=Je(),this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?await F2(o.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?l=this.config.body.enabled?await W2(o.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?l=this.config.body.enabled?await U2(o.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(l=this.config.body.enabled?await K2(o.tensor,this.config):[]),c=Math.trunc(Je()-r),c>0&&(this.performance.body=c)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(d=this.config.hand.enabled?P2(o.tensor,this.config):[],this.performance.hand&&delete this.performance.hand):(this.state="run:hand",r=Je(),d=this.config.hand.enabled?await P2(o.tensor,this.config):[],c=Math.trunc(Je()-r),c>0&&(this.performance.hand=c)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?Q2(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?a5(o.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(this.state="run:object",r=Je(),this.config.object.modelPath.includes("nanodet")?p=this.config.object.enabled?await Q2(o.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(p=this.config.object.enabled?await a5(o.tensor,this.config):[]),c=Math.trunc(Je()-r),c>0&&(this.performance.object=c)),this.analyze("End Object:"),this.config.async&&([u,l,d,p]=await Promise.all([u,l,d,p]));let h=[];this.config.gesture.enabled&&(r=Je(),h=[...W9(u),...L9(l),...V9(d),...B9(u)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=Math.trunc(Je()-r)),this.performance.total=Math.trunc(Je()-i),this.state="idle",this.result={face:u,body:l,hand:d,gesture:h,object:p,performance:this.performance,canvas:o.canvas,timestamp:Date.now(),get persons(){var m;return K9(u,l,d,h,(m=o==null?void 0:o.tensor)==null?void 0:m.shape)}},he(o.tensor),a(this.result)})}async warmup(t){let n=Je();if(t&&(this.config=Ln(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a;typeof createImageBitmap=="function"?a=await pn(this,uf).call(this):typeof Image!="undefined"?a=await pn(this,df).call(this):a=await pn(this,pf).call(this);let r=Je();return this.config.debug&&de("Warmup",this.config.warmup,Math.round(r-n),"ms",a),a}};mu=new WeakMap,Ap=new WeakMap,xp=new WeakMap,Yi=new WeakMap,Ji=new WeakMap,gu=new WeakMap,of=new WeakMap,bp=new WeakMap,lf=new WeakMap,uf=new WeakMap,df=new WeakMap,pf=new WeakMap;export{Jle as Human,Jle as default}; +2Q==`;var Q9="2.0.0";var mu,Ap,xp,Ji,Qi,gu,of,bp,lf,uf,df,pf,Jle=class{constructor(t){ra(this,mu,void 0);ra(this,Ap,void 0);ra(this,xp,void 0);ra(this,Ji,void 0);ra(this,Qi,void 0);ra(this,gu,void 0);this.analyze=(...t)=>{if(!pn(this,Ap))return;let n=this.tf.engine().state.numTensors,a=pn(this,mu);Ia(this,mu,n);let r=n-a;r!==0&&de(...t,r)};ra(this,of,t=>{if(!pn(this,xp))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Be))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});ra(this,bp,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=Ke();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&de("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&de("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&de("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&de(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&de("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&e9();try{await this.tf.setBackend(this.config.backend)}catch(r){de("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_CPU_FORWARD",!0),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&this.config.deallocate&&(de("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&de(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.performance.backend=Math.trunc(Ke()-a)}});this.next=t=>Y9(t||this.result);ra(this,lf,async t=>{if(this.config.cacheSensitivity===0)return!1;let n=32,a=t.resizeBilinear([Math.trunc(t.shape[1]/n),Math.trunc(t.shape[2]/n)]),r=a.dataSync(),s=0;for(let l=0;l10*this.config.cacheSensitivity?0:i),o});ra(this,uf,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(rf);break;case"full":n=await t(sf);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});ra(this,df,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+rf;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+sf;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));ra(this,pf,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(rf)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(sf)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&de("Warmup tfjs-node not loaded");return a});this.config=Ln(k5,t||{}),this.tf=dp,this.draw=i5,this.version=Q9,this.state="idle",Ia(this,mu,0),Ia(this,Ap,!1),Ia(this,xp,!1),Ia(this,Ji,!0),Ia(this,gu,0),this.performance={backend:0,load:0,image:0,frames:0,cached:0,changed:0,total:0,draw:0},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,movenet:null,handpose:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,centernet:null,faceres:null,segmentation:null},this.image=n=>Yi(n,this.config),this.faceTriangulation=h9,this.faceUVMap=f9,this.sysinfo=I5(),Ia(this,Qi,1)}similarity(t,n){return k2(t,n)}segmentation(t,n){return J9(t,n,this.config)}enhance(t){return I2(t)}match(t,n,a=0){return y9(t,n,a)}async load(t){this.state="load";let n=Ke();t&&(this.config=Ln(this.config,t)),pn(this,Ji)&&(this.config.debug&&de(`version: ${this.version}`),this.config.debug&&de(`tfjs version: ${this.tf.version_core}`),this.config.debug&&de("platform:",this.sysinfo.platform),this.config.debug&&de("agent:",this.sysinfo.agent),await pn(this,bp).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&de("configuration:",this.config),this.config.debug&&de("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.efficientpose,this.models.movenet,this.models.nanodet,this.models.centernet,this.models.faceres,this.models.segmentation]=await Promise.all([this.models.face||(this.config.face.enabled?g2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?x2(this.config):null),this.models.handpose||(this.config.hand.enabled?L2(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?$2(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?J0(this.config):null),this.models.efficientpose||(this.config.body.enabled&&this.config.body.modelPath.includes("efficientpose")?L9(this.config):null),this.models.movenet||(this.config.body.enabled&&this.config.body.modelPath.includes("movenet")?X2(this.config):null),this.models.nanodet||(this.config.object.enabled&&this.config.object.modelPath.includes("nanodet")?J2(this.config):null),this.models.centernet||(this.config.object.enabled&&this.config.object.modelPath.includes("centernet")?n5(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?w2(this.config):null),this.models.segmentation||(this.config.segmentation.enabled?af(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await g2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await x2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await L2(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await $2(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await J0(this.config)),this.config.body.enabled&&!this.models.efficientpose&&this.config.body.modelPath.includes("efficientpose")&&(this.models.efficientpose=await J0(this.config)),this.config.body.enabled&&!this.models.movenet&&this.config.body.modelPath.includes("movenet")&&(this.models.movenet=await X2(this.config)),this.config.object.enabled&&!this.models.nanodet&&this.config.object.modelPath.includes("nanodet")&&(this.models.nanodet=await J2(this.config)),this.config.object.enabled&&!this.models.centernet&&this.config.object.modelPath.includes("centernet")&&(this.models.centernet=await n5(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await w2(this.config)),this.config.segmentation.enabled&&!this.models.segmentation&&(this.models.segmentation=await af(this.config))),pn(this,Ji)&&(this.config.debug&&de("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),Ia(this,Ji,!1));let a=Math.trunc(Ke()-n);a>(this.performance.load||0)&&(this.performance.load=a)}async detect(t,n){return new Promise(async a=>{this.state="config";let r,s;this.config=Ln(this.config,n),this.state="check";let i=pn(this,of).call(this,t);i&&(de(i,t),a({error:i}));let o=Ke();await pn(this,bp).call(this),await this.load(),r=Ke();let l=Yi(t,this.config);if(this.performance.image=Math.trunc(Ke()-r),this.analyze("Get Image:"),this.config.segmentation.enabled&&l&&l.tensor&&(this.analyze("Start Segmentation:"),this.state="run:segmentation",r=Ke(),await l5(l),s=Math.trunc(Ke()-r),s>0&&(this.performance.segmentation=s),l.canvas&&(l.tensor.dispose(),l=Yi(l.canvas,this.config)),this.analyze("End Segmentation:")),!l||!l.tensor){de("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}r=Ke(),this.config.skipFrame=await pn(this,lf).call(this,l.tensor),this.performance.frames||(this.performance.frames=0),this.performance.cached||(this.performance.cached=0),this.performance.frames++,this.config.skipFrame&&this.performance.cached++,this.performance.changed=Math.trunc(Ke()-r),this.analyze("Check Changed:");let u,d,p,c;this.config.async?(u=this.config.face.enabled?N2(this,l.tensor):[],this.performance.face&&delete this.performance.face):(this.state="run:face",r=Ke(),u=this.config.face.enabled?await N2(this,l.tensor):[],s=Math.trunc(Ke()-r),s>0&&(this.performance.face=s)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?d=this.config.body.enabled?F2(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?d=this.config.body.enabled?W2(l.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?d=this.config.body.enabled?U2(l.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(d=this.config.body.enabled?K2(l.tensor,this.config):[]),this.performance.body&&delete this.performance.body):(this.state="run:body",r=Ke(),this.config.body.modelPath.includes("posenet")?d=this.config.body.enabled?await F2(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")?d=this.config.body.enabled?await W2(l.tensor,this.config):[]:this.config.body.modelPath.includes("efficientpose")?d=this.config.body.enabled?await U2(l.tensor,this.config):[]:this.config.body.modelPath.includes("movenet")&&(d=this.config.body.enabled?await K2(l.tensor,this.config):[]),s=Math.trunc(Ke()-r),s>0&&(this.performance.body=s)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(p=this.config.hand.enabled?P2(l.tensor,this.config):[],this.performance.hand&&delete this.performance.hand):(this.state="run:hand",r=Ke(),p=this.config.hand.enabled?await P2(l.tensor,this.config):[],s=Math.trunc(Ke()-r),s>0&&(this.performance.hand=s)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(this.config.object.modelPath.includes("nanodet")?c=this.config.object.enabled?Q2(l.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(c=this.config.object.enabled?a5(l.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(this.state="run:object",r=Ke(),this.config.object.modelPath.includes("nanodet")?c=this.config.object.enabled?await Q2(l.tensor,this.config):[]:this.config.object.modelPath.includes("centernet")&&(c=this.config.object.enabled?await a5(l.tensor,this.config):[]),s=Math.trunc(Ke()-r),s>0&&(this.performance.object=s)),this.analyze("End Object:"),this.config.async&&([u,d,p,c]=await Promise.all([u,d,p,c]));let h=[];this.config.gesture.enabled&&(r=Ke(),h=[...B9(u),...W9(d),...j9(p),...V9(u)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=Math.trunc(Ke()-r)),this.performance.total=Math.trunc(Ke()-o),this.state="idle",this.result={face:u,body:d,hand:p,gesture:h,object:c,performance:this.performance,canvas:l.canvas,timestamp:Date.now(),get persons(){var m;return Z9(u,d,p,h,(m=l==null?void 0:l.tensor)==null?void 0:m.shape)}},he(l.tensor),a(this.result)})}async warmup(t){let n=Ke();if(t&&(this.config=Ln(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a;typeof createImageBitmap=="function"?a=await pn(this,uf).call(this):typeof Image!="undefined"?a=await pn(this,df).call(this):a=await pn(this,pf).call(this);let r=Ke();return this.config.debug&&de("Warmup",this.config.warmup,Math.round(r-n),"ms",a),a}};mu=new WeakMap,Ap=new WeakMap,xp=new WeakMap,Ji=new WeakMap,Qi=new WeakMap,gu=new WeakMap,of=new WeakMap,bp=new WeakMap,lf=new WeakMap,uf=new WeakMap,df=new WeakMap,pf=new WeakMap;export{Jle as Human,Jle as default}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. diff --git a/dist/human.esm.js.map b/dist/human.esm.js.map index 0f58ac05..2b5107dd 100644 --- a/dist/human.esm.js.map +++ b/dist/human.esm.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/helpers.ts", "../src/config.ts", "../src/sysinfo.ts", "../node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js", "../node_modules/.pnpm/node-fetch@2.6.1/node_modules/node-fetch/browser.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js", "(disabled):crypto", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js", "(disabled):path", "(disabled):worker_threads", "(disabled):perf_hooks", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js", "../node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/util_base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/environment.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/global_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/kernel_names.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/kernel_registry.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/hash_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/profiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/tape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/tensor_format.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/tensor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/tensor_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/engine.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/device_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/flags.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/tensor_util_env.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/operation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/router_registry.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/indexed_db.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/local_storage.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/model_management.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/print.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/base_side_effects.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/io.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/browser_files.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/progress.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/weights_loader.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/http.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/io/passthrough.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/one_hot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/confusion_matrix.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/gather_nd_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/slice_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/test_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/globals.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/floorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/div.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/add_n.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/all.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/arg_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/arg_min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/basic_lstm_cell.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/batch_to_space_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/broadcast_to.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/clip_by_value.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/dense_bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/depth_to_space.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/dilation2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/broadcast_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/where.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/zeros_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/div_no_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/dot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/expand_dims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/eye.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/gather.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/greater_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/is_finite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/is_inf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/is_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/leaky_relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/less_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/linspace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/log_sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/log_softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/axis_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/log_sum_exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_and.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_not.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_or.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_xor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_with_argmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/zeros.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/ones.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/mirror_pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/moments.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/multi_rnn_cell.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/not_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/ones_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/outer_product.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pad1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pad2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pad3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pad4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/space_to_batch_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/rand_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/random_gamma.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/random_normal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/random_uniform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/scalar.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/separable_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/setdiff1d_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/slice1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/slice2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/slice3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/slice4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/fft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/ifft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/irfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/rfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/squared_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/squeeze.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/stack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/strided_slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor5d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor6d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/topk.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/truncated_normal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/unstack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/variable.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/where_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/where_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/boolean_mask.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/norm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/moving_average.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/gather_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/dropout_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/dropout.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/signal_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/in_top_k.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/fused_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/hamming_window.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/hann_window.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/frame.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/crop_and_resize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/flip_left_right.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/rotate_with_offset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/nonmax_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/resize_bilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/resize_nearest_neighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/threshold.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/band_part.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/gram_schmidt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/qr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/loss_ops_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/compute_weighted_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/absolute_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/cosine_distance.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/hinge_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/huber_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/log_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/mean_squared_error.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/sigmoid_cross_entropy.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/softmax_cross_entropy.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_fill_empty_rows.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_segment_mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/string/string_n_grams.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/string/string_split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/string/string_to_hash_bucket_fast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/train.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/browser_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/backend_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/reduce_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/rotate_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/array_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/selu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/erf_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/complex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/split_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/segment_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/backends/kernel_impls.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/cpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/backend_cpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/zeros_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Bincount_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherNd_Impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherV2_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LinSpace_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Range_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseFillEmptyRows_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseReshape_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseSegmentReduction_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StridedSlice_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StringNGrams_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StringSplit_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StringToHashBucketFast_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tile_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/TopK_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fused_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/pool_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Clip.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fft_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Scatter_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseFillEmptyRows.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseSegmentMean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StringNGrams.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StringSplit.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StringToHashBucketFast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-cpu/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/canvas_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flags_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/glsl_version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/packing_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reshape_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/texture_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unpack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/backend_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/kernel_funcs_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mulmat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_complex_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mean_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reduce_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reduce.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/arg_min_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pool_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/avg_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/complex_abs_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/im2col_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/crop_and_resize_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/cumsum_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/depth_to_space_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_packed_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/diag_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/dilation_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fft_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fill_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flip_left_right_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_nd_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_grad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/max_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/multinomial_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/onehot_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/rotate_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/scatter_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/select_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseFillEmptyRows.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseSegmentMean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/strided_slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StringNGrams.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StringSplit.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StringToHashBucketFast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tile_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transform_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/segment_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-webgl/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/unary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/binary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/kernel_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedBatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/flags_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/backend_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.worker.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-backend-wasm/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Abs_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Acos_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Acosh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Add_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/AddN_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ArgMax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ArgMin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Asin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Asinh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atan2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atanh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/BatchMatMul_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/BatchToSpaceND_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/BroadcastTo_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cast_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Ceil_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ClipByValue_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ComplexAbs_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Concat_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv2D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv2DBackpropInput_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cos_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cosh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cumsum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/DepthwiseConv2dNative_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Dilation2D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Elu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Erf_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Exp_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ExpandDims_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Expm1_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Floor_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/FloorDiv_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/FusedBatchNorm_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/GatherV2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/GreaterEqual_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Identity_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsFinite_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsInf_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsNan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/LeakyRelu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Log1p_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Log_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/LogSoftmax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization_backprop.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/LRN_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/min_max_grad_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Max_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Maximum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Mean_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Min_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Minimum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/MirrorPad_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Mod_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Multiply_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Neg_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/OneHot_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/OnesLike_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Pack_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/PadV2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Pow_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Prelu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/RealDiv_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reciprocal_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Relu6_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Relu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reshape_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ResizeBilinear_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ResizeNearestNeighbor_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reverse_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Round_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Rsqrt_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Select_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Selu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sigmoid_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sign_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sinh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Slice_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Softmax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Softplus_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/SpaceToBatchND_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/SplitV_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sqrt_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Square_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/SquaredDifference_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Step_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sub_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tanh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tile_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Transpose_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/Unpack_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/UnsortedSegmentSum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/gradients/ZerosLike_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-core/src/register_all_gradients.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/errors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/variables.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/logs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/losses.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-layers/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/data/compiled_api.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/register.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/arithmetic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/basic_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/control.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/convolution.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/creation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/dynamic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/evaluation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/graph.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/image.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/logical.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/matrices.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/reduction.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/slice_join.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/sparse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/spectral.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/string.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/transformation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_mapper.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/node_value_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/arithmetic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/basic_math_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_array.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_list.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/control_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/convolution_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/creation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/dynamic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/evaluation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/hash_table_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/image_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/logical_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/matrices_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/normalization_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/reduction_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/slice_join_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/sparse_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/spectral_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/string_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/transformation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/execution_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/model_analysis.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/resource_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_model.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.7.0_@tensorflow+tfjs-core@3.7.0/node_modules/@tensorflow/tfjs-converter/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/datasource.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/readers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.7.0_2d23fca999276b6587569019c21cba8f/node_modules/@tensorflow/tfjs-data/src/version.ts", "../src/tfjs/tf-browser.ts", "../src/tfjs/backend.ts", "../src/blazeface/box.ts", "../src/blazeface/util.ts", "../src/blazeface/blazeface.ts", "../src/blazeface/coords.ts", "../src/blazeface/facepipeline.ts", "../src/blazeface/facemesh.ts", "../src/emotion/emotion.ts", "../src/faceres/faceres.ts", "../src/face.ts", "../src/posenet/keypoints.ts", "../src/posenet/utils.ts", "../src/posenet/poses.ts", "../src/posenet/posenet.ts", "../src/handpose/box.ts", "../src/handpose/anchors.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/handpose/handpose.ts", "../src/blazepose/annotations.ts", "../src/blazepose/blazepose.ts", "../src/efficientpose/efficientpose.ts", "../src/movenet/movenet.ts", "../src/object/labels.ts", "../src/object/nanodet.ts", "../src/object/centernet.ts", "../src/gesture/gesture.ts", "../src/image/imagefx.js", "../src/image/image.ts", "../src/draw/draw.ts", "../src/persons.ts", "../src/interpolate.ts", "../src/segmentation/segmentation.ts", "../src/sample.ts", "../src/human.ts"], - "sourcesContent": ["/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n\n// helper function: return min and max from input array\nexport const minmax = (data) => data.reduce((acc, val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n * @typedef Config\n */\nexport interface Config {\n /** Backend used for TFJS operations */\n backend: null | '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow',\n\n /** Path to *.wasm files if backend is set to `wasm` */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n cacheSensitivity: number;\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n skipFrame: boolean;\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n */\n filter: {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n },\n // type definition end\n\n /** Controlls gesture detection */\n gesture: {\n enabled: boolean,\n },\n\n /** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - return: return extracted face as tensor for futher user processing\n */\n face: {\n enabled: boolean,\n detector: {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n },\n mesh: {\n enabled: boolean,\n modelPath: string,\n },\n iris: {\n enabled: boolean,\n modelPath: string,\n },\n description: {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n },\n emotion: {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n },\n },\n\n /** Controlls and configures all body detection specific options\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n */\n body: {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n skipFrames: number,\n },\n\n /** Controlls and configures all hand detection specific options\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n */\n hand: {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath: string,\n },\n skeleton: {\n modelPath: string,\n },\n },\n\n /** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n */\n object: {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n },\n\n /** Controlls and configures all body segmentation module\n * if segmentation is enabled, output result.canvas will be augmented with masked image containing only person output\n *\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n */\n segmentation: {\n enabled: boolean,\n modelPath: string,\n },\n}\n\nconst config: Config = {\n backend: 'webgl', // select tfjs backend to use, leave empty to use default backend\n // can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl\n modelBasePath: '../models/', // base path for all models\n wasmPath: '../node_modules/@tensorflow/tfjs-backend-wasm/dist/', // path for wasm binaries, only used for backend: wasm\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n cacheSensitivity: 0.75, // cache sensitivity\n // values 0..1 where 0.01 means reset cache if input changed more than 1%\n // set to 0 to disable caching\n skipFrame: false, // internal & dynamic\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: true, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 15, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 15, // how many max frames to go without re-running the face bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head probably hasn't moved much\n // in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 11, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 17, // how max many frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'\n maxDetected: 1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet as other models detects single pose\n minConfidence: 0.2, // threshold for discarding a prediction\n skipFrames: 1, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n},\n\n hand: {\n enabled: true,\n rotation: true, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n skipFrames: 18, // how many max frames to go without re-running the hand bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand probably\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.1, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 2, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handdetect.json', // hand detector model, can be absolute path or relative to modelBasePath\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'mb3-centernet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'mb3-centernet' or 'nanodet'\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 19, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n },\n\n segmentation: {\n enabled: false, // if segmentation is enabled, output result.canvas will be augmented\n // with masked image containing only person output\n // segmentation is not triggered as part of detection and requires separate call to human.segmentation\n modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'selfie' or 'meet'\n },\n};\nexport { config as defaults };\n", "/**\n * Helper function that returns basic system info\n */\nexport function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 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\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n", "", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "", "/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "", "", "\nvar WasmBackendModuleThreadedSimd = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModuleThreadedSimd) {\n WasmBackendModuleThreadedSimd = WasmBackendModuleThreadedSimd || {};\n\nfunction GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModuleThreadedSimd!==\"undefined\"?WasmBackendModuleThreadedSimd:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module[\"ENVIRONMENT_IS_PTHREAD\"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module[\"buffer\"]}var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"};var nodeWorkerThreads;try{nodeWorkerThreads=require(\"worker_threads\")}catch(e){console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(typeof _scriptDir !== \"undefined\" && _scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance===\"undefined\"){global.performance=require(\"perf_hooks\").performance}}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){GROWABLE_HEAP_I8().set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module[\"wasmMemory\"];buffer=Module[\"buffer\"]}else{if(Module[\"wasmMemory\"]){wasmMemory=Module[\"wasmMemory\"]}else{wasmMemory=new WebAssembly.Memory({\"initial\":INITIAL_MEMORY/65536,\"maximum\":2147483648/65536,\"shared\":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\");if(ENVIRONMENT_IS_NODE){console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\")}throw Error(\"bad memory\")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,\"addRunDependency cannot be used in a pthread worker\");runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error(\"Pthread aborting at \"+(new Error).stack);what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm-threaded-simd.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmTable=Module[\"asm\"][\"F\"];wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency(\"wasm-instantiate\")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency(\"wasm-instantiate\")}function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"],output[\"module\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var ASM_CONSTS={9816:function(){throw\"Canceled!\"},9834:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw\"Atomics.notify returned an unexpected value \"+ret}Module[\"_emscripten_futex_wake\"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! killThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in killThread!\";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cancelThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cancelThread!\";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({\"cmd\":\"cancel\"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cleanupThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cleanupThread!\";var pthread=PThread.pthreads[pthread_ptr];if(pthread){GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){var pthreadPoolSize=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2));for(var i=0;i>2]=tb;var headPtr=tb+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),tb+100>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(GROWABLE_HEAP_U32(),tb+56>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,0);PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exit\"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({\"cmd\":\"cancelDone\"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e[\"data\"];var cmd=d[\"cmd\"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d[\"targetThread\"]&&d[\"targetThread\"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d[\"transferList\"])}else{console.error('Internal error! Worker sent a message \"'+cmd+'\" to target pthread '+d[\"targetThread\"]+\", but that thread no longer exists!\")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd===\"processQueuedMainThreadWork\"){_emscripten_main_thread_process_queued_calls()}else if(cmd===\"spawnThread\"){spawnThread(e.data)}else if(cmd===\"cleanupThread\"){cleanupThread(d[\"thread\"])}else if(cmd===\"killThread\"){killThread(d[\"thread\"])}else if(cmd===\"cancelThread\"){cancelThread(d[\"thread\"])}else if(cmd===\"loaded\"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd===\"print\"){out(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"printErr\"){err(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"alert\"){alert(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"exit\"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd===\"exitProcess\"){try{exit(d[\"returnCode\"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd===\"cancelDone\"){PThread.returnWorkerToPool(worker)}else if(cmd===\"objectTransfer\"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target===\"setimmediate\"){worker.postMessage(e.data)}else{err(\"worker sent an unknown command \"+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err(\"pthread sent an error! \"+e.filename+\":\"+e.lineno+\": \"+e.message)};if(ENVIRONMENT_IS_NODE){worker.on(\"message\",function(data){worker.onmessage({data:data})});worker.on(\"error\",function(data){worker.onerror(data)});worker.on(\"exit\",function(data){})}worker.postMessage({\"cmd\":\"load\",\"urlOrBlob\":Module[\"mainScriptUrlOrBlob\"]||_scriptDir,\"wasmMemory\":wasmMemory,\"wasmModule\":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile(\"tfjs-backend-wasm-threaded-simd.worker.js\");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({\"cmd\":\"processQueuedMainThreadWork\"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({\"targetThread\":targetThreadId,\"cmd\":\"processThreadQueue\"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({\"cmd\":\"processThreadQueue\"})}return 1}function _abort(){abort()}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret===\"timed-out\")return-73;if(ret===\"not-equal\")return-6;if(ret===\"ok\")return 0;throw\"Atomics.wait returned an unexpected value \"+ret}else{if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_num_logical_cores(){if(ENVIRONMENT_IS_NODE)return require(\"os\").cpus().length;return navigator[\"hardwareConcurrency\"]}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>=2;while(ch=GROWABLE_HEAP_U8()[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?GROWABLE_HEAP_F64()[buf++>>1]:GROWABLE_HEAP_I32()[buf]);++buf}return readAsmConstArgsArray}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return\"\";if(target==window)return\"#window\";if(target==screen)return\"#screen\";return target&&target.nodeName?target.nodeName:\"\"},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):\"\";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!==\"undefined\"?document:0,typeof window!==\"undefined\"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!==\"undefined\"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension(\"ANGLE_instanced_arrays\");if(ext){ctx[\"vertexAttribDivisor\"]=function(index,divisor){ext[\"vertexAttribDivisorANGLE\"](index,divisor)};ctx[\"drawArraysInstanced\"]=function(mode,first,count,primcount){ext[\"drawArraysInstancedANGLE\"](mode,first,count,primcount)};ctx[\"drawElementsInstanced\"]=function(mode,count,type,indices,primcount){ext[\"drawElementsInstancedANGLE\"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension(\"OES_vertex_array_object\");if(ext){ctx[\"createVertexArray\"]=function(){return ext[\"createVertexArrayOES\"]()};ctx[\"deleteVertexArray\"]=function(vao){ext[\"deleteVertexArrayOES\"](vao)};ctx[\"bindVertexArray\"]=function(vao){ext[\"bindVertexArrayOES\"](vao)};ctx[\"isVertexArray\"]=function(vao){return ext[\"isVertexArrayOES\"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension(\"WEBGL_draw_buffers\");if(ext){ctx[\"drawBuffers\"]=function(n,bufs){ext[\"drawBuffersWEBGL\"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension(\"WEBGL_multi_draw\"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext(\"webgl\",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault===\"undefined\"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents===\"object\")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);GLctx.disjointTimerQueryExt=GLctx.getExtension(\"EXT_disjoint_timer_query\");__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(ext.indexOf(\"lose_context\")<0&&ext.indexOf(\"debug\")<0){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];var contextAttributes={\"alpha\":!!GROWABLE_HEAP_I32()[a+(0>>2)],\"depth\":!!GROWABLE_HEAP_I32()[a+(4>>2)],\"stencil\":!!GROWABLE_HEAP_I32()[a+(8>>2)],\"antialias\":!!GROWABLE_HEAP_I32()[a+(12>>2)],\"premultipliedAlpha\":!!GROWABLE_HEAP_I32()[a+(16>>2)],\"preserveDrawingBuffer\":!!GROWABLE_HEAP_I32()[a+(20>>2)],\"powerPreference\":__emscripten_webgl_power_preferences[powerPreference],\"failIfMajorPerformanceCaveat\":!!GROWABLE_HEAP_I32()[a+(28>>2)],majorVersion:GROWABLE_HEAP_I32()[a+(32>>2)],minorVersion:GROWABLE_HEAP_I32()[a+(36>>2)],enableExtensionsByDefault:GROWABLE_HEAP_I32()[a+(40>>2)],explicitSwapControl:GROWABLE_HEAP_I32()[a+(44>>2)],proxyContextToMainThread:GROWABLE_HEAP_I32()[a+(48>>2)],renderViaOffscreenBackBuffer:GROWABLE_HEAP_I32()[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset)}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.threadExitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! spawnThread() can only ever be called from main application thread!\";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw\"Internal error!\";if(!threadParams.pthread_ptr)throw\"Internal error, no pthread ptr!\";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(64>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(100>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(76>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(172>>2),global_locale);worker.pthread=pthread;var msg={\"cmd\":\"run\",\"start_routine\":threadParams.startRoutine,\"arg\":threadParams.arg,\"threadInfoStruct\":threadParams.pthread_ptr,\"stackBase\":threadParams.stackBase,\"stackSize\":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer===\"undefined\"){err(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\");return 6}if(!pthread_ptr){err(\"pthread_create called with a null thread pointer!\");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd=\"spawnThread\";postMessage(threadParams,transferList)}else{spawnThread(threadParams)}return 0}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={\"e\":___assert_fail,\"r\":___call_main,\"x\":__emscripten_notify_thread_queue,\"b\":_abort,\"y\":_emscripten_asm_const_int,\"j\":_emscripten_conditional_set_current_thread_status,\"c\":_emscripten_futex_wait,\"d\":_emscripten_futex_wake,\"f\":_emscripten_get_now,\"p\":_emscripten_memcpy_big,\"z\":_emscripten_num_logical_cores,\"u\":_emscripten_receive_on_main_thread_js,\"q\":_emscripten_resize_heap,\"v\":_emscripten_set_canvas_element_size,\"i\":_emscripten_set_current_thread_status,\"t\":_emscripten_set_thread_name,\"w\":_emscripten_webgl_create_context,\"m\":_fd_close,\"n\":_fd_seek,\"g\":_fd_write,\"o\":initPthreadsJS,\"a\":wasmMemory||Module[\"wasmMemory\"],\"k\":_pthread_cleanup_pop,\"l\":_pthread_cleanup_push,\"h\":_pthread_create,\"s\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ta\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Ua\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Va\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Wa\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Xa\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ya\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Za\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"_a\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"$a\"]).apply(null,arguments)};var _Transform=Module[\"_Transform\"]=function(){return(_Transform=Module[\"_Transform\"]=Module[\"asm\"][\"ab\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"bb\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"cb\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"db\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"eb\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"fb\"]).apply(null,arguments)};var _emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=function(){return(_emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=Module[\"asm\"][\"gb\"]).apply(null,arguments)};var _pthread_self=Module[\"_pthread_self\"]=function(){return(_pthread_self=Module[\"_pthread_self\"]=Module[\"asm\"][\"hb\"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=function(){return(___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=Module[\"asm\"][\"ib\"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=function(){return(_emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=Module[\"asm\"][\"jb\"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=function(){return(_emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=Module[\"asm\"][\"kb\"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=function(){return(_emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=Module[\"asm\"][\"lb\"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=function(){return(__emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=Module[\"asm\"][\"mb\"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=Module[\"asm\"][\"nb\"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=Module[\"asm\"][\"ob\"]).apply(null,arguments)};var __emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=function(){return(__emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=Module[\"asm\"][\"pb\"]).apply(null,arguments)};var _emscripten_tls_init=Module[\"_emscripten_tls_init\"]=function(){return(_emscripten_tls_init=Module[\"_emscripten_tls_init\"]=Module[\"asm\"][\"qb\"]).apply(null,arguments)};var __emscripten_thread_init=Module[\"__emscripten_thread_init\"]=function(){return(__emscripten_thread_init=Module[\"__emscripten_thread_init\"]=Module[\"asm\"][\"rb\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"sb\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"tb\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"ub\"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=function(){return(_emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=Module[\"asm\"][\"vb\"]).apply(null,arguments)};var _memalign=Module[\"_memalign\"]=function(){return(_memalign=Module[\"_memalign\"]=Module[\"asm\"][\"wb\"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module[\"__emscripten_allow_main_runtime_queued_calls\"]=9808;var __emscripten_main_thread_futex=Module[\"__emscripten_main_thread_futex\"]=11432;Module[\"cwrap\"]=cwrap;Module[\"PThread\"]=PThread;Module[\"PThread\"]=PThread;Module[\"wasmMemory\"]=wasmMemory;Module[\"ExitStatus\"]=ExitStatus;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({\"cmd\":\"loaded\"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exitProcess\",\"returnCode\":status});throw new ExitStatus(status)}else{}}if(noExitRuntime){}else{PThread.terminateAllThreads();EXITSTATUS=status;exitRuntime();if(Module[\"onExit\"])Module[\"onExit\"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run();\n\n\n return WasmBackendModuleThreadedSimd.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModuleThreadedSimd;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModuleThreadedSimd; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModuleThreadedSimd\"] = WasmBackendModuleThreadedSimd;\n", "\nvar WasmBackendModule = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModule) {\n WasmBackendModule = WasmBackendModule || {};\n\nvar Module=typeof WasmBackendModule!==\"undefined\"?WasmBackendModule:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str=\"\";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmMemory=Module[\"asm\"][\"i\"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module[\"asm\"][\"o\"];removeRunDependency(\"wasm-instantiate\")}addRunDependency(\"wasm-instantiate\");function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _abort(){abort()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_create(){return 6}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _sysconf(name){switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}var asmLibraryArg={\"a\":_abort,\"d\":_emscripten_memcpy_big,\"e\":_emscripten_resize_heap,\"f\":_fd_close,\"c\":_fd_seek,\"b\":_fd_write,\"g\":_pthread_create,\"h\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"j\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"k\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"l\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"m\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"n\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"p\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"q\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"r\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"s\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"t\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"u\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"v\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"w\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"x\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"y\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"z\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"F\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Transform=Module[\"_Transform\"]=function(){return(_Transform=Module[\"_Transform\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"Ta\"]).apply(null,arguments)};Module[\"cwrap\"]=cwrap;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}run();\n\n\n return WasmBackendModule.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModule;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModule; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModule\"] = WasmBackendModule;\n", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Backend, DataId} from '../tensor';\nimport {BackendValues, DataType} from '../types';\n\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n\n// Required information for all backends.\nexport interface BackendTimingInfo {\n kernelMs: number|{error: string};\n getExtraProfileInfo?(): string; // a field for additional timing information\n // e.g. packing / unpacking for WebGL backend\n}\n\nexport interface TensorStorage {\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n disposeData(dataId: DataId, force?: boolean): boolean;\n write(values: BackendValues, shape: number[], dtype: DataType): DataId;\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void;\n memory(): {unreliable: boolean;}; // Backend-specific information.\n /** Returns number of data ids currently in the storage. */\n numDataIds(): number;\n refCount(dataId: DataId): number;\n}\n\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n private data = new WeakMap();\n private dataIdsCount = 0;\n\n constructor(private backend: KernelBackend, private dataMover: DataMover) {}\n\n get(dataId: DataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n\n set(dataId: DataId, value: T): void {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n\n has(dataId: DataId): boolean {\n return this.data.has(dataId);\n }\n\n delete(dataId: DataId): boolean {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n\n numDataIds(): number {\n return this.dataIdsCount;\n }\n}\n\nexport interface DataMover {\n /**\n * To be called by backends whenever they see a dataId that they don't own.\n * Upon calling this method, the mover will fetch the tensor from another\n * backend and register it with the current active backend.\n */\n moveData(backend: KernelBackend, dataId: DataId): void;\n}\n\nexport interface BackendTimer {\n // check if backend timer is available\n timerAvailable(): boolean;\n time(f: () => void): Promise;\n}\n\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend implements TensorStorage, Backend, BackendTimer {\n refCount(dataId: DataId): number {\n return notYetImplemented('refCount');\n }\n incRef(dataId: DataId): void {\n return notYetImplemented('incRef');\n }\n timerAvailable(): boolean {\n return true;\n }\n time(f: () => void): Promise {\n return notYetImplemented('time');\n }\n read(dataId: object): Promise {\n return notYetImplemented('read');\n }\n readSync(dataId: object): BackendValues {\n return notYetImplemented('readSync');\n }\n numDataIds(): number {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId: object, force?: boolean): boolean {\n return notYetImplemented('disposeData');\n }\n write(values: BackendValues, shape: number[], dtype: DataType): DataId {\n return notYetImplemented('write');\n }\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void {\n return notYetImplemented('move');\n }\n memory(): {unreliable: boolean; reasons?: string[]} {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision(): 16|32 {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon(): number {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose(): void {\n return notYetImplemented('dispose');\n }\n}\n\nfunction notYetImplemented(kernelName: string): never {\n throw new Error(\n `'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap, FlatVector, NumericDataType, RecursiveArray, TensorLike, TypedArray} from './types';\n\n/**\n * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n // tslint:disable-next-line:no-any\n array: any[]|Uint32Array|Int32Array|Float32Array,\n // tslint:disable-next-line:no-any\n array2: any[]|Uint32Array|Int32Array|Float32Array): void {\n if (array.length !== array2.length) {\n throw new Error(\n `Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\nexport function nearestLargerEven(val: number): number {\n return val % 2 === 0 ? val : val + 1;\n}\n\nexport function sum(arr: number[]): number {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a: number, b: number) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr: boolean, msg: () => string) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n () => `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function\nflatten|TypedArray>(\n arr: T|RecursiveArray, result: T[] = [], skipTypedArray = false): T[] {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n } else {\n result.push(arr as T);\n }\n return result;\n}\n\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (shapeProd === 0) {\n throw Error(\n `Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n assert(\n axis.every(ax => ax >= -rank && ax < rank),\n () =>\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n assert(\n axis.every(ax => isInt(ax)),\n () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function getArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else if (dtype === 'string') {\n values = new Array<'string'>(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function checkConversionForErrors(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype: DataType): boolean {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nexport function isTypedArray(a: {}): a is Float32Array|Int32Array|Uint8Array {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'complex64') {\n return 8;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr: Uint8Array[]): number {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n\n/** Returns true if the value is a string. */\nexport function isString(value: {}): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport function isBoolean(value: {}): boolean {\n return typeof value === 'boolean';\n}\n\nexport function isNumber(value: {}): boolean {\n return typeof value === 'number';\n}\n\nexport function inferDtype(values: TensorLike): DataType {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n } else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n } else if (isNumber(values)) {\n return 'float32';\n } else if (isString(values)) {\n return 'string';\n } else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nfunction createNestedArray(\n offset: number, shape: number[], a: TypedArray, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n } else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(\n shape: number[], a: TypedArray, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${\n isComplex ? ' for a complex tensor' : ''}.`);\n }\n\n return createNestedArray(0, shape, a, isComplex);\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size) as DataTypeMap[D];\n } else if (dtype === 'int32') {\n return new Int32Array(size) as DataTypeMap[D];\n } else if (dtype === 'bool') {\n return new Uint8Array(size) as DataTypeMap[D];\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(\n shape: number[], dtype: D) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n } else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n } else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function assertNonNegativeIntegerDimensions(shape: number[]) {\n shape.forEach(dimSize => {\n assert(\n Number.isInteger(dimSize) && dimSize >= 0,\n () =>\n `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(\n locs: number[], rank: number, strides: number[]): number {\n if (rank === 0) {\n return 0;\n } else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(\n index: number, rank: number, strides: number[]): number[] {\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object: any) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Platform} from './platforms/platform';\nimport {isPromise} from './util_base';\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n\ntype FlagValue = number|boolean;\ntype FlagEvaluationFn = (() => FlagValue)|(() => Promise);\nexport type Flags = {\n [featureName: string]: FlagValue\n};\nexport type FlagRegistryEntry = {\n evaluationFn: FlagEvaluationFn;\n setHook?: (value: FlagValue) => void;\n};\n\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n private flags: Flags = {};\n private flagRegistry: {[flagName: string]: FlagRegistryEntry} = {};\n\n private urlFlags: Flags = {};\n\n platformName: string;\n platform: Platform;\n\n // Jasmine spies on this in 'environment_test.ts'\n getQueryParams = getQueryParams;\n\n // tslint:disable-next-line: no-any\n constructor(public global: any) {\n this.populateURLFlags();\n }\n\n setPlatform(platformName: string, platform: Platform) {\n if (this.platform != null) {\n console.warn(\n `Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n\n registerFlag(\n flagName: string, evaluationFn: FlagEvaluationFn,\n setHook?: (value: FlagValue) => void) {\n this.flagRegistry[flagName] = {evaluationFn, setHook};\n\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(\n `Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n\n async getAsync(flagName: string): Promise {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n\n get(flagName: string): FlagValue {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(\n `Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n\n this.flags[flagName] = flagValue as number | boolean;\n\n return this.flags[flagName];\n }\n\n getNumber(flagName: string): number {\n return this.get(flagName) as number;\n }\n\n getBool(flagName: string): boolean {\n return this.get(flagName) as boolean;\n }\n\n getFlags(): Flags {\n return this.flags;\n }\n // For backwards compatibility.\n get features(): Flags {\n return this.flags;\n }\n\n set(flagName: string, value: FlagValue): void {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n\n private evaluateFlag(flagName: string): FlagValue|Promise {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n\n setFlags(flags: Flags) {\n this.flags = Object.assign({}, flags);\n }\n\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n\n private populateURLFlags(): void {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n\nfunction parseValue(flagName: string, value: string): FlagValue {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n } else if (`${+ value}` === value) {\n return +value;\n }\n throw new Error(\n `Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\n\nexport let ENV: Environment = null;\nexport function setEnvironmentGlobal(environment: Environment) {\n ENV = environment;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace: {_tfGlobals: Map};\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace(): {_tfGlobals: Map} {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (global) !== 'undefined') {\n ns = global;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else if (typeof (self) !== 'undefined') {\n ns = self;\n } else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n\n// tslint:disable-next-line:no-any\nfunction getGlobalMap(): Map {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key: string, init: () => T): T {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n } else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Allow UpperCamelCase variable names\n// tslint:disable: variable-name\n// Unfortunately just enabling PascalCase per file (tslint:enable:\n// allow-pascal-case) doesn't work.\nimport {NamedTensorInfoMap, TensorInfo} from './kernel_registry';\nimport {ExplicitPadding} from './ops/conv_util';\nimport {Activation} from './ops/fused_types';\nimport {DataType, PixelData} from './types';\n\nexport const Abs = 'Abs';\nexport type AbsInputs = UnaryInputs;\n\nexport const Acos = 'Acos';\nexport type AcosInputs = UnaryInputs;\n\nexport const Acosh = 'Acosh';\nexport type AcoshInputs = UnaryInputs;\n\nexport const Add = 'Add';\nexport type AddInputs = BinaryInputs;\n\nexport const AddN = 'AddN';\nexport type AddNInputs = TensorInfo[];\n\nexport const All = 'All';\nexport type AllInputs = Pick;\nexport interface AllAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Any = 'Any';\nexport type AnyInputs = Pick;\nexport interface AnyAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const ArgMax = 'ArgMax';\nexport type ArgMaxInputs = Pick;\nexport interface ArgMaxAttrs {\n axis: number;\n}\n\nexport const ArgMin = 'ArgMin';\nexport type ArgMinInputs = Pick;\nexport interface ArgMinAttrs {\n axis: number;\n}\n\nexport const Asin = 'Asin';\nexport type AsinInputs = UnaryInputs;\n\nexport const Asinh = 'Asinh';\nexport type AsinhInputs = UnaryInputs;\n\nexport const Atan = 'Atan';\nexport type AtanInputs = UnaryInputs;\n\nexport const Atanh = 'Atanh';\nexport type AtanhInputs = UnaryInputs;\n\nexport const Atan2 = 'Atan2';\nexport type Atan2Inputs = BinaryInputs;\n\nexport const AvgPool = 'AvgPool';\nexport type AvgPoolInputs = Pick;\nexport interface AvgPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport type AvgPoolGradInputs = Pick;\nexport interface AvgPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n}\n\nexport const AvgPool3D = 'AvgPool3D';\nexport type AvgPool3DInputs = Pick;\nexport interface AvgPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n dataFormat: 'NDHWC'|'NCDHW';\n}\n\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport type AvgPool3DGradInputs = Pick;\nexport interface AvgPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const BatchMatMul = 'BatchMatMul';\nexport type BatchMatMulInputs = Pick;\nexport interface BatchMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n}\n\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport type BatchToSpaceNDInputs = Pick;\nexport interface BatchToSpaceNDAttrs {\n blockShape: number[];\n crops: number[][];\n}\n\nexport type BinaryInputs = Pick;\n\nexport const Bincount = 'Bincount';\nexport type BincountInputs = Pick;\nexport interface BincountAttrs {\n size: number;\n}\n\nexport const BroadcastTo = 'BroadcastTo';\nexport type BroadcastToInputs = Pick;\nexport interface BroadCastToAttrs {\n shape: number[];\n inputShape: number[]; // for gradient\n}\n\nexport const Cast = 'Cast';\nexport type CastInputs = UnaryInputs;\nexport interface CastAttrs {\n dtype: DataType;\n}\n\nexport const Ceil = 'Ceil';\nexport type CeilInputs = UnaryInputs;\n\nexport const ClipByValue = 'ClipByValue';\nexport type ClipByValueInputs = UnaryInputs;\nexport interface ClipByValueAttrs {\n clipValueMin: number;\n clipValueMax: number;\n}\n\nexport const Complex = 'Complex';\nexport type ComplexInputs = Pick;\n\nexport const ComplexAbs = 'ComplexAbs';\nexport type ComplexAbsInputs = UnaryInputs;\n\nexport const Concat = 'Concat';\nexport type ConcatInputs = TensorInfo[];\nexport interface ConcatAttrs {\n axis: number;\n}\n\nexport const Conv2D = 'Conv2D';\nexport type Conv2DInputs = Pick;\nexport interface Conv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport type Conv2DBackpropFilterInputs = Pick;\nexport interface Conv2DBackpropFilterAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport type Conv2DBackpropInputInputs = Pick;\nexport interface Conv2DBackpropInputAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Conv3D = 'Conv3D';\nexport type Conv3DInputs = Pick;\nexport interface Conv3DAttrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n dataFormat: 'NDHWC'|'NCDHW';\n dilations: [number, number, number]|number;\n}\n\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport type Conv3DBackpropFilterV2Inputs = Pick;\n\nexport interface Conv3DBackpropFilterV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n filterShape: [number, number, number, number, number];\n}\n\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport type Conv3DBackpropInputV2Inputs =\n Pick;\nexport interface Conv3DBackpropInputV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n inputShape: [number, number, number, number, number];\n}\n\nexport const Cos = 'Cos';\nexport type CosInputs = UnaryInputs;\n\nexport const Cosh = 'Cosh';\nexport type CoshInputs = UnaryInputs;\n\nexport const Cumsum = 'Cumsum';\nexport type CumsumInputs = Pick;\nexport interface CumsumAttrs {\n axis: number;\n exclusive: boolean;\n reverse: boolean;\n}\n\nexport const CropAndResize = 'CropAndResize';\nexport type CropAndResizeInputs =\n Pick;\nexport interface CropAndResizeAttrs {\n cropSize: [number, number];\n method: 'bilinear'|'nearest';\n extrapolationValue: number;\n}\n\nexport const DenseBincount = 'DenseBincount';\nexport type DenseBincountInputs = Pick;\nexport interface DenseBincountAttrs {\n size: number;\n binaryOutput?: boolean;\n}\n\nexport const DepthToSpace = 'DepthToSpace';\nexport type DepthToSpaceInputs = Pick;\nexport interface DepthToSpaceAttrs {\n blockSize: number;\n dataFormat: 'NHWC'|'NCHW';\n}\n\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport type DepthwiseConv2dNativeInputs =\n Pick;\nexport interface DepthwiseConv2dNativeAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const DepthwiseConv2dNativeBackpropFilter =\n 'DepthwiseConv2dNativeBackpropFilter';\nexport type DepthwiseConv2dNativeBackpropFilterInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropFilterAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const DepthwiseConv2dNativeBackpropInput =\n 'DepthwiseConv2dNativeBackpropInput';\nexport type DepthwiseConv2dNativeBackpropInputInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropInputAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Diag = 'Diag';\nexport type DiagInputs = Pick;\n\nexport const Dilation2D = 'Dilation2D';\nexport type Dilation2DInputs = Pick;\nexport interface Dilation2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dilations: [number, number]|number;\n}\n\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport type Dilation2DBackpropInputInputs =\n Pick;\n\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport type Dilation2DBackpropFilterInputs =\n Pick;\n\nexport const RealDiv = 'RealDiv';\nexport type RealDivInputs = BinaryInputs;\n\nexport const Einsum = 'Einsum';\nexport type EinsumInputs = TensorInfo[];\nexport interface EinsumAttrs {\n equation: string;\n}\n\nexport const Elu = 'Elu';\nexport type EluInputs = Pick;\n\nexport const EluGrad = 'EluGrad';\nexport type EluGradInputs = Pick;\n\nexport const Erf = 'Erf';\nexport type ErfInputs = UnaryInputs;\n\nexport const Equal = 'Equal';\nexport type EqualInputs = BinaryInputs;\n\nexport const Exp = 'Exp';\nexport type ExpInputs = UnaryInputs;\n\nexport const ExpandDims = 'ExpandDims';\nexport type ExpandDimsInputs = Pick;\nexport interface ExpandDimsAttrs {\n dim: number;\n}\n\nexport const Expm1 = 'Expm1';\nexport type Expm1Inputs = UnaryInputs;\n\nexport const FFT = 'FFT';\nexport type FFTInputs = Pick;\n\nexport const Fill = 'Fill';\nexport interface FillAttrs {\n shape: number[];\n value: number|string;\n dtype: DataType;\n}\n\nexport const FlipLeftRight = 'FlipLeftRight';\nexport type FlipLeftRightInputs = Pick;\n\nexport const Floor = 'Floor';\nexport type FloorInputs = UnaryInputs;\n\nexport const FloorDiv = 'FloorDiv';\nexport type FloorDivInputs = BinaryInputs;\n\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport type FusedBatchNormInputs =\n Pick;\nexport interface FusedBatchNormAttrs {\n varianceEpsilon: number;\n}\n\nexport const GatherV2 = 'GatherV2';\nexport type GatherV2Inputs = Pick;\nexport interface GatherV2Attrs {\n axis: number;\n batchDims: number;\n}\n\nexport const GatherNd = 'GatherNd';\nexport type GatherNdInputs = Pick;\n\nexport const Greater = 'Greater';\nexport type GreaterInputs = BinaryInputs;\n\nexport const GreaterEqual = 'GreaterEqual';\nexport type GreaterEqualInputs = BinaryInputs;\n\nexport const Identity = 'Identity';\nexport type IdentityInputs = Pick;\n\nexport const IFFT = 'IFFT';\nexport type IFFTInputs = Pick;\n\nexport const Imag = 'Imag';\nexport type ImagInputs = Pick;\n\nexport const IsFinite = 'IsFinite';\nexport type IsFiniteInputs = UnaryInputs;\n\nexport const IsInf = 'IsInf';\nexport type IsInfInputs = UnaryInputs;\n\nexport const IsNan = 'IsNan';\nexport type IsNanInputs = UnaryInputs;\n\nexport const LeakyRelu = 'LeakyRelu';\nexport type LeakyReluInputs = Pick;\nexport interface LeakyReluAttrs {\n alpha: number;\n}\n\nexport const Less = 'Less';\nexport type LessInputs = BinaryInputs;\n\nexport const LessEqual = 'LessEqual';\nexport type LessEqualInputs = BinaryInputs;\n\nexport const LinSpace = 'LinSpace';\nexport interface LinSpaceAttrs {\n start: number;\n stop: number;\n num: number;\n}\nexport const Log = 'Log';\nexport type LogInputs = UnaryInputs;\n\nexport const Log1p = 'Log1p';\nexport type Log1pInputs = UnaryInputs;\n\nexport const LogicalAnd = 'LogicalAnd';\nexport type LogicalAndInputs = BinaryInputs;\n\nexport const LogicalNot = 'LogicalNot';\nexport type LogicalNotInputs = Pick;\n\nexport const LogicalOr = 'LogicalOr';\nexport type LogicalOrInputs = BinaryInputs;\n\nexport const LogSoftmax = 'LogSoftmax';\nexport type LogSoftmaxInputs = Pick;\nexport interface LogSoftmaxAttrs {\n axis: number;\n}\n\nexport const LRN = 'LRN';\nexport type LRNInputs = Pick;\nexport interface LRNAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const LRNGrad = 'LRNGrad';\nexport type LRNGradInputs = Pick;\nexport interface LRNGradAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const Max = 'Max';\nexport type MaxInputs = Pick;\nexport interface MaxAttrs {\n reductionIndices: number|number[];\n keepDims: boolean;\n}\n\nexport const Maximum = 'Maximum';\nexport type MaximumInputs = BinaryInputs;\n\nexport const MaxPool = 'MaxPool';\nexport type MaxPoolInputs = Pick;\nexport interface MaxPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport type MaxPoolGradInputs = Pick;\nexport interface MaxPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3D = 'MaxPool3D';\nexport type MaxPool3DInputs = Pick;\nexport interface MaxPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NDHWC'|'NCDHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport type MaxPool3DGradInputs =\n Pick;\nexport interface MaxPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport type MaxPoolWithArgmaxInputs = Pick;\nexport interface MaxPoolWithArgmaxAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n includeBatchInIndex: boolean;\n}\n\nexport const Mean = 'Mean';\nexport type MeanInputs = Pick;\nexport interface MeanAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Min = 'Min';\nexport type MinInputs = Pick;\nexport interface MinAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Minimum = 'Minimum';\nexport type MinimumInputs = BinaryInputs;\n\nexport const MirrorPad = 'MirrorPad';\nexport type MirrorPadInputs = Pick;\nexport interface MirrorPadAttrs {\n paddings: Array<[number, number]>;\n mode: 'reflect'|'symmetric';\n}\n\nexport const Mod = 'Mod';\nexport type ModInputs = BinaryInputs;\n\nexport const Multinomial = 'Multinomial';\nexport type MultinomialInputs = Pick;\nexport interface MultinomialAttrs {\n numSamples: number;\n seed: number;\n normalized: boolean;\n}\n\nexport const Multiply = 'Multiply';\nexport type MultiplyInputs = BinaryInputs;\n\nexport const Neg = 'Neg';\nexport type NegInputs = UnaryInputs;\n\nexport const NotEqual = 'NotEqual';\nexport type NotEqualInputs = BinaryInputs;\n\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport type NonMaxSuppressionV3Inputs =\n Pick;\nexport interface NonMaxSuppressionV3Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n}\n\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport type NonMaxSuppressionV4Inputs =\n Pick;\nexport interface NonMaxSuppressionV4Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n padToMaxOutputSize: boolean;\n}\n\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport type NonMaxSuppressionV5Inputs =\n Pick;\nexport interface NonMaxSuppressionV5Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n softNmsSigma: number;\n}\n\nexport const OnesLike = 'OnesLike';\nexport type OnesLikeInputs = UnaryInputs;\n\nexport const OneHot = 'OneHot';\nexport type OneHotInputs = Pick;\nexport interface OneHotAttrs {\n depth: number;\n onValue: number;\n offValue: number;\n}\n\nexport const Pack = 'Pack';\nexport type PackInputs = TensorInfo[];\nexport interface PackAttrs {\n axis: number;\n}\n\nexport const PadV2 = 'PadV2';\nexport type PadV2Inputs = Pick;\nexport interface PadV2Attrs {\n paddings: Array<[number, number]>;\n constantValue: number;\n}\n\nexport const Pool = 'Pool';\nexport type PoolInputs = Pick;\n\nexport const Pow = 'Pow';\nexport type PowInputs = BinaryInputs;\n\nexport const Prelu = 'Prelu';\nexport type PreluInputs = Pick;\n\nexport const Prod = 'Prod';\nexport type ProdInputs = Pick;\nexport interface ProdAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Range = 'Range';\nexport interface RangeAttrs {\n start: number;\n stop: number;\n step: number;\n dtype: 'float32'|'int32';\n}\n\nexport const Real = 'Real';\nexport type RealInputs = Pick;\n\nexport const Reciprocal = 'Reciprocal';\nexport type ReciprocalInputs = UnaryInputs;\n\nexport const Relu = 'Relu';\nexport type ReluInputs = Pick;\n\nexport const Reshape = 'Reshape';\nexport type ReshapeInputs = Pick;\nexport interface ReshapeAttrs {\n shape: number[];\n}\n\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport type ResizeNearestNeighborInputs = Pick;\nexport interface ResizeNearestNeighborAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport type ResizeNearestNeighborGradInputs =\n Pick;\nexport type ResizeNearestNeighborGradAttrs = ResizeNearestNeighborAttrs;\n\nexport const ResizeBilinear = 'ResizeBilinear';\nexport type ResizeBilinearInputs = Pick;\nexport interface ResizeBilinearAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport type ResizeBilinearGradInputs = Pick;\nexport type ResizeBilinearGradAttrs = ResizeBilinearAttrs;\n\nexport const Relu6 = 'Relu6';\nexport type Relu6Inputs = Pick;\n\nexport const Reverse = 'Reverse';\nexport type ReverseInputs = Pick;\nexport interface ReverseAttrs {\n dims: number|number[];\n}\n\nexport const Round = 'Round';\nexport type RoundInputs = UnaryInputs;\n\nexport const Rsqrt = 'Rsqrt';\nexport type RsqrtInputs = UnaryInputs;\n\nexport const ScatterNd = 'ScatterNd';\nexport type ScatterNdInputs = Pick;\nexport interface ScatterNdAttrs {\n shape: number[];\n}\n\nexport const Select = 'Select';\nexport type SelectInputs = Pick;\n\nexport const Selu = 'Selu';\nexport type SeluInputs = Pick;\n\nexport const Slice = 'Slice';\nexport type SliceInputs = Pick;\nexport interface SliceAttrs {\n begin: number|number[];\n size: number|number[];\n}\nexport const Sin = 'Sin';\nexport type SinInputs = UnaryInputs;\n\nexport const Sinh = 'Sinh';\nexport type SinhInputs = UnaryInputs;\n\nexport const Sign = 'Sign';\nexport type SignInputs = UnaryInputs;\n\nexport const Sigmoid = 'Sigmoid';\nexport type SigmoidInputs = UnaryInputs;\n\nexport const Softplus = 'Softplus';\nexport type SoftplusInputs = UnaryInputs;\n\nexport const Sqrt = 'Sqrt';\nexport type SqrtInputs = UnaryInputs;\n\nexport const Sum = 'Sum';\nexport type SumInputs = Pick;\nexport interface SumAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport type SpaceToBatchNDInputs = Pick;\nexport interface SpaceToBatchNDAttrs {\n blockShape: number[];\n paddings: number[][];\n}\n\nexport const SplitV = 'SplitV';\nexport type SplitVInputs = Pick;\nexport interface SplitVAttrs {\n numOrSizeSplits: number[]|number;\n axis: number;\n}\n\nexport const Softmax = 'Softmax';\nexport type SoftmaxInputs = Pick;\nexport interface SoftmaxAttrs {\n dim: number;\n}\n\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport type SparseFillEmptyRowsInputs =\n Pick;\n\nexport const SparseReshape = 'SparseReshape';\nexport type SparseReshapeInputs =\n Pick;\n\nexport const SparseSegmentMean = 'SparseSegmentMean';\nexport type SparseSegmentMeanInputs =\n Pick;\n\nexport const SparseSegmentSum = 'SparseSegmentSum';\nexport type SparseSegmentSumInputs =\n Pick;\n\nexport const SparseToDense = 'SparseToDense';\nexport type SparseToDenseInputs =\n Pick;\nexport interface SparseToDenseAttrs {\n outputShape: number[];\n}\n\nexport const SquaredDifference = 'SquaredDifference';\nexport type SquaredDifferenceInputs = BinaryInputs;\n\nexport const Square = 'Square';\nexport type SquareInputs = Pick;\n\nexport const StridedSlice = 'StridedSlice';\nexport type StridedSliceInputs = Pick;\nexport interface StridedSliceAttrs {\n begin: number[];\n end: number[];\n strides: number[];\n beginMask: number;\n endMask: number;\n ellipsisMask: number;\n newAxisMask: number;\n shrinkAxisMask: number;\n}\n\nexport const StringNGrams = 'StringNGrams';\nexport type StringNGramsInputs = Pick;\nexport interface StringNGramsAttrs {\n separator: string;\n nGramWidths: number[];\n leftPad: string;\n rightPad: string;\n padWidth: number;\n preserveShortSequences: boolean;\n}\n\nexport const StringSplit = 'StringSplit';\nexport type StringSplitInputs = Pick;\nexport interface StringSplitAttrs {\n skipEmpty: boolean;\n}\n\nexport const StringToHashBucketFast = 'StringToHashBucketFast';\nexport type StringToHashBucketFastInputs = Pick;\nexport interface StringToHashBucketFastAttrs {\n numBuckets: number;\n}\n\nexport const Sub = 'Sub';\nexport type SubInputs = BinaryInputs;\n\nexport const Tan = 'Tan';\nexport type TanInputs = UnaryInputs;\n\nexport const Tanh = 'Tanh';\nexport type TanhInputs = UnaryInputs;\n\nexport const Tile = 'Tile';\nexport type TileInputs = Pick;\nexport interface TileAttrs {\n reps: number[];\n}\n\nexport const TopK = 'TopK';\nexport type TopKInputs = Pick;\nexport interface TopKAttrs {\n k: number;\n sorted: boolean;\n}\n\nexport const Transform = 'Transform';\nexport type TransformInputs = Pick;\nexport interface TransformAttrs {\n interpolation: 'nearest'|'bilinear';\n fillMode: 'constant'|'reflect'|'wrap'|'nearest';\n fillValue: number;\n outputShape?: [number, number];\n}\n\nexport const Transpose = 'Transpose';\nexport type TransposeInputs = Pick;\nexport interface TransposeAttrs {\n perm: number[];\n}\n\nexport const Unique = 'Unique';\nexport type UniqueInputs = Pick;\nexport interface UniqueAttrs {\n axis: number;\n}\n\nexport type UnaryInputs = Pick;\n\nexport const Unpack = 'Unpack';\nexport type UnpackInputs = Pick;\nexport interface UnpackAttrs {\n axis: number;\n}\n\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport type UnsortedSegmentSumInputs =\n Pick;\nexport interface UnsortedSegmentSumAttrs {\n numSegments: number;\n}\n\nexport const ZerosLike = 'ZerosLike';\nexport type ZerosLikeInputs = UnaryInputs;\n\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport type StepInputs = UnaryInputs;\nexport interface StepAttrs {\n alpha: number;\n}\n\nexport const FromPixels = 'FromPixels';\nexport interface FromPixelsInputs {\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap;\n}\nexport interface FromPixelsAttrs {\n numChannels: number;\n}\n\nexport const RotateWithOffset = 'RotateWithOffset';\nexport type RotateWithOffsetInputs = Pick;\nexport interface RotateWithOffsetAttrs {\n radians: number;\n fillValue: number|[number, number, number];\n center: number|[number, number];\n}\n\nexport const _FusedMatMul = '_FusedMatMul';\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulInputs extends NamedTensorInfoMap {\n a: TensorInfo;\n b: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedConv2D = 'FusedConv2D';\nexport interface FusedConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\nexport interface FusedDepthwiseConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedDepthwiseConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from './environment';\n\nimport {getGlobal} from './global_util';\nimport {NamedGradientMap} from './tape';\nimport {Tensor} from './tensor';\nimport {DataType, RecursiveArray} from './types';\n\nconst kernelRegistry =\n getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry =\n getGlobal('gradRegistry', () => new Map());\n\nexport type DataId = object;\n\ntype AttributeValue =\n number|number[]|boolean|boolean[]|string|string[]|NamedAttrMap;\n\n/** These are extra non-tensor/primitive params passed to kernel functions. */\nexport type Attribute = AttributeValue|RecursiveArray;\n\n/** Specifies the code to run when executing a kernel. */\nexport type KernelFunc = (params: {\n inputs: NamedTensorInfoMap,\n backend: {},\n attrs?: NamedAttrMap,\n}) => TensorInfo|TensorInfo[];\n\n/** The function to run when computing a gradient during backprop. */\nexport type GradFunc =\n (dy: Tensor|Tensor[], saved: Tensor[], attrs: NamedAttrMap) =>\n NamedGradientMap;\n\n/** Function that gets called after the backend initializes. */\nexport type KernelSetupFunc = (backend: {}) => void;\n/** Function that gets called right before the backend is disposed. */\nexport type KernelDisposeFunc = KernelSetupFunc;\n\n/** Config object for registering a kernel in the global registry. */\nexport interface KernelConfig {\n kernelName: string;\n backendName: string;\n kernelFunc: KernelFunc;\n setupFunc?: KernelSetupFunc;\n disposeFunc?: KernelDisposeFunc;\n}\n\n/** Config object for registering a gradient in the global registry. */\nexport interface GradConfig {\n kernelName: string;\n inputsToSave?: string[];\n // When saveAllInputs is true, all inputs will be saved. Only use this flag\n // if inputs is an array of Tensors.\n saveAllInputs?: boolean;\n outputsToSave?: boolean[];\n gradFunc: GradFunc;\n}\n\n/** Holds metadata for a given tensor. */\nexport interface TensorInfo {\n dataId: DataId;\n shape: number[];\n dtype: DataType;\n}\n\nexport interface NamedTensorInfoMap {\n [name: string]: TensorInfo;\n}\n\nexport interface NamedAttrMap {\n [name: string]: Attribute;\n}\n\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(\n kernelName: string, backendName: string): KernelConfig {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName: string): GradConfig {\n return gradRegistry.get(kernelName);\n}\n\nexport function getKernelsForBackend(backendName: string): KernelConfig[] {\n const it = kernelRegistry.entries();\n const result: KernelConfig[] = [];\n\n while (true) {\n const {done, value} = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend, ] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config: KernelConfig) {\n const {kernelName, backendName} = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config: GradConfig) {\n const {kernelName} = config;\n\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(\n kernelName: string, backendName: string): void {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName: string): void {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(\n `The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(\n registeredBackendName: string, newBackendName: string): void {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig =\n Object.assign({}, kernelConfig, {backendName: newBackendName});\n registerKernel(newKernelConfig);\n });\n}\n\nfunction makeKey(kernelName: string, backendName: string) {\n return `${backendName}_${kernelName}`;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from './environment';\nimport {BackendValues, DataType, TensorLike, TypedArray} from './types';\nimport * as base from './util_base';\nexport * from './util_base';\nexport * from './hash_util';\n\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(\n value: DataType, dtype: DataType): BackendValues {\n if (dtype === 'string') {\n return encodeString(value);\n }\n\n return toTypedArray([value], dtype);\n}\n\nfunction noConversionNeeded(a: TensorLike, dtype: DataType): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function toTypedArray(a: TensorLike, dtype: DataType): TypedArray {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a as number[], dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a as TypedArray;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a as number[]);\n } else if (dtype === 'int32') {\n return new Int32Array(a as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array((a as number[]).length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round((a as number[])[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now(): number {\n return env().platform.now();\n}\n\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(\n path: string, requestInits?: RequestInit): Promise {\n return env().platform.fetch(path, requestInits);\n}\n\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s: string, encoding = 'utf-8'): Uint8Array {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes: Uint8Array, encoding = 'utf-8'): string {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Workaround for allowing cjs module to be included in bundle created by\n// rollup.\nimport * as LongExports from 'long';\n// tslint:disable-next-line\nconst Long: LongExports.LongConstructor =\n // tslint:disable-next-line\n (LongExports as any).default || LongExports;\n\nexport function hexToLong(hex: string): Long {\n return Long.fromString(hex, true, 16);\n}\n\n// Some primes between 2^63 and 2^64 for various uses.\n// Hex 0xc3a5c85c97cb3127\nconst k0: Long = hexToLong('c3a5c85c97cb3127');\n// Hex 0xb492b66fbe98f273\nconst k1: Long = hexToLong('b492b66fbe98f273');\n// Hex 0x9ae16a3b2f90404f\nconst k2: Long = hexToLong('9ae16a3b2f90404f');\n\nfunction shiftMix(val: Long): Long {\n return val.xor(val.shru(47));\n}\n\nfunction fetch(s: Uint8Array, offset: number, numBytes: number): Long {\n const bytes = s.slice(offset, offset + numBytes);\n return Long.fromBytes(Array.from(bytes), true, true);\n}\n\nfunction fetch64(s: Uint8Array, offset: number): Long {\n return fetch(s, offset, 8);\n}\n\nfunction fetch32(s: Uint8Array, offset: number): Long {\n return fetch(s, offset, 4);\n}\n\nfunction rotate64(val: Long, shift: number): Long {\n // Avoid shifting by 64: doing so yields an undefined result.\n return shift === 0 ? val : val.shru(shift).or(val.shl(64 - shift));\n}\n\nfunction hashLen16(u: Long, v: Long, mul = hexToLong('9ddfea08eb382d69')) {\n // Murmur-inspired hashing.\n let a = u.xor(v).mul(mul);\n a = a.xor(a.shru(47));\n let b = v.xor(a).mul(mul);\n b = b.xor(b.shru(47));\n b = b.mul(mul);\n return b;\n}\n\n// Return a 16-byte hash for 48 bytes. Quick and dirty.\n// Callers do best to use \"random-looking\" values for a and b.\nfunction weakHashLen32WithSeeds(\n w: Long, x: Long, y: Long, z: Long, a: Long, b: Long) {\n a = a.add(w);\n b = rotate64(b.add(a).add(z), 21);\n const c = a;\n a = a.add(x);\n a = a.add(y);\n b = b.add(rotate64(a, 44));\n return [a.add(z), b.add(c)];\n}\n\nfunction weakHashLen32WithSeedsStr(\n s: Uint8Array, offset: number, a: Long, b: Long) {\n return weakHashLen32WithSeeds(\n fetch64(s, offset), fetch64(s, offset + 8), fetch64(s, offset + 16),\n fetch64(s, offset + 24), a, b);\n}\n\nfunction hashLen0to16(s: Uint8Array, len = s.length): Long {\n if (len >= 8) {\n const mul = k2.add(len * 2);\n const a = fetch64(s, 0).add(k2);\n const b = fetch64(s, len - 8);\n const c = rotate64(b, 37).mul(mul).add(a);\n const d = rotate64(a, 25).add(b).mul(mul);\n return hashLen16(c, d, mul);\n }\n if (len >= 4) {\n const mul = k2.add(len * 2);\n const a = fetch32(s, 0);\n return hashLen16(a.shl(3).add(len), fetch32(s, len - 4), mul);\n }\n if (len > 0) {\n const a = s[0];\n const b = s[len >> 1];\n const c = s[len - 1];\n const y = a + (b << 8);\n const z = len + (c << 2);\n return shiftMix(k2.mul(y).xor(k0.mul(z))).mul(k2);\n }\n return k2;\n}\n\nfunction hashLen17to32(s: Uint8Array, len = s.length): Long {\n const mul = k2.add(len * 2);\n const a = fetch64(s, 0).mul(k1);\n const b = fetch64(s, 8);\n const c = fetch64(s, len - 8).mul(mul);\n const d = fetch64(s, len - 16).mul(k2);\n return hashLen16(\n rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d),\n a.add(rotate64(b.add(k2), 18)).add(c), mul);\n}\n\nfunction hashLen33to64(s: Uint8Array, len = s.length): Long {\n const mul = k2.add(len * 2);\n const a = fetch64(s, 0).mul(k2);\n const b = fetch64(s, 8);\n const c = fetch64(s, len - 8).mul(mul);\n const d = fetch64(s, len - 16).mul(k2);\n const y = rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d);\n const z = hashLen16(y, a.add(rotate64(b.add(k2), 18)).add(c), mul);\n const e = fetch64(s, 16).mul(mul);\n const f = fetch64(s, 24);\n const g = y.add(fetch64(s, len - 32)).mul(mul);\n const h = z.add(fetch64(s, len - 24)).mul(mul);\n return hashLen16(\n rotate64(e.add(f), 43).add(rotate64(g, 30)).add(h),\n e.add(rotate64(f.add(a), 18)).add(g), mul);\n}\n\nexport function fingerPrint64(s: Uint8Array, len = s.length): Long {\n const seed: Long = Long.fromNumber(81, true);\n if (len <= 32) {\n if (len <= 16) {\n return hashLen0to16(s, len);\n } else {\n return hashLen17to32(s, len);\n }\n } else if (len <= 64) {\n return hashLen33to64(s, len);\n }\n\n // For strings over 64 bytes we loop. Internal state consists of\n // 56 bytes: v, w, x, y, and z.\n let x = seed;\n let y = seed.mul(k1).add(113);\n\n let z = shiftMix(y.mul(k2).add(113)).mul(k2);\n let v = [Long.UZERO, Long.UZERO];\n let w = [Long.UZERO, Long.UZERO];\n x = x.mul(k2).add(fetch64(s, 0));\n\n let offset = 0;\n // Set end so that after the loop we have 1 to 64 bytes left to process.\n const end = ((len - 1) >> 6) * 64;\n const last64 = end + ((len - 1) & 63) - 63;\n\n do {\n x = rotate64(x.add(y).add(v[0]).add(fetch64(s, offset + 8)), 37).mul(k1);\n y = rotate64(y.add(v[1]).add(fetch64(s, offset + 48)), 42).mul(k1);\n x = x.xor(w[1]);\n y = y.add(v[0]).add(fetch64(s, offset + 40));\n z = rotate64(z.add(w[0]), 33).mul(k1);\n v = weakHashLen32WithSeedsStr(s, offset, v[1].mul(k1), x.add(w[0]));\n w = weakHashLen32WithSeedsStr(\n s, offset + 32, z.add(w[1]), y.add(fetch64(s, offset + 16)));\n\n [z, x] = [x, z];\n offset += 64;\n } while (offset !== end);\n const mul = k1.add(z.and(0xff).shl(1));\n // Point to the last 64 bytes of input.\n offset = last64;\n\n w[0] = w[0].add((len - 1) & 63);\n v[0] = v[0].add(w[0]);\n w[0] = w[0].add(v[0]);\n\n x = rotate64(x.add(y).add(v[0]).add(fetch64(s, offset + 8)), 37).mul(mul);\n y = rotate64(y.add(v[1]).add(fetch64(s, offset + 48)), 42).mul(mul);\n x = x.xor(w[1].mul(9));\n y = y.add(v[0].mul(9).add(fetch64(s, offset + 40)));\n z = rotate64(z.add(w[0]), 33).mul(mul);\n v = weakHashLen32WithSeedsStr(s, offset, v[1].mul(mul), x.add(w[0]));\n w = weakHashLen32WithSeedsStr(\n s, offset + 32, z.add(w[1]), y.add(fetch64(s, offset + 16)));\n\n [z, x] = [x, z];\n\n return hashLen16(\n hashLen16(v[0], w[0], mul).add(shiftMix(y).mul(k0)).add(z),\n hashLen16(v[1], w[1], mul).add(x), mul);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer, BackendTimingInfo} from './backends/backend';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport {DataType, DataTypeMap, TypedArray} from './types';\nimport * as util from './util';\n\nexport type KernelProfile = {\n kernelName: string,\n outputs: Tensor[],\n inputs: NamedTensorMap,\n timeMs: Promise,\n extraInfo: Promise\n};\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(kernelName: string, inputs: NamedTensorMap, f: () => Tensor[]):\n KernelProfile {\n let outputs: Tensor[];\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer: Promise;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n } else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({kernelMs: util.now() - start});\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(\n timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n\n logKernelProfile(kernelProfile: KernelProfile): void {\n const {kernelName, outputs, timeMs, inputs, extraInfo} = kernelProfile;\n\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(\n kernelName, result, valueContainer[0], valueContainer[1], inputs,\n valueContainer[2]);\n });\n });\n }\n}\n\nexport function checkComputationForErrors(\n vals: DataTypeMap[D], dtype: D, kernelName: string): boolean {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray,\n timeMs: number|{error: string}, inputs: NamedTensorMap,\n extraInfo?: string) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${\n inputShapesDescription}\\t%c${extraInfo}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange',\n 'color: green', 'color: steelblue');\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n kernelName: string;\n outputs: Tensor[];\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dys: Tensor[]) => NamedGradientMap;\n saved?: Tensor[];\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[], tidy: (f: Function) => Tensor,\n add: (a: Tensor, b: Tensor) => Tensor) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dys: Tensor[] = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n } else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, isString, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples =\n dtype === 'complex64' ? createComplexTuples(vals) : vals;\n\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(\n padPerCol[j],\n valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(\n val: number|string|[number, number], pad: number, dtype: DataType) {\n let valStr: string;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n } else if (isString(val)) {\n valStr = `'${val}'`;\n } else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n } else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n\n return rightPad(valStr, pad);\n}\n\nfunction boolNumToString(v: number): string {\n return v === 0 ? 'false' : 'true';\n}\n\nfunction subTensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[], padPerCol: number[], isLast = true): string[] {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0] as number)];\n }\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n\n let firstVals = Array.from(\n vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice(\n (size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement,\n size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals: Array =\n dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n\nfunction createComplexTuples(vals: Array<{}>|\n TypedArray): Array<[number, number]> {\n const complexTuples: Array<[number, number]> = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]] as [number, number]);\n }\n return complexTuples;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {getGlobal} from './global_util';\nimport {tensorToString} from './tensor_format';\nimport {ArrayMap, BackendValues, DataType, DataTypeMap, DataValues, NumericDataType, Rank, ShapeMap, SingleValueMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides, toNestedArray} from './util';\n\nexport interface TensorData {\n dataId?: DataId;\n values?: DataTypeMap[D];\n}\n\n// This interface mimics KernelBackend (in backend.ts), which would create a\n// circular dependency if imported.\nexport interface Backend {}\n\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: DataTypeMap[D];\n\n constructor(shape: ShapeMap[R], public dtype: D, values?: DataTypeMap[D]) {\n this.shape = shape.slice() as ShapeMap[R];\n this.size = util.sizeFromShape(shape);\n\n if (values != null) {\n const n = values.length;\n util.assert(\n n === this.size,\n () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value: SingleValueMap[D], ...locs: number[]): void {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n\n const index = this.locToIndex(locs);\n this.values[index] = value as number;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs: number[]): SingleValueMap[D] {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index] as SingleValueMap[D];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor(): Tensor {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype) as\n Tensor;\n }\n}\n\nexport interface TensorTracker {\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: Backend): Tensor;\n makeVariable(\n initialValue: Tensor, trainable?: boolean, name?: string,\n dtype?: DataType): Variable;\n incRef(a: Tensor, backend: Backend): void;\n disposeTensor(t: Tensor): void;\n disposeVariable(v: Variable): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: D,\n values?: DataTypeMap[D]): TensorBuffer;\n print(x: T, verbose: boolean): void;\n clone(x: T): T;\n // TODO(yassogba) bring reshape back?\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn: (msg: string) => void = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn: (msg: string) => void) {\n deprecationWarningFn = fn;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n// Declare this namespace to make Tensor class augmentation work in google3.\nexport declare namespace Tensor {}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /** Whether this tensor has been globally kept. */\n kept = false;\n /** The id of the scope this tensor is being tracked in. */\n scopeId: number;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n constructor(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number) {\n this.shape = shape.slice() as ShapeMap[R];\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer(): Promise> {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype as D, vals);\n }\n\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype as D, this.dataSync());\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array(): Promise {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync(): ArrayMap[R] {\n return toNestedArray(\n this.shape, this.dataSync(), this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data(): Promise {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data as Uint8Array[];\n try {\n return bytes.map(b => util.decodeString(b)) as DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as Promise;\n }\n\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync(): DataTypeMap[D] {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return (data as Uint8Array[]).map(b => util.decodeString(b)) as\n DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as DataTypeMap[D];\n }\n\n /** Returns the underlying bytes of the tensor's data. */\n async bytes(): Promise {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data as Uint8Array[];\n } else {\n return new Uint8Array((data as TypedArray).buffer);\n }\n }\n\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n protected isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype);\n }\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype) as\n Variable;\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\n\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n\nexport interface NumericTensor extends Tensor {\n dtype: NumericDataType;\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\nexport interface StringTensor extends Tensor {\n dtype: 'string';\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n name: string;\n\n constructor(\n initialValue: Tensor, public trainable: boolean, name: string,\n tensorId: number) {\n super(\n initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.name = name;\n }\n\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n\n dispose(): void {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\n\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {TensorContainer, TensorContainerArray} from './tensor_types';\nimport {upcastType} from './types';\nimport {assert} from './util';\n\nexport function makeTypesMatch(a: T, b: T): [T, T] {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n return tensorList.some(x => x.id === tensor.id);\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @docalias number[] */\nexport interface ArrayMap {\n R0: number;\n R1: number[];\n R2: number[][];\n R3: number[][][];\n R4: number[][][][];\n R5: number[][][][][];\n R6: number[][][][][][];\n}\n\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n complex64: Float32Array;\n string: string[];\n}\n\nexport interface SingleValueMap {\n bool: boolean;\n int32: number;\n float32: number;\n complex64: number;\n string: string;\n}\n\n/** @docalias 'float32'|'int32'|'bool'|'complex64'|'string' */\nexport type DataType = keyof DataTypeMap;\nexport type NumericDataType = 'float32'|'int32'|'bool'|'complex64';\nexport type TypedArray = Float32Array|Int32Array|Uint8Array;\n/** Tensor data used in tensor creation and user-facing API. */\nexport type DataValues = DataTypeMap[DataType];\n/** The underlying tensor data that gets stored in a backend. */\nexport type BackendValues = Float32Array|Int32Array|Uint8Array|Uint8Array[];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool',\n 'complex64' = 'complex64'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastComplex64AndMap {\n 'float32' = 'complex64',\n 'int32' = 'complex64',\n 'bool' = 'complex64',\n 'complex64' = 'complex64'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType): DataType {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|string|RecursiveArray|\n RecursiveArray|RecursiveArray|Uint8Array[];\nexport type ScalarLike = number|boolean|string|Uint8Array;\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[]|string[]|Uint8Array[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][]|\n string[]|string[][]|Uint8Array[]|Uint8Array[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D = TypedArray|number[]|number[][][]|boolean[]|\n boolean[][][]|string[]|string[][][]|Uint8Array[]|Uint8Array[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D = TypedArray|number[]|number[][][][]|boolean[]|\n boolean[][][][]|string[]|string[][][][]|Uint8Array[]|Uint8Array[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][]|string[]|\n string[][][][][]|Uint8Array[]|Uint8Array[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][]|\n string[]|string[][][][][][]|Uint8Array[]|Uint8Array[][][][][];\n\n/** Type for representing image data in Uint8Array type. */\nexport interface PixelData {\n width: number;\n height: number;\n data: Uint8Array;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, DataMover, KernelBackend} from './backends/backend';\nimport {Environment, setEnvironmentGlobal} from './environment';\nimport {getGlobalNamespace} from './global_util';\nimport {Add, Cast, Identity} from './kernel_names';\nimport {getGradient, getKernel, getKernelsForBackend, GradFunc, NamedAttrMap, TensorInfo} from './kernel_registry';\nimport {KernelProfile, Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, TapeNode} from './tape';\nimport {DataId, setTensorTracker, Tensor, TensorTracker, Variable} from './tensor';\nimport {GradSaveFunc, NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\nimport {BackendValues, DataType, DataValues} from './types';\nimport * as util from './util';\nimport {bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backward pass.\n */\nexport type ForwardFunc = (backend: KernelBackend, save?: GradSaveFunc) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,..., save?: Function) => {\n * value: Tensor,\n * gradFunc: (dy: Tensor, saved?: NamedTensorMap) => Tensor | Tensor[]\n * }\n */\nexport type CustomGradientFunc =\n (...inputs: Array) => {\n value: T;\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[];\n };\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean; reasons: string[];\n};\n\ntype KernelInfo = {\n name: string; bytesAdded: number; totalBytesSnapshot: number;\n tensorsAdded: number;\n totalTensorsSnapshot: number;\n inputShapes: number[][];\n outputShapes: number[][];\n kernelTimeMs: number | {error: string} | Promise;\n extraInfo: string | Promise;\n};\n\nexport type ProfileInfo = {\n newBytes: number; newTensors: number; peakBytes: number;\n kernels: KernelInfo[];\n result: TensorContainer;\n kernelNames: string[];\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n id: number;\n}\n\ninterface RegisteredKernelInvocation {\n kernelName: string;\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\ninterface CustomGradKernelInvocation {\n forwardFunc: ForwardFunc;\n backwardsFunc: (dy: T, saved: Tensor[]) => {\n [P in keyof I]: () => I[P]\n };\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\nfunction isRegisteredKernelInvocation(\n kernelInvocation: RegisteredKernelInvocation|\n CustomGradKernelInvocation):\n kernelInvocation is RegisteredKernelInvocation {\n return (kernelInvocation as RegisteredKernelInvocation).kernelName != null;\n}\n\nclass EngineState {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n nextTapeNodeId = 0;\n numBytes = 0;\n numTensors = 0;\n numStringTensors = 0;\n numDataBuffers = 0;\n\n activeTape: TapeNode[];\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n kernelDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n activeScope: ScopeState;\n scopeStack: ScopeState[] = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n numDataMovesStack: number[] = [];\n nextScopeId = 0;\n\n tensorInfo = new WeakMap();\n\n profiling = false;\n activeProfile: ProfileInfo = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames():\n string[] {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\n\nexport class Engine implements TensorTracker, DataMover {\n state: EngineState;\n backendName: string;\n registry: {[id: string]: KernelBackend} = {};\n registryFactory: {\n [id: string]: {\n factory: () => KernelBackend | Promise,\n priority: number\n }\n } = {};\n\n private profiler: Profiler;\n private backendInstance: KernelBackend;\n private pendingBackendInit: Promise;\n private pendingBackendInitId = 0;\n\n constructor(public ENV: Environment) {\n this.state = new EngineState();\n }\n\n async ready(): Promise {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => {});\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n get backend(): KernelBackend {\n if (this.pendingBackendInit != null) {\n throw new Error(\n `Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const {name, asyncInit} = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(\n `The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n\n backendNames(): string[] {\n return Object.keys(this.registryFactory);\n }\n\n findBackend(backendName: string): KernelBackend {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const {asyncInit} = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n } else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n\n findBackendFactory(backendName: string):\n () => KernelBackend | Promise {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n\n registerBackend(\n backendName: string,\n factory: () => KernelBackend | Promise,\n priority = 1): boolean {\n if (backendName in this.registryFactory) {\n console.warn(\n `${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = {factory, priority};\n return true;\n }\n\n async setBackend(backendName: string): Promise {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const {success, asyncInit} = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n\n return true;\n }\n\n private setupRegisteredKernels(): void {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n\n private disposeRegisteredKernels(backendName: string): void {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n private initializeBackend(backendName: string):\n {success: boolean|Promise, asyncInit: boolean} {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(\n `Cannot initialize backend ${backendName}, no registration found.`);\n }\n\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success =\n backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(\n `Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return {success, asyncInit: true};\n } else {\n this.registry[backendName] = backend as KernelBackend;\n return {success: true, asyncInit: false};\n }\n } catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return {success: false, asyncInit: false};\n }\n }\n\n removeBackend(backendName: string): void {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n\n delete this.registryFactory[backendName];\n\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n\n private getSortedBackends(): string[] {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a: string, b: string) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n\n private initializeBackendsAndReturnBest():\n {name: string, asyncInit: boolean} {\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const {success, asyncInit} = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return {name: backendName, asyncInit};\n }\n }\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n moveData(backend: KernelBackend, dataId: DataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n\n tidy(nameOrFn: string|ScopeFn, fn?: ScopeFn):\n T {\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n private static nextTensorId = 0;\n private nextTensorId(): number {\n return Engine.nextTensorId++;\n }\n\n private static nextVariableId = 0;\n private nextVariableId(): number {\n return Engine.nextVariableId++;\n }\n\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n private clone(x: Tensor): Tensor {\n const y: Tensor = ENGINE.runKernel(Identity, {x} as {} as NamedTensorMap);\n const inputs = {x};\n const grad = (dy: Tensor) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {x: dy};\n const attrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, gradInputs as {} as NamedTensorMap,\n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs as {} as NamedAttrMap) as Tensor;\n }\n });\n const saved: Tensor[] = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(\n kernelName: string, inputs: NamedTensorMap, attrs?: NamedAttrMap): T {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${\n this.backendName}'`);\n }\n return this.runKernelFunc({kernelName, inputs, attrs});\n }\n\n private shouldCheckForMemLeaks(): boolean {\n return this.ENV.getBool('IS_TEST');\n }\n\n private checkKernelForMemLeak(\n kernelName: string, numDataIdsBefore: number,\n outInfos: TensorInfo[]): void {\n const numDataIdsAfter = this.backend.numDataIds();\n\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves =\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked =\n numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(\n `Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n private runKernelFunc(\n kernelParams: RegisteredKernelInvocation|\n CustomGradKernelInvocation): T {\n let outputs: Tensor[];\n let saved: Tensor[] = [];\n const isTapeOn = this.isTapeOn();\n\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n\n let kernelFunc: () => Tensor[];\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n\n let out: TensorInfo|TensorInfo[];\n\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n\n if (isRegisteredKernelInvocation(kernelParams)) {\n const {kernelName, inputs, attrs} = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(\n kernel != null,\n () => `Cannot find registered kernel '${kernelName}' for backend '${\n this.backendName}'`);\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({inputs, attrs, backend: this.backend});\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n\n const outTensors = outInfos.map((outInfo: TensorInfo|Tensor) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if ((outInfo as Tensor).rank != null) {\n return outInfo as Tensor;\n }\n const {dataId, shape, dtype} = outInfo as TensorInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n\n // Save any required inputs and outputs.\n\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave =\n this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n } else {\n const {forwardFunc} = kernelParams;\n // Running a customGrad op.\n const saveFunc: GradSaveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]) as Tensor[];\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const {inputs, attrs} = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n\n let kernelProfile: KernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n } else {\n kernelProfile = this.profiler.profileKernel(\n kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n\n if (isTapeOn) {\n this.addTapeNode(\n kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(\n key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]) as T;\n }\n\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n private saveTensorsForBackwardMode(tensors: Tensor[]): Tensor[] {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n private getTensorsForGradient(\n kernelName: string, inputs: NamedTensorMap,\n outputs: Tensor[]): Tensor[]|null {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave: string[] = gradConfig.inputsToSave || [];\n const outputsToSave: boolean[] = gradConfig.outputsToSave || [];\n\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave: Tensor[];\n if (gradConfig.saveAllInputs) {\n util.assert(\n Array.isArray(inputs),\n () => 'saveAllInputs is true, expected inputs to be an array.');\n\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n } else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n\n const outputTensorsToSave: Tensor[] =\n outputs.filter((_, i) => outputsToSave[i]);\n\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values as BackendValues;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = (values as string[]).map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals as Uint8Array[]);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(\n dataId: DataId, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n\n makeVariable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n\n trackTensor(a: Tensor, backend: KernelBackend): void {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a: Tensor, backend: KernelBackend): void {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n\n removeDataId(dataId: DataId, backend: KernelBackend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a: Tensor): void {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n\n disposeVariable(v: Variable): void {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push(\n 'Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n\n async profile(query: () => (TensorContainer | Promise)):\n Promise {\n this.state.profiling = true;\n\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n\n this.state.profiling = false;\n\n this.state.activeProfile.peakBytes = Math.max(\n ...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n\n isTapeOn(): boolean {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n\n private addTapeNode(\n kernelName: string, inputs: NamedTensorMap, outputs: Tensor[],\n gradientsFunc: GradFunc, saved: Tensor[], attrs: NamedAttrMap): void {\n const tapeNode: TapeNode =\n {id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved};\n\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys: Tensor[]) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n result.kept = true;\n return result;\n }\n\n private startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n\n private endTape() {\n this.state.gradientDepth--;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string) {\n const scopeInfo: ScopeState = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet =\n new Set(tensorsToTrackInParent.map(t => t.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(\n xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n\n const y = this.scopedRun(\n () => this.startTape(), () => this.endTape(),\n () => this.tidy('forward', f));\n\n util.assert(\n y instanceof Tensor,\n () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n return this.tidy('backward', () => {\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(\n accumulatedGradientMap, filteredTape,\n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f as ScopeFn),\n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return {value: y, grads};\n });\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Array) => T {\n util.assert(\n util.isFunction(f),\n () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n\n let res: {\n value: T,\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[],\n };\n const inputMap: NamedTensorMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n\n const forwardFunc: ForwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(\n res.value instanceof Tensor,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(res.gradFunc),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n\n const backwardsFunc = (dy: T, saved: Tensor[]) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads: Tensor[] = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(\n grads.length === inputs.length,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap: {[key: string]: () => Tensor} = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n\n readSync(dataId: DataId): BackendValues {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n\n return result;\n }\n\n get registeredVariables(): NamedVariableMap {\n return this.state.registeredVariables;\n }\n\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset(): void {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\n\nexport function getOrMakeEngine(): Engine {\n const ns = getGlobalNamespace() as {} as {_tfengine: Engine};\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\n\nexport const ENGINE = getOrMakeEngine();\n\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a: Tensor, b: Tensor): Tensor {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = {a, b};\n return ENGINE.runKernel(Add, inputs as {} as NamedTensorMap);\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// tslint:disable-next-line:no-any\nfunction _isNavigatorDefined(): boolean {\n return typeof navigator !== 'undefined' && navigator != null;\n}\n\nexport function isMobile(nav?: Navigator): boolean {\n if (nav || _isNavigatorDefined()) {\n if (!nav) {\n nav = navigator;\n }\n if (nav.product === 'ReactNative') {\n return true;\n }\n\n // tslint:disable-next-line:no-any\n const a = nav.userAgent || nav.vendor || (window as any).opera;\n // tslint:disable-next-line:max-line-length\n 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\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /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\n .test(a.substr(0, 4));\n }\n return false;\n}\n\nexport function isBrowser(): boolean {\n return (typeof window !== 'undefined' && window.document != null) ||\n //@ts-ignore\n (typeof WorkerGlobalScope !== 'undefined');\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport './engine';\n\nimport * as device_util from './device_util';\nimport {env} from './environment';\n\nconst ENV = env();\n\n/**\n * This file contains environment-related flag registrations.\n */\n\n/** Whether to enable debug mode. */\nENV.registerFlag('DEBUG', () => false, debugValue => {\n if (debugValue) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n});\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag('IS_BROWSER', () => device_util.isBrowser());\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag(\n 'IS_NODE',\n () => (typeof process !== 'undefined') &&\n (typeof process.versions !== 'undefined') &&\n (typeof process.versions.node !== 'undefined'));\n\n/** Whether this browser is Chrome. */\nENV.registerFlag(\n 'IS_CHROME',\n () => typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor));\n\n/**\n * True when the environment is \"production\" where we disable safety checks\n * to gain performance.\n */\nENV.registerFlag('PROD', () => false);\n\n/**\n * Whether to do sanity checks when inferring a shape from user-provided\n * values, used when creating a new tensor.\n */\nENV.registerFlag(\n 'TENSORLIKE_CHECK_SHAPE_CONSISTENCY', () => ENV.getBool('DEBUG'));\n\n/** Whether deprecation warnings are enabled. */\nENV.registerFlag('DEPRECATION_WARNINGS_ENABLED', () => true);\n\n/** True if running unit tests. */\nENV.registerFlag('IS_TEST', () => false);\n\n/** Whether to check computation result for errors. */\nENV.registerFlag('CHECK_COMPUTATION_FOR_ERRORS', () => true);\n\n/** Whether the backend needs to wrap input to imageBitmap. */\nENV.registerFlag('WRAP_TO_IMAGEBITMAP', () => false);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from './engine';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {DataType, TensorLike} from './types';\nimport {assert, flatten, inferDtype, isTypedArray, toTypedArray} from './util';\n\nexport function inferShape(val: TensorLike, dtype?: DataType): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: TensorLike, shape: number[], indices: number[]) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nfunction assertDtype(\n expectedDtype: DataType|'numeric'|'string_or_numeric',\n actualDType: DataType, argName: string, functionName: string) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype as DataType;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : (x as {}).constructor.name;\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype as DataType) :\n flatten(x as string[], [], skipTypedArray) as string[];\n return ENGINE.makeTensor(values, inferredShape, inferredDtype) as T;\n}\n\nexport function convertToTensorArray(\n arg: Array, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) =>\n convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {isPromise} from '../util';\n\nexport const OP_SCOPE_SUFFIX = '__op';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n } catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Complex, ComplexInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real: T|TensorLike, imag: T|TensorLike): T {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch(\n $real.shape, $imag.shape,\n `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n\n const inputs: ComplexInputs = {real: $real, imag: $imag};\n return ENGINE.runKernel(Complex, inputs as {} as NamedTensorMap);\n}\n\nexport const complex = op({complex_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Tensor} from '../tensor';\nimport {TensorLike, TypedArray} from '../types';\nimport {DataType} from '../types';\nimport {assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray} from '../util';\n\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(\n values: TensorLike, shape: number[], inferredShape: number[],\n dtype?: DataType): Tensor {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error(\n 'values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(\n providedSize === inferredSize,\n () =>\n `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(\n inferredShape[i] === shape[i] || !flatDimsDontMatch,\n () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values as string[], [], true) as string[];\n return ENGINE.makeTensor(values as TypedArray, shape, dtype);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {inferShape} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {DataType, Rank, ShapeMap} from '../types';\n\nimport {makeTensor} from './tensor_ops_util';\n\n/**\n * Creates a `tf.Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`. If the values are strings,\n * they will be encoded as utf-8 and kept as `Uint8Array[]`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function tensor(\n values: TensorLike, shape?: ShapeMap[R], dtype?: DataType): Tensor {\n const inferredShape = inferShape(values, dtype);\n return makeTensor(values, shape, inferredShape, dtype) as Tensor;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'float16': 2,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n 'complex64': 8\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * Group to which the weight belongs.\n *\n * - 'optimizer': Weight from a stateful optimizer.\n */\nexport type WeightGroup = 'model'|'optimizer';\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool'|'string'|'complex64';\n\n /**\n * Type of the weight.\n *\n * Optional.\n *\n * The value 'optimizer' indicates the weight belongs to an optimizer\n * (i.e., used only during model training and not during inference).\n */\n group?: WeightGroup;\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale?: number, // The scaling constant to multiply by.\n min?: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8'|'float16' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n * @innamespace io\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * non-trainable ones.\n */\n trainableOnly?: boolean;\n\n /**\n * Whether the optimizer will be saved (if exists).\n *\n * Default: `false`.\n */\n includeOptimizer?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * TODO (cais,yassogba) consider removing GraphDef as GraphDefs now\n * come in a JSON format and none of our IOHandlers support a non json\n * format. We could conder replacing this with 'Binary' if we want to\n * allow future handlers to save to non json formats (though they will\n * probably want more information than 'Binary').\n * Type of the model topology\n *\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocol buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/** Model training configuration. */\nexport declare interface TrainingConfig {\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n // See\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tfjs-layers/blob/master/src/keras_format/training_config.ts\n /** Optimizer used for the model training. */\n optimizer_config: {};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Loss function(s) for the model's output(s). */\n loss: string|string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Metric function(s) for the model's output(s). */\n metrics?: string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n weighted_metrics?: string[];\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n sample_weight_mode?: string;\n\n loss_weights?: number[]|{[key: string]: number};\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `trainingConfig`, `weightSpecs` and `weightData` fields\n * of this interface are optional, in order to support topology- or weights-only\n * saving and loading.\n *\n * Note this interface is used internally in IOHandlers. For the file format\n * written to disk as `model.json`, see `ModelJSON`.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Serialized configuration for the model's training.\n */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * The on-disk format of the `model.json` file.\n *\n * TF.js 1.0 always populates the optional fields when writing model.json.\n * Prior versions did not provide those fields.\n */\nexport declare interface ModelJSON {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology: {};\n\n /** Model training configuration. */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weights manifest.\n *\n * The weights manifest consists of an ordered list of weight-manifest\n * groups. Each weight-manifest group consists of a number of weight values\n * stored in a number of paths. See the documentation of\n * `WeightsManifestConfig` for more details.\n */\n weightsManifest: WeightsManifestConfig;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n\n/**\n * Callback for the progress of a long-running action such as an HTTP\n * request for a large binary object.\n *\n * `fraction` should be a number in the [0, 1] interval, indicating how\n * much of the action has completed.\n */\nexport type OnProgressCallback = (fraction: number) => void;\n\n/** @innamespace io */\nexport interface LoadOptions {\n /**\n * RequestInit (options) for HTTP requests.\n *\n * For detailed information on the supported fields, see\n * [https://developer.mozilla.org/en-US/docs/Web/API/Request/Request](\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)\n */\n requestInit?: RequestInit;\n\n /**\n * Progress callback.\n */\n onProgress?: OnProgressCallback;\n\n /**\n * A function used to override the `window.fetch` function.\n */\n fetchFunc?: Function;\n\n /**\n * Strict loading model: whether extraneous weights or missing\n * weights should trigger an `Error`.\n *\n * If `true`, require that the provided weights exactly match those\n * required by the layers. `false` means that both extra weights\n * and missing weights will be silently ignored.\n *\n * Default: `true`.\n */\n strict?: boolean;\n\n /**\n * Path prefix for weight files, by default this is calculated from the\n * path of the model JSON file.\n *\n * For instance, if the path to the model JSON file is\n * `http://localhost/foo/model.json`, then the default path prefix will be\n * `http://localhost/foo/`. If a weight file has the path value\n * `group1-shard1of2` in the weight manifest, then the weight file will be\n * loaded from `http://localhost/foo/group1-shard1of2` by default. However,\n * if you provide a `weightPathPrefix` value of\n * `http://localhost/foo/alt-weights`, then the weight file will be loaded\n * from the path `http://localhost/foo/alt-weights/group1-shard1of2` instead.\n */\n weightPathPrefix?: string;\n\n /**\n * Whether the module or model is to be loaded from TF Hub.\n *\n * Setting this to `true` allows passing a TF-Hub module URL, omitting the\n * standard model file name and the query parameters.\n *\n * Default: `false`.\n */\n fromTFHub?: boolean;\n\n /**\n * An async function to convert weight file name to URL. The weight file\n * names are stored in model.json's weightsManifest.paths field. By default we\n * consider weight files are colocated with the model.json file. For example:\n * model.json URL: https://www.google.com/models/1/model.json\n * group1-shard1of1.bin url:\n * https://www.google.com/models/1/group1-shard1of1.bin\n *\n * With this func you can convert the weight file name to any URL.\n */\n weightUrlConverter?: (weightFileName: string) => Promise;\n}\n\n/**\n * Additional options for Platform.fetch\n */\nexport interface RequestDetails {\n /**\n * Is this request for a binary file (as opposed to a json file)\n */\n isBinary?: boolean;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {complex} from '../ops/complex';\n\nimport {tensor} from '../ops/tensor';\nimport {NamedTensor, NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\n\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, WeightGroup, WeightsManifestEntry} from './types';\n\n/** Number of bytes reserved for the length of the string. (32bit integer). */\nconst NUM_BYTES_STRING_LENGTH = 4;\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @param group Group to which the weights belong (optional).\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(\n tensors: NamedTensorMap|NamedTensor[], group?: WeightGroup):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n\n const names: string[] = Array.isArray(tensors) ?\n tensors.map(tensor => tensor.name) :\n Object.keys(tensors);\n\n for (let i = 0; i < names.length; ++i) {\n const name = names[i];\n const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name];\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool' &&\n t.dtype !== 'string' && t.dtype !== 'complex64') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n const spec: WeightsManifestEntry = {name, shape: t.shape, dtype: t.dtype};\n if (t.dtype === 'string') {\n const utf8bytes = new Promise(async resolve => {\n const vals = await t.bytes() as Uint8Array[];\n const totalNumBytes = vals.reduce((p, c) => p + c.length, 0) +\n NUM_BYTES_STRING_LENGTH * vals.length;\n const bytes = new Uint8Array(totalNumBytes);\n let offset = 0;\n for (let i = 0; i < vals.length; i++) {\n const val = vals[i];\n const bytesOfLength =\n new Uint8Array(new Uint32Array([val.length]).buffer);\n bytes.set(bytesOfLength, offset);\n offset += NUM_BYTES_STRING_LENGTH;\n bytes.set(val, offset);\n offset += val.length;\n }\n resolve(bytes);\n });\n dataPromises.push(utf8bytes);\n } else {\n dataPromises.push(t.data());\n }\n if (group != null) {\n spec.group = group;\n }\n specs.push(spec);\n }\n\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let float16Decode: (buffer: Uint16Array) => Float32Array | undefined;\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n const size = sizeFromShape(shape);\n let values: TypedArray|string[]|Uint8Array[];\n\n if ('quantization' in spec) {\n const quantization = spec.quantization;\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n if (!('min' in quantization && 'scale' in quantization)) {\n throw new Error(\n `Weight ${spec.name} with quantization ${quantization.dtype} ` +\n `doesn't have corresponding metadata min and scale.`);\n }\n } else if (quantization.dtype === 'float16') {\n if (dtype !== 'float32') {\n throw new Error(\n `Weight ${spec.name} is quantized with ${quantization.dtype} ` +\n `which only supports weights of type float32 not ${dtype}.`);\n }\n } else {\n throw new Error(\n `Weight ${spec.name} has unknown ` +\n `quantization dtype ${quantization.dtype}. ` +\n `Supported quantization dtypes are: ` +\n `'uint8', 'uint16', and 'float16'.`);\n }\n const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP[quantization.dtype];\n const byteBuffer =\n buffer.slice(offset, offset + size * quantizationSizeFactor);\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n values = new Float32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = v * quantization.scale + quantization.min;\n }\n } else if (quantization.dtype === 'float16') {\n if (float16Decode === undefined) {\n float16Decode = getFloat16Decoder();\n }\n values = float16Decode(quantizedArray as Uint16Array);\n } else {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type float32.`);\n }\n } else if (dtype === 'int32') {\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type int32.`);\n }\n values = new Int32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = Math.round(v * quantization.scale + quantization.min);\n }\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * quantizationSizeFactor;\n } else if (dtype === 'string') {\n const size = sizeFromShape(spec.shape);\n values = [];\n for (let i = 0; i < size; i++) {\n const byteLength = new Uint32Array(\n buffer.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0];\n offset += NUM_BYTES_STRING_LENGTH;\n const bytes = new Uint8Array(buffer.slice(offset, offset + byteLength));\n (values as Uint8Array[]).push(bytes);\n offset += byteLength;\n }\n } else {\n const dtypeFactor = DTYPE_VALUE_SIZE_MAP[dtype];\n const byteBuffer = buffer.slice(offset, offset + size * dtypeFactor);\n\n if (dtype === 'float32') {\n values = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n values = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n values = new Uint8Array(byteBuffer);\n } else if (dtype === 'complex64') {\n values = new Float32Array(byteBuffer);\n const real = new Float32Array(values.length / 2);\n const image = new Float32Array(values.length / 2);\n for (let i = 0; i < real.length; i++) {\n real[i] = values[i * 2];\n image[i] = values[i * 2 + 1];\n }\n const realTensor = tensor(real, shape, 'float32');\n const imageTensor = tensor(image, shape, 'float32');\n out[name] = complex(realTensor, imageTensor);\n realTensor.dispose();\n imageTensor.dispose();\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * dtypeFactor;\n }\n if (dtype !== 'complex64') {\n out[name] = tensor(values, shape, dtype);\n }\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n const buf = new Uint8Array(buffer);\n let s = '';\n for (let i = 0, l = buf.length; i < l; i++) {\n s += String.fromCharCode(buf[i]);\n }\n return btoa(s);\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n if (buffers.length === 1) {\n return buffers[0];\n }\n\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n\n/**\n * Computes mantisa table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 2048 mantissa lookup values.\n */\nfunction computeFloat16MantisaTable(): Uint32Array {\n const convertMantissa = (i: number): number => {\n let m = i << 13;\n let e = 0;\n\n while ((m & 0x00800000) === 0) {\n e -= 0x00800000;\n m <<= 1;\n }\n m &= ~0x00800000;\n e += 0x38800000;\n\n return m | e;\n };\n\n const mantisaTable = new Uint32Array(2048);\n\n mantisaTable[0] = 0;\n for (let i = 1; i < 1024; i++) {\n mantisaTable[i] = convertMantissa(i);\n }\n for (let i = 1024; i < 2048; i++) {\n mantisaTable[i] = 0x38000000 + ((i - 1024) << 13);\n }\n\n return mantisaTable;\n}\n\n/**\n * Computes exponent table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 64 exponent lookup values.\n */\nfunction computeFloat16ExponentTable(): Uint32Array {\n const exponentTable = new Uint32Array(64);\n\n exponentTable[0] = 0;\n exponentTable[31] = 0x47800000;\n exponentTable[32] = 0x80000000;\n exponentTable[63] = 0xc7800000;\n for (let i = 1; i < 31; i++) {\n exponentTable[i] = i << 23;\n }\n for (let i = 33; i < 63; i++) {\n exponentTable[i] = 0x80000000 + ((i - 32) << 23);\n }\n\n return exponentTable;\n}\n\n/**\n * Computes offset table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 6d offset values.\n */\nfunction computeFloat16OffsetTable(): Uint32Array {\n const offsetTable = new Uint32Array(64);\n\n for (let i = 0; i < 64; i++) {\n offsetTable[i] = 1024;\n }\n offsetTable[0] = offsetTable[32] = 0;\n\n return offsetTable;\n}\n\n/**\n * Retrieve a Float16 decoder which will decode a ByteArray of Float16 values\n * to a Float32Array.\n *\n * @returns Function (buffer: Uint16Array) => Float32Array which decodes\n * the Uint16Array of Float16 bytes to a Float32Array.\n */\nexport function getFloat16Decoder(): (buffer: Uint16Array) => Float32Array {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\n // Cache lookup tables\n const mantisaTable = computeFloat16MantisaTable();\n const exponentTable = computeFloat16ExponentTable();\n const offsetTable = computeFloat16OffsetTable();\n\n return (quantizedArray: Uint16Array) => {\n const buffer = new ArrayBuffer(4 * quantizedArray.length);\n const bufferUint32View = new Uint32Array(buffer);\n for (let index = 0; index < quantizedArray.length; index++) {\n const float16Bits = quantizedArray[index];\n const float32Bits =\n mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] +\n exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler, LoadOptions} from './types';\n\nexport type IORouter = (url: string|string[], loadOptions?: LoadOptions) =>\n IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string|string[]): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @param loadOptions Optional, custom load options.\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string|string[], loadOptions?: LoadOptions):\n IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load', loadOptions);\n }\n\n private static getHandlers(\n url: string|string[], handlerType: 'save'|'load',\n loadOptions?: LoadOptions): IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ?\n IORouterRegistry.getInstance().loadRouters :\n IORouterRegistry.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url, loadOptions);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n\nexport const registerSaveRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerSaveRouter(loudRouter);\nexport const registerLoadRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerLoadRouter(loudRouter);\nexport const getSaveHandlers = (url: string|string[]) =>\n IORouterRegistry.getSaveHandlers(url);\nexport const getLoadHandlers =\n (url: string|string[], loadOptions?: LoadOptions) =>\n IORouterRegistry.getLoadHandlers(url, loadOptions);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\n\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = typeof window === 'undefined' ? self : window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\nconst MODEL_METADATA_SUFFIX = 'model_metadata';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\nfunction getModelKeys(path: string): {\n info: string,\n topology: string,\n weightSpecs: string,\n weightData: string,\n modelMetadata: string\n} {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR),\n modelMetadata:\n [PATH_PREFIX, path, MODEL_METADATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\ndeclare type LocalStorageKeys = {\n info: string,\n topology: string,\n weightSpecs: string,\n weightData: string,\n modelMetadata: string\n};\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: LocalStorageKeys;\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n const result: ModelArtifacts = {\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy\n };\n if (modelArtifacts.signature != null) {\n result.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n result.userDefinedMetadata = modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n result.modelInitializer = modelArtifacts.modelInitializer;\n }\n this.LS.setItem(this.keys.modelMetadata, JSON.stringify(result));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n this.LS.removeItem(this.keys.info);\n this.LS.removeItem(this.keys.topology);\n this.LS.removeItem(this.keys.weightSpecs);\n this.LS.removeItem(this.keys.weightData);\n this.LS.removeItem(this.keys.modelMetadata);\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load meta-data fields.\n const metadataString = this.LS.getItem(this.keys.modelMetadata);\n if (metadataString != null) {\n const metadata = JSON.parse(metadataString) as ModelArtifacts;\n out.format = metadata['format'];\n out.generatedBy = metadata['generatedBy'];\n out.convertedBy = metadata['convertedBy'];\n if (metadata['signature'] != null) {\n out.signature = metadata['signature'];\n }\n if (metadata['userDefinedMetadata'] != null) {\n out.userDefinedMetadata = metadata['userDefinedMetadata'];\n }\n if (metadata['modelInitializer'] != null) {\n out.modelInitializer = metadata['modelInitializer'];\n }\n }\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(\n env().getBool('IS_BROWSER'),\n () => 'Current environment is not a web browser');\n assert(\n typeof window === 'undefined' ||\n typeof window.localStorage !== 'undefined',\n () => 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n\n this.LS.removeItem(keys.info);\n this.LS.removeItem(keys.topology);\n this.LS.removeItem(keys.weightSpecs);\n this.LS.removeItem(keys.weightData);\n return info;\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, () => 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, () => 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n () => `A model store manager is already registered for scheme '${\n scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n () => `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n () => `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n () => `Copying failed because no save handler is found for destination ` +\n `URL ${destURL}.`);\n assert(\n saveHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\nimport {BrowserIndexedDB, BrowserIndexedDBManager} from '../io/indexed_db';\nimport {BrowserLocalStorage, BrowserLocalStorageManager} from '../io/local_storage';\nimport {ModelStoreManagerRegistry} from '../io/model_management';\n\nimport {Platform} from './platform';\n\nexport class PlatformBrowser implements Platform {\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n private textEncoder: TextEncoder;\n\n fetch(path: string, init?: RequestInit): Promise {\n return fetch(path, init);\n }\n\n now(): number {\n return performance.now();\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Browser's encoder only supports utf-8, but got ${encoding}`);\n }\n if (this.textEncoder == null) {\n this.textEncoder = new TextEncoder();\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n return new TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_BROWSER')) {\n env().setPlatform('browser', new PlatformBrowser());\n\n // Register LocalStorage IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n\n // Register IndexedDB IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from '../environment';\n\nimport {Platform} from './platform';\n\n// We are wrapping this within an object so it can be stubbed by Jasmine.\nexport const getNodeFetch = {\n // tslint:disable-next-line:no-require-imports\n importFetch: () => require('node-fetch')\n};\n\ntype FetchFn = (url: string, init?: RequestInit) => Promise;\nlet systemFetch: FetchFn;\n// These getters and setters are for testing so we don't export a mutable\n// variable.\nexport function resetSystemFetch() {\n systemFetch = null;\n}\nexport function setSystemFetch(fetchFn: FetchFn) {\n systemFetch = fetchFn;\n}\nexport function getSystemFetch(): FetchFn {\n return systemFetch;\n}\n\nexport class PlatformNode implements Platform {\n private textEncoder: TextEncoder;\n // tslint:disable-next-line:no-any\n util: any;\n\n constructor() {\n // tslint:disable-next-line:no-require-imports\n this.util = require('util');\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n this.textEncoder = new this.util.TextEncoder();\n }\n\n fetch(path: string, requestInits?: RequestInit): Promise {\n if (env().global.fetch != null) {\n return env().global.fetch(path, requestInits);\n }\n\n if (systemFetch == null) {\n systemFetch = getNodeFetch.importFetch();\n }\n return systemFetch(path, requestInits);\n }\n\n now(): number {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Node built-in encoder only supports utf-8, but got ${encoding}`);\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n if (bytes.length === 0) {\n return '';\n }\n return new this.util.TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_NODE')) {\n env().setPlatform('node', new PlatformNode());\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {TensorBuffer} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap} from '../types';\nimport * as util from '../util';\n\n/**\n * Creates an empty `tf.TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in CPU as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `tf.Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function buffer(\n shape: ShapeMap[R], dtype: D = 'float32' as D,\n values?: DataTypeMap[D]): TensorBuffer {\n dtype = dtype || 'float32' as D;\n util.assertNonNegativeIntegerDimensions(shape);\n return new TensorBuffer(shape, dtype, values);\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Cast, CastAttrs, CastInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {DataType, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n\n const inputs: CastInputs = {x: $x};\n const attrs: CastAttrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const cast = op({cast_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Identity, IdentityInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs: IdentityInputs = {x: $x};\n\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs as {} as NamedTensorMap);\n}\n\nexport const clone = op({clone_});\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\n\n/**\n * Prints information about the `tf.Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Required side effectful code for tfjs-core\n\n// Set up Engine and ENV\nimport {getOrMakeEngine} from './engine';\ngetOrMakeEngine();\n\n// Register backend-agnostic flags.\nimport './flags';\n// Register platforms\nimport './platforms/platform_browser';\nimport './platforms/platform_node';\n\n// Set up OpHandler\nimport {buffer} from './ops/buffer';\nimport {cast} from './ops/cast';\nimport {clone} from './ops/clone';\nimport {print} from './ops/print';\nimport {OpHandler, setOpHandler} from './tensor';\nconst opHandler: OpHandler = {\n buffer,\n cast,\n clone,\n print\n};\nsetOpHandler(opHandler);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest, http, isHTTPScheme} from './http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {getLoadHandlers, getSaveHandlers, registerLoadRouter, registerSaveRouter} from './router_registry';\nimport {IOHandler, LoadHandler, LoadOptions, ModelArtifacts, ModelArtifactsInfo, ModelJSON, ModelStoreManager, OnProgressCallback, RequestDetails, SaveConfig, SaveHandler, SaveResult, WeightGroup, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights, weightsLoaderFactory} from './weights_loader';\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n http,\n IOHandler,\n isHTTPScheme,\n LoadHandler,\n LoadOptions,\n loadWeights,\n ModelArtifacts,\n ModelArtifactsInfo,\n ModelJSON,\n ModelStoreManager,\n OnProgressCallback,\n registerLoadRouter,\n registerSaveRouter,\n RequestDetails,\n SaveConfig,\n SaveHandler,\n SaveResult,\n WeightGroup,\n weightsLoaderFactory,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {basename, concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelJSON, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nfunction defer(f: () => T): Promise {\n return new Promise(resolve => setTimeout(resolve)).then(f);\n}\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelTopologyFileName: string;\n private readonly weightDataFileName: string;\n private readonly jsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'browserDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (typeof (document) === 'undefined') {\n throw new Error(\n 'Browser downloads are not supported in ' +\n 'this environment since `document` is not present');\n }\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserDownloads.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelTopologyAndWeightManifest: ModelJSON = {\n modelTopology: modelArtifacts.modelTopology,\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n weightsManifest\n };\n if (modelArtifacts.signature != null) {\n modelTopologyAndWeightManifest.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n modelTopologyAndWeightManifest.userDefinedMetadata =\n modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n modelTopologyAndWeightManifest.modelInitializer =\n modelArtifacts.modelInitializer;\n }\n const modelTopologyAndWeightManifestURL =\n window.URL.createObjectURL(new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :\n this.jsonAnchor;\n jsonAnchor.download = this.modelTopologyFileName;\n jsonAnchor.href = modelTopologyAndWeightManifestURL;\n // Trigger downloads by evoking a click event on the download anchors.\n // When multiple downloads are started synchronously, Firefox will only\n // save the last one.\n await defer(() => jsonAnchor.dispatchEvent(new MouseEvent('click')));\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n await defer(\n () => weightDataAnchor.dispatchEvent(new MouseEvent('click')));\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly files: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.files = files;\n }\n\n async load(): Promise {\n const jsonFile = this.files[0];\n const weightFiles = this.files.slice(1);\n\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result) as ModelJSON;\n const modelTopology = modelJSON.modelTopology;\n if (modelTopology == null) {\n reject(new Error(\n `modelTopology field is missing from file ${jsonFile.name}`));\n return;\n }\n\n if (weightFiles.length === 0) {\n resolve({modelTopology});\n }\n\n const weightsManifest = modelJSON.weightsManifest;\n if (weightsManifest == null) {\n reject(new Error(\n `weightManifest field is missing from file ${jsonFile.name}`));\n return;\n }\n\n let pathToFile: {[path: string]: File};\n try {\n pathToFile =\n this.checkManifestAndWeightFiles(weightsManifest, weightFiles);\n } catch (err) {\n reject(err);\n return;\n }\n\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n const perFileBuffers: ArrayBuffer[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n paths.push(path);\n perFileBuffers.push(null);\n });\n weightSpecs.push(...weightsGroup.weights);\n });\n\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n const index = paths.indexOf(path);\n perFileBuffers[index] = weightData;\n if (perFileBuffers.indexOf(null) === -1) {\n const result: ModelArtifacts = {\n modelTopology,\n weightSpecs,\n weightData: concatenateArrayBuffers(perFileBuffers),\n format: modelJSON.format,\n generatedBy: modelJSON.generatedBy,\n convertedBy: modelJSON.convertedBy\n };\n if (modelJSON.signature != null) {\n result.signature = modelJSON.signature;\n }\n if (modelJSON.userDefinedMetadata != null) {\n result.userDefinedMetadata = modelJSON.userDefinedMetadata;\n }\n if (modelJSON.modelInitializer != null) {\n result.modelInitializer = modelJSON.modelInitializer;\n }\n resolve(result);\n }\n };\n weightFileReader.onerror = error =>\n reject(`Failed to weights data from file of path '${path}'.`);\n weightFileReader.readAsArrayBuffer(pathToFile[path]);\n });\n });\n };\n jsonReader.onerror = error => reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n jsonReader.readAsText(jsonFile);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(\n manifest: WeightsManifestConfig, files: File[]): {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = files.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = files[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== files.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${files.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel');\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `BrowserDownloads` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tf.loadLayersModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {assert} from '../util';\n\nimport {OnProgressCallback} from './types';\n\n/**\n * Monitor Promise.all progress, fire onProgress callback function.\n *\n * @param promises Promise list going to be monitored\n * @param onProgress Callback function. Fired when a promise resolved.\n * @param startFraction Optional fraction start. Default to 0.\n * @param endFraction Optional fraction end. Default to 1.\n */\nexport function monitorPromisesProgress(\n promises: Array>, onProgress: OnProgressCallback,\n startFraction?: number, endFraction?: number) {\n checkPromises(promises);\n startFraction = startFraction == null ? 0 : startFraction;\n endFraction = endFraction == null ? 1 : endFraction;\n checkFraction(startFraction, endFraction);\n let resolvedPromise = 0;\n\n const registerMonitor = (promise: Promise<{}>) => {\n promise.then(value => {\n const fraction = startFraction +\n ++resolvedPromise / promises.length * (endFraction - startFraction);\n // pass fraction as parameter to callback function.\n onProgress(fraction);\n return value;\n });\n return promise;\n };\n\n function checkPromises(promises: Array>): void {\n assert(\n promises != null && Array.isArray(promises) && promises.length > 0,\n () => 'promises must be a none empty array');\n }\n\n function checkFraction(startFraction: number, endFraction: number): void {\n assert(\n startFraction >= 0 && startFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got startFraction ${startFraction}`);\n assert(\n endFraction >= 0 && endFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got endFraction ${endFraction}`);\n assert(\n endFraction >= startFraction,\n () => `startFraction must be no more than endFraction, but ` +\n `got startFraction ${startFraction} and endFraction ` +\n `${endFraction}`);\n }\n\n return Promise.all(promises.map(registerMonitor));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from '../environment';\n\nimport {NamedTensorMap} from '../tensor_types';\nimport * as util from '../util';\nimport {decodeWeights} from './io_utils';\nimport {monitorPromisesProgress} from './progress';\nimport {DTYPE_VALUE_SIZE_MAP, LoadOptions, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @param fetchFunc Optional overriding value for the `window.fetch` function.\n * @param onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], loadOptions?: LoadOptions): Promise {\n if (loadOptions == null) {\n loadOptions = {};\n }\n\n const fetchFunc = loadOptions.fetchFunc == null ? env().platform.fetch :\n loadOptions.fetchFunc;\n\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(\n fetchURL =>\n fetchFunc(fetchURL, loadOptions.requestInit, {isBinary: true}));\n\n const fetchStartFraction = 0;\n const fetchEndFraction = 0.5;\n\n const responses = loadOptions.onProgress == null ?\n await Promise.all(requests) :\n await monitorPromisesProgress(\n requests, loadOptions.onProgress, fetchStartFraction,\n fetchEndFraction);\n\n const bufferPromises = responses.map(response => response.arrayBuffer());\n\n const bufferStartFraction = 0.5;\n const bufferEndFraction = 1;\n\n const buffers = loadOptions.onProgress == null ?\n await Promise.all(bufferPromises) :\n await monitorPromisesProgress(\n bufferPromises, loadOptions.onProgress, bufferStartFraction,\n bufferEndFraction);\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestInit?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n const fetchWeights = (fetchUrls: string[]) =>\n loadWeightsAsArrayBuffer(fetchUrls, {requestInit});\n const loadWeights = weightsLoaderFactory(fetchWeights);\n\n return loadWeights(manifest, filePathPrefix, weightNames);\n}\n\n/**\n * Creates a function, which reads a weights manifest JSON configuration,\n * fetches the weight files using the specified function and returns them as\n * `Tensor`s.\n *\n * ```js\n * // example for creating a nodejs weight loader, which reads the weight files\n * // from disk using fs.readFileSync\n *\n * import * as fs from 'fs'\n *\n * const fetchWeightsFromDisk = (filePaths: string[]) =>\n * filePaths.map(filePath => fs.readFileSync(filePath).buffer)\n *\n * const loadWeights = tf.io.weightsLoaderFactory(fetchWeightsFromDisk)\n *\n * const manifest = JSON.parse(\n * fs.readFileSync('./my_model-weights_manifest').toString()\n * )\n * const weightMap = await loadWeights(manifest, './')\n * ```\n * @param fetchWeightsFunction The function used for fetching the weight files.\n * @returns Weight loading function.\n */\nexport function weightsLoaderFactory(\n fetchWeightsFunction: (fetchUrls: string[]) => Promise):\n (manifest: WeightsManifestConfig, filePathPrefix?: string,\n weightNames?: string[]) => Promise {\n return async(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[]): Promise => {\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound =\n weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await fetchWeightsFunction(fetchUrls);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n const nameToTensorMap =\n decodeWeights(byteBuffer, [weightsEntry.manifestEntry]);\n for (const name in nameToTensorMap) {\n weightsTensorMap[name] = nameToTensorMap[name];\n }\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadOptions, ModelArtifacts, ModelJSON, OnProgressCallback, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nconst OCTET_STREAM_MIME_TYPE = 'application/octet-stream';\nconst JSON_TYPE = 'application/json';\nexport class HTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n private readonly fetch: Function;\n private readonly weightUrlConverter: (weightName: string) => Promise;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEME_REGEX = /^https?:\\/\\//;\n\n private readonly weightPathPrefix: string;\n private readonly onProgress: OnProgressCallback;\n\n constructor(path: string, loadOptions?: LoadOptions) {\n if (loadOptions == null) {\n loadOptions = {};\n }\n this.weightPathPrefix = loadOptions.weightPathPrefix;\n this.onProgress = loadOptions.onProgress;\n this.weightUrlConverter = loadOptions.weightUrlConverter;\n\n if (loadOptions.fetchFunc != null) {\n assert(\n typeof loadOptions.fetchFunc === 'function',\n () => 'Must pass a function that matches the signature of ' +\n '`fetch` (see ' +\n 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)');\n this.fetch = loadOptions.fetchFunc;\n } else {\n this.fetch = env().platform.fetch;\n }\n\n assert(\n path != null && path.length > 0,\n () => 'URL path for http must not be null, undefined or ' +\n 'empty.');\n\n if (Array.isArray(path)) {\n assert(\n path.length === 2,\n () => 'URL paths for http must have a length of 2, ' +\n `(actual length is ${path.length}).`);\n }\n this.path = path;\n\n if (loadOptions.requestInit != null &&\n loadOptions.requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = loadOptions.requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest: ModelJSON = {\n modelTopology: modelArtifacts.modelTopology,\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n weightsManifest\n };\n if (modelArtifacts.signature != null) {\n modelTopologyAndWeightManifest.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n modelTopologyAndWeightManifest.userDefinedMetadata =\n modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n modelTopologyAndWeightManifest.modelInitializer =\n modelArtifacts.modelInitializer;\n }\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: JSON_TYPE}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob([modelArtifacts.weightData], {type: OCTET_STREAM_MIME_TYPE}),\n 'model.weights.bin');\n }\n\n const response = await this.fetch(this.path, init);\n\n if (response.ok) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `tf.io.http` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await this.fetch(this.path, this.requestInit);\n\n if (!modelConfigRequest.ok) {\n throw new Error(\n `Request to ${this.path} failed with status code ` +\n `${modelConfigRequest.status}. Please verify this URL points to ` +\n `the model JSON of the model to load.`);\n }\n let modelConfig: ModelJSON;\n try {\n modelConfig = await modelConfigRequest.json();\n } catch (e) {\n let message = `Failed to parse model JSON of response from ${this.path}.`;\n // TODO(nsthorat): Remove this after some time when we're comfortable that\n // .pb files are mostly gone.\n if (this.path.endsWith('.pb')) {\n message += ' Your path contains a .pb file extension. ' +\n 'Support for .pb models have been removed in TensorFlow.js 1.0 ' +\n 'in favor of .json models. You can re-convert your Python ' +\n 'TensorFlow model using the TensorFlow.js 1.0 conversion scripts ' +\n 'or you can convert your.pb models with the \\'pb2json\\'' +\n 'NPM script in the tensorflow/tfjs-converter repository.';\n } else {\n message += ' Please make sure the server is serving valid ' +\n 'JSON for this request.';\n }\n throw new Error(message);\n }\n const modelTopology = modelConfig.modelTopology;\n const weightsManifest = modelConfig.weightsManifest;\n const generatedBy = modelConfig.generatedBy;\n const convertedBy = modelConfig.convertedBy;\n const format = modelConfig.format;\n const signature = modelConfig.signature;\n const userDefinedMetadata = modelConfig.userDefinedMetadata;\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n let weightSpecs: WeightsManifestEntry[];\n let weightData: ArrayBuffer;\n if (weightsManifest != null) {\n const results = await this.loadWeights(weightsManifest);\n [weightSpecs, weightData] = results;\n }\n\n const artifacts: ModelArtifacts = {\n modelTopology,\n weightSpecs,\n weightData,\n generatedBy,\n convertedBy,\n format\n };\n\n if (signature != null) {\n artifacts.signature = signature;\n }\n if (userDefinedMetadata != null) {\n artifacts.userDefinedMetadata = userDefinedMetadata;\n }\n\n const initializer = modelConfig.modelInitializer;\n if (initializer) {\n artifacts.modelInitializer = initializer;\n }\n\n return artifacts;\n }\n\n private async loadWeights(weightsManifest: WeightsManifestConfig):\n Promise<[WeightsManifestEntry[], ArrayBuffer]> {\n const weightPath = Array.isArray(this.path) ? this.path[1] : this.path;\n const [prefix, suffix] = parseUrl(weightPath);\n const pathPrefix = this.weightPathPrefix || prefix;\n\n const weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n const fetchURLs: string[] = [];\n const urlPromises: Array> = [];\n for (const weightsGroup of weightsManifest) {\n for (const path of weightsGroup.paths) {\n if (this.weightUrlConverter != null) {\n urlPromises.push(this.weightUrlConverter(path));\n } else {\n fetchURLs.push(pathPrefix + path + suffix);\n }\n }\n }\n\n if (this.weightUrlConverter) {\n fetchURLs.push(...await Promise.all(urlPromises));\n }\n\n const buffers = await loadWeightsAsArrayBuffer(fetchURLs, {\n requestInit: this.requestInit,\n fetchFunc: this.fetch,\n onProgress: this.onProgress\n });\n return [weightSpecs, concatenateArrayBuffers(buffers)];\n }\n}\n\n/**\n * Extract the prefix and suffix of the url, where the prefix is the path before\n * the last file, and suffix is the search params after the last file.\n * ```\n * const url = 'http://tfhub.dev/model/1/tensorflowjs_model.pb?tfjs-format=file'\n * [prefix, suffix] = parseUrl(url)\n * // prefix = 'http://tfhub.dev/model/1/'\n * // suffix = '?tfjs-format=file'\n * ```\n * @param url the model url to be parsed.\n */\nexport function parseUrl(url: string): [string, string] {\n const lastSlash = url.lastIndexOf('/');\n const lastSearchParam = url.lastIndexOf('?');\n const prefix = url.substring(0, lastSlash);\n const suffix =\n lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}\n\nexport function isHTTPScheme(url: string): boolean {\n return url.match(HTTPRequest.URL_SCHEME_REGEX) != null;\n}\n\nexport const httpRouter: IORouter =\n (url: string, loadOptions?: LoadOptions) => {\n if (typeof fetch === 'undefined' &&\n (loadOptions == null || loadOptions.fetchFunc == null)) {\n // `http` uses `fetch` or `node-fetch`, if one wants to use it in\n // an environment that is not the browser or node they have to setup a\n // global fetch polyfill.\n return null;\n } else {\n let isHTTP = true;\n if (Array.isArray(url)) {\n isHTTP = url.every(urlItem => isHTTPScheme(urlItem));\n } else {\n isHTTP = isHTTPScheme(url);\n }\n if (isHTTP) {\n return http(url, loadOptions);\n }\n }\n return null;\n };\nIORouterRegistry.registerSaveRouter(httpRouter);\nIORouterRegistry.registerLoadRouter(httpRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.http(\n * 'http://model-server:5000/upload', {requestInit: {method: 'PUT'}}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following GitHub Gist\n * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864\n * implements a server based on [flask](https://github.com/pallets/flask) that\n * can receive the request. Upon receiving the model artifacts via the requst,\n * this particular server reconsistutes instances of [Keras\n * Models](https://keras.io/models/model/) in memory.\n *\n *\n * @param path A URL path to the model.\n * Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the\n * body will be set by TensorFlow.js. File blobs representing the model\n * topology (filename: 'model.json') and the weights of the model (filename:\n * 'model.weights.bin') will be appended to the body. If `requestInit` has a\n * `body`, an Error will be thrown.\n * @param loadOptions Optional configuration for the loading. It includes the\n * following fields:\n * - weightPathPrefix Optional, this specifies the path prefix for weight\n * files, by default this is calculated from the path param.\n * - fetchFunc Optional, custom `fetch` function. E.g., in Node.js,\n * the `fetch` from node-fetch can be used here.\n * - onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns An instance of `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function http(path: string, loadOptions?: LoadOptions): IOHandler {\n return new HTTPRequest(path, loadOptions);\n}\n\n/**\n * Deprecated. Use `tf.io.http`.\n * @param path\n * @param loadOptions\n */\nexport function browserHTTPRequest(\n path: string, loadOptions?: LoadOptions): IOHandler {\n return http(path, loadOptions);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, TrainingConfig, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(private readonly modelArtifacts?: ModelArtifacts) {}\n\n async load(): Promise {\n return this.modelArtifacts;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler:\n (artifacts: ModelArtifacts) => Promise) {}\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadLayersModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelArtifacts a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n * @param trainingConfig Model training configuration. Optional.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelArtifacts: {}|ModelArtifacts, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer, trainingConfig?: TrainingConfig): IOHandler {\n if (arguments.length === 1) {\n const isModelArtifacts =\n (modelArtifacts as ModelArtifacts).modelTopology != null ||\n (modelArtifacts as ModelArtifacts).weightSpecs != null;\n if (isModelArtifacts) {\n return new PassthroughLoader(modelArtifacts as ModelArtifacts);\n } else {\n // Legacy support: with only modelTopology.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({modelTopology: modelArtifacts as {}});\n }\n } else {\n // Legacy support.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({\n modelTopology: modelArtifacts as {},\n weightSpecs,\n weightData,\n trainingConfig\n });\n }\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) =>\n Promise): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Exports under the tf.math.* namespace.\n */\n\nimport {confusionMatrix} from './ops/confusion_matrix';\n\nexport {confusionMatrix};\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {BatchMatMul, BatchMatMulAttrs, BatchMatMulInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {makeTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(\n a: Tensor|TensorLike, b: Tensor|TensorLike, transposeA = false,\n transposeB = false): T {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n\n const inputs: BatchMatMulInputs = {a: $a, b: $b};\n const attrs: BatchMatMulAttrs = {transposeA, transposeB};\n\n return ENGINE.runKernel(\n BatchMatMul, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const matMul = op({matMul_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {OneHot, OneHotAttrs, OneHotInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(\n indices: Tensor|TensorLike, depth: number, onValue = 1,\n offValue = 0): Tensor {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n\n const inputs: OneHotInputs = {indices: $indices};\n const attrs: OneHotAttrs = {depth, onValue, offValue};\n\n return ENGINE.runKernel(\n OneHot, inputs as unknown as NamedTensorMap,\n attrs as unknown as NamedAttrMap);\n}\n\nexport const oneHot = op({oneHot_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Transpose, TransposeAttrs, TransposeInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const inputs: TransposeInputs = {x: $x};\n const attrs: TransposeAttrs = {perm};\n\n return ENGINE.runKernel(\n Transpose, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const transpose = op({transpose_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {cast} from './cast';\nimport {matMul} from './mat_mul';\nimport {oneHot} from './one_hot';\nimport {op} from './operation';\nimport {transpose} from './transpose';\n\n/**\n * Computes the confusion matrix from true labels and predicted labels.\n *\n * ```js\n * const labels = tf.tensor1d([0, 1, 2, 1, 0], 'int32');\n * const predictions = tf.tensor1d([0, 2, 2, 1, 0], 'int32');\n * const numClasses = 3;\n * const out = tf.math.confusionMatrix(labels, predictions, numClasses);\n * out.print();\n * // Expected output matrix:\n * // [[2, 0, 0],\n * // [0, 1, 1],\n * // [0, 0, 1]]\n * ```\n *\n * @param labels The target labels, assumed to be 0-based integers\n * for the classes. The shape is `[numExamples]`, where\n * `numExamples` is the number of examples included.\n * @param predictions The predicted classes, assumed to be\n * 0-based integers for the classes. Must have the same shape as `labels`.\n * @param numClasses Number of all classes, as an integer.\n * Its value must be larger than the largest element in `labels` and\n * `predictions`.\n * @returns The confusion matrix as a int32-type 2D tensor. The value at\n * row `r` and column `c` is the number of times examples of actual class\n * `r` were predicted as class `c`.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nexport function confusionMatrix_(\n labels: Tensor1D|TensorLike, predictions: Tensor1D|TensorLike,\n numClasses: number): Tensor2D {\n const $labels = convertToTensor(labels, 'labels', 'confusionMatrix');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'confusionMatrix');\n\n util.assert(\n numClasses == null || numClasses > 0 && Number.isInteger(numClasses),\n () => `If provided, numClasses must be a positive integer, ` +\n `but got ${numClasses}`);\n util.assert(\n $labels.rank === 1,\n () => `Expected the rank of labels to be 1, but got ${$labels.rank}`);\n util.assert(\n $predictions.rank === 1,\n () => `Expected the rank of predictions to be 1, ` +\n `but got ${$predictions.rank}`);\n util.assert(\n $labels.shape[0] === $predictions.shape[0],\n () => `Mismatch in the number of examples: ` +\n `${$labels.shape[0]} vs. ${$predictions.shape[0]}. ` +\n `Labels and predictions should have the same number of elements.`);\n util.assert(\n numClasses > 0 && Number.isInteger(numClasses),\n () => `numClasses is required to be a positive integer, but got ` +\n `${numClasses}`);\n // TODO(cais): In the future, if oneHot supports tensors inputs for\n // `numClasses`, `confusionMatrix` can make `numClasses` optional.\n\n const oneHotLabels = oneHot(cast($labels, 'int32'), numClasses) as Tensor2D;\n const oneHotPredictions =\n oneHot(cast($predictions, 'int32'), numClasses) as Tensor2D;\n const oneHotLabelsT: Tensor2D = transpose(oneHotLabels);\n const product: Tensor2D = matMul(oneHotLabelsT, oneHotPredictions);\n return cast(product, 'int32');\n}\n\nexport const confusionMatrix = op({confusionMatrix_});\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {env} from '../environment';\nimport {FromPixels, FromPixelsAttrs, FromPixelsInputs} from '../kernel_names';\nimport {getKernel, NamedAttrMap} from '../kernel_registry';\nimport {Tensor, Tensor2D, Tensor3D} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {PixelData, TensorLike} from '../types';\n\nimport {cast} from './cast';\nimport {op} from './operation';\nimport {tensor3d} from './tensor3d';\n\nlet fromPixels2DContext: CanvasRenderingContext2D;\n\n/**\n * Creates a `tf.Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.browser.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel. You can also pass in an image\n * object with following attributes:\n * `{data: Uint8Array; width: number; height: number}`\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n *\n * @returns A Tensor3D with the shape `[height, width, numChannels]`.\n *\n * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true}\n */\nfunction fromPixels_(\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap,\n numChannels = 3): Tensor3D {\n // Sanity checks.\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n if (pixels == null) {\n throw new Error('pixels passed to tf.browser.fromPixels() can not be null');\n }\n let isPixelData = false;\n let isImageData = false;\n let isVideo = false;\n let isImage = false;\n let isCanvasLike = false;\n let isImageBitmap = false;\n if ((pixels as PixelData).data instanceof Uint8Array) {\n isPixelData = true;\n } else if (\n typeof (ImageData) !== 'undefined' && pixels instanceof ImageData) {\n isImageData = true;\n } else if (\n typeof (HTMLVideoElement) !== 'undefined' &&\n pixels instanceof HTMLVideoElement) {\n isVideo = true;\n } else if (\n typeof (HTMLImageElement) !== 'undefined' &&\n pixels instanceof HTMLImageElement) {\n isImage = true;\n // tslint:disable-next-line: no-any\n } else if ((pixels as any).getContext != null) {\n isCanvasLike = true;\n } else if (\n typeof (ImageBitmap) !== 'undefined' && pixels instanceof ImageBitmap) {\n isImageBitmap = true;\n } else {\n throw new Error(\n 'pixels passed to tf.browser.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData ` +\n `in browser, or OffscreenCanvas, ImageData in webworker` +\n ` or {data: Uint32Array, width: number, height: number}, ` +\n `but was ${(pixels as {}).constructor.name}`);\n }\n if (isVideo) {\n const HAVE_CURRENT_DATA_READY_STATE = 2;\n if (isVideo &&\n (pixels as HTMLVideoElement).readyState <\n HAVE_CURRENT_DATA_READY_STATE) {\n throw new Error(\n 'The video element has not loaded data yet. Please wait for ' +\n '`loadeddata` event on the